/* VanCraft - interface inspirée des menus Minecraft */
:root {
  --bg: #1d1a1f;
  --ink: #373737;
  --ink-soft: #555555;
  --panel: #c6c6c6;
  --panel-light: #ffffff;
  --panel-dark: #555555;
  --slot: #8b8b8b;
  --tooltip: rgba(16, 0, 16, 0.94);
  --tooltip-border: #2c0863;
  --mc-green: #55ff55;
  --mc-xp: #80ff20;
  --mc-gold: #ffaa00;
  --mc-yellow: #ffff55;
  --mc-aqua: #55ffff;
  --mc-red: #ff5555;
  --mc-gray: #aaaaaa;
  --grass: #5d9a33;
  --grass-dark: #3f6e22;
  --dirt: #79553a;
  --font-title: "Silkscreen", "Pixelify Sans", monospace;
  --font-body: "Pixelify Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: #e8e8e8;
  background-color: var(--bg);
  /* Texture d'ardoise des abîmes en pixels */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect width='16' height='16' fill='%231d1a1f'/%3E%3Crect x='0' y='0' width='3' height='2' fill='%23242027'/%3E%3Crect x='6' y='1' width='4' height='1' fill='%23171419'/%3E%3Crect x='12' y='2' width='3' height='2' fill='%2326222a'/%3E%3Crect x='2' y='5' width='2' height='2' fill='%23161318'/%3E%3Crect x='8' y='4' width='3' height='2' fill='%23232026'/%3E%3Crect x='13' y='7' width='3' height='1' fill='%23151216'/%3E%3Crect x='4' y='9' width='4' height='2' fill='%2326222a'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%23171419'/%3E%3Crect x='0' y='12' width='3' height='1' fill='%23151216'/%3E%3Crect x='6' y='13' width='3' height='2' fill='%23221e25'/%3E%3Crect x='12' y='13' width='4' height='2' fill='%23161318'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  image-rendering: pixelated;
}

a { color: var(--mc-aqua); }
a:hover { color: var(--mc-yellow); }
.muted { color: var(--mc-gray); font-size: 0.9em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; outline: none; }

h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.2; margin: 0 0 12px; letter-spacing: 0.5px; }
h1 { font-size: clamp(26px, 5vw, 40px); }
h2 { font-size: clamp(20px, 3.4vw, 26px); }
h3 { font-size: 18px; }

