/* ============================================================
   Tortucademia — feuille de style
   D'après la fiche de style des maquettes :
   Bleu océan #0B4F6C · Sable #F4D7A0 · Bois #8B5E3C
   Vert succès #2E7D32 · Rouge erreur #C62828 · Accent or #F4B400
   Titres : Pirata One · Texte : Nunito
   ============================================================ */
:root {
  --ocean: #0B4F6C;
  --ocean-dark: #073347;
  --ocean-light: #1a7aa1;
  --sand: #F4D7A0;
  --sand-light: #fbeccb;
  --sand-dark: #dcb676;
  --wood: #8B5E3C;
  --wood-dark: #5a3a22;
  --wood-deep: #3f2716;
  --green: #2E7D32;
  --green-dark: #1d5a21;
  --red: #C62828;
  --gold: #F4B400;
  --gold-dark: #b98700;
  --ink: #2b1b0f;
  --ink-soft: #5b4631;
  --white: #fffaf0;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(20, 12, 4, .28);
  --font-title: "Pirata One", "Luckiest Guy", Georgia, serif;
  --font-text: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--ocean);
  /* Fond : l'image assets/fonds/mer.jpg sera utilisée si elle existe, sinon le dégradé */
  background-image:
    url("../assets/fonds/mer.jpg"),
    repeating-linear-gradient(172deg, rgba(255,255,255,.05) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #8fd0ee 0%, #5fb4dc 22%, #2a8bb6 40%, #1a6f97 62%, var(--ocean) 100%);
  background-size: cover, 100% 100%, 100% 100%;
  background-position: center;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
body.teacher-mode {
  background-image: none;
  background-color: #e6ecf0;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: .01em; }

#app { min-height: 100vh; display: flex; flex-direction: column; }
.page {
  width: 100%; max-width: 820px; margin: 0 auto;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 20px; flex: 1;
}

/* ---------- Parchemin ---------- */
.parchment {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.45), transparent 55%),
    radial-gradient(ellipse at center, var(--sand-light) 0%, var(--sand) 62%, var(--sand-dark) 100%);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(139, 94, 60, .35), inset 0 0 28px rgba(139, 94, 60, .35), var(--shadow);
  padding: 22px 20px;
}
.parchment.rolled::before, .parchment.rolled::after {
  content: ""; position: absolute; left: -8px; right: -8px; height: 14px; border-radius: 8px;
  background: linear-gradient(180deg, #e7c483, #c99b58 60%, #a97b3d);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.parchment.rolled::before { top: -7px; }
.parchment.rolled::after { bottom: -7px; }

.title-xl { font-size: clamp(42px, 9vw, 60px); text-align: center; color: var(--ink); }
.title-l { font-size: clamp(32px, 6.5vw, 44px); text-align: center; color: var(--ink); }
.title-m { font-size: clamp(26px, 5vw, 32px); color: var(--ink); }
.subtitle { text-align: center; font-weight: 700; font-size: 20px; color: var(--ink-soft); margin: 4px 0 0; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 10px 24px; border: 0; border-radius: var(--radius);
  font-weight: 800; font-size: 21px; text-decoration: none; color: #fff;
  background: linear-gradient(180deg, var(--ocean-light), var(--ocean));
  box-shadow: 0 4px 0 var(--ocean-dark), 0 6px 12px rgba(0,0,0,.25);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ocean-dark), 0 2px 6px rgba(0,0,0,.25); }
.btn[disabled] { filter: grayscale(.6) opacity(.6); cursor: default; }
.btn.block { width: 100%; }
.btn.green { background: linear-gradient(180deg, #3d9a42, var(--green)); box-shadow: 0 4px 0 var(--green-dark), 0 6px 12px rgba(0,0,0,.25); }
.btn.wood { background: linear-gradient(180deg, #a06f49, var(--wood)); box-shadow: 0 4px 0 var(--wood-dark), 0 6px 12px rgba(0,0,0,.25); }
.btn.light {
  color: var(--ink); background: linear-gradient(180deg, #fff9ec, #efe2c7);
  box-shadow: 0 4px 0 #bda57a, 0 6px 12px rgba(0,0,0,.18);
}
.btn.small { min-height: 44px; font-size: 18px; padding: 6px 16px; }
.btn .arrow { font-size: 1.1em; }
.link-btn { background: none; border: 0; color: var(--ocean); font-weight: 700; text-decoration: underline; padding: 6px; }

.back-row { display: flex; justify-content: flex-start; }

/* ---------- Bandeau du haut (élève) ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #7a4f2f, var(--wood-dark));
  border-bottom: 4px solid var(--wood-deep);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  color: var(--white);
}
.topbar-inner {
  max-width: 820px; margin: 0 auto; padding: 8px 12px;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px;
}
.plate {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--sand-light), var(--sand-dark));
  color: var(--ink); border-radius: 10px; padding: 6px 12px; border: 0;
  font-weight: 800; font-size: 19px; box-shadow: inset 0 0 0 2px rgba(90,58,34,.4);
  max-width: 34vw; min-height: 44px;
}
.plate span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { display: flex; align-items: center; gap: 8px; min-width: 0; }
.medal {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe89a, var(--gold) 55%, var(--gold-dark));
  border: 3px solid var(--wood-deep); display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.medal .pic { width: 100%; height: 100%; font-size: 26px; }
.medal img { object-fit: cover; }
.rank-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rank-name { font-family: var(--font-title); font-size: 19px; color: #ffe7a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-points { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.star { color: var(--gold); filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.progress-box { min-width: 0; }
.progress-label { font-size: 13px; font-weight: 700; color: #f6e6c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 14px; border-radius: 8px; background: rgba(0,0,0,.35); border: 2px solid rgba(0,0,0,.35); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(180deg, #ffd65a, var(--gold) 60%, #d99a00); transition: width .6s ease; }
.chest-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-width: 64px; min-height: 52px; padding: 4px 8px; border-radius: 10px; border: 0;
  background: linear-gradient(180deg, #5c3a21, var(--wood-deep)); color: #ffe7a8; font-weight: 800; font-size: 12px;
  box-shadow: inset 0 0 0 2px rgba(244,180,0,.45);
}
.chest-btn .ico { font-size: 24px; line-height: 1; }
@media (max-width: 480px) {
  .cabinet-filters { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; row-gap: 6px; }
  .progress-box { grid-column: 1 / -1; order: 5; }
  .rank-name { font-size: 17px; }
  .plate { font-size: 17px; max-width: 30vw; }
}

/* ---------- Images avec repli emoji ---------- */
.pic { position: relative; display: grid; place-items: center; }
.pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pic .emo { display: none; line-height: 1; }
.pic.noimg img { display: none; }
.pic.noimg .emo { display: block; }

/* ---------- Connexion élève ---------- */
.login-card { max-width: 460px; margin: 4vh auto 0; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.name-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.name-list .btn { width: 100%; font-size: 23px; }
.name-list .btn.light:first-child { }
.login-foot { display: flex; justify-content: center; }
.teacher-link {
  color: #fff; background: rgba(7, 51, 71, .6); border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: 16px;
}
.demo-banner {
  background: var(--gold); color: var(--ink); text-align: center; font-weight: 800; font-size: 15px;
  padding: 6px 12px;
}

/* ---------- Formulaires ---------- */
.field { min-width: 0; display: flex; align-items: center; gap: 10px; background: #fffdf6; border-radius: 12px; padding: 0 14px; box-shadow: inset 0 0 0 2px #d9c39a; }
.field:focus-within { box-shadow: inset 0 0 0 3px var(--ocean); }
.field input { flex: 1; min-width: 0; border: 0; background: none; min-height: 56px; outline: none; font-size: 20px; }
.form-error { color: var(--red); font-weight: 700; min-height: 1.4em; text-align: center; margin: 0; }
.form-ok { color: var(--green); font-weight: 700; text-align: center; margin: 0; }

/* ---------- Accueil : choix de l'année ---------- */
.years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.year-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 14px 18px; border: 0; cursor: pointer; text-align: center; }
.year-card .big { font-family: var(--font-title); font-size: clamp(64px, 15vw, 96px); line-height: .9; color: var(--ocean); }
.year-card .big sup { font-size: .5em; }
.year-card.y7 .big { color: var(--wood-dark); }
.year-card .island { width: 100%; max-width: 220px; aspect-ratio: 1; font-size: 64px; margin-block: -6px -4px; }
.year-card .island img { filter: drop-shadow(0 6px 6px rgba(60, 35, 10, .25)); }
.year-card .btn { width: 100%; font-size: 19px; padding: 8px 10px; }
.cabinet-cta { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 20px; border: 0; width: 100%;
  font-family: var(--font-title); font-size: 28px; color: #ffe7a8;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 2px, transparent 2px 40px), linear-gradient(180deg, #7a4f2f, var(--wood-dark));
  border-radius: var(--radius); box-shadow: inset 0 0 0 3px rgba(244,180,0,.5), var(--shadow); }
.cabinet-cta .ico { font-size: 40px; }

/* ---------- Choix de la matière ---------- */
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.subject-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 10px; border: 0; cursor: pointer; text-align: center; }
.subject-tile:hover, .year-card:hover { transform: translateY(-2px); }
.subject-tile, .year-card { transition: transform .12s ease; }
.subject-tile .label { font-weight: 900; font-size: 21px; line-height: 1.15; color: var(--ink); }
.flag-wrap { position: relative; width: 72px; height: 72px; }
.flag { display: block; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(0,0,0,.3); }
.flag svg { width: 100%; height: 100%; display: block; }
.gear { position: absolute; right: -14px; top: -6px; font-size: 28px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.flag-sm, .flag-sm .flag { width: 52px; height: 52px; }

/* ---------- Liste des quiz ---------- */
.list-head { display: flex; align-items: center; gap: 14px; }
.quiz-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.quiz-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  background: #fffaf0; border: 0; border-radius: 12px; padding: 12px 14px; min-height: 60px; text-align: left;
  box-shadow: inset 0 0 0 2px #dcc79f, 0 2px 0 #cbb286; width: 100%;
}
.quiz-row:hover { background: #fff; }
.quiz-row .num { font-weight: 900; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.quiz-row .qt { font-weight: 800; font-size: 20px; }
.quiz-row .qs { font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.quiz-row .status { display: flex; gap: 6px; align-items: center; font-size: 26px; }
.quiz-row .chev { font-size: 26px; color: var(--ink-soft); }
.mini-trophy { display: inline-grid; width: 34px; height: 34px; vertical-align: middle; font-size: 24px; }
.mini-trophy .pic { width: 100%; height: 100%; }
.dot { width: 26px; height: 26px; border-radius: 50%; background: #b9b0a3; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.check { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 900; }
.empty { text-align: center; padding: 24px 10px; color: var(--ink-soft); font-weight: 700; }

/* ---------- Écran de quiz ---------- */
.quiz-progress { color: #fff; font-weight: 800; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.quiz-progress .bar { margin-top: 6px; height: 16px; background: rgba(255,255,255,.35); border-color: rgba(255,255,255,.5); }
.quiz-progress .bar > i { background: linear-gradient(180deg, #4caf50, var(--green)); }
.question { font-family: var(--font-text); font-weight: 900; font-size: clamp(24px, 5.5vw, 32px); text-align: center; line-height: 1.25; margin: 0 0 18px; text-wrap: balance; }
.answer-row { display: flex; gap: 12px; align-items: center; }
.speak { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--ocean); color: #fff; font-size: 26px; box-shadow: 0 3px 0 var(--ocean-dark); }
.answer-row .field { flex: 1; }
.answer-row .field input { font-size: 22px; }
.feedback { margin-top: 16px; border-radius: 12px; padding: 12px 16px; font-weight: 800; font-size: 20px; text-align: center; }
.feedback.ok { background: #e3f3e3; color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.feedback.ko { background: #fbe5e5; color: #8e1b1b; box-shadow: inset 0 0 0 2px var(--red); }
.feedback .good { display: block; font-size: 24px; color: var(--ink); margin-top: 4px; }
.field.ok { box-shadow: inset 0 0 0 3px var(--green); }
.field.ko { box-shadow: inset 0 0 0 3px var(--red); }
.accents { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.accents button { min-width: 44px; min-height: 44px; border-radius: 10px; border: 0; background: #fff6e2; font-weight: 800; font-size: 20px; box-shadow: inset 0 0 0 2px #d9c39a; }
.quit-row { display: flex; justify-content: center; }

/* ---------- Résultat ---------- */
.result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.result .seal { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 54px; font-weight: 900; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.result .seal.ok { background: radial-gradient(circle at 35% 30%, #56b25b, var(--green)); }
.result .seal.ko { background: radial-gradient(circle at 35% 30%, #e0605f, var(--red)); }
.result .pct { font-family: var(--font-title); font-size: 64px; line-height: 1; color: var(--ocean); font-variant-numeric: tabular-nums; }
.result .gain { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; }
.result .gain .star { font-size: 36px; }
.result .actions { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 380px; margin-top: 10px; }
.missed { width: 100%; text-align: left; background: #fffaf0; border-radius: 12px; padding: 12px 16px; box-shadow: inset 0 0 0 2px #dcc79f; }
.missed h3 { font-family: var(--font-text); font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.missed ul { margin: 0; padding-left: 20px; }
.missed li { margin: 2px 0; }

/* ---------- Pop-ups ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 26, 38, .72); display: grid; place-items: center; padding: 16px; animation: fade .25s ease; }
.modal { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.modal .portrait { width: 100%; max-width: 340px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; font-size: 110px;
  background: linear-gradient(180deg, #bfe6f5, #7cc6e8 60%, #2a8bb6); box-shadow: inset 0 0 0 3px var(--wood); }
.ribbon {
  position: relative; background: linear-gradient(180deg, #e3b86a, #c9954a); color: var(--ink);
  font-family: var(--font-title); font-size: 32px; padding: 6px 34px; margin: 0 -6px;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
}
.modal p { margin: 0; font-size: 18px; }
.modal .btn { min-width: 180px; }
.trophy-big { width: 170px; height: 170px; font-size: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,230,140,.95), rgba(244,180,0,.35) 55%, transparent 70%); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Armoire à trophées ---------- */
.cabinet {
  border-radius: 16px; padding: 16px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 46px), linear-gradient(180deg, #6d4529, #4a2e1a);
  box-shadow: inset 0 0 0 4px #3a2414, inset 0 0 30px rgba(0,0,0,.4), var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.cabinet-head { display: flex; align-items: center; justify-content: center; gap: 12px; }
.cabinet-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.select { width: 100%; min-height: 50px; border-radius: 10px; border: 0; padding: 0 12px; font-weight: 800; font-size: 17px; background: #fffaf0; box-shadow: inset 0 0 0 2px #d9c39a; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px 10px;
  padding: 14px 10px; border-radius: 10px; background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.12)); }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 0; background: none; color: #fbe9c4; padding: 0; }
.trophy .slot { width: 96px; height: 96px; font-size: 56px; border-radius: 12px; position: relative;
  background: radial-gradient(circle at 50% 40%, rgba(255,220,120,.35), transparent 70%);
  border-bottom: 6px solid #2e1c0f; }
.trophy.locked .slot { filter: brightness(0) invert(.22); opacity: .6; background: none; }
.trophy .tname { font-size: 14px; font-weight: 800; line-height: 1.2; }
.trophy .qname { font-size: 13px; color: #d9c29a; line-height: 1.2; }
.trophy.locked .tname { color: #b9a58a; }
.cabinet-count { text-align: center; color: #ffe7a8; font-family: var(--font-title); font-size: 26px; }
.cabinet .empty { color: #e9d6b0; }

/* ---------- Espace enseignant (sobre) ---------- */
.t-header { background: linear-gradient(180deg, #0e5a7b, var(--ocean-dark)); color: #fff; }
.t-header-inner { max-width: 1100px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.t-header h1 { font-size: 30px; flex: 1; }
.t-header .wheel { font-size: 30px; }
.t-page { max-width: 1100px; margin: 0 auto; width: 100%; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 16px; font-size: 17px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; border-radius: 10px; padding: 10px 16px; min-height: 44px; font-weight: 800; background: #fff; color: var(--ocean); box-shadow: inset 0 0 0 2px #c7d6de; }
.tab.on { background: var(--ocean); color: #fff; box-shadow: none; }
.panel { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08), inset 0 0 0 1px #d7e1e7; }
.panel h2 { font-family: var(--font-text); font-weight: 900; font-size: 20px; margin-bottom: 10px; color: var(--ocean-dark); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .select { width: auto; min-width: 170px; background: #fff; box-shadow: inset 0 0 0 2px #c7d6de; font-size: 16px; min-height: 44px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e3eaee; white-space: nowrap; }
table.data th { background: #eef3f6; color: var(--ocean-dark); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #f6fafc; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 800; }
.pill.ok { background: #e3f3e3; color: var(--green-dark); }
.pill.ko { background: #fbe5e5; color: #8e1b1b; }
.pill.gold { background: #fff1c4; color: #7a5900; }
.pill.grey { background: #edf0f2; color: #5a6a74; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: #f4f8fa; border-radius: 10px; padding: 12px; }
.kpi b { display: block; font-size: 28px; color: var(--ocean-dark); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 14px; color: #5a6a74; font-weight: 700; }
.t-page .btn { font-size: 17px; min-height: 46px; padding: 8px 18px; }
.t-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.t-form { display: grid; gap: 12px; }
.t-form label { display: grid; gap: 4px; font-weight: 800; font-size: 15px; color: var(--ocean-dark); }
.t-form input, .t-form select, .t-form textarea { border: 0; border-radius: 10px; padding: 10px 12px; background: #fff; box-shadow: inset 0 0 0 2px #c7d6de; font-size: 17px; font-weight: 600; }
.t-form textarea { min-height: 220px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; line-height: 1.5; }
.t-form .hint { font-weight: 600; font-size: 14px; color: #5a6a74; }
.t-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.t-form-block { display: grid; gap: 6px; }
.t-label { font-weight: 800; font-size: 15px; color: var(--ocean-dark); }
.trophy-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.tp { position: relative; aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 12px; padding: 6px; background: #f4f8fa; box-shadow: inset 0 0 0 2px #d7e1e7; font-size: 30px; }
.tp .pic { width: 100%; height: 100%; }
.tp:hover { background: #fff; }
.tp.on { background: #fff6d6; box-shadow: inset 0 0 0 3px var(--gold), 0 2px 6px rgba(0,0,0,.15); }
.tp.used:not(.on) .pic { opacity: .4; filter: grayscale(.7); }
.tp-n { position: absolute; left: 5px; top: 3px; font-size: 11px; font-weight: 900; color: #5a6a74; }
.tp-used { position: absolute; right: 4px; bottom: 3px; font-size: 10px; font-weight: 900; color: #fff; background: #5a6a74; border-radius: 6px; padding: 0 4px; }
.bad-words li { margin: 4px 0; }
.btn.danger { background: linear-gradient(180deg, #d94a4a, var(--red)); box-shadow: 0 3px 0 #8e1b1b; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 800; box-shadow: var(--shadow); animation: fade .2s; }
.confirm-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fbe5e5; border-radius: 10px; padding: 10px 12px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
