/* ============================================================
   CRT//95: DIGITAL UNDERGROUND — styles.css
   A 1995 desktop simulation. All effects are pure CSS/SVG, offline.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05070a; }
body { font-family: "Courier New", Courier, monospace; -webkit-font-smoothing: none; }
.hidden { display: none !important; }
.screen { position: absolute; inset: 0; }

:root {
  --phos: #9dff9d;
  --phos-dim: #3f9f3f;
  --phos-dark: #0b2e0b;
  --amber: #ffc966;
  --crt-w: 800px;
  --beige: #d8d2c4;
  --beige-light: #efe9db;
  --beige-dark: #9a948a;
}

/* ============ shared noise / backdrop ============ */
.noise-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% -20%, #1a3a2a 0%, transparent 60%),
    radial-gradient(ellipse at 50% 120%, #241a0e 0%, transparent 55%),
    linear-gradient(180deg, #060a12 0%, #0a1018 45%, #05070a 100%);
}
.noise-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05; mix-blend-mode: overlay; animation: noiseShift 0.4s steps(4) infinite;
}
@keyframes noiseShift {
  0% { transform: translate(0,0); } 25% { transform: translate(-2%,1%); }
  50% { transform: translate(1%,-2%); } 75% { transform: translate(-1%,-1%); }
  100% { transform: translate(2%,2%); }
}

