/* La Vallée des Dragons, page theme. Panels on a wall of flames; artwork generated in web/art (see STYLE.md).
   Every image comes from web/art (generated, see STYLE.md). Text is always HTML on a
   cream or ink panel. Fonts: Ubuntu Condensed (titles), Linux Biolinum (text). */

@font-face { font-family: "Ubuntu Condensed"; src: url("fonts/Ubuntu-C.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Biolinum"; src: url("fonts/LinBiolinum_R.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Biolinum"; src: url("fonts/LinBiolinum_RB.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #14100e;
  --ink-2: #2a221d;
  --flame: #ff6a1a;
  --ember: #c8102e;
  --gold: #e3b341;
  --shield: #1f4fa3;
  --paper: #f6ebd3;
  --paper-2: #fffaf0;
  --steel: #d7dce3;
  --muted: #5c4a3a;
  --muted-dark: #c9b9a2;
  --sans: "Biolinum", "Segoe UI", system-ui, sans-serif;
  --display: "Ubuntu Condensed", "Liberation Sans Narrow", "Arial Narrow", sans-serif;
  --line: 3px;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 18px/1.5 var(--sans);
  background: var(--ink) url("art/background.webp") center top / cover fixed no-repeat;
}
@media (min-resolution: 1.5dppx) { body { background-image: url("art/background@2x.webp"); } }
h1, h2, h3 { margin: 0 0 0.3em; font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: 0.01em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 0.8em; }
a { color: var(--shield); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.95rem; }
.error { color: var(--ember); font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .btn, .tab, .slip { transition: transform 100ms ease; } }

/* ---------- Panels: thick ink border, hard flame-coloured offset shadow ---------- */
.panel {
  position: relative; padding: 24px 28px; color: var(--ink);
  background: var(--paper) url("art/paper-cream.webp") center / 512px repeat;
  border: var(--line) solid var(--ink); border-radius: 4px;
  box-shadow: 8px 8px 0 var(--flame), 8px 8px 0 var(--line) var(--ink);
}
.panel-dark {
  color: var(--paper);
  background: var(--ink-2) url("art/paper-ink.webp") center / 512px repeat;
  box-shadow: 8px 8px 0 var(--gold), 8px 8px 0 var(--line) var(--ink);
}
.panel-dark .muted, .panel-dark .hint { color: var(--muted-dark); }
.panel-dark a { color: var(--gold); }
.panel-frame { padding: 0; overflow: hidden; }
main { max-width: 1180px; margin: 36px auto 48px; padding: 0 24px; }
.footer { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted-dark); font-size: 0.9rem; }
.footer span { background: rgba(20, 16, 14, 0.85); padding: 4px 10px; border-radius: 4px; }

/* ---------- Header ---------- */
.topbar { background: rgba(20, 16, 14, 0.92); border-bottom: var(--line) solid var(--ink); box-shadow: 0 var(--line) 0 var(--flame); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--paper); text-decoration: none; }
.brand img { width: 64px; height: 72px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)); }
.brand h1 { font-size: 2.1rem; margin: 0; color: var(--paper); }
.brand small { display: block; font: 400 0.95rem var(--sans); color: var(--muted-dark); margin-top: 2px; }
.tabs { display: flex; gap: 10px; margin-left: 10px; }
.tab {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 22px 9px 16px;
  font: 400 1.25rem var(--display); color: var(--paper); text-decoration: none;
  background: var(--ink-2); border: var(--line) solid var(--paper); border-radius: 4px;
  transform: skewX(-8deg);
}
.tab > * { transform: skewX(8deg); }
.tab img { width: 30px; height: 30px; object-fit: contain; }
.tab:hover { transform: skewX(-8deg) translateY(-2px); }
.tab[aria-current="page"] { color: var(--ink); background: var(--flame); border-color: var(--ink); box-shadow: 4px 4px 0 var(--paper); }
.session { margin-left: auto; display: flex; align-items: center; gap: 14px; color: var(--paper); font-size: 0.95rem; }

