:root {
  --ink: #0e1626; --panel: rgba(14, 24, 40, 0.86); --line: #2c4260;
  --sand: #e8d89a; --foam: #7fe3d0; --coral: #d4634f; --gold: #f2b950;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1626;
  font-family: system-ui, "Segoe UI", sans-serif; color: #eaf2f8; }
#scene { position: fixed; inset: 0; display: block; }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud .btn, .hud .palbtn, .hud .pad { pointer-events: auto; }
.topbar { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.stat b { color: var(--sand); font-variant-numeric: tabular-nums; }
.stat .ico { font-size: 15px; }
.gold .ico { color: var(--gold); } .core .ico { color: var(--coral); }
.bar { width: 90px; height: 9px; border-radius: 5px; background: #26313f; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #d4634f, #f2b950, #54e08a); }
.spacer { flex: 1; }
.botbar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 10px;
  flex-wrap: wrap; align-items: flex-end; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; }
.palbtn { background: var(--panel); border: 1px solid var(--line); color: #eaf2f8; border-radius: 10px;
  padding: 8px 10px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.palbtn em { font-style: normal; color: #9fb4cc; margin-left: 6px; }
.palbtn .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.palbtn.sel { border-color: var(--foam); box-shadow: 0 0 12px rgba(127, 227, 208, 0.35); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { background: var(--panel); border: 1px solid var(--line); color: #eaf2f8; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; }
.btn em { font-style: normal; color: #9fb4cc; margin-left: 6px; font-size: 11px; }
.btn:hover { border-color: var(--foam); }
.btn.ready { border-color: var(--gold); color: var(--sand); box-shadow: 0 0 14px rgba(242, 185, 80, 0.45); }
.btn.small { padding: 6px 9px; }

.dpad { position: absolute; right: 10px; bottom: 118px; display: grid;
  grid-template-columns: 46px 46px 46px; grid-template-rows: 46px 46px 46px; }
.pad { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--foam); font-size: 16px; touch-action: none; }
.pad.up { grid-column: 2; grid-row: 1; } .pad.left { grid-column: 1; grid-row: 2; }
.pad.right { grid-column: 3; grid-row: 2; } .pad.down { grid-column: 2; grid-row: 3; }
.padacts { position: absolute; right: 10px; bottom: 66px; display: flex; flex-direction: column; gap: 6px; }
.info { position: absolute; left: 8px; bottom: 84px; max-width: 52ch; font-size: 12.5px;
  color: #b9ccdf; background: rgba(14, 24, 40, 0.65); border-radius: 8px; padding: 6px 9px; }
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center;
  justify-content: center; background: rgba(8, 12, 22, 0.72); backdrop-filter: blur(3px); }
.overlay.hidden { display: none; }
.panel { max-width: 560px; margin: 16px; padding: 26px 28px; border-radius: 16px;
  background: linear-gradient(160deg, #16243c, #0d1524); border: 1px solid #33507a;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55); }
.panel h1 { margin: 0 0 4px; font-size: 30px; color: var(--sand); letter-spacing: 1px; }
.panel .tag { margin: 0 0 14px; color: var(--foam); }
.panel p { font-size: 14px; line-height: 1.55; color: #d7e3ee; }
.panel .keys { color: #9fb4cc; font-size: 12.5px; }
.btn.big { margin-top: 14px; font-size: 17px; padding: 12px 22px; border-radius: 12px;
  background: linear-gradient(140deg, #2a7f6d, #1c4f5e); border: 1px solid #5fd8c8; color: #eafff8; }
.pausetag { position: fixed; top: 46%; left: 0; right: 0; text-align: center; z-index: 9;
  font-size: 26px; letter-spacing: 6px; color: var(--sand); text-shadow: 0 2px 10px #000; }
.pausetag.hidden { display: none; }
@media (max-width: 640px) {
  .stat { font-size: 12px; padding: 5px 8px; }
  .info { display: none; }
  .palbtn { font-size: 11px; padding: 6px 7px; }
  .btn { font-size: 11px; padding: 6px 8px; }
  .btn em { display: none; }
  .padacts { bottom: 64px; }
}
