:root {
  color-scheme: dark;
  --gold: #ffbe0b;
  --neon-cyan: #00f5d4;
  --neon-pink: #ff2a85;
  --neon-blue: #38bdf8;
  --ink: #f8fafc;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #1e2a5e 0%, #111936 55%, #070b19 100%);
  color: var(--ink);
  font: 14px/1.25 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body.fever-active {
  background:
    radial-gradient(circle at 50% 45%, #3c1361 0%, #1c1240 55%, #090616 100%);
}

main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1600px;
  height: 100svh;
  margin: 0 auto;
  padding: 8px 14px;
  gap: 6px;
}

/* Compact Single-Row Top Arcade Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1.5px solid #4f74ff44;
  background: linear-gradient(180deg, #131d3bdd 0%, #0c1329ee 100%);
  box-shadow: 0 4px 16px #00000066, inset 0 1px 0 #ffffff22;
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.home {
  color: #ffe082;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  background: #ffffff10;
  border: 1px solid #ffffff22;
  transition: transform 0.15s, border-color 0.15s;
}

.home:hover {
  border-color: var(--gold);
  transform: translateX(-2px);
}

h1 {
  font: 900 22px/1 system-ui, -apple-system, sans-serif;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 0 #091026, 0 0 16px #38bdf866;
  white-space: nowrap;
}

h1 em {
  color: var(--gold);
  font-style: normal;
  text-shadow: 0 2px 0 #5f3700, 0 0 14px #ffbe0baa;
}

h1 .spark {
  font-size: 19px;
  margin-left: 4px;
  color: var(--neon-cyan);
  display: inline-block;
  animation: pulseSpark 1.6s infinite alternate ease-in-out;
}

@keyframes pulseSpark {
  from { transform: scale(0.95) rotate(-6deg); filter: drop-shadow(0 0 4px #00f5d4); }
  to { transform: scale(1.1) rotate(8deg); filter: drop-shadow(0 0 10px #ffbe0b); }
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.stat small {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #94a3b8;
}

.stat strong {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.score-val {
  color: var(--gold);
  text-shadow: 0 0 12px #ffbe0b66;
}

.combo-stat {
  min-width: 112px;
  padding: 2px 8px 4px;
  border-radius: 8px;
  background: #ffffff08;
  border: 1px solid #ffffff18;
}

.combo-stat.combo-hot {
  border-color: var(--gold);
  background: linear-gradient(180deg, #42200666, #1f120466);
  box-shadow: 0 0 12px #ffbe0b33;
}

.combo-stat.combo-fever {
  border-color: var(--neon-pink);
  background: linear-gradient(180deg, #590d2288, #2b093888);
  box-shadow: 0 0 16px #ff2a8566;
}

.combo-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

#combo {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px #00f5d488;
}

.fever-badge {
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff2a85, #ffbe0b);
  color: #111;
  animation: feverPulse 0.45s infinite alternate;
}

@keyframes feverPulse {
  from { transform: scale(0.96); }
  to { transform: scale(1.06); }
}

.meter-track {
  width: 100%;
  height: 5px;
  background: #090d1a;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
  border: 1px solid #ffffff1f;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00f5d4, #ffbe0b, #ff2a85);
  transition: width 0.1s linear;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

button, select {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: linear-gradient(180deg, #25335a 0%, #17213e 100%);
  border: 1.5px solid #5c7cfa66;
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 2px 0 #0a0f24;
  transition: transform 0.12s, border-color 0.15s, filter 0.15s;
  white-space: nowrap;
}

button:hover:not(:disabled), select:hover {
  border-color: var(--gold);
  filter: brightness(1.14);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0a0f24;
}

button:focus-visible, select:focus-visible, .tile:focus-visible {
  outline: 3px solid var(--neon-cyan);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

button.sound-on {
  border-color: #00f5d4aa;
  background: linear-gradient(180deg, #0d4b4d 0%, #092c34 100%);
  color: #a7f3d0;
}

select {
  background: #172347;
  color: #fff;
  padding-right: 8px;
}

.btn-new {
  background: linear-gradient(180deg, #ffd13b 0%, #f59e0b 100%);
  color: #171203;
  border: 1px solid #fef08a;
  font-weight: 800;
  box-shadow: 0 2px 0 #78350f, 0 0 12px #f59e0b55;
}

.btn-new:hover:not(:disabled) {
  background: linear-gradient(180deg, #fde047 0%, #fbbf24 100%);
  color: #000;
}

.btn-special {
  background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 2px 0 #2e1065, 0 0 14px #9333ea66;
}

.btn-special.ready {
  background: linear-gradient(180deg, #ec4899 0%, #be185d 100%);
  border-color: #fde047;
  box-shadow: 0 2px 0 #500724, 0 0 18px #f43f5e99;
  animation: readyGlow 1.1s infinite alternate;
}

@keyframes readyGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.22); }
}

.badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 5px;
  background: #00000044;
  color: #fde047;
  margin-left: 3px;
}

/* Maximized Board Viewport — takes all remaining vertical & horizontal space */
#viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, #1c2c54 0%, #0f1830 72%, #090e1f 100%);
  border: 1.5px solid #38bdf833;
  box-shadow: inset 0 0 40px #000000aa, 0 6px 20px #00000077;
}

