/* DaGame — moderne et épuré : grotesque géométrique, aplats, un seul accent vif. Tactile d'abord. */
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope.woff2') format('woff2'); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --display: 'Manrope', 'Inter', -apple-system, system-ui, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Sombre : noir profond, rouge vif, encre claire */
  --bg: #0b0b0d;
  --bg-glow: rgba(255, 69, 58, 0.07);
  --surface: #151518;
  --surface2: #1e1e22;
  --raised: #232328;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.13);
  --text: #f3f3f5;
  --text2: #c8c8cf;
  --muted: #8c8c96;
  --gold: #ff453a;          /* accent rouge (nom historique de la variable) */
  --gold2: #ff6a5f;
  --gold-ink: #ffffff;
  --ink: #f3f3f5;           /* bouton principal */
  --ink-fg: #0b0b0d;
  --ok: #30d17c;
  --bad: #ff453a;

  --tile-top: #ffffff;
  --tile-bot: #f6f6f3;
  --tile-edge: #d4d4cf;
  --tile-ink: #0f0f11;

  --board-bg: #151518;
  --cell: #202025;
  --cell-line: #151518;
  --p-TW: #ff453a;  --p-ink-TW: #ffffff;
  --p-DW: #3d1a18;  --p-ink-DW: #ff8a80;
  --p-TL: #f3f3f5;  --p-ink-TL: #0b0b0d;
  --p-DL: #2f2f36;  --p-ink-DL: #d8d8de;
  --p-ink: #ffffff;

  --banner-bg: #050506;
  --rack-bg: #1e1e22;
  --slot-bg: rgba(255, 255, 255, 0.05);

  --clue-bg: #232328;
  --clue-ink: #e6e6ea;
  --letter-bg: #f6f6f3;
  --letter-ink: #0f0f11;
  --grid-line: #0b0b0d;

  --shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f2ef; --bg-glow: rgba(229, 50, 45, 0.05); --surface: #ffffff; --surface2: #f2f1ee; --raised: #ffffff;
    --line: rgba(15, 15, 17, 0.07); --line2: rgba(15, 15, 17, 0.12);
    --text: #0f0f11; --text2: #3a3a40; --muted: #7b7b84;
    --gold: #e5322d; --gold2: #ff4a3d; --gold-ink: #ffffff; --ink: #0f0f11; --ink-fg: #ffffff; --bad: #e5322d; --ok: #1f9d5c;
    --tile-bot: #fbfbf9; --tile-edge: #dcdcd6;
    --board-bg: #ffffff; --cell: #f3f2ef; --cell-line: #ffffff;
    --p-TW: #e5322d; --p-ink-TW: #ffffff; --p-DW: #fbe1de; --p-ink-DW: #c4231e;
    --p-TL: #0f0f11; --p-ink-TL: #ffffff; --p-DL: #e4e3e0; --p-ink-DL: #0f0f11;
    --banner-bg: #0f0f11; --rack-bg: #0f0f11; --slot-bg: rgba(255, 255, 255, 0.07);
    --clue-bg: #0f0f11; --clue-ink: #f3f3f5; --letter-bg: #ffffff; --letter-ink: #0f0f11; --grid-line: #e2e1dd;
    --shadow: 0 24px 60px -30px rgba(15, 15, 17, 0.28); --shadow-sm: 0 6px 18px -10px rgba(15, 15, 17, 0.22);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
    --bg: #f3f2ef; --bg-glow: rgba(229, 50, 45, 0.05); --surface: #ffffff; --surface2: #f2f1ee; --raised: #ffffff;
    --line: rgba(15, 15, 17, 0.07); --line2: rgba(15, 15, 17, 0.12);
    --text: #0f0f11; --text2: #3a3a40; --muted: #7b7b84;
    --gold: #e5322d; --gold2: #ff4a3d; --gold-ink: #ffffff; --ink: #0f0f11; --ink-fg: #ffffff; --bad: #e5322d; --ok: #1f9d5c;
    --tile-bot: #fbfbf9; --tile-edge: #dcdcd6;
    --board-bg: #ffffff; --cell: #f3f2ef; --cell-line: #ffffff;
    --p-TW: #e5322d; --p-ink-TW: #ffffff; --p-DW: #fbe1de; --p-ink-DW: #c4231e;
    --p-TL: #0f0f11; --p-ink-TL: #ffffff; --p-DL: #e4e3e0; --p-ink-DL: #0f0f11;
    --banner-bg: #0f0f11; --rack-bg: #0f0f11; --slot-bg: rgba(255, 255, 255, 0.07);
    --clue-bg: #0f0f11; --clue-ink: #f3f3f5; --letter-bg: #ffffff; --letter-ink: #0f0f11; --grid-line: #e2e1dd;
    --shadow: 0 24px 60px -30px rgba(15, 15, 17, 0.28); --shadow-sm: 0 6px 18px -10px rgba(15, 15, 17, 0.22);
    color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(70vmax 45vmax at 85% -15%, var(--bg-glow), transparent 70%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }
