/* Aspect d'un CMS de serveur Minecraft : bannière, menu, actualités en cartes, colonne de widgets.
   Jaune et bleu : les deux couleurs du « AEsa Serv » défilant de la tablist et du scoreboard. */
:root {
  color-scheme: dark;
  --bg: #0f1220;
  --bg-rgb: 15 18 32;
  --panel: #181c30;
  --panel-2: #1f2440;
  --line: #2a3052;
  --line-hover: #3b4372;
  --text: #e9ecf6;
  --muted: #98a1bd;
  --accent: #fff800;
  --accent-ink: #1a1a00;
  --accent-text: var(--accent);
  --accent-tint: rgba(255, 248, 0, .14);
  --sky: #00d6ff;
  --sky-text: var(--sky);
  --discord: #5865f2;
  --footer: #0b0d18;
  --shadow: #000;
  --err: #ff9c9c;
  --ok: #8dffbd;
}
/* Thème clair : posé par theme.js. Le jaune et le bleu restent ceux du serveur en aplat,
   mais sont assombris là où ils servent de couleur de texte, illisibles sinon sur fond clair. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4fa;
  --bg-rgb: 242 244 250;
  --panel: #fff;
  --panel-2: #eceff8;
  --line: #d6dbeb;
  --line-hover: #b4bcd8;
  --text: #171b2e;
  --muted: #5a6382;
  --accent-text: #7d6400;
  --accent-tint: rgba(255, 248, 0, .4);
  --sky-text: #007391;
  --footer: #e6e9f3;
  --shadow: rgba(40, 50, 90, .45);
  --err: #b3261e;
  --ok: #146c3c;
}
/* La bannière garde ses textes clairs : ils sont posés sur l'image. */
.banner { --text: #e9ecf6; --muted: #98a1bd; }
/* Les couleurs des grades viennent du jeu, pensées pour un fond sombre. */
[data-theme="light"] main .mm, [data-theme="light"] .account .mm { filter: brightness(.6) saturate(1.5); }

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 15px/1.6 Rubik, system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--sky-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 1px solid var(--accent); border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 600 14px Rubik, sans-serif;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--sky); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.discord { background: var(--discord); border-color: var(--discord); color: #fff; }

.btn { position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, filter .15s, border-color .15s; }
.btn:not(.ghost):hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px var(--accent); }
.btn.discord:hover { box-shadow: 0 8px 20px -8px var(--discord); }
.btn:not(.ghost)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transform: translateX(-120%); }
.btn:not(.ghost):hover::after { transform: translateX(120%); transition: transform .6s; }

/* ── Apparition au défilement (classe posée par app.js) ── */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease-out, transform .5s ease-out, border-color .15s; transition-delay: var(--d, 0s), var(--d, 0s), 0s; }
.card { transition: transform .15s, border-color .15s, box-shadow .15s; }
.item:hover, aside .card:hover { border-color: var(--line-hover); box-shadow: 0 12px 30px -18px var(--shadow); }
.item:hover { transform: translateY(-3px); border-color: var(--accent); }
.item .thumb { transition: transform .3s; }
.item:hover .thumb { transform: scale(1.12) rotate(-4deg); }

