/* Variant — "Select".
   A job application maps onto character creation almost too neatly: pick your
   class, allocate your stats, read the quest reward, accept or decline. The
   stipend screen becomes the reward panel, which is the one place in this whole
   set where a hard number feels like good news rather than fine print.

   Angular clipped panels and letterspaced caps do the heavy lifting; no webfont
   beyond Inter, no sprites, no images. */

@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:     #0d1018;
  --panel:  #151b28;
  --panel-2:#1c2434;
  --fg:     #e4e9f2;
  --dim:    #8792a8;
  --faint:  #56607a;
  --line:   #26304a;
  --gold:   #f2c14e;
  --gold-2: #b8892a;
  --cyan:   #5fd0e0;
  --red:    #ef6b6b;
  --font: 'Inter', ui-sans-serif, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --cut: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(90% 60% at 50% 0%, #182137, transparent 70%),
    radial-gradient(70% 50% at 20% 100%, #14192c, transparent 70%),
    var(--bg);
  color: var(--fg);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: clamp(16px, 3vw, 34px);
}

/* A faint scanline wash — enough to read as a game screen, not enough to hurt. */
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}

::selection { background: var(--gold); color: #12141c; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.hud { max-width: 1120px; margin: 0 auto; }

.hud-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 22px;
}
.title { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.chapter { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-family: var(--mono); }

.cols {
  display: grid; gap: clamp(20px, 3vw, 38px);
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
}

/* ============================================================ character sheet */

.sheet {
  background: var(--panel); border: 1px solid var(--line);
  clip-path: var(--cut);
  padding: 22px 20px;
  position: sticky; top: 20px;
}

.portrait {
  position: relative; height: 128px;
  background: linear-gradient(160deg, #1f2a42, #131a29);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.glyph {
  font-size: 46px; color: var(--gold);
  text-shadow: 0 0 26px rgba(242, 193, 78, .35);
  transition: transform 420ms var(--ease);
}
.portrait:hover .glyph { transform: scale(1.06) rotate(6deg); }
.lvl {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--gold); background: rgba(0,0,0,.5);
  border: 1px solid var(--gold-2); padding: 2px 7px;
}

.charname { font-size: 18px; font-weight: 600; letter-spacing: -.01em; word-break: break-word; }
.charclass { font-size: 12.5px; color: var(--dim); margin-bottom: 18px; }

.stats { display: flex; flex-direction: column; gap: 11px; }
.stat { }
.stat-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 5px;
}
.stat-top b { color: var(--gold); font-family: var(--mono); font-size: 11px; }
.bar { height: 7px; background: #0e1420; border: 1px solid var(--line); }
.bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
  transition: width 620ms var(--ease);
}
.stat.maxed .bar i { background: linear-gradient(90deg, var(--gold), var(--cyan)); }