body.fever-active #viewport {
  border-color: #ff2a85aa;
  box-shadow: inset 0 0 60px #ff2a8533, 0 0 24px #ff2a8544;
}

#viewport.shake {
  animation: boardShake 0.28s cubic-bezier(.36,.07,.19,.97);
}

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 4px); }
  40% { transform: translate(6px, -4px); }
  60% { transform: translate(-4px, -3px); }
  80% { transform: translate(4px, 3px); }
}

#board {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
}

#fx-canvas, #popup-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
}

/* Compact Single-Row Bottom Bar (Status + Action Tools) */
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 12px;
  border-radius: 11px;
  background: #0c1329cc;
  border: 1px solid #ffffff1a;
  flex-shrink: 0;
}

#status {
  margin: 0;
  color: #fde047;
  font-weight: 700;
  font-size: 13px;
  text-shadow: 0 0 10px #f59e0b55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

kbd {
  font-size: 9.5px;
  opacity: 0.7;
  margin-left: 4px;
  padding: 1px 4px;
  background: #00000044;
  border-radius: 4px;
}

/* Vibrant 3D Arcade Tiles — 100% solid opaque so lower layers never bleed through */
.tile {
  position: absolute;
  width: 54px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #ffffff;
  opacity: 1;
  transition: transform 0.14s cubic-bezier(.2, .9, .3, 1.2), filter 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

/* Free / Selectable tiles shine brightly like lit arcade buttons */
.tile:not(.blocked) {
  outline: 2px solid #ffffff;
  box-shadow:
    0 0 0 2px #00f5d4aa,
    0 0 14px 2px rgba(0, 245, 212, 0.45),
    3px 4px 0 #cbd5e1,
    5px 8px 0 #1e293b,
    8px 14px 18px rgba(0, 0, 0, 0.85);
}

.tile svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: #ffffff;
  filter: saturate(1.2) contrast(1.05);
}

.tile:not(.blocked):hover {
  transform: translate(-3px, -5px) scale(1.08);
  outline: 2.5px solid #fde047;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 24px 6px var(--gold),
    4px 6px 0 #e2e8f0,
    7px 11px 0 #1e293b;
  z-index: 1500 !important;
}

/* Blocked / Non-selectable tiles are deeply dimmed, desaturated & recessed into shadow */
.tile.blocked {
  background: #1e293b;
  outline: 1px solid #0f172a;
  filter: brightness(0.36) saturate(0.28) contrast(0.92);
  box-shadow:
    1px 2px 0 #0f172a,
    2px 4px 6px rgba(0, 0, 0, 0.9);
  cursor: not-allowed;
}

/* Subtle dark lock veil on blocked tiles so selectable tiles stand out unmistakably */
.tile.blocked::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: rgba(6, 11, 25, 0.38);
  pointer-events: none;
  z-index: 2;
}

.tile.selected {
  transform: translate(-3px, -6px) scale(1.09) !important;
  outline: 3px solid #ffffff;
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 26px 6px var(--neon-cyan),
    4px 8px 0 #1e293b !important;
  z-index: 1600 !important;
}

