/* Panneau Valheim « Les Déglingos » — d'après la maquette Claude Design (bois sombre, or, braises) */

@font-face { font-family: Cinzel; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cinzel-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Cinzel; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/cinzel-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/alegreya-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/alegreya-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/alegreya-sans-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Sans Runic"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/noto-sans-runic-runic-400-normal.woff2) format("woff2"); }

:root {
  --bg: #16110c;
  --card: #221910;
  --card-line: #3b2d1f;
  --well: #1a130d;
  --well-line: #33271b;
  --sheet: #241a12;
  --wood: #2a1f15;
  --avatar: #3a2a1b;
  --avatar-line: #5a4329;
  --text: #f3e9d6;
  --text-soft: #e6d8c0;
  --muted: #bfae92;
  --faint: #9c8b72;
  --rune: #6b5640;
  --rune-dim: #4e3e2c;
  --gold: #e0b04f;
  --gold-light: #f5cf7a;
  --gold-line: #a8823a;
  --ember: #e86a2a;
  --ember-light: #ffa36b;
  --ok: #8fdc7e;
  --ok-text: #9be08b;
  --warn: #ff9d5c;
  --warn-text: #ffb27a;
  --info: #7fb7e8;
  --info-text: #a9d0f3;
  --amber: #f0c860;
  --bad: #ff8a7a;
  --bad-text: #ff9a8b;
  --off: #c2bbb0;
  --off-text: #d6cfc3;
  --shadow: inset 0 1px 0 rgba(255, 214, 150, 0.07), 0 10px 24px rgba(0, 0, 0, 0.35);
  --display: Cinzel, Georgia, serif;
  --runic: "Noto Sans Runic", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(90deg, rgba(255, 235, 200, 0.014) 0 2px, transparent 2px 11px);
  color: var(--text);
  font: 16px/1.45 "Alegreya Sans", system-ui, sans-serif;
}
p, h1, h2, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: var(--gold); }
a:hover { color: var(--gold-light); }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex-shrink: 0; }
.icon-bold { stroke-width: 2.4; }
.icon-bolder { stroke-width: 3; }
.icon-gold { color: var(--gold); }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 14px; }
.small { font-size: 14px; }
.text { color: var(--text); }
.who { color: var(--gold-light); font-weight: 700; }
.runes { font-family: var(--runic); font-size: 14px; letter-spacing: 0.3em; color: var(--rune); }
.runes--footer { text-align: center; letter-spacing: 0.6em; color: var(--rune-dim); margin-top: 8px; }