/* ── Menu ── */
.nav { position: sticky; top: 0; z-index: 10; background: rgb(var(--bg-rgb) / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent-text); margin-left: 4px; }
.nav nav { display: flex; gap: 4px; flex: 1; }
.nav nav a { color: var(--muted); font-weight: 500; padding: 8px 14px; border-radius: 8px; }
.nav nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav nav a.on { color: var(--accent-text); background: var(--panel); }
.nav nav a { position: relative; transition: color .15s, background .15s; }
.nav nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.nav nav a:hover::after, .nav nav a.on::after { transform: scaleX(1); }
.menu { display: contents; }
.nav .theme { order: 1; }
.account { order: 2; display: flex; align-items: center; gap: 8px; }
.nav .burger { display: none; }
.nav .burger:hover { transform: none; }
.account .me { font-weight: 600; margin-right: 6px; color: var(--text); }
.badges { display: inline-flex; align-items: center; gap: 4px; }
.badge { max-width: none; image-rendering: pixelated; }
.mm { font-weight: 500; }
.mm.gradient { -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Profil ── */
.profile { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 28px; }
.profile h2 { font-size: 30px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile .badges { gap: 8px; margin: 12px 0 0; }
.profile dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 16px 0 0; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; }
.profile dd { font-weight: 500; }

/* ── Joueurs, staff, classements ── */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.player { display: flex; align-items: center; gap: 16px; padding: 16px; color: var(--text); }
.player:hover { text-decoration: none; border-color: var(--sky); transform: translateY(-2px); }
.player > div { display: grid; gap: 4px; min-width: 0; }
.player b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.player-link { color: var(--text); font-weight: 500; }
.staff-group { margin-bottom: 32px; }
.staff-group h3 { margin-bottom: 14px; min-height: 33px; }
.tops { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.top td { padding: 9px 18px; }
.top .pos { width: 1%; color: var(--muted); font-weight: 600; }
.top tr:nth-child(1) .pos { color: var(--accent-text); }
.top .value { text-align: right; white-space: nowrap; }
.layout.single > section > .muted { margin: -6px 0 18px; }
.layout.single > section > div + .muted { margin: 18px 0 0; }

/* ── Guerre des factions ── */
.war-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--panel-2); }
.war-bar i { min-width: 6px; transition: flex-grow .6s; }
.war-bar i + i { border-left: 2px solid var(--bg); }
.war-legend { display: grid; gap: 4px; margin: 12px 0 0; }
.war-legend div { display: flex; justify-content: space-between; gap: 12px; }
#war .muted { margin: 10px 0 0; font-size: 13px; }
/* Skin de 64 px de large : visage en (8,8), chapeau en (40,8), 8 px de côté chacun.
   Le chapeau occupe toute la case, le visage 8/9 : il déborde d'un demi-pixel de skin. */
.head { position: relative; flex: none; display: inline-block; width: var(--s); height: var(--s); }
.head::before, .head::after { content: ""; position: absolute; background-image: var(--skin); background-repeat: no-repeat; image-rendering: pixelated; }
.head::before { inset: calc(var(--s) / 18); background-size: calc(var(--s) / 9 * 64) auto; background-position: calc(var(--s) / 9 * -8) calc(var(--s) / 9 * -8); }
.head::after { inset: 0; background-size: calc(var(--s) * 8) auto; background-position: calc(var(--s) * -5) calc(var(--s) * -1); }