.tile.hinted {
  animation: hintBounce 0.45s infinite alternate ease-in-out;
  outline: 3.5px solid #ffffff !important;
  box-shadow:
    0 0 0 4px #ff2a85,
    0 0 28px 10px #00f5d4,
    0 0 45px 14px #ffbe0b !important;
  z-index: 1700 !important;
}

@keyframes hintBounce {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-2px, -6px) scale(1.08); }
}

/* Supercharged Golden Tile (created when zapped by a beam!) */
.tile.charged::after {
  content: '⚡';
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbeb 0%, #f59e0b 80%);
  border: 1.5px solid #fff;
  color: #111;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 12px #ffbe0b;
  pointer-events: none;
}

/* Tile permanently lit & unlocked by a Lantern Beam */
.tile.beam-lit:not(.blocked),
.tile.charged:not(.blocked) {
  outline: 2.5px solid #fde047;
  box-shadow:
    0 0 0 2px #f59e0b,
    0 0 20px 4px #ffbe0baa,
    3px 4px 0 #fde047,
    5px 8px 0 #b45309,
    8px 14px 18px rgba(0, 0, 0, 0.85);
}

.tile.blocked.charged::after {
  opacity: 0.45;
  box-shadow: none;
}

/* Tile actively flashing while beam hits it */
.tile.lit {
  filter: brightness(1.38) saturate(1.5) !important;
  transform: translate(-2px, -4px) scale(1.08);
  outline: 3px solid #fff;
  box-shadow:
    0 0 24px 8px var(--neon-cyan),
    0 0 40px 12px var(--gold) !important;
}

/* Arcade match pop-out animation */
.tile.removing {
  transform: scale(1.35) rotate(8deg) !important;
  filter: brightness(2.2) !important;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out, filter 0.22s !important;
}

/* Pure Smiley Mode — NO rectangular cards, NO background boxes, JUST the faces! */
.tile.smiley-tile {
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 50%;
}

.tile.smiley-tile svg {
  background: transparent !important;
  border-radius: 50%;
  overflow: visible;
  filter: none;
}

.tile.smiley-tile:not(.blocked) {
  outline: none !important;
  box-shadow: none !important;
  filter:
    brightness(1.06)
    saturate(1.15)
    drop-shadow(0 0 8px rgba(0, 245, 212, 0.8))
    drop-shadow(0 5px 7px rgba(0, 0, 0, 0.85));
}

.tile.smiley-tile:not(.blocked):hover {
  transform: translate(-2px, -5px) scale(1.18);
  outline: none !important;
  box-shadow: none !important;
  filter:
    brightness(1.15)
    saturate(1.25)
    drop-shadow(0 0 14px var(--gold))
    drop-shadow(0 7px 10px rgba(0, 0, 0, 0.9));
}

.tile.smiley-tile.blocked {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  filter:
    brightness(0.32)
    saturate(0.22)
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.85));
}

.tile.smiley-tile.blocked::before {
  display: none !important;
}

.tile.smiley-tile.selected {
  outline: none !important;
  box-shadow: none !important;
  transform: translate(-2px, -6px) scale(1.22) !important;
  filter:
    brightness(1.2)
    drop-shadow(0 0 12px #ffffff)
    drop-shadow(0 0 22px var(--neon-cyan)) !important;
}

.tile.smiley-tile.beam-lit:not(.blocked),
.tile.smiley-tile.charged:not(.blocked) {
  outline: none !important;
  box-shadow: none !important;
  filter:
    brightness(1.12)
    saturate(1.22)
    drop-shadow(0 0 12px var(--gold))
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.85));
}