/* ---------- Mise en page ---------- */
.page { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 960px) {
  .page { max-width: 1180px; padding: 24px 32px 48px; gap: 24px; }
  .grid {
    gap: 20px 24px;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "state players" "actions players" "mods journal";
    align-items: start;
  }
  .area-state { grid-area: state; }
  .area-actions { grid-area: actions; }
  .area-players { grid-area: players; }
  .area-mods { grid-area: mods; }
  .area-journal { grid-area: journal; }
}

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--card-line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-title { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.15; }
.brand-sub { font-size: 14px; color: var(--muted); }
@media (max-width: 420px) { .brand-title { font-size: 18px; letter-spacing: 0.02em; } }
.sigil {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px;
  background: var(--wood); border: 1px solid var(--gold-line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--runic); font-size: 24px; color: var(--gold);
  box-shadow: inset 0 0 12px rgba(224, 176, 79, 0.18);
}
.sigil--big { width: 104px; height: 104px; border-radius: 26px; border-width: 2px; font-size: 54px; box-shadow: inset 0 0 24px rgba(224, 176, 79, 0.2), 0 0 40px rgba(232, 106, 42, 0.18); }
.user-chip {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 4px;
  border-radius: 999px; background: #241a12; border: 1px solid var(--card-line);
  color: var(--text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.user-chip:hover { border-color: var(--gold-line); }
.user-chip-out { color: var(--faint); }
.avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  background: #4a3420; color: var(--gold-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 15px; position: relative;
}
.avatar--small { width: 28px; height: 28px; font-size: 13px; }
.avatar--online { width: 40px; height: 40px; background: var(--avatar); border: 1px solid var(--avatar-line); }
.avatar--online::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--card);
}

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--gold); }
.eyebrow { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.pill { padding: 2px 10px; border-radius: 999px; background: #2b2722; color: var(--muted); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill--ok { background: rgba(124, 207, 107, 0.14); color: var(--ok-text); }
.pill--warn { background: rgba(239, 122, 53, 0.14); color: var(--warn-text); }
.empty { padding: 14px; border-radius: 10px; background: var(--well); border: 1px dashed var(--card-line); font-size: 15px; color: var(--muted); text-align: center; }
.note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.note--left { justify-content: flex-start; align-items: flex-start; text-align: left; }
.note--left .icon { margin-top: 1px; color: var(--faint); }
.rows { display: flex; flex-direction: column; }
.row { border-top: 1px solid var(--well-line); }

/* ---------- État ---------- */
.state { --tone: var(--off); --tone-text: var(--off-text); --tone-rgb: 107, 102, 94; gap: 16px; }
.tone-ok { --tone: var(--ok); --tone-text: var(--ok-text); --tone-rgb: 124, 207, 107; }
.tone-warn { --tone: var(--amber); --tone-text: var(--amber); --tone-rgb: 232, 184, 74; }
.tone-info { --tone: var(--info); --tone-text: var(--info-text); --tone-rgb: 127, 183, 232; }
.tone-bad { --tone: var(--bad); --tone-text: var(--bad-text); --tone-rgb: 255, 107, 90; }
.tone-off { --tone: var(--off); --tone-text: var(--off-text); --tone-rgb: 107, 102, 94; }
.state.tone-ok, .state.tone-warn, .state.tone-info { border-color: rgba(var(--tone-rgb), 0.5); }
.state.tone-info { box-shadow: 0 0 0 4px rgba(var(--tone-rgb), 0.08), var(--shadow); }
.state.tone-bad { background: #2a1512; border-color: rgba(var(--tone-rgb), 0.65); box-shadow: 0 0 0 4px rgba(var(--tone-rgb), 0.08), var(--shadow); }
.state-main { display: flex; align-items: center; gap: 16px; }
.state-badge {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: 50%;
  background: rgba(var(--tone-rgb), 0.14); border: 2px solid rgba(var(--tone-rgb), 0.6); color: var(--tone);
  display: flex; align-items: center; justify-content: center;
}
.tone-ok .state-badge { box-shadow: 0 0 22px rgba(var(--tone-rgb), 0.25); }
.state-label { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--tone-text); line-height: 1.15; }
.state-sub { margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.state-sub strong { color: var(--text); }
.state-sub .who { color: var(--gold-light); }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); display: inline-block; animation: pulse 2.4s ease-in-out infinite; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--well); border: 1px solid var(--well-line); border-radius: 10px; padding: 10px 12px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { margin-top: 2px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hint { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 14px; color: #e6cdb2; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(239, 122, 53, 0.13); border: 1px solid rgba(239, 122, 53, 0.6); color: var(--warn); }
.banner-title { font-weight: 700; color: var(--warn-text); }
.banner-sub { font-size: 14px; color: #e6cdb2; }
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 700; }
.flash--warn { background: rgba(232, 184, 74, 0.12); border: 1px solid rgba(232, 184, 74, 0.5); color: var(--amber); }
.flash--bad { background: rgba(255, 107, 90, 0.12); border: 1px solid rgba(255, 107, 90, 0.55); color: var(--bad-text); text-align: left; }

/* Progression d'une action */
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.progress { display: block; width: 100%; height: 10px; border-radius: 999px; border: 1px solid var(--well-line); background: var(--well); overflow: hidden; -webkit-appearance: none; appearance: none; color: var(--tone); }
.progress::-webkit-progress-bar { background: var(--well); }
.progress::-webkit-progress-value { background: var(--tone); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--tone); border-radius: 999px; }
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--muted); }
.step-dot {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--rune-dim);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--faint);
}
.step-label { flex: 1; }
.step-status { font-size: 14px; color: var(--faint); }
.step--done .step-dot { border: 0; background: rgba(124, 207, 107, 0.16); color: var(--ok); }
.step--running { padding: 10px 12px; margin: 0 -12px; border-radius: 10px; background: rgba(var(--tone-rgb), 0.1); }
.step--running .step-dot { border-color: var(--tone); color: var(--tone-text); }
.step--running .step-label { font-weight: 700; color: var(--text); }
.step--running .step-status { color: var(--tone-text); font-weight: 700; }
.step--failed .step-dot { border: 0; background: rgba(255, 107, 90, 0.16); color: var(--bad); }
.step--failed .step-status { color: var(--bad-text); font-weight: 700; }