input { font: inherit; -webkit-user-select: text; user-select: text; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ic { display: inline-flex; line-height: 0; }
.serif { font-family: var(--display); }

#app { min-height: 100%; display: flex; flex-direction: column; }
.screen {
  flex: 1; display: flex; flex-direction: column;
  padding: 22px calc(var(--safe-right) + 20px) calc(var(--safe-bot) + 96px) calc(var(--safe-left) + 20px);
  max-width: 920px; width: 100%; margin: 0 auto;
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- typographie */
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.h1 { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin: 4px 0; }
.h1 em { font-style: normal; color: var(--gold); }
.section { display: flex; align-items: center; gap: 14px; margin: 34px 0 14px; }
.section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ---------- boutons */
.btn {
  appearance: none; cursor: pointer; border-radius: 999px; padding: 0 20px; min-height: 46px;
  background: transparent; color: var(--text); border: 1px solid var(--line2);
  font-family: var(--sans); font-weight: 550; font-size: 14.5px; letter-spacing: 0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s;
}
.btn:hover { border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--ink-fg); border-color: transparent; font-weight: 650; }
.btn.primary:hover { opacity: 0.88; }
.btn.soft { background: var(--surface2); border-color: var(--line); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; min-height: 42px; padding: 0; flex: none; }
.btn.icon.sm { width: 36px; min-height: 36px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label, .label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.input {
  border: 1px solid var(--line2); background: transparent; color: var(--text); border-radius: 12px; padding: 14px 16px;
  font-size: 16px; outline: none; width: 100%; transition: border-color 0.2s;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: var(--muted); }
.input.code { text-transform: uppercase; letter-spacing: 0.22em; font-family: var(--display); font-weight: 800; text-align: center; font-size: 26px; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 550; border: 1px solid var(--line2); cursor: pointer; color: var(--text2); background: transparent; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: #fff;
  background: var(--c, #5b5bd6);
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.ai { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.avatar .st { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); border: 2px solid var(--bg); }
.avatar .st.on { background: var(--ok); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); }
.badge { background: var(--gold); color: var(--gold-ink); border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; }

/* ---------- accueil */
.topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.wordmark { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.04em; }
.wordmark i { font-style: normal; color: var(--gold); }
.hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.idchip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 750; letter-spacing: 0.12em; padding: 6px 12px 6px 14px; border-radius: 999px; border: 1px solid var(--line2); cursor: pointer; font-size: 14px; color: var(--text2); background: none; }
.idchip .ic { color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 14px 4px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; }
.stat span { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }

.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .games-grid { grid-template-columns: 1fr; } }
.game-card {
  position: relative; overflow: hidden; border-radius: 18px; padding: 22px; min-height: 196px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
}
.game-card h3 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.game-card p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 26ch; }
.game-card .actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.game-card .deco { position: absolute; right: 18px; top: 20px; display: flex; gap: 4px; transform: rotate(-5deg); pointer-events: none; }
.game-card .deco .tile { width: 30px; height: 30px; }
.game-card .deco .tile:nth-child(2) { transform: translateY(6px) rotate(4deg); }
.game-card .deco-grid { position: absolute; right: 20px; top: 22px; display: grid; grid-template-columns: repeat(4, 15px); gap: 2px; padding: 2px; background: var(--grid-line); border-radius: 3px; transform: rotate(4deg); pointer-events: none; }
.game-card .deco-grid i { width: 15px; height: 15px; border-radius: 1px; background: var(--letter-bg); }
.game-card .deco-grid i.c { background: var(--ink); }
.game-card .deco-grid i.g { background: var(--gold); }
.daily { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.daily .date { font-family: var(--display); text-align: center; line-height: 1; padding-right: 16px; border-right: 1px solid var(--line2); min-width: 54px; }
.daily .date b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.daily .date span { font-family: var(--sans); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.daily h4 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:first-child { border-top: 1px solid var(--line); }
.item:active { background: var(--surface); }
.item .t { font-weight: 600; }
.item .score { font-family: var(--display); font-size: 18px; font-variant-numeric: lining-nums tabular-nums; color: var(--text2); white-space: nowrap; }
.item .tag { margin-left: 8px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold); padding: 2px 7px; border-radius: 999px; vertical-align: 2px; font-weight: 700; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); font-size: 14px; }

/* ---------- barre d'onglets */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-bot) + 12px); z-index: 30;
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line2); box-shadow: var(--shadow);
}
.tabbar button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.tabbar button.on { background: var(--text); color: var(--bg); }
.tabbar .badge { position: absolute; top: 2px; right: 4px; }

/* ---------- feuilles modales */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(4, 6, 5, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line2); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 10px 22px calc(var(--safe-bot) + 22px); box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
  animation: up 0.38s cubic-bezier(0.2, 0.9, 0.25, 1); -webkit-user-select: text; user-select: text;
}
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1px solid var(--line2); padding-bottom: 24px; } }
@keyframes up { from { transform: translateY(30%); opacity: 0; } }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line2); margin: 2px auto 14px; }
.sheet h2 { margin: 0 0 16px; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.035em; }
.sheet .actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet .actions .btn { flex: 1; }
.menu-list { display: flex; flex-direction: column; }
.menu-list button { display: flex; align-items: center; gap: 14px; padding: 15px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font-size: 15px; text-align: left; color: var(--text); }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button .ic { color: var(--gold); }
.menu-list button.danger, .menu-list button.danger .ic { color: var(--bad); }
.menu-list button .sub { display: block; font-size: 12.5px; color: var(--muted); }
.seg { display: flex; border: 1px solid var(--line2); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 20px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 999px; font-weight: 550; cursor: pointer; color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.seg button.on { background: var(--text); color: var(--bg); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.level { border: 1px solid var(--line2); border-radius: 14px; padding: 14px 4px 12px; text-align: center; cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--text2); }
.level .n { display: flex; gap: 3px; justify-content: center; margin: 2px 0 8px; }
.level .n i { width: 5px; height: 14px; border-radius: 2px; background: var(--line2); }
.level .n i.on { background: var(--gold); }
.level.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--text); }

/* ---------- toasts */
.toasts { position: fixed; top: calc(var(--safe-top) + 12px); left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(92vw, 440px); background: color-mix(in srgb, var(--raised) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line2); padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 550; font-size: 14px; animation: toast 0.35s cubic-bezier(0.2, 0.9, 0.25, 1); display: flex; gap: 10px; align-items: center; }
.toast::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.toast.bad::before { background: var(--bad); }
.toast.ok::before { background: var(--ok); }
@keyframes toast { from { transform: translateY(-16px); opacity: 0; } }

/* ============================================================ JEU */
.shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.game {
  position: relative; flex: 1; min-height: 0; display: grid; overflow: hidden;
  padding: 10px calc(var(--safe-right) + 12px) calc(var(--safe-bot) + 12px) calc(var(--safe-left) + 12px);
  grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); gap: 12px;
}
.topbar { display: flex; align-items: center; gap: 8px; }
.players { flex: 1; display: flex; gap: 6px; min-width: 0; justify-content: center; }
.pl { flex: 1; max-width: 220px; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); transition: background 0.3s, color 0.3s; }
.pl.active { background: var(--ink); color: var(--ink-fg); border-color: transparent; }
.pl .info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pl .nm { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.pl.active .nm { color: color-mix(in srgb, var(--ink-fg) 70%, transparent); }
.pl.active .nm::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
@media (max-width: 430px) { .pl .avatar { display: none; } .pl { padding: 5px 14px; } }
.pl .sc { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: lining-nums tabular-nums; line-height: 1.05; }
.bump { animation: bump 0.7s ease; }
@keyframes bump { 35% { transform: scale(1.18); color: var(--gold); } }
.pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--display); font-weight: 800; font-size: 14px; padding: 0 14px; height: 42px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); flex: none; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--text); }
.minitiles { position: relative; width: 18px; height: 16px; flex: none; }
.minitiles::before, .minitiles::after { content: ''; position: absolute; width: 11px; height: 11px; border-radius: 3px; border: 1.6px solid currentColor; box-sizing: border-box; }
.minitiles::before { left: 0; bottom: 0; }
.minitiles::after { right: 0; top: 0; background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--surface); }

.main { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }

