/* Start page for the Vampire Slayer browser port. System fonts only: the server sends COEP require-corp,
   so cross-origin fonts would be blocked. Accent red is the VS6 HUD red (255, 32, 32). */
:root {
  --bg: #0a0607;
  --bg-2: #130c0d;
  --panel: #181012;
  --line: #3b1c1f;
  --blood: #ff2020;
  --blood-deep: #8d0f12;
  --bone: #eadfc8;
  --muted: #a39484;
  --slayer: #e0b85a;
  --slayer-deep: #6b5a2a;
  --ok: #6fcf7a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules (grid, flex) would otherwise beat the hidden attribute */
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--bone); font: 16px/1.5 var(--sans);
  background: radial-gradient(ellipse 80% 50% at 50% -10%, #3a0a0d 0%, transparent 70%), var(--bg);
}
a { color: #ff7b72; }
a:hover { color: #ffb0aa; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); font-size: .9rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blood); color: #000; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--blood); outline-offset: 2px; }

/* Masthead. In the lobby it holds the hero art with the title (.brand) over it and the ES | EN switch in the corner; while
   playing (body.playing) the art goes away and the brand becomes a compact row, so the game keeps its height. */
body { position: relative; isolation: isolate; } /* the desktop hero sits behind the page content (z-index: -1) */
.masthead { position: relative; max-width: 1200px; margin: 0 auto; }
body.playing .masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
}
body.playing .masthead .brand { display: flex; }
body.playing .hero { display: none; }
.brand { display: flex; align-items: center; gap: .85rem; }

/* Hero art: a Slayer on the left, vampires on the right, an empty dark middle. Narrow screens: a 16:9 banner that fades into
   the page, with the title over its middle. */
.hero { margin: 0; position: relative; }
.hero picture { display: block; height: 100%; }
.hero img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 40%;
  background: #1a0607;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
body:not(.playing) .masthead .brand {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-58%);
  flex-direction: column; gap: .35rem; text-align: center; pointer-events: none;
}
body:not(.playing) .brand .sigil { font-size: 1.4rem; }
body:not(.playing) .brand h1 {
  font-size: clamp(1.7rem, 6.4vw, 2.6rem); letter-spacing: .16em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .9), 0 0 32px rgba(255, 32, 32, .28);
}
body:not(.playing) .brand .tagline {
  margin-top: .3rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bone);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .95);
}