.inventory { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.inv-head { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.inventory ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.inventory li { font-size: 12.5px; color: var(--fg); display: flex; gap: 8px; }
.inventory li::before { content: '◆'; color: var(--cyan); font-size: 9px; }
.inventory li.empty { color: var(--faint); }
.inventory li.empty::before { content: '◇'; color: var(--faint); }
.inventory li.fresh { animation: pickup 420ms var(--ease) both; }
@keyframes pickup {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

/* =================================================================== stage */

#stage {
  background: var(--panel); border: 1px solid var(--line);
  clip-path: var(--cut);
  padding: clamp(22px, 3vw, 34px);
  min-height: 420px;
}

.scene { display: flex; flex-direction: column; gap: 18px; }
.scene > * { animation: slide-in 360ms var(--ease) both; animation-delay: calc(var(--i,0) * 55ms); }
.scene.out { opacity: 0; transform: translateX(-10px); transition: opacity 150ms ease, transform 150ms ease; }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--cyan); font-family: var(--mono);
}
h1 { font-size: clamp(23px, 3.2vw, 32px); font-weight: 600; letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
.lede { color: var(--dim); max-width: 56ch; }
.hint { color: var(--faint); font-size: 13.5px; }

/* ================================================================ choices */

.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 14px 16px;
  font: inherit; font-size: 15px; color: var(--fg); text-align: left; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background 150ms ease, color 150ms ease, transform 150ms var(--ease);
}
.opt:hover { background: #26314a; transform: translateX(4px); }
.opt.chosen { background: var(--gold); color: #12141c; }
.opt .n {
  flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--gold); border: 1px solid currentColor; padding: 1px 6px;
}
.opt.chosen .n { color: #12141c; }
.opt .perk { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--cyan); }
.opt.chosen .perk { color: #12141c; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.tool {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit; font-size: 13.5px; color: var(--dim); text-align: left; cursor: pointer;
  transition: all 150ms ease;
}
.tool .rune { color: var(--faint); font-size: 11px; }
.tool:hover { color: var(--fg); border-color: var(--faint); }
.tool.on { color: #12141c; background: var(--cyan); border-color: var(--cyan); }
.tool.on .rune { color: #12141c; }

/* ================================================================== forms */

.fields { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.field label {
  display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 6px;
}
.field .opt-tag { color: var(--cyan); letter-spacing: .04em; text-transform: none; }

.field input, .field textarea {
  width: 100%; background: #0e1420;
  border: 1px solid var(--line); border-radius: 0;
  padding: 12px 14px;
  font: inherit; font-size: 15px; color: var(--fg);
  outline: none; transition: border-color 160ms ease, background 160ms ease;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { border-color: var(--gold); background: #101828; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); }

.counter { font-size: 11.5px; color: var(--faint); text-align: right; margin-top: 5px; font-family: var(--mono); }
.err { color: var(--red); font-size: 13px; margin-top: 6px; font-family: var(--mono); }
.err:empty { display: none; }

/* ================================================================= upload */

.drop {
  display: block; border: 1px dashed var(--line);
  padding: 28px 18px; text-align: center; cursor: pointer; background: var(--panel-2);
  transition: border-color 160ms ease, background 160ms ease;
}
.drop:hover, .drop.over { border-color: var(--cyan); background: #22304a; }
.drop strong { display: block; font-size: 15px; font-weight: 500; }
.drop span { font-size: 13px; color: var(--faint); }
.drop input[type=file] { display: none; }

.file-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--panel-2); border: 1px solid var(--cyan);
  padding: 14px 16px;
}
.file-card .doc { font-family: var(--mono); font-size: 11px; color: var(--cyan); flex: none; }
.file-card .name { font-size: 14.5px; word-break: break-all; }
.file-card .size { font-size: 12.5px; color: var(--faint); }

/* ============================================================ quest reward */

.reward {
  border: 1px solid var(--gold-2);
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(242, 193, 78, .16), transparent 70%),
    var(--panel-2);
  padding: 26px;
  clip-path: var(--cut);
  text-align: center;
}
.reward .label {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold);
  font-family: var(--mono); margin-bottom: 12px;
}
.reward .amount {
  font-size: clamp(32px, 6vw, 50px); font-weight: 600; letter-spacing: -.04em;
  line-height: 1.05; color: var(--gold);
  text-shadow: 0 0 40px rgba(242, 193, 78, .3);
}
.reward .per { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.reward ul { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.reward li { display: flex; gap: 11px; font-size: 14px; color: var(--dim); line-height: 1.5; }
.reward li::before { content: '◆'; color: var(--gold); font-size: 9px; flex: none; margin-top: 6px; }

/* ================================================================ actions */

.acts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.btn {
  background: var(--gold); color: #12141c; border: 0;
  padding: 12px 26px;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: filter 150ms ease, transform 150ms var(--ease);
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-plain {
  background: none; border: 0; padding: 6px 0;
  font: inherit; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); cursor: pointer;
}
.btn-plain:hover { color: var(--gold); }

.turnstile-slot { min-height: 66px; }
.legal { font-size: 12px; color: var(--faint); line-height: 1.6; max-width: 60ch; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.banner {
  align-self: flex-start;
  border: 1px solid var(--gold); color: var(--gold);
  padding: 8px 16px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-family: var(--mono);
}
.banner.warn { border-color: var(--cyan); color: var(--cyan); }

.noscript {
  max-width: 440px; margin: 60px auto; padding: 22px;
  border: 1px solid var(--line); text-align: center; color: var(--dim);
}

@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .sheet { position: static; }
}

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

/* The mark stands in for a character portrait until they name themselves, at
   which point it becomes their initial. */
.portrait { --brand-icon-size: 62px; }
.glyph { display: grid; place-items: center; font-size: 0; }
.glyph.initial { font-size: 46px; }