/* ---------- panneau latéral (grand écran) */
.panel { display: none; }
.panel-head { display: flex; align-items: center; gap: 12px; }
.panel-head .t { flex: 1; min-width: 0; }
.panel-head .t b { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.panel-head .t span { font-size: 13px; color: var(--muted); }
.scorecard { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); transition: box-shadow 0.3s, border-color 0.3s; }
.scorecard.active { border-color: transparent; box-shadow: 0 0 0 2px var(--text); }
.scorecard .who { min-width: 0; }
.scorecard .who b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scorecard .who span { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.scorecard.active .who span { color: var(--gold); font-weight: 600; }
.scorecard.active .who span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.scorecard .sc { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: lining-nums tabular-nums; line-height: 1; }
.bagmeter { padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.bagmeter .top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.bagmeter .top b { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.bagmeter .top span { font-size: 12.5px; color: var(--muted); }
.bagmeter .bar { height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.bagmeter .bar i { display: block; height: 100%; background: var(--text); border-radius: 2px; transition: width 0.5s ease; }
.lastmove { font-size: 14px; color: var(--muted); line-height: 1.5; padding: 0 4px; }
.lastmove b { color: var(--text); font-weight: 650; }
.lastmove .w { font-family: var(--display); color: var(--text); font-weight: 800; letter-spacing: 0.02em; }
.panel-foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }

@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .game.wide {
    grid-template-columns: 300px auto; grid-template-rows: minmax(0, 1fr); column-gap: clamp(32px, 4vw, 64px);
    justify-content: center; padding: 24px 32px;
  }
  .game.wide .main { width: max(var(--bs), 560px); }
  .game.wide .topbar { display: none; }
  .game.wide .panel { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; padding: 2px; }
  .game.wide .under { display: none; }
  .game.wide.drawer-open { padding-right: calc(min(380px, 92vw) + 32px); }
}

/* ---------- plateau */
.board-frame { position: relative; width: var(--bs); height: var(--bs); max-width: 100%; padding: clamp(5px, 0.9vmin, 12px); border-radius: clamp(14px, 1.8vmin, 24px); background: var(--board-bg); border: 1px solid var(--line); box-shadow: var(--shadow); flex: none; }
.board-wrap { position: relative; width: 100%; height: 100%; border-radius: clamp(8px, 1vmin, 14px); overflow: hidden; touch-action: manipulation; }
.board-wrap.zoomed { overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; scrollbar-width: none; }
.board-wrap.zoomed::-webkit-scrollbar { display: none; }
.board { display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); gap: clamp(2px, 0.35vmin, 4px); width: calc(100% * var(--z, 1)); height: calc(100% * var(--z, 1)); position: relative; background: var(--cell-line); }
.cell { position: relative; background: var(--cell); border-radius: clamp(2px, 0.45vmin, 6px); display: grid; place-items: center; container-type: size; }
.cell .pm { font-family: var(--display); font-size: max(5.5px, 25cqw); font-weight: 800; letter-spacing: 0.01em; line-height: 1; pointer-events: none; }
.cell.TW { background: var(--p-TW); } .cell.TW .pm { color: var(--p-ink-TW); }
.cell.DW, .cell.ST { background: var(--p-DW); } .cell.DW .pm, .cell.ST .pm { color: var(--p-ink-DW); }
.cell.TL { background: var(--p-TL); } .cell.TL .pm { color: var(--p-ink-TL); }
.cell.DL { background: var(--p-DL); } .cell.DL .pm { color: var(--p-ink-DL); }
.cell.ST .pm { font-size: 52cqw; color: var(--gold); }
.cell.drop { box-shadow: inset 0 0 0 2px var(--gold); z-index: 2; }
.under { width: var(--bs); max-width: 100%; display: flex; align-items: center; gap: 8px; min-height: 34px; }
.under .statusline { flex: 1; }
.zoom-ctl { display: flex; gap: 6px; flex: none; }
.zoom-ctl button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.zoom-ctl button:disabled { opacity: 0.35; }

.tile {
  position: relative; width: 100%; height: 100%; border-radius: 16%; display: grid; place-items: center; container-type: size;
  background: var(--tile-top); color: var(--tile-ink);
  box-shadow: inset 0 0 0 1px rgba(15, 15, 17, 0.06), inset 0 -2px 0 var(--tile-edge), 0 2px 5px -1px rgba(15, 15, 17, 0.22);
  line-height: 1;
}
.tile .l { font-family: var(--display); font-weight: 800; font-size: 56cqh; letter-spacing: -0.04em; transform: translateY(-3%); }
.tile .v { position: absolute; right: 9%; bottom: 7%; font-family: var(--display); font-size: 21cqh; font-weight: 700; color: color-mix(in srgb, var(--tile-ink) 55%, transparent); }
.tile.blank .l { color: var(--gold); }
.tile.pending { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px -6px rgba(15, 15, 17, 0.5); }
.tile.pending.good { box-shadow: 0 0 0 2px var(--ok), 0 6px 14px -6px rgba(15, 15, 17, 0.5); }
.tile.pending.bad { box-shadow: 0 0 0 2px var(--bad), 0 6px 14px -6px rgba(15, 15, 17, 0.5); }
.tile.last { box-shadow: inset 0 0 0 1px rgba(15, 15, 17, 0.06), inset 0 -3px 0 var(--gold), 0 2px 5px -1px rgba(15, 15, 17, 0.22); }
.tile.ghost { background: #e3f7ec; box-shadow: 0 0 0 2px var(--ok); }
.tile.drop-in { animation: dropin 0.32s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes dropin { from { transform: scale(1.35); opacity: 0.2; } }
.preview-bubble { position: absolute; z-index: 5; transform: translate(-30%, -112%); background: var(--ink); color: var(--ink-fg); font-family: var(--display); font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; pointer-events: none; box-shadow: var(--shadow-sm); white-space: nowrap; }
.preview-bubble.bad { background: var(--bad); color: #fff; }

/* ---------- chevalet et actions */
.rack-area { width: min(var(--bs), 480px); max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.rack { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(5px, 1vw, 9px); padding: clamp(8px, 1.4vw, 12px); border-radius: 22px; background: var(--rack-bg); touch-action: none; width: 100%; box-shadow: var(--shadow); }
.slot { aspect-ratio: 1; min-width: 0; border-radius: 14%; background: var(--slot-bg); }
.slot .tile .l { font-size: 46cqh; }
.slot .tile .v { font-size: 19cqh; }
.slot .tile { cursor: grab; transition: transform 0.18s ease; box-shadow: inset 0 -2px 0 var(--tile-edge), 0 3px 8px -2px rgba(0, 0, 0, 0.5); }
.slot .tile.sel { transform: translateY(-14%); box-shadow: 0 0 0 2px var(--gold), 0 12px 18px -8px rgba(0, 0, 0, 0.7); }
.actions-bar { display: flex; gap: 6px; justify-content: center; align-items: flex-start; }
.act { flex: 1; max-width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 550; color: var(--muted); padding: 0; }
.act .ic { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); transition: border-color 0.2s, transform 0.12s; }
.act:hover .ic { border-color: var(--line2); }
.act:active .ic { transform: scale(0.94); }
.act:disabled { opacity: 0.35; pointer-events: none; }
.act.play { flex: 0 1 200px; max-width: 220px; min-width: 150px; height: 50px; margin-top: -1px; flex-direction: row; justify-content: center; gap: 10px; border-radius: 999px; background: var(--ink); color: var(--ink-fg); font-family: var(--display); font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.act.play .ic { width: auto; height: auto; background: none; border: 0; color: inherit; }
.act.play:disabled { opacity: 1; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted); }
.act.play .pts { background: var(--gold); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 15px; font-weight: 800; }
.act.play:active { transform: scale(0.97); }
@media (max-width: 380px) { .act .ic { width: 44px; height: 44px; } .act.play { min-width: 120px; } }
.dragging { position: fixed; z-index: 100; pointer-events: none; width: 58px; height: 58px; transform: translate(-50%, -112%) scale(1.12); filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45)); }
.statusline { font-size: 13.5px; color: var(--muted); text-align: center; min-height: 20px; }
.statusline b { color: var(--text); font-weight: 650; }
.statusline .w { font-family: var(--display); color: var(--text); font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; font-size: 13px; }

/* ---------- historique (tiroir) */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 45; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.35); transform: translateX(105%); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bot) + 20px); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-head b { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.history { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; -webkit-user-select: text; user-select: text; }
.hist { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.hist .w { flex: 1; font-family: var(--display); font-size: 14px; font-weight: 800; letter-spacing: 0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .s { font-family: var(--display); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; color: var(--text2); }
.hist.cur { background: var(--surface2); border-radius: 10px; }
.hist .best { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 500; color: var(--ok); letter-spacing: 0; }
.hist .best.same { color: var(--muted); }
.floating-emoji { position: fixed; z-index: 95; font-size: 56px; pointer-events: none; animation: floatup 2.2s ease forwards; }
@keyframes floatup { 0% { transform: translateY(20px) scale(0.4); opacity: 0; } 15% { transform: none; opacity: 1; } 100% { transform: translateY(-160px) scale(1.1); opacity: 0; } }

/* ---------- définition */
.def-word { font-family: var(--display); font-size: 32px; font-weight: 800; margin: 0; letter-spacing: -0.035em; }
.def-pos { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); margin: 18px 0 6px; }
.def-list { margin: 0; padding-left: 22px; }
.def-list li { margin: 6px 0; line-height: 1.5; color: var(--text2); }
.def-list li::marker { font-family: var(--display); color: var(--muted); }
.valid { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; border: 1px solid; }
.valid.yes { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.valid.no { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.spinner { width: 24px; height: 24px; border: 2px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.letter-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.letter-grid button { aspect-ratio: 1; border: 0; border-radius: 9px; font-family: var(--display); font-weight: 800; font-size: 21px; background: linear-gradient(170deg, var(--tile-top), var(--tile-bot)); color: var(--tile-ink); cursor: pointer; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--tile-edge) 60%, transparent); transition: transform 0.15s; }
.letter-grid button.on { box-shadow: 0 0 0 2px var(--gold); transform: translateY(-3px); }
.letter-grid.plain { grid-template-columns: repeat(4, 1fr); }
.letter-grid.plain button { background: none; border: 1px solid var(--line2); color: var(--text); font-size: 28px; box-shadow: none; }

/* ============================================================ MOTS FLÉCHÉS */
.fl-frame { width: var(--gw); max-width: 100%; height: var(--gh); padding: 3px; border-radius: 12px; background: var(--grid-line); box-shadow: var(--shadow), 0 0 0 1px var(--line2); position: relative; flex: none; }
.fl-scroll { width: 100%; height: 100%; overflow: hidden; border-radius: 7px; position: relative; }
.fl-scroll.zoomed { overflow: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fl-scroll.zoomed::-webkit-scrollbar { display: none; }
.fl-grid { display: grid; gap: 2px; width: calc(100% * var(--z, 1)); height: calc((var(--gh) - 6px) * var(--z, 1)); touch-action: manipulation; }
.fc { position: relative; min-width: 0; min-height: 0; border-radius: 3px; overflow: hidden; container-type: size; }
.fc.L { background: var(--letter-bg); color: var(--letter-ink); display: grid; place-items: center; cursor: pointer; transition: background 0.15s; }
.fc.L .ch { font-family: var(--display); font-size: 58cqh; font-weight: 750; line-height: 1; text-transform: uppercase; }
.fc.L.inword { background: color-mix(in srgb, var(--gold) 20%, var(--letter-bg)); }
.fc.L.cur { background: color-mix(in srgb, var(--gold) 52%, var(--letter-bg)); }
.fc.L.claimed .ch { color: var(--c); }
.fc.L.claimed::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: 8%; height: 2px; border-radius: 1px; background: var(--c); opacity: 0.55; }
.fc.L.revealed .ch { color: var(--muted); }
.fc.L.hint .ch { color: var(--gold); }
.fc.L.wrong { animation: wrong 0.5s ease; background: color-mix(in srgb, var(--bad) 35%, var(--letter-bg)); }
.fc.L.flag .ch { color: var(--bad); }
.fc.L.flag::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--bad) 14%, transparent); }
@keyframes wrong { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
.fc.L.win { animation: win 0.6s ease; }
@keyframes win { 40% { transform: scale(1.14); } }
.fc.L.opp::before { content: ''; position: absolute; inset: 2px; border: 1.5px dashed var(--oc, var(--bad)); border-radius: 2px; pointer-events: none; }
.fc.C { background: var(--clue-bg); color: var(--clue-ink); display: flex; flex-direction: column; cursor: pointer; }
.fc.C.empty { background: color-mix(in srgb, var(--clue-bg) 82%, var(--letter-bg)); padding: 0; border: 0; border-radius: 3px; } /* annule la règle générique .empty */
.fc.C .q { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; text-align: center; container-type: size; overflow: hidden; position: relative; padding: 0 3px; transition: background 0.15s; }
.fc.C .q .tx { font-size: clamp(6px, min(19cqh, 15cqw), 13px); line-height: 1.08; font-weight: 500; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.fc.C .q.two .tx { font-size: clamp(6px, min(30cqh, 15cqw), 12px); -webkit-line-clamp: 2; }
.fc.C .q + .q { border-top: 1px solid color-mix(in srgb, var(--clue-ink) 18%, transparent); }
.fc.C .q.on { background: var(--gold); color: var(--gold-ink); }
.fc.C .q.done .tx { opacity: 0.35; }
.fc.C .q .ar { position: absolute; font-size: 8px; color: var(--gold); }
.fc.C .q.on .ar { color: var(--gold-ink); }
.fc.C .q .ar.r { right: 1px; top: 50%; transform: translateY(-50%); }
.fc.C .q .ar.d { bottom: 0; left: 50%; transform: translateX(-50%); }
.fc.logo-cell { background: var(--gold); display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; letter-spacing: -0.06em; font-size: 46cqh; }
.cluebar { width: min(100%, max(var(--gw), 560px)); max-width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line2); min-height: 62px; }
.cluebar .txt { flex: 1; min-width: 0; font-family: var(--display); font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.28; cursor: pointer; }
.cluebar .txt .def { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cluebar .txt .dir { color: var(--gold); font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; display: block; margin-bottom: 1px; }
.fl-tools { width: min(100%, max(var(--gw), 560px)); max-width: 100%; display: flex; gap: 6px; justify-content: center; }
.fl-tools .act { min-height: 46px; max-width: none; }
.kbd { margin-top: auto; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 6px; touch-action: manipulation; }
.kbd .kr { display: flex; gap: 5px; justify-content: center; }
.kbd button { flex: 1; max-width: 50px; height: 46px; border: 0; border-radius: 9px; background: var(--surface2); font-family: var(--display); font-weight: 700; font-size: 19px; cursor: pointer; box-shadow: inset 0 -1px 0 var(--line2), 0 1px 2px rgba(0, 0, 0, 0.3); color: var(--text); display: grid; place-items: center; }
.kbd button:active { background: var(--gold); color: var(--gold-ink); }
.kbd button.wide { max-width: 76px; flex: 1.5; color: var(--gold); }
@media (max-height: 740px) { .kbd button { height: 40px; } .fl-tools .act { min-height: 40px; gap: 2px; } .fl-tools .act .lbl { display: none; } }

.timer { font-variant-numeric: tabular-nums; }

/* ---------- classement */
.lb-row { display: grid; grid-template-columns: 30px 34px 1fr auto; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.lb-row:first-child { border-top: 1px solid var(--line); }
.lb-row .rk { font-family: var(--display); font-size: 18px; font-weight: 800; text-align: center; color: var(--muted); }
.lb-row:nth-child(1) .rk { color: var(--gold); }
.lb-row .v { font-family: var(--display); font-size: 20px; font-variant-numeric: lining-nums tabular-nums; text-align: right; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px 18px; padding: 0 20px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .chip { white-space: nowrap; }

/* ---------- connexion */
.welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto; width: 100%; }
.welcome .tiles-deco { display: flex; justify-content: center; gap: 6px; margin-bottom: 30px; }
.welcome .tiles-deco .tile { width: 44px; height: 44px; animation: float 4s ease-in-out infinite; }
.welcome .tiles-deco .tile:nth-child(2n) { animation-delay: -1.6s; }
@keyframes float { 50% { transform: translateY(-6px); } }
.welcome .h1 { font-size: 40px; text-align: center; line-height: 1.02; }
.welcome .lede { text-align: center; color: var(--muted); margin: 10px auto 30px; max-width: 32ch; }

/* ---------- résultats */
.result-hero { text-align: center; padding: 8px 0 4px; }
.result-hero .kicker { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.result-hero h2 { font-size: 34px !important; letter-spacing: -0.04em; margin: 6px 0 4px !important; }
.result-scores { display: flex; justify-content: center; gap: 28px; margin: 18px 0; }
.result-scores .s { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.result-scores .s b { font-family: var(--display); font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: lining-nums; }
.confetti { position: fixed; top: -20px; width: 6px; height: 12px; z-index: 99; pointer-events: none; animation: fall linear forwards; border-radius: 1px; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.replay-bar { width: var(--bs); max-width: 100%; display: flex; align-items: center; gap: 8px; }
.replay-bar input[type=range] { flex: 1; accent-color: var(--gold); }
.replay-info { width: var(--bs); max-width: 100%; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; font-size: 14px; min-height: 70px; background: var(--surface); }
.replay-info .best { color: var(--ok); }
.replay-info .w { font-family: var(--display); font-size: 16px; }

/* ============================================================ BANDEAU ET LOGO */
.banner {
  position: sticky; top: 0; z-index: 25; flex: none; color: #fff;
  background-color: var(--banner-bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1.3px);
  background-size: 14px 14px; background-position: 7px 7px;
  padding-top: var(--safe-top);
}
.banner::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 25%, var(--gold) 75%, transparent); }
.banner-in { height: 60px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 calc(var(--safe-right) + 12px) 0 calc(var(--safe-left) + 12px); }
.b-left { justify-self: start; display: flex; align-items: center; gap: 6px; }
.b-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
.brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px 6px; border-radius: 12px; }
.brand .wm { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.05em; line-height: 1; }
.brand .wm b { color: var(--gold); font-weight: 800; }
.logo { display: inline-block; width: 52px; height: 41px; flex: none; }
.logo svg { width: 100%; height: 100%; overflow: visible; }
.logo text { font-family: var(--display); font-weight: 800; }
.logo .f1 { fill: #ffffff; }
.logo .l1 { fill: #0f0f11; font-size: 24px; }
.logo .v1 { fill: #0f0f11; opacity: 0.55; font-size: 7.5px; }
.logo .f2 { fill: var(--gold); stroke: var(--banner-bg); stroke-width: 3; }
.logo .l2 { fill: #ffffff; font-size: 24px; }
.logo .v2 { fill: #ffffff; opacity: 0.8; font-size: 7.5px; }
.logo .t1 { transform-box: view-box; transform-origin: 22px 25px; transform: rotate(-8deg); animation: logo-in-1 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.logo .t2 { transform-box: view-box; transform-origin: 48px 31px; transform: rotate(7deg); animation: logo-in-2 0.7s 0.08s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes logo-in-1 { from { transform: translateY(-16px) rotate(-30deg); opacity: 0; } }
@keyframes logo-in-2 { from { transform: translateY(16px) rotate(30deg); opacity: 0; } }
.logo.shuffle .t1 { animation: logo-sh-1 0.55s ease; }
.logo.shuffle .t2 { animation: logo-sh-2 0.55s ease; }
@keyframes logo-sh-1 { 50% { transform: translate(18px, -6px) rotate(10deg); } }
@keyframes logo-sh-2 { 50% { transform: translate(-18px, 6px) rotate(-10deg); } }
.bbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; transition: background 0.2s; }
.bbtn:hover { background: rgba(255, 255, 255, 0.12); }
@media (min-width: 700px) { .brand .wm { font-size: 25px; } .logo { width: 58px; height: 45px; } .banner-in { height: 66px; } }
@media (prefers-reduced-motion: reduce) { .logo .t1, .logo .t2 { animation: none; } }

/* ============================================================ ANAGRAMMES & RAFALE */
.game.rounds { grid-template-rows: auto minmax(0, 1fr); }
.rmain { justify-content: flex-start; overflow: auto; padding-bottom: 8px; }
.rdots { display: flex; gap: 5px; flex: none; padding: 0 6px; }
.rdots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); }
.rdots i.done { background: var(--text); }
.rdots i.cur { background: var(--gold); }
.rcard { width: min(100%, 480px); margin: auto; padding: 26px 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.rtitle { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin: 8px 0 14px; }
.rrules { text-align: left; color: var(--text2); line-height: 1.55; padding-left: 20px; margin: 0 0 18px; font-size: 14.5px; }
.btn.big { min-height: 54px; font-size: 16px; margin-top: 8px; }
.rplay { width: min(100%, 600px); display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0 auto; flex: 1; }
.rhead { width: 100%; display: flex; align-items: center; gap: 14px; }
.rtimer { flex: 1; display: flex; align-items: center; gap: 10px; }
.rtimer .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.rtimer .bar i { display: block; height: 100%; background: var(--text); border-radius: 4px; transition: width 0.25s linear; }
.rtimer .t { font-family: var(--display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.rtimer.low .bar i { background: var(--gold); }
.rtimer.low .t { color: var(--gold); animation: pulse 1s ease infinite; }
.rscore { text-align: right; line-height: 1; }
.rscore b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.rscore span { font-size: 12px; color: var(--muted); }
.rword { min-height: 40px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: 0.06em; }
.rword .fb { font-size: 18px; letter-spacing: 0; padding: 6px 14px; border-radius: 999px; animation: toast 0.25s ease; }
.rword .fb.ok { background: var(--ok); color: #fff; }
.rword .fb.bad { background: var(--bad); color: #fff; }
.rword .fb.warn { background: var(--surface2); color: var(--text); }
.rfound { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 22vh; overflow: auto; }
.rfound .chip { font-family: var(--display); font-weight: 700; padding: 6px 11px; cursor: default; }
.rfound .chip small, .rsols .sol small { color: var(--muted); font-weight: 600; margin-left: 5px; font-size: 11px; }
.ractions { width: 100%; display: flex; gap: 6px; justify-content: center; align-items: flex-start; }
.endbtn { margin-top: auto; }

/* lettres d'anagramme */
.ana { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.ana-slots, .ana-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.ana-slots { padding: 10px; border-radius: 20px; background: var(--surface); border: 1px dashed var(--line2); }
.ana-tiles { padding: 10px; border-radius: 22px; background: var(--rack-bg); }
.aslot { aspect-ratio: 1; min-width: 0; border-radius: 14%; background: var(--slot-bg); }
.ana-slots .aslot { background: var(--surface2); }
.aslot .tile { border: 0; padding: 0; cursor: pointer; font: inherit; animation: dropin 0.2s ease; }
.aslot .tile .l { font-size: 50cqh; }

/* grille Rafale */
.raf { position: relative; width: min(100%, 560px, 56vh); aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2.4vw, 14px); padding: clamp(10px, 2.6vw, 16px); border-radius: 28px; background: var(--rack-bg); touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: var(--shadow); }
.rc { position: relative; min-width: 0; min-height: 0; }
.rc .tile { transition: transform 0.12s ease, background 0.15s; pointer-events: none; }
.rc .tile .l { font-size: 52cqh; }
.rc.on .tile { background: var(--gold); color: #fff; transform: scale(0.94); }
.rc.on .tile .v { color: rgba(255, 255, 255, 0.8); }
.rc.good .tile { background: var(--ok); color: #fff; }
.rc.badc .tile { background: var(--surface2); color: var(--muted); }
.rbadge { position: absolute; top: -6px; left: -6px; z-index: 2; font-family: var(--display); font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; pointer-events: none; letter-spacing: 0.02em; }
.b-L2 .rbadge { background: #ffffff; color: #0f0f11; box-shadow: 0 0 0 1.5px #0f0f11; }
.b-L3 .rbadge { background: #0f0f11; color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.b-M2 .rbadge { background: var(--gold); color: #fff; }
.raf-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.raf-path polyline { fill: none; stroke: var(--gold); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }

/* résultats */
.rres { width: min(100%, 560px); margin: 0 auto; display: flex; flex-direction: column; gap: 14px; text-align: center; padding-bottom: 20px; }
.rbig b { display: block; font-family: var(--display); font-size: 64px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.rbig span { color: var(--muted); font-size: 14px; }
.hidden-word { font-family: var(--display); font-weight: 800; color: var(--gold); cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; }
.rcmp { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.rcmp > div:not(.vs) { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rcmp b { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.rcmp span { font-size: 12px; color: var(--muted); }
.rcmp .vs { color: var(--muted); font-size: 13px; }
.rsols { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; text-align: left; }
.rsols .sol { font-family: var(--display); font-weight: 700; font-size: 13.5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line2); cursor: pointer; color: var(--muted); }
.rsols .sol.mine { color: #fff; background: var(--gold); border-color: transparent; }
.rsols .sol.mine small { color: rgba(255, 255, 255, 0.8); }
.rsols .sol.opp { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; color: var(--text); }
.game.rounds .topbar { justify-content: center; }
@media (min-width: 1000px) { .game.rounds { padding-top: 22px; } }

.game-card .deco-raf { position: absolute; right: 18px; top: 20px; display: grid; grid-template-columns: repeat(2, 26px); gap: 4px; padding: 5px; border-radius: 10px; background: var(--rack-bg); transform: rotate(5deg); pointer-events: none; }
.game-card .deco-raf .tile { width: 26px; height: 26px; }
.game-card .deco-raf .tile.hot { background: var(--gold); color: #fff; }

/* Sur ordinateur (souris ou pavé tactile), le vrai clavier suffit : la grille prend la place. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .kbd { display: none; }
}

.fl-side { display: contents; }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .game.fl .main { flex-direction: row; align-items: center; justify-content: center !important; gap: 40px; }
  .game.fl .fl-side { display: flex; flex-direction: column; gap: 16px; width: 340px; flex: none; }
  .game.fl .fl-side .cluebar, .game.fl .fl-side .fl-tools { width: 100%; }
  .game.fl .fl-side .cluebar { min-height: 120px; align-items: flex-start; padding: 14px 10px; }
  .game.fl .fl-side .cluebar .def { -webkit-line-clamp: 6; }
  .game.fl .fl-side .kbd { margin-top: 0; }
  .game.fl .fl-side .kbd button { height: 40px; }
}

/* ============================================================ SUDOKU */
.game.su .topbar, .game.pe .topbar { justify-content: center; }
.su-main { gap: 18px; }
.su-frame { width: var(--sus); height: var(--sus); max-width: 100%; padding: 3px; border-radius: 17px; background: var(--text); box-shadow: var(--shadow); flex: none; }
.su-grid { width: 100%; height: 100%; display: grid; gap: 3px; background: var(--text); border-radius: 14px; overflow: hidden; }
.su-box { display: grid; gap: 1px; background: color-mix(in srgb, var(--text) 18%, var(--surface)); min-width: 0; min-height: 0; }
.su-c { position: relative; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0; background: var(--surface); color: var(--text2); font-family: var(--display); cursor: pointer; display: grid; place-items: center; container-type: size; transition: background 0.12s; }
.su-c .d { font-size: 58cqh; font-weight: 600; line-height: 1; }
.su-c.given .d { color: var(--text); font-weight: 800; }
.su-c.peer { background: color-mix(in srgb, var(--text) 5%, var(--surface)); }
.su-c.same { background: color-mix(in srgb, var(--text) 13%, var(--surface)); }
.su-c.same .d { color: var(--text); }
.su-c.sel { background: color-mix(in srgb, var(--text) 9%, var(--surface)); box-shadow: inset 0 0 0 2.5px var(--text); z-index: 1; }
.su-c.wrong { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.su-c.wrong .d { color: var(--bad); }
.su-c.wave { animation: suwave 0.5s ease; }
@keyframes suwave { 40% { background: var(--text); color: var(--surface); transform: scale(0.92); } }
.notes { position: absolute; inset: 6%; display: grid; font-family: var(--display); font-weight: 600; color: var(--muted); }
.notes.n9 { grid-template-columns: repeat(3, 1fr); font-size: 22cqh; }
.notes.n6 { grid-template-columns: repeat(3, 1fr); font-size: 26cqh; }
.notes i { font-style: normal; display: grid; place-items: center; line-height: 1; }
.su-side { width: min(var(--sus), 520px); max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.su-pad { display: grid; gap: 8px; }
.su-pad.p9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.su-pad.p6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.su-k { aspect-ratio: 0.82; border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 var(--line2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text); }
.su-k b { font-family: var(--display); font-size: clamp(20px, 5.4vw, 30px); font-weight: 800; line-height: 1; }
.su-k small { font-size: 10px; color: var(--muted); font-weight: 600; min-height: 12px; }
.su-k:active { background: var(--ink); color: var(--ink-fg); }
.su-k.full { opacity: 0.3; }
.su-tools { display: flex; justify-content: center; gap: 6px; }
.su-tools .act.on .ic { background: var(--ink); color: var(--ink-fg); border-color: transparent; }
.su-done { text-align: center; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.su-done b { display: block; font-family: var(--display); font-size: 48px; font-weight: 800; letter-spacing: -0.05em; margin: 4px 0; }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .su-main { flex-direction: row; gap: 48px; }
  .su-side { width: 340px; }
  .su-pad.p9 { grid-template-columns: repeat(3, 1fr); }
  .su-pad.p6 { grid-template-columns: repeat(3, 1fr); }
  .su-k { aspect-ratio: 1.25; }
}

/* ============================================================ PENDU */
.pe-main { gap: 18px; justify-content: flex-start; overflow: auto; }
.pe-left { display: flex; justify-content: center; width: 100%; }
.pe-art { position: relative; width: min(64vw, 260px, 34vh); aspect-ratio: 200 / 236; }
.gallows { width: 100%; height: auto; overflow: visible; }
.gallows .p { fill: none; stroke: var(--text); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.55s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
.gallows .p.drawn { animation: none; stroke-dashoffset: 0; }
.gallows .post .p { stroke: color-mix(in srgb, var(--text) 75%, transparent); }
.gallows .rope { stroke: var(--gold); stroke-width: 4; }
.gallows .fig { stroke-width: 5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.gallows.lost .hanged { transform-origin: 146px 24px; animation: sway 2.4s ease-in-out infinite; }
.gallows.lost .fig { stroke: var(--bad); }
.gallows .eyes path { fill: none; stroke: var(--bad); stroke-width: 2.5; stroke-linecap: round; }
@keyframes sway { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-4deg); } }
.gallows .free circle, .gallows .free path { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; }
.gallows .free { transform-origin: 160px 202px; animation: hop 0.6s ease-in-out infinite alternate; }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-16px); } }
.pe-lives { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.pe-lives i { width: 10px; height: 10px; border-radius: 50%; background: var(--text); transition: background 0.3s, transform 0.3s; }
.pe-lives i.lost { background: var(--line2); transform: scale(0.7); }
.pe-right { width: min(100%, 560px); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pe-word { display: flex; justify-content: center; gap: clamp(4px, 1.4vw, 8px); flex-wrap: nowrap; width: 100%; }
.pe-l { flex: 0 1 46px; aspect-ratio: 0.78; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: clamp(18px, calc(70vw / var(--n, 8)), 36px); color: var(--text); border-bottom: 3px solid var(--text); }
.pe-l.on { animation: popin 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) both; animation-delay: var(--d); }
.pe-l.miss { color: var(--bad); border-color: var(--bad); }
@keyframes popin { from { transform: translateY(8px) scale(0.6); opacity: 0; } }
.pe-info { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-height: 64px; }
.pe-clue { width: 100%; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.pe-clue p { margin: 4px 0 0; font-size: 15px; line-height: 1.4; }
.pe-end { width: 100%; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: up 0.35s cubic-bezier(0.2, 0.9, 0.25, 1); }
.pe-end h3 { margin: 4px 0 6px; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.pe-end h3 .ic { color: var(--muted); }
.pe-end p { margin: 0 0 12px; color: var(--text2); font-size: 14.5px; line-height: 1.45; }
.pe-end.won .eyebrow { color: var(--ok); }
.pe-end:not(.won) .eyebrow { color: var(--bad); }
.pe-kbd { margin-top: 0; }
.pe-kbd button.hit { background: var(--ink); color: var(--ink-fg); opacity: 1; }
.pe-kbd button.miss { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); text-decoration: line-through; opacity: 0.6; }
.pe-kbd button:disabled { cursor: default; }
.pe-kbd.off { opacity: 0.5; }
/* potence en filigrane : ce qui reste à dessiner */
.gallows .guide path, .gallows .guide circle { fill: none; stroke: var(--line2); stroke-width: 5; stroke-dasharray: 2 9; stroke-linecap: round; }
/* écran plus large que haut (pliant ouvert, tablette en paysage) : potence à gauche, mot et clavier à droite */
@media (min-width: 700px) and (min-aspect-ratio: 1/1) {
  .pe-main { flex-direction: row; justify-content: center; align-items: center; gap: 40px; }
  .pe-left { width: auto; }
  .pe-art { width: min(300px, 44vh); }
  .pe-kbd { display: flex; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 900px) { .pe-kbd { display: flex; } }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .pe-main { flex-direction: row; justify-content: center; align-items: center; gap: 64px; }
  .pe-left { width: auto; }
  .pe-art { width: min(340px, 52vh); }
}

.game-card .deco-su { position: absolute; right: 18px; top: 20px; display: grid; grid-template-columns: repeat(4, 17px); gap: 1px; padding: 2px; background: var(--text); border-radius: 5px; transform: rotate(4deg); pointer-events: none; }
.game-card .deco-su i { width: 17px; height: 17px; background: var(--surface); display: grid; place-items: center; font-style: normal; font-family: var(--display); font-weight: 800; font-size: 10px; color: var(--text); }
.game-card .deco-su i.d:nth-child(3n) { color: var(--gold); }
.game-card .deco-pe { position: absolute; right: 16px; top: 14px; width: 66px; height: 66px; pointer-events: none; }
.game-card .deco-pe svg { width: 100%; height: 100%; }
.game-card .deco-pe path, .game-card .deco-pe circle { fill: none; stroke: var(--text); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.game-card .deco-pe circle, .game-card .deco-pe path:last-child { stroke: var(--gold); }

/* ============================================================ EN-TÊTE COMMUN, ACCUEIL, PAGES */
.topwrap { position: sticky; top: 0; z-index: 25; }
.topwrap .banner { position: relative; }
.bbtn.av { padding: 0; overflow: hidden; border-color: rgba(255, 255, 255, 0.2); }
.bbtn.av .avatar { width: 100%; height: 100%; font-size: 14px; box-shadow: none; }
.dash { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.dash-in { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px calc(var(--safe-right) + 20px) 10px calc(var(--safe-left) + 20px); overflow-x: auto; scrollbar-width: none; }
.dash-in::-webkit-scrollbar { display: none; }
.dash-id { display: flex; flex-direction: column; flex: none; min-width: 0; }
.dash-id b { font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; line-height: 1.15; }
.dash-code { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: 0.12em; display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.dash-code .ic { color: var(--gold); }
.dash-stats { display: flex; flex: none; margin-left: auto; }
.ds { padding: 0 14px; border-left: 1px solid var(--line); text-align: center; }
.ds b { display: block; font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ds span { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; font-weight: 600; }
.dash-turn { flex: none; display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px 8px 10px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.dash-turn b { font-family: var(--display); font-size: 15px; background: #fff; color: var(--gold); border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; }
.dash-ok { flex: none; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; font-weight: 600; }
.dash-ok i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
@media (max-width: 520px) { .ds { padding: 0 9px; } .ds:nth-child(4) { display: none; } .dash-in { gap: 10px; } .dash-turn { padding: 6px; } .dash-turn .lbl { display: none; } }

.screen { padding-top: 20px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.sec-h h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.035em; }
.sec-h span { font-size: 12.5px; color: var(--muted); font-weight: 550; text-align: right; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 2px 16px; }
.panel-card > .item:first-child, .panel-card > .lb-row:first-child { border-top: 0; }
.panel-card > .item:last-child, .panel-card > .lb-row:last-child { border-bottom: 0; }
.panel-card .empty { border: 0; padding: 22px 0; }
.page { width: 100%; max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.page.profile { max-width: 760px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pref:last-child { border-bottom: 0; }
.pref > span { font-weight: 600; }
.pref .seg { min-width: 200px; }

.home { width: 100%; max-width: 1160px; margin: 0 auto; display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "turns" "games" "daily" "current"; }
.home-turns { grid-area: turns; } .home-games { grid-area: games; } .home-daily { grid-area: daily; } .home-current { grid-area: current; }
.home-turns:empty { display: none; }
.home-daily .daily { margin-top: 0; }
@media (min-width: 980px) {
  .home { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "games turns" "games current" "daily current"; column-gap: 32px; align-items: start; }
  .home-turns:empty { display: none; }
}
.gtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .gtiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gt { position: relative; text-align: left; font: inherit; color: var(--text); border: 1px solid var(--line); background: var(--surface); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; min-height: 176px; transition: transform 0.18s ease, box-shadow 0.2s, border-color 0.2s; }
.gt:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line2); }
.gt:active { transform: scale(0.98); }
.gt-art { width: 52px; height: 52px; border-radius: 16px; background: var(--rack-bg); display: grid; place-items: center; margin-bottom: 4px; }
.gt-art svg { width: 40px; height: 40px; font-family: var(--display); }
.gt .go { position: absolute; right: 14px; top: 18px; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.gt:hover .go { transform: translateX(3px); color: var(--text); }
.gt h3 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: -0.035em; }
.gt p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.gt-modes { margin-top: auto; display: flex; gap: 5px; flex-wrap: wrap; padding-top: 6px; }
.gt-modes span { font-size: 10.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--surface2); color: var(--text2); }
@media (max-width: 400px) { .gt { padding: 14px; min-height: 164px; } .gt p { font-size: 12.5px; } }

.item .tag.neutral { background: var(--surface2); color: var(--text2); }
.home { grid-template-areas: "games" "daily" "current"; }
.home.urgent { grid-template-areas: "current" "games" "daily"; }
@media (min-width: 980px) {
  .home, .home.urgent { grid-template-areas: "games current" "daily current"; }
}

/* bandeau : badges, tuiles compactes */
.bbtn { position: relative; }
.bbtn.av { overflow: visible; }
.bbtn.av .avatar { border-radius: 50%; }
.bdg { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #fff; font-family: var(--display); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--banner-bg); pointer-events: none; }
.dash-stats { margin: 0 auto; }
.dash-in { justify-content: center; }
@media (max-width: 520px) { .ds:nth-child(4) { display: block; } .ds { padding: 0 10px; } }
.home { max-width: 980px; grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "games" "daily" !important; }
.gt { min-height: 0; gap: 12px; padding: 14px; }
.gt-head { display: flex; align-items: center; gap: 12px; }
.gt-head .gt-art { width: 46px; height: 46px; border-radius: 14px; margin: 0; flex: none; }
.gt-head .gt-art svg { width: 34px; height: 34px; }
.gt-head h3 { font-size: 18px; line-height: 1.15; }
.gt-modes { margin-top: 0; padding-top: 0; }
.mygames .panel-card { margin-bottom: 4px; }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { margin: 0 0 6px; font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.elo-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 0; border-bottom: 1px solid var(--line); }
.elo-grid div { text-align: center; }
.elo-grid b { display: block; font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.elo-grid span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.item .elo { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.item .elo.up { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.item .elo.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.item.fresh { position: relative; }
.item.fresh::before { content: ''; position: absolute; left: -10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--gold); }
.gt-head h3 { min-width: 0; overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 430px) {
  .gt-head { gap: 9px; }
  .gt-head .gt-art { width: 38px; height: 38px; border-radius: 12px; }
  .gt-head .gt-art svg { width: 28px; height: 28px; }
  .gt-head h3 { font-size: 15.5px; letter-spacing: -0.04em; }
}

.bbtn.games { color: var(--gold); }
.bbtn.games .bdg { background: #fff; color: #0f0f11; }
.bbtn.games .bdg.urgent { color: var(--gold); animation: bdgpulse 1.8s ease infinite; }
@keyframes bdgpulse { 0%, 100% { box-shadow: 0 0 0 2px var(--banner-bg), 0 0 0 2px rgba(255, 255, 255, 0.55); } 50% { box-shadow: 0 0 0 2px var(--banner-bg), 0 0 0 7px transparent; } }

/* pastille de profil du bandeau : même rouge que la manette */
.bbtn.av .avatar { background: var(--gold); color: #fff; }

/* très petites hauteurs (iPhone SE dans Safari, pliant replié) : tout se resserre */
@media (max-height: 680px) {
  .kbd { gap: 5px; } .kbd button { height: 36px; font-size: 17px; }
  .fl-tools .act { min-height: 36px; }
  .cluebar { min-height: 50px; padding: 4px 6px; } .cluebar .txt { font-size: 14px; } .cluebar .txt .def { -webkit-line-clamp: 1; }
  .pe-main { gap: 8px; } .pe-art { width: min(64vw, 180px, 21vh); } .pe-right { gap: 10px; } .pe-info { min-height: 0; }
}.spinner.boot { margin-top: 40vh; }
