:root { color-scheme: dark; --ink: #eaf0f4; --deep: #1b0041; --violet: #6000bd; --electric: #8a18ec; --scene-bg: radial-gradient(circle at 50% 44%, #4c0093, #210049 60%, #14002e); }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--scene-bg); }
.intro-loader { position: fixed; z-index: 99; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--scene-bg); color: #fff; opacity: 1; transform: scale(1); filter: blur(0); transition: opacity .95s cubic-bezier(.2,.65,.25,1), transform .95s cubic-bezier(.2,.65,.25,1), filter .95s ease; }
.intro-loader::before { content: ''; position: absolute; inset: -15%; background: radial-gradient(ellipse at 50% 45%, #a94cff38 0, transparent 58%); animation: loaderGlow 2.6s ease-in-out infinite alternate; }
.intro-loader.is-leaving { opacity: 0; transform: scale(1.025); filter: blur(9px); pointer-events: none; }
.loader-lockup { position: relative; z-index: 1; width: min(76vw, 560px); aspect-ratio: 610 / 600; }
.logo-guides, .logo-outline, .logo-anchors { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.logo-guides { fill: none; stroke: #d9b8ff; stroke-width: 1.15; opacity: .58; }
.logo-grid-y { transform-origin: center top; animation: fieldDown .7s .45s both; }
.logo-grid-x { transform-origin: left center; animation: fieldAcross .7s .7s both; }
.logo-diagonals { opacity: 0; animation: guideReveal .5s 1.05s forwards; }
.logo-curves { opacity: 0; animation: guideReveal .6s 1.2s forwards; }
.logo-outline { fill: none; stroke: #f8efff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px #e6c3ff7f); }
.logo-outline path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: traceStroke 1.25s cubic-bezier(.2,.6,.15,1) forwards; }
.logo-outline .trace-r { animation-delay: 1.45s; }
.logo-outline .trace-s { animation-delay: 1.67s; }
.logo-outline .trace-dot { animation-delay: 1.9s; }
.logo-outline .trace-wordmark { stroke-width: 1.5; animation-delay: 2.05s; }
.logo-anchors { fill: #fff; opacity: 0; animation: anchorsIn .25s 1.5s forwards, anchorsOut .35s 3.2s forwards; }
.logo-anchors rect { stroke: #220044; stroke-width: 1; }
.logo-complete { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(1); opacity: 0; animation: logoFinish .65s 2.85s forwards; }
.screen { position: relative; width: 100vw; height: 100dvh; overflow: hidden; isolation: isolate; background: transparent; opacity: 0; transition: opacity 1.05s cubic-bezier(.2,.65,.25,1); }
.screen.is-visible { opacity: 1; }
.screen:not(.is-visible) * { animation-play-state: paused !important; }
.glow { position: absolute; z-index: -2; inset: -20%; opacity: .72; background: radial-gradient(circle at 51% 46%, #aa3cff85 0%, #7500d566 22%, transparent 52%); animation: breathe 10s ease-in-out infinite alternate; }
.grid { --cell: clamp(48px, 4.45vw, 76px); position: absolute; z-index: -1; inset: -4%; opacity: .42; background-image: linear-gradient(to right, #b66cff45 1px, transparent 1px), linear-gradient(to bottom, #b66cff45 1px, transparent 1px), radial-gradient(circle, #dbb8ffad 1.8px, transparent 2.4px); background-size: var(--cell) var(--cell); background-position: center center; mask-image: radial-gradient(ellipse at center, #000 12%, #000a 43%, transparent 75%); animation: gridFloat 16s ease-in-out infinite alternate; }
.scanlines { position: absolute; inset: 0; pointer-events: none; opacity: .14; background: repeating-linear-gradient(to bottom, #09001d 0 1px, transparent 2px 4px); }
.sweep { position: absolute; left: 0; top: -40%; width: 100%; height: 24%; opacity: .13; pointer-events: none; background: linear-gradient(transparent, #e9d5ff55, transparent); filter: blur(14px); animation: sweep 9s linear infinite; }
.screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 11vw 4vw #100022b8; }
.screen-copy { position: relative; width: min(78vw, 1080px); height: 100%; margin: auto; display: flex; flex-direction: column; justify-content: center; z-index: 1; text-shadow: 0 0 26px #eadcff7d; }
.screen-topline, .screen-bottomline, .eyebrow { font: 700 clamp(12px, 1.3vw, 20px)/1.2 'Courier New', monospace; letter-spacing: .16em; }
.screen-topline { position: absolute; top: 13%; left: 0; right: 0; display: flex; justify-content: space-between; animation: metaIn 9s ease-in-out infinite; }
.screen-logo { display: block; width: clamp(44px, 5vw, 68px); height: clamp(44px, 5vw, 68px); object-fit: contain; }
.message { transform: translateY(4%); }
.eyebrow { max-width: 100%; margin: 0 0 2.1vh; white-space: normal; animation: eyebrowIn 9s ease-in-out infinite; }
h1 { margin: 0; font: 900 clamp(84px, 14vw, 250px)/.81 Impact, 'Arial Black', sans-serif; letter-spacing: -.028em; }
.line { display: block; overflow: hidden; padding-right: .04em; }
.line > span { display: block; transform: translateY(110%); animation: rise 9s cubic-bezier(.2,.72,.12,1) infinite; }
.line:nth-child(2) > span { animation-delay: .26s; }
.signal { height: clamp(9px, 1.25vw, 17px); width: 100%; margin-top: 5.2vh; border: 1px solid #e6eaf6ac; padding: 2px; opacity: 0; animation: signalIn 9s ease-in-out infinite; }
.signal span { display: block; width: 0; height: 100%; background: repeating-linear-gradient(to right, var(--ink) 0 10px, transparent 10px 14px); animation: load 9s ease-in-out infinite; }
.screen-bottomline { display: flex; justify-content: space-between; margin-top: 12px; opacity: 0; animation: signalIn 9s ease-in-out infinite; }
.record { display: inline-flex; align-items: center; gap: .55em; }
.record i { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: #ed9ff5; box-shadow: 0 0 12px #f0a5f8; animation: record 1.4s ease-in-out infinite; }
.play-button { margin-top: clamp(24px, 4vh, 48px); padding: 15px 22px; border: 1px solid #eaf0f4bd; color: var(--deep); background: var(--ink); font: 900 clamp(12px, 1.1vw, 17px) 'Courier New', monospace; letter-spacing: .08em; cursor: pointer; box-shadow: 0 0 0 4px #ffffff14, 0 0 30px #d9a9ff44; transition: transform .18s ease, box-shadow .18s ease; }
.play-button span { margin-right: .65em; }
.play-button:hover { transform: translateY(-3px); box-shadow: 0 0 0 4px #ffffff27, 0 0 38px #d9a9ff8c; }
.play-button:focus-visible, .game-shell button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
[hidden] { display: none !important; }
.game-shell { --board-size: min(70vh, 64vw, 640px); --side-size: 280px; --layout-gap: clamp(15px, 2.5vw, 34px); --layout-width: calc(var(--board-size) + var(--side-size) + var(--layout-gap)); position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(16px, 2.2vw, 30px); overflow: auto; background: radial-gradient(circle at 50% 35%, #4c0093, #210049 60%, #14002e); color: var(--ink); font-family: 'Courier New', monospace; }
.game-shell::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .15; background-image: linear-gradient(to right, #d5aaff55 1px, transparent 1px), linear-gradient(to bottom, #d5aaff55 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at center, black, transparent 82%); }
.game-header, .game-layout, .touch-controls { position: relative; z-index: 1; }
.game-header { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; width: min(var(--layout-width), 100%); margin: 0 auto clamp(26px, 3vh, 38px); gap: 12px; }
.game-title { --brand-size: clamp(58px, 6.4vw, 84px); display: flex; flex-direction: row; align-items: center; gap: clamp(22px, 2.4vw, 34px); font-size: clamp(30px, 3.3vw, 48px); font-weight: 900; letter-spacing: .06em; }
.brand-logo { display: block; width: var(--brand-size); height: var(--brand-size); flex: 0 0 auto; object-fit: contain; }
.game-name { display: flex; height: var(--brand-size); flex-direction: column; justify-content: space-between; gap: 0; line-height: .8; white-space: nowrap; }
.game-actions { display: flex; gap: 8px; }
.game-actions button, .game-overlay button, .touch-controls button { border: 1px solid #f4eaff9c; background: #27064ecb; color: var(--ink); cursor: pointer; }
.game-actions button { padding: 10px 14px; font: 700 12px 'Courier New', monospace; letter-spacing: .08em; }
.game-actions button:hover, .game-overlay button:hover, .touch-controls button:hover { background: #7b22ce; }
.game-layout { display: grid; flex: 0 0 auto; grid-template-columns: var(--board-size) var(--side-size); align-items: stretch; gap: var(--layout-gap); width: min(var(--layout-width), 100%); margin: 0 auto; }
.board-frame { position: relative; width: 100%; aspect-ratio: 1; min-width: 0; padding: 7px; border: 1px solid #e9d9ff86; background: #150032; box-shadow: 0 0 0 7px #f3e9ff0b, 0 24px 70px #0900189c; }
#board { display: block; width: 100%; height: 100%; touch-action: none; image-rendering: pixelated; }
.game-toast { position: absolute; z-index: 2; top: 18px; left: 50%; max-width: calc(100% - 36px); transform: translateX(-50%); padding: 10px 15px; border: 1px solid #f2d8ff; background: #210044ed; color: var(--ink); box-shadow: 0 0 20px #bf73ff77; text-align: center; font: 900 12px 'Courier New', monospace; letter-spacing: .08em; }
.game-overlay { position: absolute; inset: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; background: #180035ec; backdrop-filter: blur(4px); }
.game-overlay p { margin: 0 0 10px; font-size: 13px; letter-spacing: .14em; }
.game-overlay h2 { margin: 0 0 14px; font: 900 clamp(50px, 6vw, 95px)/.9 Impact, 'Arial Black', sans-serif; }
.game-overlay #overlay-detail { max-width: 280px; line-height: 1.45; letter-spacing: 0; }
.game-overlay button { margin-top: 18px; padding: 12px 25px; font-weight: 900; letter-spacing: .1em; }
.game-panel { min-width: 0; padding: clamp(20px, 2.1vw, 30px); border: 1px solid #dec4ff6b; background: #160032a8; box-shadow: inset 0 0 40px #7a18d417; }
.panel-label { margin: 0 0 10px; font-size: 11px; letter-spacing: .16em; opacity: .78; }
#score { font: 900 clamp(66px, 7.5vw, 110px)/.9 Impact, 'Arial Black', sans-serif; }
.score-goal { font-size: 16px; opacity: .6; margin-left: 10px; letter-spacing: .1em; }
.emi-meter { margin: 18px 0 25px; }
.emi-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 10px; letter-spacing: .1em; opacity: .82; }
.emi-label b { font-size: 13px; color: #ffaddd; }
.emi-track { height: 8px; padding: 1px; border: 1px solid #f4d7ff88; }
.emi-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #da95ff, #ffaddd); transition: width .25s ease; }
.emi-note { margin: 6px 0 0; font-size: 9px; line-height: 1.3; letter-spacing: .04em; opacity: .62; }
.game-help { margin: 0 0 25px; line-height: 1.55; font-size: 13px; }
.legend { list-style: none; padding: 0; margin: 0; }
.legend li { display: grid; grid-template-columns: 15px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #e7d7ff2b; font-size: 12px; font-weight: 700; }
.item-dot { width: 13px; height: 13px; display: inline-block; border: 2px solid currentColor; box-shadow: 0 0 10px currentColor; }
.item-dot.plot { color: #f1e9ff; }.item-dot.land { color: #da95ff; }.item-dot.area { color: #ffaddd; }.item-dot.key { color: #ffe17a; }.item-dot.inspector { color: #ff6a9c; }
.controls-hint { margin: 24px 0 0; font-size: 10px; line-height: 1.7; opacity: .6; }
.touch-controls { display: none; flex: 0 0 auto; width: min(var(--layout-width), 100%); margin: 22px auto 0; text-align: center; }
.touch-controls button { width: 54px; height: 45px; margin: 2px; font-size: 27px; }
.touch-controls > div { display: flex; justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes breathe { from { transform: scale(.94); opacity: .58; } to { transform: scale(1.1); opacity: .86; } }
@keyframes fieldDown { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes fieldAcross { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes guideReveal { to { opacity: .72; } }
@keyframes traceStroke { to { stroke-dashoffset: 0; } }
@keyframes anchorsIn { to { opacity: 1; } }
@keyframes anchorsOut { to { opacity: 0; } }
@keyframes logoFinish { from { opacity: 0; } to { opacity: 1; } }
@keyframes loaderGlow { from { transform: scale(.92); opacity: .58; } to { transform: scale(1.08); opacity: 1; } }
@keyframes gridFloat { from { transform: translate(-1%, -.7%) scale(1.01); } to { transform: translate(1%, .8%) scale(1.035); } }
@keyframes sweep { 0%, 8% { transform: translateY(-30vh); } 72%, 100% { transform: translateY(145vh); } }
@keyframes metaIn { 0%, 3% { opacity: 0; } 12%, 88% { opacity: .85; } 98%, 100% { opacity: 0; } }
@keyframes eyebrowIn { 0%, 7% { opacity: 0; transform: translateY(8px); } 16%, 88% { opacity: 1; transform: translateY(0); } 97%, 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes rise { 0%, 11% { transform: translateY(110%); opacity: 0; } 23%, 87% { transform: translateY(0); opacity: 1; } 97%, 100% { transform: translateY(-105%); opacity: 0; } }
@keyframes signalIn { 0%, 23% { opacity: 0; } 33%, 88% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes load { 0%, 28% { width: 0; } 68%, 88% { width: 76%; } 100% { width: 0; } }
@keyframes record { 50% { opacity: .3; box-shadow: 0 0 3px #f0a5f8; } }
@media (max-width: 680px) { .screen-copy { width: 84vw; } .screen-topline { top: 12%; } .message { transform: none; } h1 { font-size: clamp(76px, 17vw, 120px); } .eyebrow, .screen-topline, .screen-bottomline { font-size: clamp(10px, 2.3vw, 14px); } .eyebrow { letter-spacing: .08em; } .signal { margin-top: 4vh; } }
@media (max-width: 850px) { .game-shell { --board-size: min(86vw, 43vh, 600px); --layout-width: var(--board-size); } .game-layout { grid-template-columns: 1fr; justify-items: center; gap: 12px; } .board-frame, .game-panel { width: 100%; } .game-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; padding: 12px; } .emi-meter { grid-column: 1 / -1; margin: 2px 0 8px; } .game-help { margin: 0; font-size: 12px; line-height: 1.35; } .legend { grid-column: 1; } .legend li { padding: 5px 0; } .controls-hint { display: none; } .touch-controls { display: block; margin-top: 12px; } }
@media (max-width: 540px) { .game-header { align-items: center; margin-bottom: 24px; } .game-title { --brand-size: 52px; flex-direction: row; align-items: center; gap: 16px; font-size: clamp(21px, 6vw, 30px); } .game-actions button { padding: 8px; font-size: 10px; } .game-panel { grid-template-columns: 1fr; } .game-help, .legend, .controls-hint { grid-column: 1; } .game-help { margin: 12px 0; } .controls-hint { display: none; } .touch-controls { margin-top: 12px; } }
@media (max-width: 700px) {
  .game-shell { --board-size: 100%; --side-size: 0px; --layout-gap: 8px; --layout-width: 100%; height: 100dvh; justify-content: flex-start; overflow: hidden; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); }
  .game-header { width: 100%; margin: 0 auto 8px; gap: 8px; }
  .game-title { --brand-size: 42px; gap: 10px; font-size: 20px; letter-spacing: .04em; }
  .game-name { line-height: .84; }
  .game-actions button { min-height: 42px; padding: 8px 10px; }
  .game-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: var(--layout-gap); width: 100%; margin: 0 auto; padding: 0 0 120px; }
  .board-frame { flex: 1 1 0; width: 100%; min-height: 0; aspect-ratio: auto; padding: 4px; box-shadow: 0 0 0 4px #f3e9ff0b, 0 14px 35px #0900189c; }
  .game-overlay { inset: 4px; padding: 12px; }
  .game-overlay h2 { font-size: clamp(40px, 12vw, 64px); }
  .game-overlay #overlay-detail { max-width: 240px; font-size: 12px; }
  .game-panel { position: relative; flex: 0 0 auto; width: 100%; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: center; column-gap: 8px; row-gap: 7px; padding: 12px 12px 9px; border-color: #dec4ff6b; background: #160032a8; color: #f2eaff; box-shadow: inset 0 0 40px #7a18d417, 0 12px 30px #09001855; }
  .game-panel::before { content: none; }
  .game-panel::after { content: none; }
  .score-block, .emi-meter { min-width: 0; padding: 0 4px 9px; border: 0; background: transparent; }
  .score-block .panel-label { margin: 0 0 3px; color: #d7c2f2; font-size: 8px; }
  #score { font-size: clamp(38px, 11vw, 48px); line-height: .82; font-variant-numeric: tabular-nums; }
  .score-goal { margin-left: 4px; font-size: 10px; }
  .emi-meter { grid-column: auto; margin: 0; display: flex; flex-direction: column; justify-content: center; }
  .emi-label { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-bottom: 5px; color: #d7c2f2; font-size: 8px; letter-spacing: .06em; }
  .emi-label b { font-size: clamp(14px, 4vw, 18px); white-space: nowrap; }
  .emi-track { height: 5px; background: #160032; border-color: #d7c2f2; }
  .emi-track i { background: linear-gradient(90deg, #d78cff, #ff9ed7); }
  .emi-note { display: none; }
  .game-extra { display: none; }
  .game-help { margin: 2px 0 6px; font-size: 10px; line-height: 1.3; }
  .legend { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0; padding-top: 9px; border-top: 1px solid #dec4ff6b; }
  .legend li { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 40px; padding: 4px 2px; border: 1px solid #dec4ff42; color: #f2eaff; font-size: 7px; line-height: 1; text-align: center; }
  .legend li > span:nth-child(2) { min-width: 0; font-size: 7px; }
  .legend li b { text-align: center; color: #f2eaff; font-size: 7px; }
  .item-dot { width: 9px; height: 9px; box-shadow: 0 0 7px currentColor; }
  .controls-hint { display: none; }
  .touch-controls { position: fixed; z-index: 20; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); flex: 0 0 auto; width: calc(100vw - 24px); margin: 0; padding: 8px 0 max(4px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1b004100, #1b0041 26%); }
  .touch-controls button { width: 54px; height: 46px; margin: 1px; font-size: 25px; }
}
@media (max-width: 700px) and (max-height: 700px) { .touch-controls button { height: 42px; } }
@media (prefers-reduced-motion: reduce) { .intro-loader, .screen { transition: none; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } .logo-complete { opacity: 1; } .logo-grid-x, .logo-grid-y, .logo-curves { transform: none; opacity: .48; } .line > span { transform: none; opacity: 1; } .eyebrow { opacity: 1; } .screen-topline, .signal, .screen-bottomline { opacity: 1; } .signal span { width: 76%; } }