.tile.smiley-tile.hinted {
  outline: none !important;
  box-shadow: none !important;
  filter:
    brightness(1.25)
    drop-shadow(0 0 14px #ff2a85)
    drop-shadow(0 0 26px #00f5d4) !important;
}

.beam {
  position: absolute;
  height: 7px;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #fff, #fef08a, #00f5d4, #fff);
  box-shadow:
    0 0 12px 4px #00f5d4,
    0 0 26px 8px #ffbe0b;
  z-index: 1800;
  pointer-events: none;
  border-radius: 99px;
  animation: beamPulse 0.12s infinite alternate;
}

@keyframes beamPulse {
  from { filter: brightness(1); height: 6px; }
  to { filter: brightness(1.4); height: 9px; }
}

.arcade-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow:
    0 2px 0 #000,
    0 0 12px var(--gold),
    0 0 22px var(--neon-pink);
  white-space: nowrap;
  pointer-events: none;
  animation: floatUp 0.95s cubic-bezier(.16, 1, .3, 1) forwards;
}

.arcade-popup.mega {
  font-size: 24px;
  color: #fde047;
  text-shadow:
    0 3px 0 #78350f,
    0 0 18px #ff2a85,
    0 0 32px #ffbe0b;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.5); }
  18% { opacity: 1; transform: translate(-50%, -65%) scale(1.15); }
  35% { opacity: 1; transform: translate(-50%, -80%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(0.92); }
}

.suit-e { color: #34d399; font-weight: 800; }
.suit-r { color: #fb7185; font-weight: 800; }
.suit-s { color: #60a5fa; font-weight: 800; }

dialog {
  max-width: 490px;
  background: linear-gradient(180deg, #1b284d 0%, #101830 100%);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 24px;
  line-height: 1.55;
  box-shadow: 0 20px 60px #000000cc, 0 0 40px #ffbe0b44;
}

dialog::backdrop {
  background: #050814cc;
  backdrop-filter: blur(4px);
}

dialog h2 {
  font: 900 26px system-ui, sans-serif;
  margin-top: 0;
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}

/* Nickel Nebula-style High Score & 3-Letter Spinner Overlay */
.is-visible-block { display: block !important; }
.is-visible-flex  { display: flex !important; }
.is-hidden        { display: none !important; }

@keyframes hsPulse {
  0%, 100% { text-shadow: 0 0 10px #0f9, 0 0 20px #0f9; }
  50%      { text-shadow: 0 0 20px #0f9, 0 0 40px #0f9, 0 0 60px #0f9; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 20, 0.88);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: monospace;
  text-align: center;
  padding: 12px;
}

#overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 100%;
  overflow-y: auto;
  padding: 14px 22px;
}

.game-over-title {
  font-size: 36px;
  letter-spacing: 6px;
  color: var(--gold);
  text-shadow: 0 0 18px var(--gold);
  margin: 0;
}

.game-over-score {
  font-size: 20px;
  color: #e2e8f0;
  margin: 6px 0 4px;
}

#high-scores {
  margin-top: 10px;
  display: none;
  flex-direction: column;
  align-items: center;
}

#hs-title {
  font-size: 24px;
  letter-spacing: 6px;
  font-weight: bold;
  color: #0f9;
  text-shadow: 0 0 12px #0f9, 0 0 24px #0f9;
  margin-bottom: 10px;
  animation: hsPulse 2s ease-in-out infinite;
}

#score-list {
  background: rgba(0, 255, 150, 0.05);
  border: 1px solid rgba(0, 255, 150, 0.25);
  border-radius: 8px;
  padding: 6px 20px;
  width: min(390px, 88vw);
  max-height: 270px;
  overflow-y: auto;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 20px;
  font-weight: bold;
  animation: rowIn 0.3s ease both;
}

.score-row:last-child { border-bottom: none; }
.score-rank { color: rgba(255, 255, 255, 0.4); font-size: 15px; width: 32px; text-align: left; }
.score-name { color: #0af; letter-spacing: 4px; width: 100px; text-align: center; text-shadow: 0 0 8px #0af; }
.score-row .score-val { color: #f0f; text-shadow: 0 0 8px #f0f; flex: 1; text-align: right; }
.score-date { color: rgba(255, 255, 255, 0.4); font-size: 12px; font-weight: normal; width: 58px; text-align: right; }

.score-row.top { background: rgba(255, 220, 0, 0.08); }
.score-row.top .score-name,
.score-row.top .score-val { color: #ff0; text-shadow: 0 0 10px #ff0; }
.score-row.top .score-date { color: rgba(255, 220, 0, 0.6); }

/* 3-Letter Initials Spinner */
#initials-box {
  display: none;
  margin-top: 8px;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

#hs-new-label {
  font-size: 28px;
  letter-spacing: 5px;
  font-weight: bold;
  color: #ff0;
  text-shadow: 0 0 14px #ff0, 0 0 28px #ff0;
  animation: hsPulse 1s ease-in-out infinite;
}

#hs-enter-label {
  font-size: 14px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 3px;
}

#spinner-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 4px 0;
}

.spinner-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.spin-btn {
  width: 60px;
  height: 34px;
  font-size: 18px;
  font-weight: bold;
  background: rgba(0, 255, 150, 0.15);
  color: #0f9;
  border: 2px solid #0f9;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  user-select: none;
}

.spin-btn:hover {
  background: rgba(0, 255, 150, 0.38);
}

.spin-window {
  width: 60px;
  height: 160px;
  overflow: hidden;
  position: relative;
  border: 2px solid #0f9;
  border-radius: 6px;
  background: rgba(0, 20, 10, 0.75);
}

.spin-window::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 28%, transparent 72%, rgba(0,0,0,0.85) 100%);
}

.spin-window::after {
  content: '';
  position: absolute;
  z-index: 3;
  pointer-events: none;
  top: 50px;
  left: 0;
  right: 0;
  height: 55px;
  border-top: 1px solid rgba(0, 255, 150, 0.6);
  border-bottom: 1px solid rgba(0, 255, 150, 0.6);
  background: rgba(0, 255, 150, 0.08);
}

.spinner-col.active-col .spin-window {
  box-shadow: 0 0 16px #0f9;
  border-color: #0f9;
}

.spin-strip {
  display: flex;
  flex-direction: column;
}

.spin-strip.spin-center { transition: none; transform: translateY(-55px); }
.spin-strip.spin-up     { transition: transform 0.15s ease; transform: translateY(-110px); }
.spin-strip.spin-down   { transition: transform 0.15s ease; transform: translateY(0); }

.spin-cell {
  height: 55px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: rgba(0, 255, 150, 0.3);
}

.spin-cell.curr {
  color: #0f9;
  text-shadow: 0 0 12px #0f9, 0 0 24px #0f9;
}

#hs-confirm-btn,
.nn-post-btn {
  padding: 9px 22px;
  font-size: 16px;
  font-weight: bold;
  font-family: monospace;
  background: #053018;
  color: #0f9;
  border: 2px solid #0f9;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1.5px;
  transition: all 0.18s;
}

#hs-confirm-btn:hover,
#hs-confirm-btn.active-btn,
.nn-post-btn:hover,
.nn-post-btn.active-btn {
  background: #0f9;
  color: #000;
  border-color: #0f9;
  box-shadow: 0 0 16px #0f9, 0 0 24px #0f9;
  transform: scale(1.04);
}

#nn-post-menu {
  display: none;
  gap: 12px;
  margin-top: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-mode {
  background: linear-gradient(180deg, #0ea5e9 0%, #0369a1 100%);
  border-color: #7dd3fc;
  color: #fff;
  box-shadow: 0 2px 0 #082f49, 0 0 12px #38bdf855;
}

.btn-mode.active-mode {
  background: linear-gradient(180deg, #10b981 0%, #047857 100%);
  border-color: #6ee7b7;
  box-shadow: 0 2px 0 #064e3b, 0 0 12px #10b98166;
}

@media (max-width: 960px) {
  .hide-sm { display: none; }
  main { padding: 4px 6px; gap: 4px; }
  .topbar, .bottombar { flex-wrap: wrap; gap: 4px; padding: 4px 6px; }
  h1 { font-size: 17px; }
  .stat { min-width: 42px; }
  .stat strong { font-size: 15px; }
  .combo-stat { min-width: 88px; }
  button, select { font-size: 11.5px; padding: 5px 8px; }
  #status { width: 100%; text-align: center; font-size: 11.5px; }
  .tools { width: 100%; justify-content: center; flex-wrap: wrap; gap: 4px; }
  kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
