@font-face { font-family: Lexend; src: url(assets/Lexend-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Lexend; src: url(assets/Lexend-SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --pink: #E80ADE;
  --blue: #0C9CE5;
  --orange: #FF8511;
  --ink: #060606;
  --paper: #f4f1ea;
  --dim: rgba(255, 255, 255, .62);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--ink); color: #fff; font-family: Lexend, system-ui, sans-serif; overflow: hidden; }
canvas#gl, canvas#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#gl { transition: opacity .9s; }
canvas#stage { touch-action: none; cursor: crosshair; }
.pink { color: var(--pink); }
.orange { color: var(--orange); }
.slash { color: var(--pink); font-weight: 600; margin-right: .15em; }

/* HUD */
.hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(16px, env(safe-area-inset-top)) 20px 0; pointer-events: none; z-index: 2; }
.mark { pointer-events: auto; display: block; }
.mark img { height: 40px; width: auto; display: block; transform: rotate(-2deg); }
.stats { display: flex; gap: 18px; font-size: 13px; letter-spacing: .04em; color: var(--dim); }
.stat b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
#time { font-variant-numeric: tabular-nums; color: #fff; }
body.intro-on .stats, body.result-on .stats, body.wall-on .stats { opacity: 0; }
.stats { transition: opacity .4s; }

/* process phases (from the capabilities deck timeline) */
.phases { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 0; margin: 0; padding: 0; list-style: none; z-index: 2; pointer-events: none; transition: opacity .4s; }
.phases li { position: relative; font-size: 11px; letter-spacing: .06em; text-transform: lowercase; color: rgba(255,255,255,.35); padding: 14px 10px 0; white-space: nowrap; transition: color .3s; }
.phases li::before { content: ''; position: absolute; top: 3px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .3s, transform .3s; }
.phases li::after { content: ''; position: absolute; top: 6px; left: calc(50% + 6px); width: calc(100% - 12px); height: 1px; background: rgba(255,255,255,.14); }
.phases li:last-child::after { display: none; }
.phases li.done { color: rgba(255,255,255,.6); }
.phases li.done::before { background: var(--c, var(--pink)); }
.phases li.active { color: #fff; }
.phases li.active::before { background: var(--c, var(--pink)); transform: scale(1.6); box-shadow: 0 0 12px var(--c, var(--pink)); }
body.intro-on .phases, body.result-on .phases, body.wall-on .phases { opacity: 0; }

/* panels */
.intro, .result, .wall { position: fixed; z-index: 3; transition: opacity .5s, transform .5s; }
.intro { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); text-align: center; padding: 36px 28px 30px; background: rgba(6,6,6,.82); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; backdrop-filter: blur(6px); max-height: calc(100vh - 32px); overflow-y: auto; }
.intro.hide { opacity: 0; transform: translate(-50%, -46%); pointer-events: none; }
.kicker { margin: 0 0 14px; font-size: 13px; letter-spacing: .08em; color: var(--dim); }
h1, h2 { font-weight: 600; letter-spacing: -.02em; line-height: 1.02; margin: 0 0 16px; text-transform: lowercase; }
h1 { font-size: clamp(34px, 6vw, 56px); }
h2 { font-size: clamp(34px, 4.6vw, 60px); }
.lead, .copy { color: var(--dim); font-size: 15px; line-height: 1.55; margin: 0 0 24px; }
.keys { margin: 16px 0 0; font-size: 12px; color: rgba(255,255,255,.4); }

.btn { font: 600 15px Lexend, sans-serif; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 13px 22px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { border-color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn.primary { background: var(--pink); border-color: var(--pink); box-shadow: 4px 4px 0 #000, 4px 4px 0 1px rgba(255,255,255,.25); }
.btn.primary:hover { background: #ff2bf2; }
.btn.ghost { border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: #fff; }

.result, .wall { left: 6vw; top: 50%; transform: translateY(-50%); width: min(440px, 38vw); opacity: 0; }
.result.show, .wall.show { opacity: 1; }
.result, .wall { max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
/* v13: the longer core line and the bigger logo both need room on the end card */
.result h2 { font-size: clamp(30px, 3.4vw, 44px); }
.result { top: calc(50% + 30px); max-height: calc(100vh - 170px); }
.rank { font-size: 16px; line-height: 1.45; margin: 0 0 22px; color: #fff; }
.numbers { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 22px; margin: 0 0 22px; justify-content: start; }
.numbers div { display: flex; flex-direction: column-reverse; }
.numbers dt { font-size: 11px; letter-spacing: .06em; color: var(--dim); }
.numbers dd { margin: 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.numbers div:nth-child(1) dd { color: var(--pink); }
.numbers div:nth-child(3) dd { color: var(--orange); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* portrait / phones: board on top, result below */
@media (max-aspect-ratio: 10/11) {
  .result { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 52vh; overflow-y: auto; padding: 20px 18px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(6,6,6,0), rgba(6,6,6,.92) 28px); }
  .numbers { grid-template-columns: repeat(2, auto); }
  h2 { font-size: 34px; }
  .phases li { padding: 14px 4px 0; font-size: 0; }
  .phases li.active { font-size: 11px; }
  .stats { gap: 12px; }
}
@media (max-width: 420px) {
  .mark img { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .result, .btn, .phases li, .phases li::before { transition: none; }
}

/* v2: team edition */
.live { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .06em; color: #fff; background: rgba(232,10,222,.22); border: 1px solid rgba(232,10,222,.5); }
.actions.center { justify-content: center; }
.team { font-size: 13px; color: var(--dim); margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.wall .team { margin: -4px 0 22px; }
.btn.small { padding: 10px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.obst { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); text-align: left; }
.obst label { display: block; font-size: 13px; color: #fff; margin-bottom: 10px; }
.obst .row { display: flex; gap: 8px; }
.obst input { flex: 1; min-width: 0; font: 600 14px Lexend, sans-serif; letter-spacing: .03em; text-transform: uppercase; color: #0b0b0b; background: var(--paper); border: 0; border-radius: 6px; padding: 11px 12px; box-shadow: 4px 4px 0 var(--pink); }
.obst input::placeholder { color: rgba(11,11,11,.38); }
.obst input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.note { min-height: 1em; font-size: 12px; color: var(--dim); margin: 10px 0 0; }
.note.err { color: var(--orange); }
.wall h3 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px; }
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.board, .recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); min-width: 0; }
.board li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#wSmooth li b { color: var(--blue); }
#wLegend li b { color: var(--orange); }
.board li.me span { color: var(--pink); }
.board li.empty, .recent li.empty { color: rgba(255,255,255,.4); font-size: 13px; border: 0; }
.recent { margin-bottom: 4px; }
.recent li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.recent li span { font-size: 12px; font-weight: 600; letter-spacing: .03em; color: #0b0b0b; background: var(--paper); padding: 4px 8px; border-radius: 4px; transform: rotate(-1deg); }
.recent li small { font-size: 11px; color: var(--pink); }
.wall .obst { margin-bottom: 20px; }
@media (max-aspect-ratio: 10/11) {
  .wall { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 54vh; overflow-y: auto; padding: 20px max(18px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left, 0px)); background: linear-gradient(to bottom, rgba(6,6,6,0), rgba(6,6,6,.94) 28px); }
  .boards { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* v3: the graph screens are paper, like the graph on deepvibe.com */
body.paper-on { background: #e6e6e4; }
body.paper-on canvas#stage { cursor: default; }
body.paper-on .mark img { filter: invert(1); }
.paper-on .result, .paper-on .wall { --dim: rgba(11,11,11,.62); color: #0b0b0b; color-scheme: light; }
.paper-on .result .btn:not(.primary), .paper-on .wall .btn:not(.primary) { color: #0b0b0b; border-color: rgba(11,11,11,.3); }
.paper-on .result .btn:not(.primary):hover, .paper-on .wall .btn:not(.primary):hover { border-color: #0b0b0b; }
.paper-on .result .btn.ghost, .paper-on .wall .btn.ghost { border-color: transparent; }
.paper-on .btn.primary { box-shadow: 4px 4px 0 #0b0b0b; }
.paper-on .rank { color: #0b0b0b; }
.paper-on .numbers div:nth-child(3) dd { color: #c06a10; }
.paper-on .obst { border-top-color: rgba(11,11,11,.12); }
.paper-on .obst label { color: #0b0b0b; }
.paper-on .obst input { background: #fff; box-shadow: 4px 4px 0 #0b0b0b; }
.paper-on .note.err { color: #b4570c; }
.paper-on .board li { border-bottom-color: rgba(11,11,11,.1); }
.paper-on .board li.empty, .paper-on .recent li.empty { color: rgba(11,11,11,.45); }
.paper-on .recent li span { background: #fff; box-shadow: 2px 2px 0 #0b0b0b; }
.paper-on #wSmooth li b { color: #0a7fc0; }
.paper-on #wLegend li b { color: #c06a10; }
@media (max-aspect-ratio: 10/11) {
  .paper-on .result, .paper-on .wall { background: linear-gradient(to bottom, rgba(230,230,228,0), rgba(230,230,228,.96) 28px); }
}

/* v4: deadline, sound, boost, ghost */
.deadline { position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .05em; color: var(--dim); transition: opacity .4s; }
.dl-track { width: clamp(90px, 22vw, 220px); height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.dl-fill { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, var(--blue), var(--pink)); transition: transform .25s linear; }
.dl-text { min-width: 9.5em; color: #fff; font-variant-numeric: tabular-nums; }
.deadline.low .dl-fill { background: var(--orange); animation: dlpulse .6s ease-in-out infinite alternate; }
.deadline.over .dl-fill { background: var(--orange); }
.deadline.over .dl-text { color: var(--orange); }
.deadline.hit .dl-text { color: var(--pink); }
@keyframes dlpulse { to { opacity: .45; } }
body.intro-on .deadline, body.result-on .deadline, body.wall-on .deadline { opacity: 0; }
.mute { pointer-events: auto; font: 400 12px Lexend, sans-serif; letter-spacing: .04em; color: var(--dim); background: none; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.mute:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.mute:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
body.intro-on .stats, body.result-on .stats, body.wall-on .stats { opacity: 1; }
body.intro-on .stat, body.result-on .stat, body.wall-on .stat { display: none; }
.paper-on .mute { color: rgba(11,11,11,.6); border-color: rgba(11,11,11,.25); }
.ghost-tag { position: fixed; left: 50%; top: calc(max(14px, env(safe-area-inset-top, 0px)) + 26px); transform: translateX(-50%); margin: 0; font-size: 11px; letter-spacing: .05em; color: #9fd8ff; pointer-events: none; z-index: 2; }
body.intro-on .ghost-tag, body.result-on .ghost-tag, body.wall-on .ghost-tag { display: none; }
.boost { display: none; position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 44px); z-index: 3; width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--pink); background: rgba(232,10,222,.18); color: #fff; font: 600 12px Lexend, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
.boost.on { background: var(--pink); }
@media (pointer: coarse) { body:not(.intro-on):not(.result-on):not(.wall-on) .boost { display: block; } }
.team.day { margin-top: 4px; color: rgba(255,255,255,.45); }
@media (max-width: 520px) {
  .deadline { top: calc(max(14px, env(safe-area-inset-top, 0px)) + 34px); }
  .dl-label { display: none; }
  .ghost-tag { top: calc(max(14px, env(safe-area-inset-top, 0px)) + 58px); }
}

.boost.brake { right: auto; left: max(16px, env(safe-area-inset-left, 0px)); border-color: var(--blue); background: rgba(12,156,229,.18); }
.boost.brake.on { background: var(--blue); }

/* v13: the hit flash, and the client quote on the end card */
.flash { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; mix-blend-mode: screen; }
.quote { margin: 0 0 22px; padding-left: 14px; border-left: 3px solid var(--pink); }
.quote p { margin: 0 0 6px; font-size: 16px; line-height: 1.45; }
.quote cite { font-style: normal; font-size: 12px; letter-spacing: .03em; color: var(--dim); }

/* solo: no shared team wall here (playground build) */
.solo #toWallIntro, .solo #toWallResult, .solo .obst, .solo #iTeam { display: none; }