/* ============ 3D bevel utilities (the 1995 look) ============ */
.bevel-out { border: 2px solid; border-color: #fff var(--beige-dark) var(--beige-dark) #fff; }
.bevel-in  { border: 2px solid; border-color: var(--beige-dark) #fff #fff var(--beige-dark); }
.bevel-out-deep { border: 3px solid; border-color: #fff #6b655b #6b655b #fff; box-shadow: 1px 1px 0 #000; }
.bevel-in-deep  { border: 3px solid; border-color: #6b655b #fff #fff #6b655b; box-shadow: inset 1px 1px 0 #000; }

/* ============ main menu ============ */
#menuScreen { display: flex; align-items: center; justify-content: center; }
.menu-crt {
  position: relative; width: min(900px, 94vw); aspect-ratio: 4/3;
  border-radius: 46px 46px 40px 40px;
  background: linear-gradient(160deg, #3a3f46 0%, #23262b 40%, #17191d 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,.8), inset 0 0 0 6px #101216, inset 0 0 0 7px #4a5058, inset 0 0 60px rgba(0,0,0,.7);
  overflow: hidden; padding: 26px;
}
.menu-crt::before {
  content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 14px; border-radius: 0 0 10px 10px;
  background: repeating-linear-gradient(90deg, #2b2e33 0 8px, #1b1d21 8px 14px);
}
.menu-crt-glass {
  position: absolute; inset: 26px; border-radius: 30px;
  background:
    radial-gradient(ellipse at 30% 15%, rgba(255,255,255,.10), transparent 45%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, #050a06 0%, #04140a 50%, #020604 100%);
  box-shadow: inset 0 0 40px #000;
}
.menu-crt-scan {
  position: absolute; inset: 26px; border-radius: 30px; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 2px, transparent 2px 4px);
  mix-blend-mode: multiply; opacity: .5;
}
.menu-content { position: absolute; inset: 26px; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; padding: 20px; }
.menu-kicker { color: var(--phos-dim); font-size: 11px; letter-spacing: 3px; text-shadow: 0 0 8px rgba(63,159,63,.8); }
.menu-title {
  font-size: clamp(70px, 15vw, 150px); line-height: .85; font-weight: 900; letter-spacing: 4px;
  color: var(--phos);
  text-shadow: 0 0 6px #baffba, 0 0 22px #46c946, 0 0 60px #1e7a1e, 1px 0 2px rgba(255,0,60,.45), -1px 0 2px rgba(0,180,255,.45);
  animation: titlePulse 4s ease-in-out infinite;
}
.menu-title .slash { color: var(--amber); text-shadow: 0 0 8px #ffc966, 0 0 30px #b9731a; }
@keyframes titlePulse { 0%,100% { opacity: 1; } 50% { opacity: .88; } }
.menu-sub { color: #7de0a0; font-size: 16px; letter-spacing: 8px; text-shadow: 0 0 10px rgba(60,255,140,.7); }
.menu-tagline { color: #2f7a4a; font-size: 12px; font-style: italic; letter-spacing: 1px; margin-top: 2px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; width: min(340px, 80%); }
.menu-btn {
  font-family: inherit; font-size: 15px; font-weight: bold; letter-spacing: 2px;
  color: #101418; background: linear-gradient(180deg, #f3f6f0 0%, #c8cdc2 50%, #aab0a4 100%);
  border: 3px solid; border-color: #fdfefe #565b55 #565b55 #fdfefe;
  padding: 12px 18px; cursor: pointer; text-shadow: 0 1px 0 rgba(255,255,255,.6);
  box-shadow: 0 2px 0 #000, 0 0 0 1px #000; position: relative; transition: transform .05s;
}
.menu-btn:hover { filter: brightness(1.08); }
.menu-btn:active { transform: translateY(2px); box-shadow: 0 0 0 1px #000; border-color: #565b55 #fdfefe #fdfefe #565b55; }
.menu-btn-red { background: linear-gradient(180deg, #f5c9c9 0%, #c94f4f 50%, #a53232 100%); border-color: #ffdada #5f1a1a #5f1a1a #ffdada; }
.menu-btn.sm { font-size: 13px; padding: 8px 14px; letter-spacing: 1px; }
.menu-footer { color: #2f7a4a; font-size: 10px; letter-spacing: 2px; margin-top: 8px; }

/* ============ generic panel (slots, how-to, credits, exit) ============ */
.panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(720px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  background: #c8c4b6; border: 3px solid; border-color: #fff #6b655b #6b655b #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), inset 0 0 0 2px #a09a8e;
}
.panel-title {
  background: linear-gradient(90deg, #00006b 0%, #1c2a9e 60%, #3a4ac8 100%);
  color: #fff; font-size: 14px; font-weight: bold; letter-spacing: 2px;
  padding: 7px 12px; text-shadow: 1px 1px 0 #000; display: flex; align-items: center; gap: 8px;
  border-bottom: 2px solid #0a0a0a;
}
.panel-title::before { content: "▮"; color: #9ff; }
.panel-body { padding: 16px; overflow-y: auto; color: #101010; flex: 1; }
.center-text { text-align: center; }
.dim { color: #444; font-size: 12px; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }

/* ============ save slots ============ */
.slot-panel .panel-body { display: flex; flex-direction: column; gap: 10px; }
.slot-card {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; cursor: pointer;
  background: linear-gradient(180deg, #e2ddcf, #b9b3a3); border: 2px solid;
  border-color: #fff #6b655b #6b655b #fff;
}
.slot-card:hover { filter: brightness(1.06); }
.slot-card.empty { justify-content: center; color: #5a554a; font-style: italic; letter-spacing: 2px; }
.slot-num { font-size: 22px; font-weight: bold; color: #0a2a6a; border-right: 2px solid #8b857a; padding-right: 12px; min-width: 34px; }
.slot-info { flex: 1; font-size: 12px; }
.slot-info b { font-size: 14px; }
.slot-meta { color: #444; }
.slot-del { margin-left: 8px; padding: 4px 8px; font-family: inherit; background: #b93a2a; color: #fff; border: 2px solid; border-color: #f08070 #5f1a1a #5f1a1a #f08070; cursor: pointer; }
.char-form { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid #8b857a; padding-top: 14px; margin-top: 6px; }
.char-form-title { font-weight: bold; color: #00006b; letter-spacing: 2px; }
.char-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: 1px; color: #333; }
.char-form input {
  font-family: inherit; font-size: 15px; padding: 7px 9px; background: #f5f2e8; border: 2px solid;
  border-color: #6b655b #fff #fff #6b655b; outline: none; color: #000;
}
.char-form input:focus { background: #fffce8; }

/* ============ how-to / credits ============ */
.howto-body, .credits-body { font-size: 13px; line-height: 1.55; }
.howto-body h3 { color: #00006b; margin: 14px 0 4px; letter-spacing: 1px; }
.howto-body h3:first-child { margin-top: 0; }
.howto-body p { margin: 4px 0; }
.howto-body code, .howto-body .cmd {
  background: #0a0f0a; color: #9dff9d; padding: 1px 5px; font-size: 12px; display: inline-block;
  text-shadow: 0 0 6px #2f9f2f; border: 1px solid #2f3a2f;
}
.howto-body table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.howto-body td, .howto-body th { border: 1px solid #8b857a; padding: 3px 6px; text-align: left; }
.howto-body th { background: #aaa594; }
.credits-body { text-align: center; }
.credits-body .big { font-size: 26px; font-weight: 900; color: #0a2a6a; letter-spacing: 3px; margin: 18px 0 4px; text-shadow: 2px 2px 0 #fff; }
.credits-body .sub { font-size: 13px; color: #333; letter-spacing: 4px; }
.credits-body .role { margin-top: 20px; color: #7a1606; font-weight: bold; letter-spacing: 2px; border-top: 2px solid #8b857a; padding-top: 10px; }
.credits-body .line { margin: 3px 0; font-size: 13px; }
.exit-ascii { font-size: 20px; font-weight: bold; color: #9dff9d; background: #0a0f0a; border: 2px solid #2f3a2f; padding: 20px; text-align: center; margin-bottom: 14px; text-shadow: 0 0 8px #3f9f3f; line-height: 1.3; }
.exit-panel p { margin: 8px 0; }

/* ============ GAME: room & desk ============ */
#gameScreen { background: #060a12; }
.roomback {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, #0b1322 0%, #0d1626 40%, #0a0f18 100%);
}
.roomback::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(80,140,255,.06), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,120,80,.05), transparent 45%);
}
.room-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 65%, rgba(90,255,150,.08), transparent 55%);
  animation: roomGlow 6s ease-in-out infinite;
}
@keyframes roomGlow { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

.desk {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%) scale(var(--ds, 1));
  transform-origin: 50% 100%;
  width: 1560px; height: 620px;
  background:
    radial-gradient(ellipse at 50% -30%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(180deg, #7a5c38 0%, #5d4527 12%, #4a361f 45%, #3a2a17 100%);
  border-top: 4px solid #8a6a42;
  box-shadow: inset 0 40px 60px rgba(0,0,0,.35), 0 -10px 60px rgba(0,0,0,.6);
}
.desk::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), transparent);
}

/* ============ CRT MONITOR ============ */
.monitor {
  position: absolute; left: 50%; bottom: 240px; transform: translateX(-50%);
  width: 800px; z-index: 5;
  filter: drop-shadow(0 26px 30px rgba(0,0,0,.8));
}
.monitor-vent.top {
  position: absolute; top: -16px; left: 8%; right: 8%; height: 18px; border-radius: 6px 6px 0 0;
  background: repeating-linear-gradient(90deg, #3c4148 0 10px, #26292e 10px 14px);
  box-shadow: inset 0 -3px 4px rgba(0,0,0,.6);
}
.monitor-body {
  position: relative; border-radius: 34px 34px 20px 20px; padding: 30px 40px 26px;
  background: linear-gradient(165deg, #6b7078 0%, #454a51 18%, #2e3137 55%, #23262b 100%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.35), inset 0 -14px 24px rgba(0,0,0,.5), inset 3px 0 10px rgba(0,0,0,.4), inset -3px 0 10px rgba(0,0,0,.4);
}
.monitor-label {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  color: #b8bdc4; font-size: 13px; font-weight: bold; letter-spacing: 5px;
  text-shadow: 0 1px 0 rgba(255,255,255,.25), 0 -1px 0 rgba(0,0,0,.8);
  display: flex; gap: 6px; align-items: baseline;
}
.monitor-label-sub { font-size: 11px; color: #8f959c; letter-spacing: 2px; }
.crt {
  position: relative; width: 100%; aspect-ratio: 4/3; margin: 0 auto;
  border-radius: 24px 24px 16px 16px;
  background: #0a0c10;
  box-shadow: inset 0 0 0 10px #1c1f24, inset 0 0 0 12px #05070a, inset 0 0 60px #000;
  overflow: hidden;
}
.crt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 9;
  box-shadow: inset 0 0 90px rgba(0,0,0,.85), inset 0 0 26px rgba(0,0,0,.9);
}
.crt-inner {
  position: absolute; inset: 0; border-radius: 18px;
  background: #020604; transform: scale(1.02);
}
#bootCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#desktop { position: absolute; inset: 0; display: flex; flex-direction: column; z-index: 2; }
#deskIcons { flex: 1; position: relative; overflow: hidden; padding: 6px; }
#winLayer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#winLayer > .window { pointer-events: auto; }
#taskbar {
  height: 24px; background: linear-gradient(180deg, #c8c4b6, #a8a494);
  border-top: 2px solid #fff; display: flex; align-items: center; gap: 6px; padding: 0 6px;
  box-shadow: 0 -2px 0 #55503f;
}
.task-btn {
  font-family: inherit; font-size: 12px; font-weight: bold; padding: 3px 10px;
  background: linear-gradient(180deg, #e8e4d6, #b0ab9a); border: 2px solid;
  border-color: #fff #55503f #55503f #fff; cursor: pointer; color: #101010; display: flex; gap: 6px; align-items: center;
}
.task-btn-sub { font-size: 10px; color: #0a2a6a; }
#taskWindows { flex: 1; display: flex; gap: 5px; overflow: hidden; }
#taskClock { font-size: 11px; color: #101010; background: #d6d2c4; border: 2px solid; border-color: #55503f #fff #fff #55503f; padding: 3px 8px; font-weight: bold; }

/* CRT overlays */
.crt-glass {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse at 28% 12%, rgba(255,255,255,.13), transparent 42%),
    radial-gradient(ellipse at 75% 88%, rgba(255,255,255,.05), transparent 40%),
    radial-gradient(ellipse at 50% 50%, transparent 62%, rgba(0,0,0,.5) 100%);
}
.crt-scanlines {
  position: absolute; inset: 0; z-index: 7; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.crt-aperture {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,0,60,.035) 0 2px, rgba(0,255,120,.03) 2px 4px, rgba(0,80,255,.035) 4px 6px);
  mix-blend-mode: screen;
}
.crt-flicker {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: rgba(180,255,180,.02);
  animation: none;
}
.crt-vignette {
  position: absolute; inset: 0; z-index: 8; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 120px rgba(0,0,0,.75), inset 0 0 30px rgba(0,0,0,.6);
}
.crt-curve {
  position: absolute; inset: 0; z-index: 8; pointer-events: none; border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,10,5,.6) 100%);
}
.crt-reflect {
  position: absolute; inset: 0; z-index: 9; pointer-events: none; border-radius: inherit; overflow: hidden;
}
.crt-reflect::before {
  content: ""; position: absolute; top: -30%; left: -20%; width: 55%; height: 160%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.06) 48%, rgba(255,255,255,.02) 52%, transparent 60%);
  transform: rotate(8deg);
}
.crt-static {
  position: absolute; inset: 0; z-index: 10; pointer-events: none; opacity: 0; border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23s)' opacity='0.9'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}
.crt-static.on { opacity: .85; animation: staticJitter .12s steps(3) infinite; }
@keyframes staticJitter { 0% { background-position: 0 0; } 33% { background-position: -40px 20px; } 66% { background-position: 30px -30px; } 100% { background-position: -10px 40px; } }

/* monitor buttons */
.monitor-buttons {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px;
}
.mb-group { display: flex; gap: 4px; }
.mb-btn {
  width: 26px; height: 18px; border-radius: 3px; cursor: pointer;
  background: linear-gradient(180deg, #5a5f66, #3a3e44);
  border: 2px solid; border-color: #7d828a #22252a #22252a #7d828a;
  font-size: 10px; color: #cfd4da;
}
.mb-btn:hover { background: linear-gradient(180deg, #6a6f76, #4a4e54); }
.mb-btn.wide { width: 30px; }
.power-led {
  width: 10px; height: 10px; border-radius: 50%; margin-left: 6px;
  background: #1d2a1d; box-shadow: inset 0 0 3px #000;
}
.power-led.on { background: #5dff5d; box-shadow: 0 0 8px #5dff5d, 0 0 16px rgba(93,255,93,.7); animation: ledBreath 3s ease-in-out infinite; }
@keyframes ledBreath { 0%,100% { opacity: 1; } 50% { opacity: .75; } }
.mb-power {
  width: 40px; height: 22px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(180deg, #e8ecf0, #9aa0a6 60%, #7a8086);
  border: 2px solid; border-color: #fff #3a3e44 #3a3e44 #fff;
  font-size: 9px; color: #222; font-weight: bold;
}
.mb-power:hover { filter: brightness(1.05); }
.monitor-base {
  width: 56%; height: 26px; margin: 0 auto; border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #3a3e44, #23262b);
  box-shadow: inset 0 3px 6px rgba(0,0,0,.6), 0 4px 8px rgba(0,0,0,.4);
}

/* ============ COMPUTER TOWER ============ */
.tower {
  position: absolute; left: 90px; bottom: 72px; width: 150px; height: 400px; z-index: 4;
  background: linear-gradient(90deg, #d8d2c4 0%, #efe9db 12%, #c4beae 50%, #8f897d 100%);
  border: 3px solid #6b655b; border-radius: 8px;
  box-shadow: 0 18px 30px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.3);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 10px;
}
.tower-top { display: flex; align-items: center; gap: 8px; }
.tower-power-btn { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg,#8f959c,#454a51); border: 2px solid #2e3137; cursor: pointer; }
.tower-led { width: 8px; height: 8px; border-radius: 50%; }
.led-green { background: #2a3a2a; box-shadow: inset 0 0 3px #000; }
.led-green.on { background: #5dff5d; box-shadow: 0 0 6px #5dff5d; }
.led-red { background: #3a1a1a; }
.led-red.on { background: #ff5d5d; box-shadow: 0 0 6px #ff5d5d; animation: hddBlink .4s steps(2) infinite; }
@keyframes hddBlink { 0% { opacity: 1; } 100% { opacity: .2; } }
.floppy-drive { position: relative; background: #a8a294; border: 2px solid; border-color: #6b655b #e6e0d2 #e6e0d2 #6b655b; padding: 10px 8px; border-radius: 3px; }
.floppy-slot { height: 8px; background: #1c1a16; border: 1px solid #000; box-shadow: inset 0 0 4px #000; }
.floppy-btn { position: absolute; right: 6px; top: 6px; width: 14px; height: 14px; background: #c9c3b5; border: 2px solid; border-color: #fff #55503f #55503f #fff; cursor: pointer; }
.floppy-led { position: absolute; left: 6px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #2a3a2a; }
.floppy-led.on { background: #5dff5d; box-shadow: 0 0 6px #5dff5d; }
.cdrom { position: relative; background: #a8a294; border: 2px solid; border-color: #6b655b #e6e0d2 #e6e0d2 #6b655b; padding: 8px; border-radius: 3px; height: 30px; }
.cdrom-tray { position: absolute; left: 8px; top: 7px; width: 46%; height: 15px; background: #1c1a16; border-radius: 2px; border: 1px solid #000; }
.cdrom-btn { position: absolute; right: 8px; top: 7px; width: 12px; height: 15px; background: #c9c3b5; border: 2px solid; border-color: #fff #55503f #55503f #fff; cursor: pointer; }
.cdrom-led { position: absolute; right: 22px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: #3a1a1a; }
.tower-label { text-align: center; font-size: 12px; font-weight: bold; color: #2e2a22; letter-spacing: 2px; background: #b8b2a2; border: 2px solid #6b655b; padding: 4px; }
.tower-vents { flex: 1; background: repeating-linear-gradient(90deg, #8f897d 0 4px, #767064 4px 8px); border: 2px solid #6b655b; border-radius: 3px; opacity: .9; }

/* ============ KEYBOARD ============ */
.keyboard {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%);
  width: 720px; height: 190px; z-index: 6;
  background: linear-gradient(180deg, #f2ecdd 0%, #d4cebe 40%, #b6b0a0 100%);
  border: 3px solid #6b655b; border-radius: 12px;
  box-shadow: 0 14px 22px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.6);
  padding: 12px; display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; align-content: start;
}
.key {
  height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #2a261e; font-weight: bold;
  background: linear-gradient(180deg, #fffdf4 0%, #d8d2c4 55%, #b4ae9e 100%);
  border: 2px solid; border-color: #fff #6b655b #6b655b #fff;
  box-shadow: 0 2px 0 #5f594c; user-select: none;
}
.key.wide { grid-column: span 2; }
.key.space { grid-column: span 7; }
.key.tall { height: 30px; }
.key.pressed { transform: translateY(2px); box-shadow: 0 0 0 #5f594c; }
.key.fn { color: #7a1606; }

/* ============ MOUSE ============ */
.mousepad {
  position: absolute; left: 200px; bottom: 56px; width: 190px; height: 150px; z-index: 5;
  background: linear-gradient(135deg, #20304a 0%, #16223a 60%, #0e1626 100%);
  border: 3px solid #0a0f18; border-radius: 6px; box-shadow: 0 10px 16px rgba(0,0,0,.5);
}
.mouse {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 52px; height: 80px; border-radius: 26px 26px 18px 18px;
  background: linear-gradient(120deg, #f5f1e6 0%, #cdc7b8 45%, #8f897d 100%);
  box-shadow: 0 8px 12px rgba(0,0,0,.5), inset 0 -6px 10px rgba(0,0,0,.25);
  cursor: pointer;
}
.mouse::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: 12px; width: 26px; height: 4px; border-radius: 2px; background: #8f897d; }
.mouse::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; width: 3px; height: 10px; background: #6b655b; border-radius: 2px; }

/* ============ DESK CLUTTER ============ */
.desk-items { position: absolute; inset: 0; pointer-events: none; }
.coffee { position: absolute; right: 240px; top: 20px; width: 74px; height: 86px; z-index: 4; }
.coffee-lid {
  position: absolute; top: 0; left: 6px; width: 62px; height: 14px; border-radius: 50%;
  background: radial-gradient(ellipse, #efe9db 0%, #b6b0a0 70%); border: 2px solid #8f897d;
}
.coffee::before {
  content: ""; position: absolute; top: 8px; left: 10px; width: 54px; height: 60px; border-radius: 4px 4px 12px 12px;
  background: linear-gradient(90deg, #7a1606 0%, #a32714 50%, #6b1205 100%);
  box-shadow: inset 0 8px 10px rgba(255,255,255,.18), inset 0 -10px 14px rgba(0,0,0,.4);
}
.coffee-steam { position: absolute; top: -20px; left: 20px; width: 30px; height: 20px; opacity: .35; }
.coffee-steam::before {
  content: ""; position: absolute; width: 8px; height: 20px; border-left: 2px solid #fff; border-radius: 50%;
  filter: blur(1px); animation: steam 2.6s ease-in-out infinite;
}
.coffee-steam::after {
  content: ""; position: absolute; left: 16px; width: 8px; height: 20px; border-left: 2px solid #fff; border-radius: 50%;
  filter: blur(1px); animation: steam 3.1s ease-in-out infinite reverse;
}
@keyframes steam { 0% { transform: translateY(6px) scaleY(.5); opacity: 0; } 50% { opacity: .6; } 100% { transform: translateY(-10px) scaleY(1); opacity: 0; } }
.floppy-stack { position: absolute; right: 380px; top: 90px; width: 84px; height: 64px; z-index: 3; }
.floppy {
  position: absolute; left: 0; width: 84px; height: 60px; border-radius: 4px;
  background: linear-gradient(180deg, #3a4a8a 0%, #2a3a6a 60%, #1e2c52 100%);
  border: 2px solid #141e3a; box-shadow: 0 4px 6px rgba(0,0,0,.5);
  cursor: pointer;
}
.floppy::before {
  content: ""; position: absolute; top: 0; right: 16px; width: 18px; height: 26px;
  background: linear-gradient(180deg, #d8d2c4, #9a948a); border: 1px solid #000; border-top: none;
}
.floppy::after {
  content: ""; position: absolute; top: 28px; left: 10px; width: 20px; height: 24px; border: 1px solid #000;
  background: linear-gradient(180deg, #fff, #cfc9bb); box-shadow: 0 0 0 1px #6b655b;
}
.floppy[data-label]::marker { }
.floppy-label { position: absolute; top: 2px; left: 4px; right: 4px; text-align: center; font-size: 8px; color: #dfe6ff; letter-spacing: 1px; z-index: 2; }
.notebook { position: absolute; right: 520px; top: 60px; width: 110px; height: 80px; z-index: 3; background: linear-gradient(180deg, #f7f3e6, #ddd6c4); border-radius: 3px; box-shadow: 0 6px 8px rgba(0,0,0,.45); }
.notebook-spiral { position: absolute; top: -4px; left: 0; right: 0; height: 8px; background: repeating-linear-gradient(90deg, #8f897d 0 6px, transparent 6px 12px); }
.pen { position: absolute; right: 640px; top: 120px; width: 150px; height: 6px; transform: rotate(-14deg); z-index: 3; background: linear-gradient(90deg, #a32714 0 20px, #efe9db 20px 130px, #2a261e 130px); border-radius: 3px; box-shadow: 0 3px 4px rgba(0,0,0,.4); }
.phone { position: absolute; left: 320px; bottom: 220px; width: 120px; height: 90px; z-index: 4; }
.phone-base {
  position: absolute; bottom: 0; left: 0; width: 120px; height: 62px; border-radius: 8px;
  background: linear-gradient(180deg, #6b7078, #454a51); border: 2px solid #2e3137;
  box-shadow: 0 8px 10px rgba(0,0,0,.5);
}
.phone-handset {
  position: absolute; top: -14px; left: 8px; width: 104px; height: 40px; transform: rotate(-8deg);
  background: linear-gradient(180deg, #7d828a, #4a4e54); border-radius: 20px 20px 14px 14px;
  border: 2px solid #2e3137; box-shadow: 0 4px 6px rgba(0,0,0,.4);
}
.phone-handset::before { content: ""; position: absolute; top: 6px; left: 12px; width: 16px; height: 8px; border-radius: 4px; background: #1c1f24; }
.phone-cord { position: absolute; top: 30px; right: -30px; width: 60px; height: 60px; border: 3px solid #2a261e; border-left: none; border-top: none; border-radius: 0 0 40px 0; }
.phone-dial { position: absolute; right: 8px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; background: #c9c3b5; border: 2px solid #2e3137; box-shadow: inset 0 0 6px rgba(0,0,0,.4); }
.speaker { position: absolute; bottom: 66px; width: 74px; height: 120px; z-index: 3; background: linear-gradient(180deg, #3a3f46, #23262b); border: 2px solid #101216; border-radius: 6px; box-shadow: 0 10px 14px rgba(0,0,0,.5); }
.speaker.left { left: 620px; }
.speaker.right { right: 150px; }
.speaker-grill {
  position: absolute; inset: 14px; border-radius: 4px;
  background: repeating-linear-gradient(0deg, #101216 0 3px, #23262b 3px 5px);
  box-shadow: inset 0 0 8px #000;
}
.speaker-grill::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #2e3137 0%, #101216 60%); box-shadow: inset 0 0 8px #000; }
.printer { position: absolute; right: 300px; bottom: 60px; width: 150px; height: 90px; z-index: 3; background: linear-gradient(180deg, #f2ecdd, #c4beae); border: 2px solid #6b655b; border-radius: 4px; box-shadow: 0 10px 12px rgba(0,0,0,.45); }
.printer-paper {
  position: absolute; top: -26px; left: 18px; width: 110px; height: 30px;
  background: repeating-linear-gradient(0deg, #f5f2e8 0 18px, #d8d2c4 18px 20px);
  border: 1px solid #b6b0a0;
}
.printer-led { position: absolute; right: 10px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #2a3a2a; }
.modem-box {
  position: absolute; left: 480px; bottom: 60px; width: 120px; height: 40px; z-index: 3;
  background: linear-gradient(180deg, #e8e2d4, #b6b0a0); border: 2px solid #6b655b; border-radius: 4px;
  box-shadow: 0 8px 10px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
}
.modem-leds { display: flex; gap: 5px; }
.modem-leds i { width: 6px; height: 6px; border-radius: 50%; background: #3a1a1a; display: block; }
.modem-leds i.on { background: #ff8c3a; box-shadow: 0 0 5px #ff8c3a; }

/* ============ DESKTOP ICONS ============ */
.desk-icon {
  position: absolute; width: 74px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; user-select: none; border: 1px dashed transparent;
}
.desk-icon:hover { background: rgba(120,160,255,.08); }
.desk-icon.selected { background: rgba(80,120,255,.2); border: 1px dashed rgba(160,200,255,.4); }
.desk-icon .ic { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.desk-icon .ic svg { display: block; width: 100%; height: 100%; max-width: 40px; max-height: 40px; }
.desk-icon .ic-label {
  font-size: 10px; color: #dff0df; text-align: center; line-height: 1.15; text-shadow: 1px 1px 0 #000;
  letter-spacing: .5px;
}
.desk-icon .ic-label.gold { color: #ffd97a; }
.desk-icon .ic-label.red { color: #ff9d7a; }

/* ============ WINDOWS ============ */
.window {
  position: absolute; min-width: 240px; min-height: 150px;
  background: #c8c4b6; border: 3px solid; border-color: #fff #55503f #55503f #fff;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4); display: flex; flex-direction: column;
}
.window.minimized { display: none; }
.win-title {
  background: linear-gradient(90deg, #00006b 0%, #1c2a9e 60%, #3a4ac8 100%);
  color: #fff; font-size: 12px; font-weight: bold; letter-spacing: 1px;
  padding: 4px 6px; display: flex; align-items: center; gap: 6px; cursor: move;
  text-shadow: 1px 1px 0 #000;
}
.win-title .wt { flex: 1; white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 4px; }
.win-title .wt svg { width: 16px; height: 16px; flex: 0 0 16px; display: block; }
.win-close, .win-min {
  width: 18px; height: 16px; font-size: 10px; line-height: 12px; cursor: pointer;
  background: #c8c4b6; border: 2px solid; border-color: #fff #55503f #55503f #fff;
  color: #000; font-weight: bold; text-align: center; padding: 0;
}
.win-close:hover { background: #d85050; color: #fff; }
.win-close:active, .win-min:active { border-color: #55503f #fff #fff #55503f; }
.win-body { flex: 1; min-height: 0; overflow: auto; padding: 6px; background: #d6d2c4; }
.win-body.dark { background: #060a06; }
.win-status {
  border-top: 2px solid #8b857a; background: #b0ab9a; font-size: 10px; padding: 3px 6px; color: #101010;
}
.app-toolbar {
  display: flex; gap: 4px; padding: 4px; background: #b8b2a2; border-bottom: 2px solid #8b857a; flex-wrap: wrap;
}
.app-btn {
  font-family: inherit; font-size: 11px; padding: 3px 8px; cursor: pointer;
  background: #c8c4b6; border: 2px solid; border-color: #fff #55503f #55503f #fff; color: #101010;
}
.app-btn:active { border-color: #55503f #fff #fff #55503f; }
.app-btn.disabled { color: #88827a; pointer-events: none; }

/* ============ FILE LIST (explorer / floppy) ============ */
.filelist { width: 100%; border-collapse: collapse; font-size: 12px; }
.filelist th {
  text-align: left; background: #aaa594; padding: 3px 6px; border: 1px solid #8b857a; color: #101010;
}
.filelist td { padding: 3px 6px; border: 1px solid #a09a8e; cursor: default; }
.filelist tr:hover td { background: #c4e0ff; }
.filelist tr.sel td { background: #a8ccf0; }
.mg-guess { min-height: 40px; }
.filelist td.fn { font-weight: bold; color: #00006b; }
.filelist td.fn.sec { color: #a32714; }

/* ============ TERMINAL ============ */
.term { font-family: "Courier New", monospace; font-size: 13px; line-height: 1.25; color: var(--phos); text-shadow: 0 0 6px rgba(80,255,120,.55); white-space: pre-wrap; word-break: break-word; }
.term .dim { color: #3f8f4f; }
.term .amber { color: var(--amber); text-shadow: 0 0 6px rgba(255,200,90,.5); }
.term .red { color: #ff7a6a; text-shadow: 0 0 6px rgba(255,90,80,.5); }
.term .cyan { color: #7ae0ff; text-shadow: 0 0 6px rgba(90,200,255,.5); }
.term .mag { color: #ff9de0; text-shadow: 0 0 6px rgba(255,120,220,.5); }
.term .bold { font-weight: bold; }
.term .blink { animation: blink .9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-input-row { display: flex; align-items: center; }
.term-prompt { color: var(--amber); margin-right: 6px; text-shadow: 0 0 6px rgba(255,200,90,.5); }
#termInput {
  flex: 1; background: transparent; border: none; outline: none; color: var(--phos);
  font-family: "Courier New", monospace; font-size: 13px; text-shadow: 0 0 6px rgba(80,255,120,.55); caret-color: var(--phos);
}

/* ============ BBS styles ============ */
.bbs-banner { color: #7ae0ff; font-weight: bold; letter-spacing: 2px; text-shadow: 0 0 8px rgba(90,200,255,.7); }
.bbs-menu { color: var(--amber); }
.msg-block { border: 1px solid #2f4a2f; padding: 6px 8px; margin: 6px 0; background: rgba(40,80,40,.12); }
.msg-head { color: #7ae0ff; font-weight: bold; }
.msg-body { color: var(--phos); margin-top: 3px; }
.msg-sig { color: #3f8f4f; font-style: italic; margin-top: 3px; }

/* ============ HUD ============ */
#hud {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%) scale(var(--ds, 1));
  transform-origin: 50% 100%;
  width: 1560px; height: 34px; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 0 12px;
  background: linear-gradient(180deg, rgba(20,24,32,.92), rgba(10,12,18,.95));
  border-top: 2px solid #2a3a2a; color: #cfd8cf; font-size: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}
.hud-group { display: flex; align-items: center; gap: 6px; }
.hud-label { color: #5f7a5f; letter-spacing: 1px; font-size: 10px; }
.hud-val { color: var(--phos); font-weight: bold; text-shadow: 0 0 6px rgba(80,255,120,.5); }
#hudHeat.hot { color: #ff7a4a; text-shadow: 0 0 8px rgba(255,120,60,.8); animation: heatPulse 1s ease-in-out infinite; }
@keyframes heatPulse { 50% { opacity: .6; } }
.hud-spacer { flex: 1; }
.hud-btn {
  font-family: inherit; font-size: 11px; font-weight: bold; padding: 4px 12px; cursor: pointer;
  background: #2a3a2a; color: var(--phos); border: 2px solid; border-color: #3f5f3f #0a0f0a #0a0f0a #3f5f3f;
  letter-spacing: 1px;
}
.hud-btn:hover { background: #355035; }

/* ============ in-game menu overlay ============ */
#gameMenu {
  position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(2,4,8,.72);
}
.game-menu-panel { width: 380px; }
#gameMenu .menu-buttons { width: 100%; }

/* ============ city map ============ */
#mapScreen { position: absolute; inset: 0; z-index: 35; background: rgba(2,4,8,.8); }
.map-panel { width: min(900px, 96vw); }
.city-map {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.city-node {
  border: 2px solid; border-color: #fff #6b655b #6b655b #fff; padding: 10px; cursor: pointer;
  background: linear-gradient(180deg, #e2ddcf, #b9b3a3); text-align: center;
}
.city-node:hover { filter: brightness(1.07); }
.city-node .cn-name { font-weight: bold; color: #00006b; font-size: 13px; }
.city-node .cn-desc { font-size: 10px; color: #444; margin-top: 3px; }
.city-node .cn-lock { color: #a32714; font-size: 10px; margin-top: 3px; font-weight: bold; }
.city-desc { margin-top: 12px; font-size: 12px; color: #101010; background: #e2ddcf; border: 2px solid #8b857a; padding: 8px; min-height: 40px; }

/* ============ dialogs / toasts ============ */
#dialogRoot { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.dialog-overlay { position: absolute; inset: 0; background: rgba(2,4,8,.6); display: flex; align-items: center; justify-content: center; pointer-events: auto; }
.dialog-box { width: min(560px, 92vw); background: #c8c4b6; border: 3px solid; border-color: #fff #55503f #55503f #fff; box-shadow: 6px 6px 0 rgba(0,0,0,.5); }
.dialog-title { background: linear-gradient(90deg, #00006b, #3a4ac8); color: #fff; font-size: 13px; font-weight: bold; padding: 6px 10px; letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }
.dialog-body { padding: 12px; font-size: 13px; color: #101010; line-height: 1.5; max-height: 60vh; overflow-y: auto; }
.dialog-body .term { font-size: 12px; }
.dialog-btns { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px; border-top: 2px solid #8b857a; flex-wrap: wrap; }
.dlg-input { width: 100%; font-family: inherit; font-size: 14px; padding: 6px; margin-top: 6px; background: #f5f2e8; border: 2px solid; border-color: #6b655b #fff #fff #6b655b; outline: none; }
#toastRoot { position: absolute; right: 12px; bottom: 46px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: rgba(8,20,10,.92); border: 2px solid #2f5f2f; color: var(--phos); font-size: 12px;
  padding: 8px 14px; text-shadow: 0 0 6px rgba(80,255,120,.5); max-width: 340px;
  box-shadow: 0 6px 16px rgba(0,0,0,.6); animation: toastIn .25s ease-out;
}
.toast.warn { color: var(--amber); border-color: #6a5520; text-shadow: 0 0 6px rgba(255,200,90,.5); }
.toast.bad { color: #ff8a7a; border-color: #6a2a20; text-shadow: 0 0 6px rgba(255,120,100,.5); }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============ Wolf3D on-CRT launcher ============ */
.wolf3d-launch { position: absolute; inset: 0; z-index: 99999; background: #000; display: flex; flex-direction: column; pointer-events: auto; }
.wolf3d-title { display: flex; align-items: center; gap: 8px; background: linear-gradient(90deg, #00006b, #3a4ac8); color: #fff; font: bold 12px "Courier New", monospace; padding: 10px 18px 8px 12px; text-shadow: 1px 1px 0 #000; border-bottom: 2px solid #000; }
.wolf3d-name { flex: 1; white-space: nowrap; overflow: hidden; }
.wolf3d-new, .wolf3d-close { font: bold 13px "Courier New", monospace; padding: 5px 12px; cursor: pointer; background: #c8c4b6; border: 2px solid; border-color: #fff #55503f #55503f #fff; color: #000; }
.wolf3d-new:active, .wolf3d-close:active { border-color: #55503f #fff #fff #55503f; }
.wolf3d-new:hover { filter: brightness(1.08); }
.wolf3d-close {
  background: linear-gradient(180deg, #ffb3a6 0%, #ff6a52 45%, #e8381f 100%);
  border: 3px solid;
  border-color: #ffe6df #99120a #99120a #ffe6df;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 0 #8a0d08;
  box-shadow: 0 0 10px rgba(255,110,70,.9), inset 0 1px 0 rgba(255,255,255,.45);
}
.wolf3d-close:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 18px rgba(255,130,90,1);
}
.wolf3d-frame { flex: 1; position: relative; background: #000; min-height: 0; }
.wolf3d-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.wolf3d-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #7ae0ff; font: 12px "Courier New", monospace; text-shadow: 0 0 8px rgba(90,200,255,.6); }

/* ============ BBS door games ============ */
.door-game { width: min(620px, 94vw); }
.door-game-screen { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #071007; border: 2px solid #2f4a2f; padding: 12px; color: #9dff9d; }
.door-game-status { min-height: 28px; padding: 8px; color: #ffc966; background: #071007; font-family: "Courier New", monospace; font-size: 12px; }
.door-grid { display: grid; gap: 3px; }
.tic-grid { grid-template-columns: repeat(3, 64px); }
.board8 { grid-template-columns: repeat(8, 34px); }
.battle-grid { grid-template-columns: repeat(6, 38px); }
.door-cell { width: 38px; height: 38px; border: 2px solid #315331; background: linear-gradient(145deg,#173f21,#061307); color: #9dff9d; font: bold 20px "Courier New", monospace; cursor: pointer; text-shadow: 0 0 5px #5dff5d; transition: background .18s, transform .18s, box-shadow .18s; }
.door-cell:disabled { cursor: wait; opacity: .65; }
.board8 .door-cell { width: 38px; height: 38px; font-family: Georgia, serif; font-size: 25px; line-height: 36px; background: radial-gradient(circle at 35% 25%, #e9e2c4 0 20%, #b8ab84 52%, #57503c 100%); border-color: #6c704a; }
.board8 .door-cell.dark-square { background: radial-gradient(circle at 35% 25%, #8fae86 0 20%, #4d7a52 52%, #14301c 100%); }
.board8 .door-cell:hover, .board8 .door-cell.selected-square { transform: scale(1.1); box-shadow: 0 0 10px #ffc966, inset 0 0 8px #fff6b0; z-index: 2; }
.cpiece { display: inline-block; line-height: 36px; vertical-align: middle; }
.cpiece.pw { color: #fdf6e0; text-shadow: 0 0 2px #fffbe8, -1px -1px 1px rgba(30,26,12,.9), 1px 1px 1px rgba(30,26,12,.9), 0 0 6px rgba(255,250,220,.55); }
.cpiece.pb { color: #17181d; text-shadow: 0 0 2px #2a2b31, -1px -1px 1px rgba(226,232,240,.75), 1px 1px 1px rgba(0,0,0,.95), 0 0 6px rgba(150,170,195,.35); }
.chkpiece { display: inline-block; width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; line-height: 22px; font-size: 13px; }
.chkpiece.w { background: radial-gradient(circle at 32% 28%, #fff8e6 0%, #ecdcae 38%, #c9a86a 72%, #8a6a3a 100%); border: 2px solid #fdf6e3; box-shadow: 0 2px 3px rgba(0,0,0,.65), inset 0 -3px 4px rgba(0,0,0,.35), inset 0 2px 2px rgba(255,255,255,.7); }
.chkpiece.b { background: radial-gradient(circle at 32% 28%, #8a90a0 0%, #3d4350 40%, #171a20 76%, #05060a 100%); border: 2px solid #9aa0ac; box-shadow: 0 2px 3px rgba(0,0,0,.75), inset 0 -3px 4px rgba(0,0,0,.55), inset 0 2px 2px rgba(255,255,255,.25); }
.chkpiece.k { color: #ffd75e; text-shadow: 0 1px 2px #000, 0 0 5px rgba(255,215,90,.8); font-weight: bold; }
/* battleship grids */
.bgrids { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.bgrid-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bgrid-label { color: #7ae0ff; font-size: 11px; letter-spacing: 1px; }
.bgrid { display: grid; grid-template-columns: 18px repeat(8, 34px); gap: 2px; }
.bcorner, .bhead { width: 34px; height: 24px; display: flex; align-items: center; justify-content: center; color: #7ae0ff; font-size: 10px; }
.bcorner { width: 18px; }
.bcell { width: 34px; height: 34px; border: 1px solid #2f6f7f; background: repeating-linear-gradient(165deg, #0a3a52 0 5px, #0c2236 5px 10px); color: #7ae0ff; font: bold 14px "Courier New", monospace; cursor: crosshair; }
.bcell.bhull { background: linear-gradient(145deg, #9fb0b4 0%, #39484d 55%, #0d1417 100%); color: #dce8e2; text-shadow: 1px 1px 0 #000; border-color: #5c6f74; box-shadow: inset 0 2px 3px rgba(255,255,255,.3), inset 0 -3px 4px rgba(0,0,0,.5); }
.bcell.bhit { background: radial-gradient(circle, #b3271c 0 35%, #5c0f08 100%); color: #ffd7c8; border-color: #d55a3a; text-shadow: 0 0 6px #ff8a5a; }
.bcell.bmiss { background: #0a2434; color: #2f7a9a; }
.bcell:hover { box-shadow: 0 0 9px #7ae0ff; }
.bcell:disabled { cursor: wait; }
.sea-cell { color: #7ae0ff; background: repeating-linear-gradient(165deg,#07304a 0 5px,#0a1d32 5px 10px); }
.sea-cell.ship-cell { color: #d9c7a0; background: linear-gradient(145deg,#7d8b8e,#273236 45%,#101719); text-shadow: 1px 1px #000; }
.sea-cell:hover { box-shadow: 0 0 9px #7ae0ff; }
.tic-grid .door-cell { width: 64px; height: 64px; font-size: 30px; }
.door-cell:nth-child(even), .board8 .door-cell.dark-square { background: #123612; }
.door-cell:hover, .door-cell.selected-square { background: #285f28; outline: 1px solid #ffc966; }
.door-help, .door-label { color: #7ae0ff; font-size: 11px; text-align: center; }
.door-pong { width: min(420px, 100%); height: auto; image-rendering: pixelated; border: 2px solid #2f9f4f; background: #020604; }

/* ============ minigames ============ */
.mg-wrap { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mg-grid { display: grid; gap: 6px; }
.mg-cell { width: 52px; height: 52px; background: #b8b2a2; border: 2px solid; border-color: #fff #55503f #55503f #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.mg-cell.flip { background: #2a4a8a; }
.mg-cell.done { background: #2a5a2a; }
.mg-peg { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #000; }
.mg-hint { font-size: 12px; color: #101010; min-height: 16px; letter-spacing: 2px; }
.mg-bar { width: 100%; height: 22px; background: #060a06; border: 2px solid; border-color: #55503f #fff #fff #55503f; position: relative; overflow: hidden; }
.mg-zone { position: absolute; height: 100%; background: rgba(80,255,120,.35); border: 1px solid #5dff5d; }
.mg-cursor { position: absolute; width: 3px; height: 100%; background: #ffd97a; box-shadow: 0 0 6px #ffd97a; }
.mg-stats { font-size: 12px; color: #101010; }
.mg-btn { font-family: inherit; font-size: 12px; padding: 5px 14px; cursor: pointer; background: #c8c4b6; border: 2px solid; border-color: #fff #55503f #55503f #fff; }

/* ============ misc ============ */
.center { text-align: center; }
::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: #a09a8e; }
::-webkit-scrollbar-thumb { background: #6b655b; border: 2px solid #a09a8e; }
.money-pos { color: #7ae07a; }
.money-neg { color: #ff7a6a; }
.screen-dim { animation: dimIn .4s ease-out; }
@keyframes dimIn { from { opacity: 0; } to { opacity: 1; } }