/* ---------- Buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; cursor: pointer;
  font: 400 1.2rem var(--display); padding: 10px 20px; color: var(--ink);
  background: var(--paper-2); border: var(--line) solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--ink);
}
.btn img { width: 26px; height: 26px; object-fit: contain; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--flame); }
.btn-danger { color: var(--paper); background: var(--ember); }
.btn-ghost { color: var(--paper); background: transparent; border-color: var(--paper); box-shadow: none; }
.btn-small { font-size: 1.05rem; padding: 6px 14px; box-shadow: 3px 3px 0 var(--ink); }
.btn-big { font-size: 1.5rem; padding: 14px 28px; }
label { display: block; font: 400 1.15rem var(--display); margin: 16px 0 6px; }
input[type="text"], input[type="password"], textarea, select {
  font: inherit; width: 100%; padding: 11px 14px; color: var(--ink);
  background: var(--paper-2); border: var(--line) solid var(--ink); border-radius: 4px;
}
textarea { resize: vertical; min-height: 120px; }
select { width: auto; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; margin-top: 22px; }

/* ---------- Badges (generated ribbons, label is HTML) and type tags ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center; width: 200px; height: 62px; padding: 0 0 8px;
  font: 400 0.98rem/1 var(--display); text-align: center; white-space: nowrap; overflow: hidden;
  background: center / 100% 100% no-repeat;
}
.badge-new { background-image: url("art/badge-new.webp"); color: var(--paper); }
.badge-seen { background-image: url("art/badge-seen.webp"); color: var(--paper); }
.badge-question { background-image: url("art/badge-question.webp"); color: var(--ink); }
.badge-answered { background-image: url("art/badge-answered.webp"); color: var(--paper); }
.badge-planned { background-image: url("art/badge-planned.webp"); color: var(--paper); }
.badge-done { background-image: url("art/badge-done.webp"); color: var(--ink); }
.badge-later { background-image: url("art/badge-later.webp"); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 400 1.05rem var(--display); color: var(--muted); }
.tag img { width: 24px; height: 24px; object-fit: contain; }
.tag-bug { color: var(--ember); }

/* ---------- Two panes ---------- */
.two-pane { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 30px; align-items: start; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.pane-head h2 { margin: 0; font-size: 1.7rem; }
.filters { display: flex; gap: 6px; margin: 10px 0 6px; }
.filter { font: 400 1rem var(--display); padding: 4px 12px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.slip-group h3 { font-size: 1.1rem; color: var(--muted); margin: 18px 0 8px; }
.slip-group h3.waiting { color: var(--ember); }
.slip {
  display: block; text-decoration: none; color: inherit; padding: 10px 12px 10px 14px; margin-bottom: 10px;
  background: var(--paper-2); border: 2px solid var(--ink); border-left: 8px solid var(--ink); border-radius: 3px;
}
.slip:hover { transform: translateX(3px); }
.slip .title { display: block; font: 400 1.25rem/1.15 var(--display); margin-bottom: 6px; }
.slip .row { display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.slip .badge { flex: none; }
.slip .badge { width: 170px; height: 54px; padding: 0 0 7px; font-size: 0.82rem; }
.slip[aria-current="true"] { border-left-color: var(--flame); box-shadow: 4px 4px 0 var(--ink); }
.slip.waiting { background: #ffe0cc; border-left-color: var(--flame); }
.slip.closed { opacity: 0.8; }
details.closed-group summary { cursor: pointer; font: 400 1.1rem var(--display); color: var(--muted); margin: 18px 0 8px; }

.request-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.request-head h2 { flex: 1 1 320px; margin: 0; }
.meta { color: var(--muted); font-size: 0.95rem; margin: 6px 0 16px; display: flex; align-items: center; gap: 6px; }
.description { white-space: pre-wrap; font-size: 1.05rem; }
.thumb { display: inline-block; margin: 6px 0 14px; border: var(--line) solid var(--ink); box-shadow: 6px 6px 0 var(--ember); transform: rotate(-1.5deg); background: #fff; }
.thumb img, .thumb svg { display: block; max-width: 360px; height: auto; }
.thread { border-top: var(--line) solid var(--ink); margin-top: 14px; padding-top: 14px; }
.reply { padding: 12px 16px; margin: 10px 0; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper-2); }
.reply.admin { background: #ffe9d6; border-left: 8px solid var(--flame); }
.reply .who { font: 400 1.15rem var(--display); }
.reply .when { color: var(--muted); font-size: 0.9rem; margin-left: 10px; }
.reply p { margin: 4px 0 0; white-space: pre-wrap; }
.callout { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: var(--line) solid var(--ink); background: var(--flame); font: 400 1.2rem var(--display); }
.callout img { width: 30px; height: 30px; object-fit: contain; }
.reply-form .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.reply-form .row input { max-width: 220px; }

/* ---------- Game page ---------- */
/* The game takes as much width as the window allows (it breaks out of main's 1180 px column) while
   the header, the toolbar and its 16:10 area still fit in the window height; never smaller than the
   former 1000 px when the window is wide enough. The HUD is laid out for 1920 px across: the wider
   the canvas, the larger its text. The toolbar sits above the game so "plein écran" is always in view. */
.game-frame {
  --game-w: min(calc(100vw - 64px), 1920px, max(1000px, calc((100vh - 200px) * 1.6)));
  width: var(--game-w);
  margin: -16px 0 36px calc(50% - var(--game-w) / 2);
}
.screen { position: relative; display: block; width: 100%; aspect-ratio: 960 / 600; background: var(--ink) url("art/loading.webp") center / cover no-repeat; }
.loading-strip { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 24px; background: rgba(20, 16, 14, 0.88); color: var(--paper); display: flex; align-items: center; gap: 18px; font: 400 1.3rem var(--display); }
.loading-strip .bar { flex: 1; height: 14px; border: 2px solid var(--paper); background: var(--ink); }
.loading-strip .bar i { display: block; height: 100%; width: 62%; background: var(--flame); }
.game-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; color: var(--paper); }
.btn-fullscreen { font-size: 1.35rem; padding: 12px 26px; }
.btn-fullscreen svg { width: 22px; height: 22px; flex: none; }
.game-toolbar .hint { color: var(--muted-dark); background: rgba(20, 16, 14, 0.85); padding: 6px 12px; border-radius: 4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; margin-bottom: 36px; }
.heading-icon { display: flex; align-items: center; gap: 12px; }
.heading-icon img { width: 44px; height: 44px; object-fit: contain; }
.empty { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
.empty img { width: 200px; height: auto; border: var(--line) solid var(--ink); }
.keys { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.keys td { padding: 6px 8px 6px 0; border-bottom: 1px solid rgba(20, 16, 14, 0.25); vertical-align: top; }
.keys td:first-child { white-space: nowrap; width: 38%; }
kbd { font: 400 0.95rem var(--display); padding: 2px 8px; border-radius: 4px; background: var(--paper-2); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.map { position: relative; }
.map img { display: block; width: 100%; height: auto; }
.map .label { position: absolute; transform: translate(-50%, -50%); padding: 2px 10px; background: var(--ink); color: var(--paper); font: 400 1rem var(--display); border: 2px solid var(--paper); white-space: nowrap; }

/* ---------- Login ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.gate-card { display: grid; grid-template-columns: 480px 1fr; width: min(960px, 100%); border: var(--line) solid var(--ink); box-shadow: 10px 10px 0 var(--flame), 10px 10px 0 var(--line) var(--ink); }
.gate-art { background: var(--ink) url("art/hero.webp") center bottom / cover no-repeat; min-height: 600px; border-right: var(--line) solid var(--ink); }
@media (min-resolution: 1.5dppx) { .gate-art { background-image: url("art/hero@2x.webp"); } }
.gate-form { padding: 34px 40px 30px; background: var(--paper) url("art/paper-cream.webp") center / 512px repeat; }
.gate-form .emblem { width: 120px; height: 135px; object-fit: contain; display: block; margin: 0 auto 6px; }
.gate-form h1 { font-size: 2.3rem; text-align: center; margin: 0 0 4px; }
.gate-form .lede { text-align: center; color: var(--muted); margin-bottom: 10px; }
.gate-form .btn { width: 100%; justify-content: center; margin-top: 22px; }
@media (max-width: 860px) { .gate-card { grid-template-columns: 1fr; } .gate-art { min-height: 300px; border-right: 0; border-bottom: var(--line) solid var(--ink); } }

/* ---------- Dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 16, 14, 0.7); display: grid; place-items: center; padding: 20px; overflow: auto; }
.dialog { width: min(720px, 100%); }
.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.type-choice label {
  margin: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
  background: var(--paper-2); border: var(--line) solid var(--ink); border-radius: 4px; font: 400 1.3rem var(--display);
}
.type-choice label img { width: 44px; height: 44px; object-fit: contain; }
.type-choice input { width: 22px; height: 22px; margin: 0 0 0 auto; accent-color: var(--ink); }
.type-choice label.selected { background: var(--flame); box-shadow: 4px 4px 0 var(--ink); }
.image-block { margin-top: 18px; padding: 14px 16px; border: var(--line) dashed var(--ink); border-radius: 4px; background: rgba(255, 250, 240, 0.6); }
.image-block .preview { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.image-block .thumb { margin: 0; transform: none; }
.image-block .thumb img { max-width: 260px; }

@media (max-width: 960px) {
  .two-pane, .cols, .empty { grid-template-columns: 1fr; }
}

/* ---------- Unity canvas, loading screen, banners, toast ---------- */
#unity-container { position: relative; width: 100%; aspect-ratio: 960 / 600; background: var(--ink); }
#unity-canvas { display: block; width: 100%; height: 100%; background: var(--ink); outline: none; }
#unity-canvas:fullscreen { width: 100vw; height: 100vh; }
#unity-loading-bar { position: absolute; inset: 0; display: none; background: var(--ink) url("art/loading.webp") center / cover no-repeat; }
@media (min-resolution: 1.5dppx) { #unity-loading-bar { background-image: url("art/loading@2x.webp"); } }
#unity-loading-bar.shown { display: block; }
#unity-warning { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: none; }
.banner-error { background: var(--ember); color: var(--paper); padding: 10px 14px; font-weight: 700; }
.banner-warning { background: var(--gold); color: var(--ink); padding: 10px 14px; font-weight: 700; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50; padding: 12px 20px; background: var(--ink); color: var(--paper); border: var(--line) solid var(--paper); box-shadow: 6px 6px 0 var(--flame); font: 400 1.15rem var(--display); max-width: 90vw; }
.login-error { margin-top: 12px; }
.detail-placeholder { display: grid; place-items: center; min-height: 240px; text-align: center; }
.admin-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--ink); }
.checklist label { font: inherit; display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.release-actions { margin-top: 12px; }
dialog.panel { border: var(--line) solid var(--ink); padding: 26px 32px 24px; width: min(720px, 92vw); max-height: 90vh; overflow: auto; }
dialog::backdrop { background: rgba(20, 12, 4, 0.7); }
.empty-board { text-align: center; padding: 10px 0; }
.empty-board img { width: 320px; max-width: 100%; height: auto; border: var(--line) solid var(--ink); margin-bottom: 12px; }
.type-fieldset { border: 0; padding: 0; margin: 0; }
.type-fieldset legend { font: 400 1.15rem var(--display); margin-top: 10px; padding: 0; }
input[type="file"] { font: inherit; display: block; margin-top: 4px; }
.reply-form label { margin-top: 12px; }