/* ---------- En-tête ---------- */
.site-header {
  position: relative;
  /* Textures terre + herbe dessinées par textures.js ; dégradé de secours */
  background: linear-gradient(var(--dirt), #5b3f2b);
  border-bottom: 4px solid #000;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  padding: 44px 0 16px;
  image-rendering: pixelated;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 18px; text-decoration: none; position: relative; }
.logo img {
  width: 88px; height: 88px;
  image-rendering: pixelated;
  border: 4px solid #000;
  background: #000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}
.logo-text {
  display: block;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(30px, 6vw, 46px);
  color: #d7d7d7;
  text-shadow: 3px 3px 0 #3a3a3a, 6px 6px 0 #000;
  letter-spacing: 2px;
}
.logo-text svg { display: block; height: clamp(48px, 9vw, 86px); width: auto; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.5)); }

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 15px var(--font-body);
  color: #fff;
  background: var(--tooltip);
  border: 2px solid var(--tooltip-border);
  outline: 2px solid #000;
  padding: 8px 14px;
}
.header-pills { display: flex; flex-wrap: wrap; gap: 12px; }
.ip-pill { cursor: pointer; font-family: var(--font-title); color: var(--mc-green); }
.ip-pill:hover, .ip-pill:focus-visible { border-color: #5a2fb0; color: var(--mc-yellow); outline: 2px solid #000; }
.dot { width: 12px; height: 12px; background: var(--mc-gray); box-shadow: 0 0 0 2px #000; }
.dot.up { background: var(--mc-green); animation: pulse 1.6s steps(2) infinite; }
.dot.down { background: var(--mc-red); }
@keyframes pulse { 50% { background: #2a9d2a; } }

.nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Boutons façon Minecraft ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 16px var(--font-body);
  color: #e0e0e0;
  text-decoration: none;
  text-shadow: 2px 2px 0 #383838;
  background: #6f6f6f;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -4px 0 #4a4a4a;
  padding: 9px 16px 11px;
  cursor: pointer;
  user-select: none;
}
.btn:hover, .btn:focus-visible { color: var(--mc-yellow); background: #7c86c0; box-shadow: inset 2px 2px 0 #b9c1ff, inset -2px -4px 0 #4d5385; outline: none; }
.btn.active { color: #fff; background: #4f7d2c; box-shadow: inset 2px 2px 0 #8fcf5c, inset -2px -4px 0 #2f4f18; }
.btn.small { font-size: 14px; padding: 5px 10px 7px; }

/* ---------- Panneaux ---------- */
.panel {
  background: var(--panel);
  color: var(--ink);
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 var(--panel-light), inset -3px -3px 0 var(--panel-dark);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h2, .panel h3 { color: #3f3f3f; }
.panel .muted { color: #5e5e5e; }
.panel a { color: #1f4fb0; }
.panel a:hover { color: #7a2fb0; }

.tooltip-box {
  background: var(--tooltip);
  border: 3px solid var(--tooltip-border);
  outline: 3px solid #000;
  padding: 24px;
  margin: 3px 3px 25px;
}
.tooltip-box h1 { color: #fff; text-shadow: 3px 3px 0 #3e3e3e; }
.tooltip-box p { color: #d7d7d7; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title h2 { margin: 0; color: #fff; text-shadow: 3px 3px 0 #000; }

/* ---------- Accueil ---------- */
.hero-tag { color: var(--mc-gold); font-family: var(--font-title); font-size: 14px; margin-bottom: 8px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 32px; }
.hero h1 { margin-bottom: 16px; }
.hero .lead { font-size: 20px; color: #fff; margin: 0 0 12px; }
.hero p:last-child { margin-bottom: 0; }
.join-stack { display: grid; gap: 14px; }
.join-stack .join-card { margin: 0; padding: 16px 18px; }
.join-stack h3 { margin-bottom: 4px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.feature { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; margin: 0; }
.feature .slot { width: 64px; height: 64px; font-size: 32px; }
.feature h3 { margin: 4px 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); }
.join-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.join-card { margin: 0; }
.join-card h3 { display: flex; align-items: center; gap: 8px; }
.address {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #000; color: var(--mc-green);
  font-family: var(--font-title); font-size: 18px;
  padding: 10px 12px; margin: 10px 0 6px;
  border: 2px solid #373737;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tile { display: block; text-decoration: none; margin: 0; transition: transform 0.08s; }
.tile:hover { transform: translateY(-3px); }
.tile .icon { font-size: 34px; line-height: 1; margin-bottom: 10px; display: block; }
.tile p { margin: 0; color: var(--ink-soft); }
.tile h3 { margin-bottom: 6px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 18px; }
.fact { background: rgba(0, 0, 0, 0.35); border: 2px solid #000; padding: 10px 12px; color: #eee; }
.fact b { display: block; font-family: var(--font-title); color: var(--mc-yellow); font-size: 14px; }

/* ---------- Têtes / joueurs ---------- */
.head { image-rendering: pixelated; background: var(--slot); border: 2px solid #000; display: block; }
.online-row { display: flex; flex-wrap: wrap; gap: 12px; }
.online-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--slot); padding: 6px 10px 6px 6px; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.online-chip:hover { color: #000; background: #a0a0a0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.input {
  flex: 1; min-width: 200px;
  font: 500 17px var(--font-body);
  color: #fff; background: #000;
  border: 2px solid #a0a0a0; outline: 2px solid #000;
  padding: 10px 12px;
}
.input:focus { border-color: #fff; }
.input::placeholder { color: #7a7a7a; }

.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.player-card { display: flex; align-items: center; gap: 14px; text-decoration: none; margin: 0; padding: 16px; }
.player-card:hover { background: #d4d4d4; }
.player-card .name { font-family: var(--font-title); font-size: 16px; color: #2a2a2a; word-break: break-all; }
.player-card .meta { font-size: 14px; color: var(--ink-soft); }
.badge { display: inline-block; font: 600 12px var(--font-title); padding: 2px 6px; border: 2px solid #000; vertical-align: middle; }
.badge.on { background: var(--mc-green); color: #063306; }
.badge.off { background: #7a7a7a; color: #1b1b1b; }
.badge.bedrock { background: #3b8edb; color: #fff; }

/* ---------- Profil ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.profile-head .body-render { image-rendering: pixelated; width: 120px; height: auto; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.45)); }
.profile-head h1 { color: #fff; text-shadow: 3px 3px 0 #000; word-break: break-all; }
.profile-head .facts { margin-top: 10px; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.skill { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; background: #b5b5b5; padding: 10px; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #7a7a7a; }
.slot { width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px; background: var(--slot); box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.skill .top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.skill .label { font-weight: 600; color: #2a2a2a; }
.level { font-family: var(--font-title); font-weight: 700; color: var(--mc-xp); font-size: 18px; text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000; }
.xpbar { height: 12px; margin-top: 6px; background: #2b2b2b; border: 2px solid #000; }
.xpbar > span { display: block; height: 100%; background: linear-gradient(#c6ff8a, var(--mc-xp) 45%, #4c9a0f); }
.skill .xptext { font-size: 13px; color: #4a4a4a; margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #b5b5b5; padding: 12px; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #7a7a7a; }
.stat .v { font-family: var(--font-title); font-size: 20px; color: #1e1e1e; }
.stat .k { font-size: 14px; color: #4a4a4a; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.two-col > .panel { margin-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 2px solid #adadad; }
.list li:last-child { border-bottom: 0; }
.list .n { font-family: var(--font-title); color: #2a2a2a; }

/* ---------- Classements ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 700 14px var(--font-title); color: #4a4a4a; padding: 8px 10px; border-bottom: 3px solid #8b8b8b; }
.table td { padding: 10px; border-bottom: 2px solid #adadad; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .rank { font-family: var(--font-title); font-size: 18px; width: 56px; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who a { color: #2a2a2a; text-decoration: none; font-weight: 600; }
.table .who a:hover { color: #1f4fb0; }
.table .val { text-align: right; font-family: var(--font-title); color: #1e1e1e; white-space: nowrap; }
.r1 { color: #c79a00; } .r2 { color: #7d7d7d; } .r3 { color: #a0522d; }

/* ---------- Plugins ---------- */
.plugin { display: grid; grid-template-columns: 64px 1fr; gap: 18px; }
.plugin .slot { width: 64px; height: 64px; font-size: 34px; }
.plugin h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.plugin p { margin: 0 0 10px; }
.tag { font: 600 12px var(--font-title); background: #373737; color: var(--mc-yellow); padding: 2px 7px; }
.cmds { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cmds td { padding: 8px 10px; border-top: 2px solid #adadad; vertical-align: top; }
.cmds td:first-child { width: 38%; }
code, .cmd { font-family: var(--font-title); font-size: 14px; background: #000; color: var(--mc-green); padding: 2px 6px; white-space: nowrap; }
.note { background: #b5b5b5; padding: 10px 12px; margin-top: 10px; font-size: 15px; box-shadow: inset 2px 2px 0 #7a7a7a, inset -2px -2px 0 #fff; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* ---------- Carte ---------- */
.map-frame { width: 100%; height: min(75vh, 760px); border: 3px solid #000; outline: 3px solid #555; background: #000; display: block; }

/* ---------- Divers ---------- */
.loading, .empty { text-align: center; padding: 60px 16px; font-family: var(--font-title); color: var(--mc-gray); }
.error { background: #3a0d0d; border: 3px solid #000; outline: 2px solid var(--mc-red); color: #ffd0d0; padding: 16px; margin-bottom: 20px; }
.site-footer { background: #111; border-top: 4px solid #000; padding: 20px 0; font-size: 14px; color: #bdbdbd; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%);
  background: var(--tooltip); color: #fff; border: 2px solid var(--tooltip-border); outline: 2px solid #000;
  padding: 10px 16px; font-weight: 600; transition: transform 0.2s; z-index: 10; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .panel { padding: 16px; }
  .site-header { padding-top: 36px; }
  .logo { gap: 12px; }
  .logo img { width: 56px; height: 56px; border-width: 3px; }
  .logo-text svg { height: auto; width: min(64vw, 320px); }
  .profile-head { grid-template-columns: 1fr; text-align: center; }
  .profile-head .body-render { margin: 0 auto; width: 96px; }
  .plugin { grid-template-columns: 1fr; }
  .cmds td:first-child { width: auto; }
  .cmds td { display: block; border-top: 0; padding: 4px 0; }
  .cmds tr { display: block; border-top: 2px solid #adadad; padding: 8px 0; }
  .table .rank { width: 40px; }
  .nav .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .dot.up { animation: none; }
  .tile { transition: none; }
}
