@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Space+Mono:wght@400;700&display=swap');

:root {
  --green: #64ff72;
  --bright: #baffbd;
  --dim: #1b963f;
  --dark: #020805;
  --panel: rgba(3, 15, 9, 0.92);
  --line: rgba(83, 255, 109, 0.22);
}

* { box-sizing: border-box; }
html { background: var(--dark); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: #b8e9bd;
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  background:
    radial-gradient(circle at 50% 28%, rgba(13, 96, 40, .18), transparent 38%),
    linear-gradient(180deg, #020906, #010403 70%);
}

button, a { font: inherit; }
button { color: inherit; }
#matrix { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .16; z-index: 0; }
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: .16;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.45) 3px 4px);
}
.shell { position: relative; z-index: 1; width: min(1240px, calc(100% - clamp(20px, 4vw, 40px))); margin: 0 auto; }

.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--green); text-decoration: none; font: 700 18px 'Space Mono', monospace; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 32px; border: 1px solid var(--green); box-shadow: inset 0 0 12px rgba(63,255,94,.12); }
.brand small { color: #4c8156; font-size: 9px; align-self: flex-end; margin-bottom: 6px; }
.system-status { flex-shrink: 0; color: #4e9a5b; font-size: 12px; letter-spacing: .1em; display: flex; gap: 10px; align-items: center; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 1.5s infinite; }
.clock { margin-left: 18px; color: #8bca94; }
.lang-switch { margin-left: 8px; padding: 5px 8px; border: 1px solid #285f34; color: var(--green); text-decoration: none; font-size: 10px; letter-spacing: .08em; }
.lang-switch:hover { background: rgba(64,255,92,.1); border-color: var(--green); }

.hero { min-height: 235px; display: flex; justify-content: space-between; align-items: center; padding: 42px 3% 32px; overflow: hidden; }
.eyebrow { color: var(--green); font-size: 12px; letter-spacing: .13em; }
h1 { margin: 12px 0 14px; color: #d4ffd8; font: 700 clamp(34px, 5vw, 64px)/.98 'Space Mono', monospace; letter-spacing: -.07em; text-shadow: 0 0 25px rgba(60,255,100,.17); }
h1 span { color: var(--green); -webkit-text-stroke: 1px var(--green); color: transparent; }
.intro { color: #5f9e68; line-height: 1.7; font-size: 13px; }
.hex-art { display: grid; transform: skewY(-8deg); color: rgba(62, 224, 89, .16); font-size: 24px; letter-spacing: .32em; text-align: right; text-shadow: 0 0 15px rgba(65,255,95,.25); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.game-panel, .side-panel { min-width: 0; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.5), inset 0 0 45px rgba(32,255,74,.015); }
.panel-head { height: 38px; border-bottom: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #55875c; }
.panel-head i { display: inline-block; width: 6px; height: 6px; background: var(--green); margin-right: 8px; box-shadow: 0 0 8px var(--green); }
.window-actions { display: flex; gap: 6px; }.window-actions b { width: 7px; height: 7px; border: 1px solid #336b3d; }
.modebar { min-height: 42px; padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); color: #376a40; font-size: 9px; }
.mode-tabs { display: flex; gap: 5px; }.mode-tabs button { border: 1px solid #1d4f29; background: #041008; color: #477d50; padding: 7px 12px; cursor: pointer; }.mode-tabs button.active { color: var(--green); border-color: #378e48; background: rgba(69,255,96,.09); }
.scorebar { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 70px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 18px; gap: 12px; }
.scorebar div { display: flex; flex-direction: column; }
.scorebar small { color: #477d50; font-size: 9px; letter-spacing: .16em; }
.scorebar strong { color: var(--green); font: 700 22px 'Space Mono', monospace; letter-spacing: .08em; text-shadow: 0 0 12px rgba(99,255,114,.3); }
.scorebar .signal { flex-direction: row; align-items: end; gap: 3px; }
.signal span { width: 4px; background: var(--green); opacity: .8; }.signal span:nth-child(1){height:6px}.signal span:nth-child(2){height:10px}.signal span:nth-child(3){height:15px}.signal span:nth-child(4){height:20px}

.game-wrap { position: relative; width: min(100%, 700px); margin: 0 auto; outline: none; background: #010805; cursor: crosshair; touch-action: none; }
#game { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 1; }
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(1,10,5,.78); backdrop-filter: blur(2px); transition: .2s; }
.game-overlay.hidden { opacity: 0; pointer-events: none; }
.overlay-code { color: #367842; font-size: 10px; letter-spacing: .18em; }
.game-overlay h2 { margin: 15px 0 6px; color: #d5ffda; font: 700 28px 'Space Mono'; }
.game-overlay p { margin: 0 0 24px; color: #569b61; font-size: 12px; }
.primary { border: 1px solid var(--green); background: rgba(30,255,67,.08); color: var(--green); padding: 12px 26px; cursor: pointer; letter-spacing: .08em; box-shadow: 0 0 18px rgba(73,255,98,.1); }
.primary:hover { background: var(--green); color: #001d06; box-shadow: 0 0 25px rgba(73,255,98,.35); }
.primary span { margin-right: 9px; }
.command-line { height: 40px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 11px; }
.command-line span { color: var(--green); }.command-line b { font-weight: 400; color: #5d8c64; }
.command-line i { width: 7px; height: 13px; background: var(--green); animation: blink 1s steps(1) infinite; }

.side-panel { padding: 0 16px 16px; }
.module { padding: 18px 0; border-bottom: 1px solid var(--line); }
.module-title { color: #66b870; font-size: 10px; letter-spacing: .12em; margin-bottom: 16px; }.module-title span { color: var(--green); margin-right: 7px; }
.keypad { width: 150px; height: 98px; display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 44px); gap: 5px; margin: 0 auto; }
.keypad button { border: 1px solid #286738; background: #06150b; cursor: pointer; color: #70cb7b; font-weight: 700; position: relative; }
.keypad button:hover, .keypad button:active { border-color: var(--green); color: var(--green); background: #0b2912; box-shadow: inset 0 0 10px rgba(63,255,95,.1); }
.keypad button small { position: absolute; right: 5px; bottom: 3px; font-size: 8px; color: #30643a; }
.keypad [data-dir="up"] { grid-column: 2; }.keypad [data-dir="left"] { grid-column: 1; }.keypad [data-dir="down"] { grid-column: 2; }.keypad [data-dir="right"] { grid-column: 3; }
.hint { margin: 14px 0 0; text-align: center; font-size: 8px; color: #3f7148; letter-spacing: .11em; }.hint b { color: #69a872; }
.action { width: 100%; height: 42px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; border: 1px solid #225e31; background: rgba(14, 55, 24, .25); margin-top: 8px; cursor: pointer; text-align: left; }
.action:hover { border-color: var(--green); background: rgba(40, 155, 59, .15); }.action span { font-size: 17px; color: var(--green); text-align: center; }.action b { font-size: 11px; font-weight: 400; }.action small { color: #37633e; font-size: 8px; padding-right: 10px; }
.action.danger:hover { border-color: #c5ff66; }.action.danger span { color: #b1e85c; }
.speed-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.speed-tabs button { background: #06140a; border: 1px solid #1d4f29; color: #396f42; font-size: 9px; padding: 8px 2px; cursor: pointer; }
.speed-tabs button + button { border-left: 0; }.speed-tabs button.active { background: rgba(66,255,95,.12); color: var(--green); box-shadow: inset 0 0 12px rgba(64,255,92,.08); }
.meter { height: 3px; margin-top: 14px; background: #0a2510; }.meter span { display: block; width: 50%; height: 100%; background: var(--green); box-shadow: 0 0 9px var(--green); transition: width .2s; }
.speed-label { display: flex; justify-content: space-between; color: #315b38; font-size: 7px; margin-top: 6px; }
.terminal-log { padding-top: 14px; font-size: 9px; color: #416d48; height: 82px; overflow: hidden; }.terminal-log p { margin: 3px 0; }.terminal-log span { color: var(--green); }
.daily-module { padding-bottom: 4px; }.streak-row { display: flex; justify-content: space-between; font-size: 10px; color: #477d50; }.streak-row strong { color: var(--green); }.streak-row b { font-size: 17px; }
.share-button { width: 100%; margin-top: 12px; padding: 9px; border: 1px solid #286738; background: rgba(40,130,54,.09); color: #69bd74; cursor: pointer; }.share-button:hover { border-color: var(--green); color: var(--green); }

.content-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; margin-top: 18px; }
.content-card, .site-copy { border: 1px solid var(--line); background: var(--panel); padding: 28px; }
.content-card h2, .site-copy h2 { margin: 7px 0 22px; color: #c9ffcf; font: 700 24px 'Space Mono', monospace; }
.how-to ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.how-to li { display: flex; gap: 12px; }.how-to li > span { color: var(--green); font-size: 11px; }.how-to b { color: #9be7a4; font-size: 12px; }.how-to p { color: #4a7c52; font-size: 10px; line-height: 1.5; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.profile-stats div { padding: 16px 8px; border: 1px solid #174523; text-align: center; }.profile-stats strong { display: block; color: var(--green); font: 700 20px 'Space Mono'; }.profile-stats span { color: #3d7146; font-size: 8px; }.privacy-note { color: #365f3d; font-size: 9px; margin: 15px 0 0; }
.site-copy { margin-top: 18px; }.site-copy > p:last-child { max-width: 820px; color: #54845b; font-size: 12px; line-height: 1.9; }
footer nav { display: flex; gap: 14px; } footer a { color: #3c7145; text-decoration: none; } footer a:hover { color: var(--green); }

footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; color: #315d39; font-size: 9px; letter-spacing: .08em; } footer b { color: #4c8b56; font-weight: 400; }
@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 3px var(--green); } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .hero { min-height: 200px; }.hex-art { display: none; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }.side-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }.module { min-width: 0; }.terminal-log { display: none; }
  .daily-module { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 16px); }.topbar { height: 58px; }.system-status { font-size: 0; gap: 7px; }.clock { display: none; }
  .game-panel, .side-panel, .content-card, .site-copy { width: 100%; max-width: 100%; overflow: hidden; }
  .brand { gap: 8px; font-size: 15px; }.brand-mark { width: 34px; height: 29px; }.brand small { display: none; }
  .lang-switch { margin-left: 2px; font-size: 10px; }
  .hero { min-height: 0; padding: 25px 2% 22px; }.intro br { display: none; }
  h1 { font-size: clamp(31px, 11vw, 48px); }.eyebrow { font-size: 10px; }
  .modebar { width: 100%; min-width: 0; align-items: stretch; flex-direction: column; gap: 6px; overflow: hidden; }.mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); inline-size: calc(100dvw - 46px); min-width: 0; max-width: 100%; }.mode-tabs button { width: auto; min-width: 0; padding-inline: 2px; overflow: hidden; white-space: nowrap; font-size: 8px; }
  .scorebar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px 12px; gap: 8px 14px; }.scorebar strong { font-size: 17px; }
  .game-overlay { padding: 18px; text-align: center; }.game-overlay h2 { font-size: clamp(20px, 7vw, 28px); }.game-overlay p { line-height: 1.5; }
  .command-line { overflow: hidden; }.command-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-panel { grid-template-columns: minmax(0, 1fr); }.module, .daily-module { grid-column: auto; }.module { padding: 16px 0; }
  .keypad { width: 174px; height: 114px; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 52px); gap: 6px; }
  .content-grid { grid-template-columns: 1fr; }.how-to ol { grid-template-columns: 1fr; }.content-card, .site-copy { padding: 20px; }
  footer { flex-wrap: wrap; gap: 12px; padding: 18px 0; } footer nav { order: 3; width: 100%; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .shell { width: calc(100% - 10px); }
  .brand { font-size: 13px; }.brand-mark { width: 30px; }
  .scorebar small { letter-spacing: .08em; }.scorebar strong { font-size: 15px; }
  .overlay-code { display: none; }.primary { padding: 11px 16px; }
  .content-card, .site-copy { padding: 16px; }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .hero { min-height: 0; padding-block: 18px; }.hero .intro { margin-bottom: 0; }
  .game-wrap { width: min(100%, calc(100svh - 20px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