/* ---------- Boutons ---------- */
.actions { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 62px; padding: 0 18px;
  border-radius: 12px; font: inherit; font-size: 18px; font-weight: 800; text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
}
.btn--ember { background: var(--ember); color: #1a0f07; box-shadow: inset 0 0 0 1px var(--ember-light), inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 8px 22px rgba(232, 106, 42, 0.3); }
.btn--ember:hover { background: #f07a3a; color: #1a0f07; }
.btn--gold { background: var(--gold); color: #1a120a; min-height: 60px; box-shadow: inset 0 0 0 1px var(--gold-light), inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 8px 22px rgba(224, 176, 79, 0.25); }
.btn--gold:hover { background: var(--gold-light); color: #1a120a; }
.btn--stone { background: #2b2722; color: var(--text); border-color: var(--gold-line); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.btn--stone:hover { background: #35302a; color: var(--text); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--avatar-line); min-height: 54px; font-size: 17px; font-weight: 700; width: 100%; }
.btn--ghost:hover { border-color: var(--gold-line); color: var(--text); }
.btn--locked { background: #2c241c; color: #a8977d; border: 1px dashed var(--avatar-line); cursor: not-allowed; }
@media (min-width: 960px) {
  .actions { flex-direction: row; flex-wrap: wrap; }
  .actions .btn { flex: 1 1 240px; }
  .actions .note { flex-basis: 100%; }
}

/* ---------- Joueurs, mods, journal ---------- */
.player { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.player-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .muted { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mods-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.mod { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; }
.mod-text { min-width: 0; }
.mod-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-name a { color: var(--text); text-decoration-color: var(--rune); text-underline-offset: 3px; }
.mod-name a:hover { color: var(--gold-light); }
.mod .muted { font-size: 14px; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: #2b2722; border: 1px solid var(--rune-dim); color: var(--muted); font-size: 14px; font-weight: 700;
}
.badge--ok { background: rgba(124, 207, 107, 0.14); border-color: rgba(124, 207, 107, 0.4); color: var(--ok-text); }
.badge--warn { background: rgba(239, 122, 53, 0.16); border-color: rgba(239, 122, 53, 0.55); color: var(--warn-text); }
.entry { display: flex; gap: 12px; padding: 12px 0; }
.entry-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(var(--tone-rgb), 0.13); color: var(--tone); }
.entry-text { flex: 1; min-width: 0; }
.entry-text .small { margin-top: 2px; }
.info-text { color: var(--info-text); }

/* ---------- Confirmation ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 5, 3, 0.74); z-index: 10; }
.sheet-wrap { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; z-index: 11; }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--sheet); border: 1px solid var(--gold-line); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 12px 20px 28px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 214, 150, 0.12);
}
.sheet-grip { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--avatar-line); }
.sheet-head { display: flex; align-items: flex-start; gap: 14px; }
.sheet-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; background: rgba(239, 122, 53, 0.16); border: 1px solid rgba(239, 122, 53, 0.55); color: var(--warn); display: flex; align-items: center; justify-content: center; }
.sheet-title { font-family: var(--display); font-size: 23px; font-weight: 700; line-height: 1.2; }
.sheet-desc { margin-top: 6px; color: var(--text-soft); }
.sheet-players { background: var(--well); border: 1px solid var(--card-line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sheet-warn { font-weight: 700; color: var(--warn-text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--avatar); font-weight: 700; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions .btn--ember { min-height: 58px; }
@media (min-width: 960px) {
  .sheet-wrap { top: 0; align-items: center; }
  .sheet { max-width: 560px; border: 1px solid var(--gold-line); border-radius: 18px; padding: 28px; }
  .sheet-grip { display: none; }
}

/* ---------- Connexion ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.login-brand .runes { letter-spacing: 0.6em; }
.login-title { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.login-sub { margin-top: 8px; font-size: 18px; color: var(--muted); }
.login-card { width: 100%; padding: 24px 20px; gap: 16px; border-radius: 16px; color: var(--text-soft); }
.steamid { font-family: ui-monospace, monospace; font-size: 18px; padding: 10px; border-radius: 10px; background: var(--well); border: 1px solid var(--well-line); color: var(--gold-light); user-select: all; }

/* ---------- Animations ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.4s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .spin, .pulse-dot { animation: none; } }