/* ── Connexion et inscription ── */
.auth { max-width: 460px; margin: 0 auto; padding-top: 8px; padding-bottom: 64px; }
.auth.wide { max-width: 920px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.auth form { display: grid; gap: 16px; }
.auth label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.auth input { padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.auth input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 248, 0, .18); }
.auth input[name=code] { font-size: 20px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.auth .btn:disabled { opacity: .6; cursor: wait; }
.auth .foot { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.alert { padding: 10px 14px; border-radius: 8px; background: rgba(255, 103, 103, .12); border: 1px solid rgba(255, 103, 103, .4); color: var(--err); font-size: 14px; }
#who { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(98, 255, 165, .08); border: 1px solid rgba(98, 255, 165, .3); }
[hidden] { display: none !important; }
.howto { counter-reset: h; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.howto li { counter-increment: h; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.howto li::before { content: counter(h); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.howto b { display: block; }
.howto span { color: var(--muted); font-size: 14px; }
kbd { padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--accent-text); font: 600 13px ui-monospace, monospace; }

/* ── Bannière ── */
.banner { position: relative; overflow: hidden; isolation: isolate; }
.banner-bg { position: absolute; inset: 0; z-index: -2; background: url(img/spawn.webp) center 45% / cover; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.16) translateY(-2%); } }
.banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(15, 18, 32, .35), rgba(15, 18, 32, .3) 45%, rgb(var(--bg-rgb) / .85) 85%, var(--bg)); }
.banner canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.banner .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: clamp(340px, 46vw, 500px); padding-top: 48px; padding-bottom: 72px; }
.logo { text-align: center; color: #fff; font-size: clamp(40px, 7vw, 68px); font-weight: 700; line-height: 1; letter-spacing: -.02em; text-shadow: 0 4px 24px rgba(0, 0, 0, .6); }
.logo:hover { text-decoration: none; }
.logo { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.logo span { margin-left: 10px; background: linear-gradient(90deg, var(--accent), var(--sky), var(--accent)) 0 / 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% 0; } }
.logo small { display: block; margin-top: 12px; font-size: 14px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #d6dcf0; }
.pill {
  justify-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 12px 20px; border-radius: 12px; cursor: pointer; color: var(--text); font-family: inherit;
  background: rgba(24, 28, 48, .78); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
  transition: transform .15s, border-color .15s;
}
.pill:hover { transform: translateY(-2px); border-color: var(--sky); text-decoration: none; }
.pill.right { justify-self: end; align-items: flex-end; text-align: right; }
.pill.right:hover { border-color: var(--discord); }
.pill small { display: flex; align-items: center; gap: 7px; }
.pill small.live { color: #b9f5c9; }
.pill b { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); } 100% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } }
.pill small { font-size: 12px; color: var(--muted); }