.masthead > .lang-switch {
  position: absolute; top: .75rem; right: .75rem; z-index: 1; padding: .1rem .2rem; border-radius: 6px;
  background: rgba(10, 6, 7, .62); backdrop-filter: blur(4px);
}
body.playing .masthead > .lang-switch { position: static; }
.sigil { font-size: 2rem; color: var(--blood); text-shadow: 0 0 14px rgba(255, 32, 32, .55); line-height: 1; }
h1 { margin: 0; font: 700 1.6rem/1.1 var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
.tagline { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.upstream { font-size: .85rem; color: var(--muted); }
/* ES | EN switch (i18n.js). Hidden while playing: the lobby is the only place whose text it redoes. */
.lang-switch { display: inline-flex; align-items: center; gap: .15rem; font-size: .8rem; color: var(--muted); }
.lang-btn {
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; font: 600 .8rem/1 var(--sans); letter-spacing: .08em;
  color: var(--muted); background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
}
.lang-btn:hover { color: var(--bone); border-color: var(--line); }
.lang-btn[aria-pressed="true"] { color: var(--bone); border-color: var(--blood-deep); background: #1a0e10; }
.lang-sep { opacity: .5; }
body.playing .lang-switch { display: none; }

main { max-width: 1200px; margin: 0 auto; padding: 1.25rem; display: grid; gap: 1.25rem; }

/* Panels */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line);
  border-radius: 6px; padding: 1.25rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.panel.primary { border-color: var(--blood-deep); box-shadow: 0 0 0 1px rgba(255, 32, 32, .12), 0 10px 40px rgba(120, 0, 0, .35); }
#lobby { display: grid; gap: 1.25rem; max-width: 880px; width: 100%; margin: 0 auto; }
h2 { margin: 0 0 .35rem; font: 700 1.5rem/1.2 var(--serif); letter-spacing: .04em; }
.lead { margin: 0 0 1rem; color: var(--muted); }
summary { cursor: pointer; font: 600 1.1rem var(--serif); letter-spacing: .03em; }
summary:hover { color: #fff; }
details[open] > summary { margin-bottom: 1rem; }

/* Mode switch (Online / Local) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mode {
  display: block; padding: 1rem 1.1rem; text-decoration: none; color: var(--bone); background: #0f0809;
  border: 1px solid var(--line); border-radius: 6px; transition: border-color .12s, background .12s;
}
.mode strong { display: block; font: 700 1.35rem/1.2 var(--serif); letter-spacing: .06em; text-transform: uppercase; }
.mode small { display: block; margin-top: .2rem; color: var(--muted); }
.mode:hover { color: #fff; background: #1a0e10; border-color: #5a2a2e; }
.mode[aria-current="page"] { background: #2a0d10; border-color: var(--blood); box-shadow: inset 0 0 0 1px var(--blood), 0 0 18px rgba(255, 32, 32, .18); }
.tests, .advanced { margin-top: 1rem; }
.tests summary, .advanced summary { font: 600 .9rem var(--sans); color: var(--muted); }
.advanced { display: grid; gap: .3rem; max-width: 26rem; }
.advanced label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .5rem; }

/* Choice cards (radio) */
fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
legend { padding: 0; margin-bottom: .5rem; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; }
.choices > legend { grid-column: 1 / -1; float: left; width: 100%; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-body {
  display: block; height: 100%; padding: .7rem .85rem; background: #0f0809; border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 4px; transition: border-color .12s, background .12s;
}
.choice.slayer .choice-body { border-left-color: #6b5a2a; }
.choice.vampire .choice-body { border-left-color: var(--blood-deep); }
.choice-body strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.choice-body small { display: block; margin-top: .15rem; color: var(--muted); line-height: 1.35; }
.choice:hover .choice-body { background: #1a0e10; border-color: #5a2a2e; }
.choice input:checked + .choice-body { background: #2a0d10; border-color: var(--blood); box-shadow: inset 0 0 0 1px var(--blood), 0 0 18px rgba(255, 32, 32, .18); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--bone); outline-offset: 2px; }
.choice input:disabled + .choice-body { opacity: .35; }
.choice input:disabled, .choice:has(input:disabled) { cursor: not-allowed; }

/* Online lobby: side (step 1), character of that side (step 2), name and Entrar. */
.lobby-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; }
.server-status {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0; padding: .3rem .75rem; font-size: .85rem;
  color: var(--muted); background: #0f0809; border: 1px solid var(--line); border-radius: 999px;
}
.status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); flex: none; }
.server-status[data-state="online"] { color: var(--bone); }
.server-status[data-state="online"] .status-dot { background: var(--ok); box-shadow: 0 0 8px rgba(111, 207, 122, .7); }
.server-status[data-state="unavailable"] .status-dot { background: #6a5a52; }
.server-info { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.server-location { margin: 0 .75rem 0 0; font-size: .75rem; color: var(--muted); letter-spacing: .02em; }
.next-map { margin: .45rem 0 0; font-size: .85rem; letter-spacing: .03em; color: var(--slayer); }
.step {
  display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; margin-right: .45rem; border-radius: 50%;
  font: 700 .8rem var(--sans); letter-spacing: 0; color: #fff; background: var(--blood-deep); vertical-align: middle;
}
.side-choices { grid-template-columns: 1fr 1fr; gap: .8rem; }
.side .choice-body {
  position: relative; overflow: hidden; padding: 1.2rem 1.25rem 1.1rem; border-left-width: 1px; border-radius: 6px;
  min-height: 9.5rem; display: flex; flex-direction: column; justify-content: flex-end;
}
.side.slayer .choice-body { background: linear-gradient(160deg, #241c0c 0%, #0f0809 65%); border-color: var(--slayer-deep); }
.side.vampire .choice-body { background: linear-gradient(160deg, #2c070a 0%, #0f0809 65%); border-color: var(--blood-deep); }
.side .choice-body strong { font: 700 1.9rem/1.1 var(--serif); letter-spacing: .08em; text-transform: uppercase; }
.side.slayer .choice-body strong { color: var(--slayer); }
.side.vampire .choice-body strong { color: #ff5a4f; }
.side-mark { position: absolute; top: .4rem; right: .9rem; font-size: 3.6rem; line-height: 1; opacity: .16; pointer-events: none; }
.side.slayer .side-mark { color: var(--slayer); }
.side.vampire .side-mark { color: var(--blood); }
.choice-body .side-count { margin-top: .55rem; color: var(--bone); font-size: .82rem; letter-spacing: .04em; min-height: 1.1em; }
.side.slayer input:checked + .choice-body {
  background: linear-gradient(160deg, #3a2d10 0%, #160e08 70%); border-color: var(--slayer);
  box-shadow: inset 0 0 0 1px var(--slayer), 0 0 22px rgba(224, 184, 90, .22);
}
.side.vampire input:checked + .choice-body {
  background: linear-gradient(160deg, #4a0b10 0%, #170809 70%); border-color: var(--blood);
  box-shadow: inset 0 0 0 1px var(--blood), 0 0 22px rgba(255, 32, 32, .25);
}
.side:hover .choice-body { filter: brightness(1.15); }
.class-choices { grid-template-columns: repeat(3, 1fr); }
.choice.slayer input:checked + .choice-body { border-color: var(--slayer); box-shadow: inset 0 0 0 1px var(--slayer), 0 0 14px rgba(224, 184, 90, .16); background: #221808; }
.lobby-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 1.25rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.lobby-foot .field { margin: .8rem 0 0; flex: 1 1 14rem; }
.lobby-foot .actions { flex-direction: column; align-items: stretch; gap: .35rem; margin-top: .8rem; }
.lobby-foot .actions p { text-align: center; min-height: 1.3em; }
.enter-btn { font-size: 1.25rem; padding: .9rem 3rem; letter-spacing: .14em; }

/* Fields */
.field { display: grid; gap: .3rem; margin-bottom: 1.1rem; max-width: 22rem; }
.field label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field small { color: var(--muted); }
input[type="text"], select {
  font: inherit; color: var(--bone); background: #0f0809; border: 1px solid #5a2a2e; border-radius: 4px; padding: .6rem .7rem; width: 100%;
}
input[type="text"]:focus-visible, select:focus-visible { border-color: var(--blood); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--blood); box-shadow: 0 0 0 1px var(--blood); }
input[type="range"] { accent-color: var(--blood); vertical-align: middle; }
input[type="checkbox"] { accent-color: var(--blood); width: 1.1rem; height: 1.1rem; margin-top: .2rem; flex: none; }
.check { display: flex; gap: .7rem; cursor: pointer; }
.check small { display: block; color: var(--muted); margin-top: .15rem; }
/* Collapsed panels (Pantalla y resolución, Controles): one row with the title and the current picks / key reminder. */
details.panel.options, details#controls { padding: 0; }
details.panel.options > summary, details#controls > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; padding: .85rem 1.25rem; list-style: none;
}
details.panel.options > summary::-webkit-details-marker, details#controls > summary::-webkit-details-marker { display: none; }
details.panel.options > summary::before, details#controls > summary::before {
  content: ""; width: .5rem; height: .5rem; flex: none; border-right: 2px solid var(--blood); border-bottom: 2px solid var(--blood);
  transform: rotate(-45deg); transition: transform .15s;
}
details.panel.options[open] > summary::before, details#controls[open] > summary::before { transform: rotate(45deg); }
details.panel.options[open] > summary, details#controls[open] > summary { margin: 0; border-bottom: 1px solid var(--line); }
details.panel.options > :not(summary), details#controls > :not(summary) { margin-left: 1.25rem; margin-right: 1.25rem; }
details.panel.options > :last-child, details#controls > :last-child { margin-bottom: 1.1rem; }
.summary-title { font: 600 1.05rem var(--serif); letter-spacing: .04em; }
.summary-current { margin-left: auto; font: 400 .85rem var(--sans); letter-spacing: 0; color: var(--muted); }
.summary-current kbd { font-size: .75rem; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.setting-card { padding: .85rem 1rem; background: #0f0809; border: 1px solid var(--line); border-radius: 6px; }
.setting-card small { font-size: .82rem; line-height: 1.4; }
.resolution { display: grid; gap: .4rem; align-content: start; }
.resolution small { color: var(--muted); }
.gpu-warning { margin: 0; padding: .5rem .7rem; border: 1px solid var(--blood); border-radius: 4px; color: #ffb3ab; font-size: .85rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.actions p { margin: 0; }
.btn {
  font: 600 .95rem var(--sans); color: var(--bone); background: #241517; border: 1px solid #5a2a2e; border-radius: 4px;
  padding: .7rem 1.1rem; cursor: pointer; min-height: 44px; transition: background .12s, border-color .12s;
}
.btn:hover:not(:disabled) { background: #351c1f; border-color: var(--blood); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[hidden] { display: none; }
.primary-btn {
  background: linear-gradient(180deg, #d91a1a, #8d0f12); border-color: #ff5a4f; color: #fff;
  font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; padding: .8rem 1.8rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.primary-btn:hover:not(:disabled) { background: linear-gradient(180deg, #ff2a2a, #a81216); }

/* Stage: the canvas keeps 16:9 and always fits the viewport height. */
#stage { display: grid; gap: .6rem; justify-items: center; }
.screen {
  position: relative; width: min(100%, calc((100vh - 190px) * 16 / 9)); min-width: min(100%, 320px);
  aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--blood-deep); border-radius: 4px;
  box-shadow: 0 0 40px rgba(120, 0, 0, .35); overflow: hidden;
}
@supports (height: 100dvh) { .screen { width: min(100%, calc((100dvh - 190px) * 16 / 9)); } }
canvas { display: block; width: 100%; height: 100%; background: #000; outline: none; }
canvas:focus-visible { outline: 2px solid var(--blood); outline-offset: -2px; }
canvas:fullscreen { border: 0; }
.screen:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem; text-align: center; background: radial-gradient(ellipse at center, rgba(40, 6, 8, .92), rgba(0, 0, 0, .96)); overflow: auto;
}
.overlay[hidden] { display: none; }
.overlay p { margin: 0; }
.overlay-title { font: 700 1.4rem var(--serif); letter-spacing: .06em; }
.overlay.error .overlay-title { color: var(--blood); }
/* Online game menu (Esc): lobby look, the running match stays visible behind it. */
.overlay.game-menu { z-index: 3; justify-content: flex-start; background: rgba(5, 2, 3, .62); }
.game-menu-panel { margin: auto; width: min(26rem, 100%); padding: 1.1rem 1.25rem; text-align: left; }
.game-menu-panel .overlay-title { margin: 0; text-align: center; letter-spacing: .12em; text-transform: uppercase; }
.game-menu-panel > .muted { text-align: center; margin: .2rem 0 .9rem; }
.game-menu-panel .menu-map { margin: .2rem 0 0; text-align: center; font-size: .85rem; }
.game-menu-panel #menu-next-map { color: var(--slayer); }
.game-menu-actions { display: grid; gap: .55rem; }
.game-menu-actions .btn { width: 100%; }
.game-menu-actions .menu-note { margin: -.3rem 0 .15rem; font-size: .8rem; color: var(--muted); text-align: center; }
.menu-vote { margin: .1rem 0 .2rem; }
.menu-vote h3 { margin: 0 0 .45rem; font: 600 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.menu-vote-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .4rem; }
.menu-vote-options .btn { width: 100%; padding: .45rem .5rem; font-size: .9rem; }
.menu-vote-options .btn[aria-pressed="true"] { border-color: var(--slayer); color: var(--slayer); }
.game-menu-actions .menu-vote .menu-note { margin: .4rem 0 0; }
.menu-slider {
  display: flex; align-items: center; gap: .8rem; padding: .35rem .2rem; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.menu-slider input, .menu-slider select { flex: 1; }
.menu-slider select { letter-spacing: normal; text-transform: none; }
.perf-toast {
  position: absolute; top: .6rem; left: 50%; transform: translateX(-50%); z-index: 2; max-width: min(90%, 34rem); margin: 0;
  padding: .45rem .8rem; border: 1px solid var(--blood-deep); border-radius: 4px; background: rgba(0, 0, 0, .78);
  color: #f2e6e6; font-size: .85rem; text-align: center; pointer-events: none;
}
.leave-btn { border-color: var(--blood-deep); color: #ff9a92; }
.game-menu-side fieldset { margin-bottom: .8rem; }
.menu-sides, .menu-classes { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .45rem; }
.menu-sides .choice.vampire strong { color: #ff5a4f; }
.menu-sides .choice.slayer strong { color: var(--slayer); }
.game-menu-side > .muted { margin: 0 0 .8rem; }
.game-menu-side-actions { flex-direction: column; align-items: stretch; gap: .5rem; }
progress { width: min(420px, 80%); height: .7rem; accent-color: var(--blood); }
.overlay .loading-tip { max-width: 34rem; margin-top: 1.1rem; color: var(--bone); font-size: .95rem; line-height: 1.6; }
.tip-label { margin-right: .4rem; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--slayer); }
progress { appearance: none; border: 1px solid var(--blood-deep); border-radius: 4px; background: #1a0a0b; overflow: hidden; }
progress::-webkit-progress-bar { background: #1a0a0b; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #8d0f12, var(--blood)); }
progress::-moz-progress-bar { background: var(--blood); }

.toolbar {
  width: min(100%, calc((100vh - 190px) * 16 / 9)); min-width: min(100%, 320px);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1.2rem;
}
@supports (height: 100dvh) { .toolbar { width: min(100%, calc((100dvh - 190px) * 16 / 9)); } }
#status { margin: 0; flex: 1 1 320px; color: var(--muted); font-size: .88rem; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; font-size: .88rem; }
.tools label { color: var(--muted); }
.tools .btn { min-height: 38px; padding: .45rem .9rem; }

/* Controls */
.keys { list-style: none; margin: 1rem 0 .8rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .5rem 1rem; }
kbd {
  display: inline-block; min-width: 1.6rem; padding: .05rem .4rem; margin-right: .15rem; text-align: center; font-size: .82rem;
  color: var(--bone); background: #0f0809; border: 1px solid #5a2a2e; border-bottom-width: 2px; border-radius: 4px;
}
#controls details p { color: var(--muted); font-size: .92rem; margin: .5rem 0 0; }
#controls summary { font: 600 .95rem var(--sans); }
#log-panel summary { font: 600 .9rem var(--sans); color: var(--muted); }
pre { white-space: pre-wrap; max-height: 220px; overflow: auto; font-size: .75rem; color: var(--muted); margin: 0; }

body.playing #controls { max-width: 1280px; margin: 0 auto; width: 100%; }
#controls { max-width: 880px; width: 100%; margin: 0 auto; }

/* About: what the game is, three cards, the questions and the credits. Below the lobby; hidden while playing. */
.about { max-width: 1040px; width: 100%; margin: 2.5rem auto 0; display: grid; gap: 1rem; }
.about h2 { text-align: center; font-size: 1.7rem; letter-spacing: .08em; }
.about h2::after {
  content: ""; display: block; width: 4rem; height: 2px; margin: .6rem auto 0;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
}
.about-lead { max-width: 44rem; margin: 0 auto .6rem; text-align: center; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.about-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.about-card {
  position: relative; overflow: hidden; padding: 1.3rem 1.3rem 1.2rem; border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(160deg, #1d1013 0%, #0f0809 70%); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.about-card.slayer { background: linear-gradient(160deg, #221a0c 0%, #0f0809 70%); border-color: #4a3e1e; }
.about-card.vampire { background: linear-gradient(160deg, #2a080b 0%, #0f0809 70%); border-color: #5a1a1e; }
.about-card h3 { margin: 0 0 .45rem; font: 700 1.2rem/1.2 var(--serif); letter-spacing: .05em; }
.about-card.slayer h3 { color: var(--slayer); }
.about-card.vampire h3 { color: #ff5a4f; }
.about-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.about-mark { position: absolute; top: .3rem; right: .8rem; font-size: 2.8rem; line-height: 1; opacity: .14; color: var(--bone); }
.faq-title { margin-top: 1.6rem !important; }
.faq { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; align-items: start; }
.faq details { padding: .8rem 1rem; background: #0f0809; border: 1px solid var(--line); border-radius: 6px; }
.faq details[open] { border-color: #5a2a2e; }
.faq summary { display: flex; align-items: center; gap: .7rem; list-style: none; font: 600 .98rem var(--serif); letter-spacing: .02em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; width: .45rem; height: .45rem; flex: none; border-right: 2px solid var(--blood); border-bottom: 2px solid var(--blood);
  transform: rotate(-45deg); transition: transform .15s;
}
.faq details[open] > summary::before { transform: rotate(45deg); }
.faq details[open] > summary { margin-bottom: .4rem; }
.faq p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.about-credits { margin: 1rem auto 0; max-width: 44rem; text-align: center; color: var(--muted); font-size: .85rem; font-style: italic; }
body.playing .about { display: none; }

/* Footer: credit and the Red Games line. Hidden while playing, like the hero art. */
.site-foot {
  max-width: 880px; margin: .5rem auto 0; padding: 1.25rem 1.25rem 2rem; text-align: center; font-size: .88rem;
  border-top: 1px solid var(--line);
}
.site-foot p { margin: .2rem 0; }
.site-foot a { font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255, 123, 114, .4); }
.site-foot a:hover { border-bottom-color: currentColor; }
body.playing .site-foot { display: none; }

@media (max-width: 600px) {
  main { padding: .75rem; }
  .panel { padding: 1rem; }
  h1 { font-size: 1.25rem; letter-spacing: .08em; }
  body.playing .masthead { padding: .75rem; flex-wrap: nowrap; align-items: flex-start; }
  .masthead > .lang-switch { top: .4rem; right: .4rem; }
  /* Phones: a taller crop of the art (the middle of the scene), so the title has room over it. */
  .hero img { aspect-ratio: 4 / 3; object-position: 50% 30%; }
  .hero.hero--skin img { object-position: 20% 30%; } /* a skin's hero (event_notice.js): keep its figure on the left in the 4:3 crop */
  body:not(.playing) .brand .sigil { display: none; }
  body:not(.playing) .masthead .brand { top: 56%; padding: 0 .75rem; }
  body:not(.playing) .brand .tagline { font-size: .66rem; letter-spacing: .1em; }
  .about { margin-top: 1.5rem; }
  .about-cards, .faq { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  details.panel.options > summary, details#controls > summary { padding: .8rem 1rem; }
  details.panel.options > :not(summary), details#controls > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
  .summary-current { margin-left: 1.5rem; flex-basis: 100%; }
  .brand { min-width: 0; }
  .server-info { align-items: flex-start; }
  .server-location { margin: 0 0 0 .75rem; }
  .choices { grid-template-columns: 1fr 1fr; }
  .class-choices { grid-template-columns: 1fr; }
  .side .choice-body { min-height: 7.5rem; padding: .9rem; }
  .side .choice-body strong { font-size: 1.35rem; }
  .side-mark { font-size: 2.6rem; }
  .lobby-foot .actions { width: 100%; }
  .mode strong { font-size: 1.1rem; }
  .primary-btn, .practice-actions .btn { width: 100%; }
  .overlay-title { font-size: 1.1rem; }
  .overlay { padding: .5rem; gap: .3rem; font-size: .85rem; }
}
/* Desktop: the art covers the whole first screen behind the title and the lobby panel, which sits in the dark middle between
   the Slayer and the vampires; the "Entrar" button stays in view without scrolling. */
@media (min-width: 900px) {
  body:not(.playing) .masthead { position: static; } /* the art and the ES | EN switch take the page as their box */
  body:not(.playing) .hero {
    position: absolute; top: 0; left: 0; width: 100%; height: clamp(660px, 100vh, 1100px); z-index: -1; overflow: hidden;
  }
  body:not(.playing) .hero img {
    width: 100%; height: 100%; aspect-ratio: auto; object-position: 50% 30%;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  }
  body:not(.playing) .hero.hero--skin img { object-position: 30% 30%; } /* a skin's hero: the figure stays in the left third */
  /* Shade: darker at the top for the title and in the middle for the panel; the characters at the sides stay lit. */
  body:not(.playing) .hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      linear-gradient(to bottom, rgba(10, 6, 7, .55) 0%, rgba(10, 6, 7, 0) 26%),
      radial-gradient(ellipse 34% 58% at 50% 56%, rgba(10, 6, 7, .5) 0%, rgba(10, 6, 7, 0) 100%);
  }
  body:not(.playing) .masthead .brand { position: static; transform: none; padding: 2.4rem 1rem 1.6rem; }
  body:not(.playing) .brand .sigil { font-size: 1.6rem; }
  body:not(.playing) .brand h1 { font-size: clamp(2.6rem, 4vw, 3.8rem); letter-spacing: .2em; margin-right: -.2em; }
  body:not(.playing) .brand .tagline { font-size: .85rem; letter-spacing: .22em; }
  body:not(.playing) main { padding-top: 0; }
  body:not(.playing) #lobby, body:not(.playing) #controls { max-width: 800px; }
  /* The lobby panels read the art through a dark glass. */
  body:not(.playing) #lobby > .panel {
    background: linear-gradient(180deg, rgba(24, 16, 18, .82), rgba(15, 9, 10, .9));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  body:not(.playing) #lobby > .panel.primary { box-shadow: 0 0 0 1px rgba(255, 32, 32, .14), 0 24px 60px rgba(0, 0, 0, .6), 0 0 80px rgba(120, 0, 0, .25); }
  .lobby .lead { margin-bottom: .8rem; }
  .side .choice-body { min-height: 7.25rem; padding: 1rem 1.15rem .95rem; }
  .side .choice-body strong { font-size: 1.7rem; }
  .side-mark { font-size: 3.1rem; }
  .lobby fieldset { margin-bottom: .9rem; }
}
/* Short desktop screens (768 px tall laptops): a tighter title and lobby, so "Entrar" still fits the first screen. */
@media (min-width: 900px) and (max-height: 860px) {
  body:not(.playing) .masthead .brand { padding: 1.3rem 1rem 1rem; gap: .2rem; }
  body:not(.playing) .brand .sigil { display: none; }
  body:not(.playing) .brand h1 { font-size: clamp(2.2rem, 3.4vw, 3rem); }
  .lobby.panel { padding: 1rem 1.25rem; }
  .lobby .lead { display: none; }
  .side .choice-body { min-height: 5.6rem; padding: .75rem 1rem; }
  .side .choice-body strong { font-size: 1.45rem; }
  .side-mark { font-size: 2.4rem; }
  .lobby legend { margin-bottom: .35rem; }
  .lobby fieldset { margin-bottom: .7rem; }
  .lobby-foot .field small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* WebRTC: transport badge in the toolbar. Green = WebRTC, amber = WebSocket fallback. */
.transport-badge { padding: .15rem .55rem; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; letter-spacing: .06em; }
.transport-badge[data-transport="webrtc"] { color: var(--ok); border-color: rgba(111, 207, 122, .5); }
.transport-badge[data-transport="websocket"] { color: var(--slayer); border-color: var(--slayer-deep); }