/* ── Mise en page ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; padding-top: 8px; padding-bottom: 64px; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 20px; margin-bottom: 16px; }
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(var(--accent), var(--sky)); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }
.stack { display: grid; gap: 20px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 10px 0; }
.muted { color: var(--muted); }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-text); font-size: 12px; font-weight: 600; }

/* ── Actualités ── */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.post { display: flex; flex-direction: column; color: var(--text); transition: transform .15s, border-color .15s; }
.post:hover { text-decoration: none; }
.post .more { color: var(--sky-text); font-weight: 500; }
.posts > .empty { grid-column: 1 / -1; padding: 40px 0; }
.post:hover { transform: translateY(-3px); border-color: var(--accent); }
.post.wide { grid-column: 1 / -1; }
.cover { aspect-ratio: 16 / 7; background: linear-gradient(135deg, #2a3566, #171c33); background-size: cover; background-position: center; transition: transform .5s; }
.post { overflow: hidden; }
.post:hover .cover { transform: scale(1.06); }
.post.wide .cover { aspect-ratio: 16 / 5; }
.cover.c-spawn { background-image: url(img/spawn.webp); }
.cover.c-or { background-image: linear-gradient(135deg, #fff800, #e08a1e); }
.cover.c-violet { background-image: linear-gradient(135deg, #8a5cf6, #3b2a7a); }
.cover.c-bleu { background-image: linear-gradient(135deg, #00d6ff, #1b4fa8); }
.post .card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post h3 { font-size: 18px; }
.post p { margin: 0; color: var(--muted); }
.post .meta { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }

/* ── Article ── */
.article .cover { aspect-ratio: 16 / 5; }
.article .card-body { padding: clamp(20px, 4vw, 40px); }
.article h1 { font-size: clamp(26px, 4vw, 36px); margin: 12px 0 6px; }
.article .meta { color: var(--muted); font-size: 14px; }
.prose { margin-top: 24px; max-width: 72ch; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.prose h3 { font-size: 21px; margin: 28px 0 8px; color: var(--accent-text); }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--sky-text); }

/* ── Boutique ── */
.shop { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 8px; padding-bottom: 64px; }
.cats { display: grid; }
.cats a { padding: 12px 18px; color: var(--muted); font-weight: 500; border-left: 3px solid transparent; }
.cats a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.cats a.on { color: var(--accent-text); border-left-color: var(--accent); background: var(--panel-2); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 20px; }
.item { text-align: center; }
.item .thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--panel-2); font-size: 44px; }
.item h3 { font-size: 16px; }
.item .price { margin: 6px 0 14px; color: var(--accent-text); font-size: 18px; font-weight: 600; }

/* ── Vote ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.step .num { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.field { display: flex; gap: 10px; margin-top: 14px; }
.field input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }

/* ── Administration ── */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 8px; padding-bottom: 64px; }
.admin-menu { position: sticky; top: 82px; }
.menu-group { padding: 14px 18px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin > section > .muted { margin: -6px 0 16px; }
#tops .top td { padding: 12px 18px; font-size: 15px; }
#tops .top tr:nth-child(-n+3) .pos { color: var(--accent-text); font-size: 17px; }
.admin [data-panel] > .muted { margin: -6px 0 16px; }
.admin [data-panel] > .card + .muted { margin: 16px 0 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head .section-title { margin: 0; }
.search { width: min(280px, 100%); padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; }
.search:focus { outline: 0; border-color: var(--accent); }
.shortcuts { display: flex; flex-wrap: wrap; gap: 10px; }
a.stat { color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--sky); transform: translateY(-2px); }
.nav nav a.admin { color: var(--sky-text); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 20px; margin-bottom: 20px; }
.stat b { display: block; font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.who, .actions { display: flex; align-items: center; gap: 10px; }
.actions { justify-content: flex-end; }
td { vertical-align: middle; }

.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.form input, .form select, .form textarea { width: 100%; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.form textarea { min-height: 300px; resize: vertical; line-height: 1.6; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 248, 0, .18); }
.form .row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.form .buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form .buttons .spacer { flex: 1; }
.form .cover { aspect-ratio: 16 / 4; border-radius: 8px; border: 1px solid var(--line); }
.form .hint { margin: 0; font-size: 13px; color: var(--muted); }
.form .field-group { display: grid; gap: 8px; align-content: start; }
.form .field-group .btn { justify-self: start; }
.link { padding: 0; border: 0; background: none; color: var(--sky-text); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.prose figure { margin: 0 0 16px; }
.prose img { border-radius: 8px; }
.prose figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.alert.ok { background: rgba(98, 255, 165, .1); border-color: rgba(98, 255, 165, .4); color: var(--ok); }

/* ── Règlement ── */
.rules { counter-reset: r; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.rules li::before { content: counter(r); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); color: var(--accent-text); font-weight: 700; }
.rules b { display: block; }
.rules span { color: var(--muted); font-size: 14px; }

/* ── Pied de page ── */
footer { background: var(--footer); border-top: 1px solid var(--line); padding-top: 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
footer h4 { color: var(--text); font-size: 14px; margin-bottom: 10px; }
footer .wrap a:not(.brand) { display: block; color: var(--muted); padding: 3px 0; }
footer p { margin: 8px 0 0; }
footer .legal { margin: 32px 0 0; padding: 18px 20px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 10px 18px; border-radius: 8px; transition: .2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .layout, .shop { grid-template-columns: minmax(0, 1fr); }
  .banner .wrap { grid-template-columns: 1fr; justify-items: center; padding-top: 40px; padding-bottom: 48px; }
  .banner .logo { order: -1; }
  .pill, .pill.right { justify-self: center; align-items: center; text-align: center; }
  /* Menu replié derrière le bouton ☰ : liens en colonne, puis le compte */
  .nav .wrap { gap: 10px; }
  .nav .theme { order: 0; margin-left: auto; }
  .nav .burger { display: grid; order: 3; margin-left: 0; }
  .menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 62px); overflow-y: auto; padding: 10px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -20px var(--shadow);
  }
  .nav.open .menu { display: grid; gap: 12px; }
  .nav nav { flex-direction: column; gap: 2px; }
  .nav nav a { padding: 11px 14px; }
  .nav nav a::after { display: none; }
  .nav nav a.on { box-shadow: inset 3px 0 var(--accent); }
  .account { flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
  .account .btn { flex: 1; }
  .account .me { margin-right: auto; }
  .steps { grid-template-columns: 1fr; }
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-menu { position: static; }
  /* Catégories (boutique, panel) : une barre d'onglets qui défile */
  .admin-menu .cats, .shop .cats { display: flex; overflow-x: auto; }
  .admin-menu .menu-group { display: none; }
  .admin-menu .cats a, .shop .cats a { flex: none; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .admin-menu .cats a.on, .shop .cats a.on { border-bottom-color: var(--accent); }
  .form .row { grid-template-columns: 1fr; }
  .auth.wide { grid-template-columns: 1fr; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
  footer .wrap > :first-child { grid-column: 1 / -1; }
  /* sous 16 px, iOS zoome sur le champ au toucher */
  input, select, textarea { font-size: 16px !important; }
  .auth input[name=code] { font-size: 20px !important; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .banner .wrap { min-height: 0; gap: 14px; padding-top: 32px; padding-bottom: 40px; }
  .logo small { font-size: 12px; letter-spacing: .1em; }
  .pill { width: 100%; max-width: 320px; padding: 10px 16px; }
  .layout, .shop, .admin, .auth { padding-bottom: 40px; }
  .card-head { padding: 12px 16px; }
  .card-body { padding: 16px; }
  th, td, .top td, #tops .top td { padding: 9px 12px; }
  .post.wide .cover, .article .cover { aspect-ratio: 16 / 7; }
  .profile { padding: 20px; gap: 18px; }
  .profile h2 { font-size: 24px; }
  .stat b { font-size: 24px; }
  .field { flex-wrap: wrap; }
  .field .btn { flex: 1; }
  .podium { gap: 6px; }
  .podium .player-link { font-size: 14px; }
  .podium .step { font-size: 20px; }
  .podium .p1 .step { font-size: 26px; }
  .vote-login .actions { width: 100%; }
  .vote-login .actions .btn { flex: 1; }
  #toast { max-width: calc(100% - 32px); text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
.post .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag.draft { background: rgba(152, 161, 189, .16); color: var(--muted); }
.tag.pin { background: rgba(0, 214, 255, .14); color: var(--sky-text); }
td select.search { width: auto; padding: 6px 10px; }

/* ── Bascule clair / sombre ── */
.theme { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: border-color .15s, transform .3s; }
.theme:hover { border-color: var(--sky); transform: rotate(20deg); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="light"] .theme .moon, [data-theme="dark"] .theme .sun { display: none; }

/* ── Podium des classements : 2e, 1er, 3e ── */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; max-width: 640px; margin: 8px auto 0; }
.podium .place { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.podium .p1 { order: 2; } .podium .p2 { order: 1; } .podium .p3 { order: 3; }
.podium .model { width: 100%; min-height: 200px; display: grid; place-items: end center; }
.podium .p1 .model { min-height: 240px; }
.podium canvas { cursor: grab; filter: drop-shadow(0 14px 12px rgb(0 0 0 / .35)); }
.podium .player-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.podium .value { font-size: 14px; color: var(--muted); }
.podium .step { width: 100%; height: 56px; margin-top: 10px; display: grid; place-items: center; border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; background: var(--panel-2); color: var(--text); font-size: 26px; font-weight: 700; }
.podium .p2 .step { height: 80px; background: var(--sky); border-color: var(--sky); color: #00222b; }
.podium .p1 .step { height: 110px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 34px; }

/* ── Voter ── */
.vote-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.vote-site .card-body { display: grid; gap: 10px; height: 100%; align-content: space-between; }
.vote-site h3 { font-size: 17px; }
.vote-site p { margin: 0; font-size: 14px; min-height: 3.2em; }
.vote-site.done { border-color: var(--ok); }
.vote-site .btn:disabled, .btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; filter: none; }
.vote-login { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.vote-login p { margin: 0; }
#vote-login { margin-bottom: 20px; }
.hook { font: 12px ui-monospace, monospace; color: var(--muted); word-break: break-all; user-select: all; }
