/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:           #0d0d1a;
  --surface:      #161629;
  --accent:       #7c3aed;
  --accent2:      #06b6d4;
  --text:         #f8fafc;
  --text-muted:   #94a3b8;
  --gold:         #fbbf24;
  --red:          #ef4444;
  --green:        #22c55e;
  --cyan:         #06b6d4;
  --radius:       16px;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  width:  100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* ─── App layout ────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh; /* fallback */
  width: 100vw;
  overflow: hidden;
  padding-top:    env(safe-area-inset-top,    0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left:   env(safe-area-inset-left,   0px);
  padding-right:  env(safe-area-inset-right,  0px);
  background: radial-gradient(ellipse at 30% 20%, #1e1b4b 0%, var(--bg) 60%);
}

/* ─── Header ────────────────────────────────────────────────────── */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 2px;
  flex-shrink: 0;
  gap: 8px;
}

#logo {
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #a78bfa, #06b6d4, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
}

#score-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

#score {
  font-size: clamp(22px, 5.5vw, 38px);
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 20px rgba(251,191,36,0.5);
  transition: transform 0.1s;
}

#score.pop { transform: scale(1.3); }

#score-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

#high-score-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
#high-score-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
#high-score {
  font-size: 13px;
  font-weight: 700;
  color: #a78bfa;
}

#level-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(124,58,237,0.25);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 20px;
  padding: 2px 8px;
}
#level-label {
  font-size: 10px;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#level {
  font-size: 12px;
  font-weight: 700;
  color: #c4b5fd;
}

/* ─── Sub-header (mode + dust) ─────────────────────────────────── */
#sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  height: 20px;
}
#mode-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
#header-dust {
  font-size: 11px;
  color: var(--cyan);
  font-weight: 600;
}

/* ─── Toolbar ───────────────────────────────────────────────────── */
#toolbar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 3px 12px;
  flex-shrink: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  min-height: 38px;
}
.btn:active { transform: scale(0.93); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 15px rgba(124,58,237,0.4);
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-daily {
  background: linear-gradient(135deg, #0369a1, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6,182,212,0.35);
}
.btn-hardcore {
  background: linear-gradient(135deg, #7f1d1d, #ef4444);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239,68,68,0.35);
}
.btn-icon {
  padding: 7px 11px;
  font-size: 17px;
}

/* ─── Powerup bar ───────────────────────────────────────────────── */
#powerup-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 12px;
  flex-shrink: 0;
  position: relative;
}

.pp-btn {
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 52px;
  min-height: 44px;
}
.pp-btn:active { transform: scale(0.9); }
.pp-btn:disabled { cursor: default; }

.pp-emoji {
  font-size: 18px;
  line-height: 1;
}
.pp-charge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0 5px;
}

#pp-aim-hint {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  background: #FF4757;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 50;
  pointer-events: none;
  animation: popIn 0.3s ease forwards;
}
#pp-aim-hint.hidden { display: none; }

/* ─── Combo / notification bar ───────────────────────────────────── */
#combo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  flex-shrink: 0;
  position: relative;
}
#combo {
  font-size: clamp(13px, 3.2vw, 19px);
  font-weight: 900;
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-shadow: 0 0 15px currentColor;
  transition: color 0.2s;
}
#combo.hidden { display: none; }
#combo-msg    { display: none; }

/* ─── Canvas area ───────────────────────────────────────────────── */
#canvas-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
}
#game-canvas {
  display: block;
  width:  100%;
  height: 100%;
  max-width:  100%;
  max-height: 100%;
  touch-action: none;
  border-radius: var(--radius);
}

/* ─── Level-up banner ───────────────────────────────────────────── */
#level-up {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: clamp(20px, 5.5vw, 34px);
  font-weight: 900;
  padding: 12px 32px;
  border-radius: 50px;
  box-shadow: 0 0 40px rgba(124,58,237,0.7);
  z-index: 100;
  pointer-events: none;
  text-align: center;
}
#level-up.hidden { display: none; }

/* ─── Banners ───────────────────────────────────────────────────── */
#new-high-banner, #daily-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  padding: 7px 22px;
  border-radius: 50px;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
}
#new-high-banner {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 0 30px rgba(245,158,11,0.6);
}
#daily-banner {
  background: linear-gradient(135deg, #0891b2, #22c55e);
  box-shadow: 0 0 30px rgba(6,182,212,0.6);
  top: 108px;
}
#new-high-banner.hidden,
#daily-banner.hidden { display: none; }

/* ─── Overlays ───────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(13, 13, 26, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
}
.overlay.hidden { display: none; }

.overlay-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 24px 22px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.overlay-header h2 {
  font-size: 20px;
  font-weight: 900;
}

/* ─── Start Screen ───────────────────────────────────────────────── */
.start-card { max-height: 92vh; overflow-y: auto; }

#start-title {
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #06b6d4, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 6px;
}
#start-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.start-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
#start-streak {
  font-size: 14px;
  font-weight: 700;
  color: #f97316;
}
#start-dust {
  font-size: 13px;
  color: var(--cyan);
  font-weight: 600;
}

/* High score row per mode */
.start-hs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.start-hs-box {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 8px 6px;
}
.start-hs-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.start-hs-val {
  font-size: 16px;
  font-weight: 900;
  color: #a78bfa;
}

/* Mode buttons */
.mode-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.mode-btn {
  width: 100%;
  font-size: 15px;
  padding: 13px;
}

/* Secondary buttons */
.secondary-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.secondary-btns .btn {
  flex: 1;
  font-size: 13px;
}

/* How to play */
.how-to-play {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: left;
}
.how-to-play h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.how-to-play ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.how-to-play li {
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.how-to-play li::before {
  content: '→';
  color: #06b6d4;
  flex-shrink: 0;
}

/* ─── Game Over Screen ───────────────────────────────────────────── */
#game-over-title {
  font-size: clamp(24px, 7vw, 38px);
  font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 30px rgba(239,68,68,0.5);
  margin-bottom: 4px;
}
#game-over-msg {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.4;
}

.score-summary {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}
.score-box {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
}
.score-box-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.score-box-value {
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 900;
}
.score-box-value.gold   { color: var(--gold); }
.score-box-value.purple { color: #a78bfa; }
.score-box-value.cyan   { color: var(--cyan); }

.final-rank {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 20px;
  padding: 5px 16px;
  margin-bottom: 10px;
  display: inline-block;
}
.final-rank.hidden { display: none; }

/* Leaderboard */
.lb-section {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: left;
}
.lb-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 8px;
  font-size: 13px;
}
.lb-row-new {
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
}
.lb-rank  { font-size: 16px; min-width: 28px; }
.lb-score { font-weight: 900; color: var(--gold); flex: 1; }
.lb-meta  { font-size: 11px; color: var(--text-muted); }
.lb-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 8px; }

.go-btns {
  display: flex;
  gap: 10px;
}

/* ─── Settings ───────────────────────────────────────────────────── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  cursor: pointer;
}
.setting-label {
  font-size: 14px;
  font-weight: 600;
}

/* Toggle switch */
.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle:checked {
  background: var(--accent);
}
.toggle:checked::after {
  transform: translateX(20px);
}

.settings-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Shop ───────────────────────────────────────────────────────── */
.shop-card {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
}
.shop-dust-display {
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 14px;
  text-align: center;
}
.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.shop-tab {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.shop-tab:active { transform: scale(0.95); }
.shop-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.shop-items {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.07);
}
.shop-item.equipped {
  border-color: var(--accent);
  background: rgba(124,58,237,0.12);
}
.shop-item-emoji {
  font-size: 28px;
  flex-shrink: 0;
}
.shop-item-info {
  flex: 1;
  text-align: left;
}
.shop-item-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.shop-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.shop-item-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 12px;
  min-height: 32px;
}
.shop-item-btn.equipped {
  background: rgba(124,58,237,0.2);
  color: var(--accent2);
  border: 1px solid var(--accent);
}

/* ─── Confirm popup ──────────────────────────────────────────────── */
.confirm-card {
  padding: 24px 20px;
  max-width: 300px;
}
.confirm-msg {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
  white-space: pre-line;
}
.confirm-btns {
  display: flex;
  gap: 10px;
}
.confirm-btns .btn { flex: 1; }

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes popIn {
  0%   { transform: scale(0.4); opacity: 0; }
  70%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

.pop-in {
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.overlay:not(.hidden) {
  animation: fadeIn 0.22s ease forwards;
}

/* ─── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 360px) {
  #header   { padding: 5px 8px 2px; }
  .btn      { padding: 6px 10px; font-size: 12px; }
  #logo     { font-size: 14px; }
  .pp-btn   { min-width: 44px; padding: 4px 8px; }
  .pp-emoji { font-size: 16px; }
}

@media (max-height: 650px) {
  /* Short screens (landscape or small phones) */
  #sub-header { height: 16px; }
  #combo-area { height: 22px; }
  #toolbar    { padding: 2px 8px; }
  #powerup-bar{ padding: 2px 8px; }
}

@media (min-aspect-ratio: 1/1) {
  /* Landscape */
  #header     { padding: 3px 12px; }
  #sub-header { height: 14px; }
  #combo-area { height: 20px; }
  #toolbar    { padding: 2px 8px; gap: 6px; }
  #powerup-bar{ padding: 2px 8px; gap: 6px; }
}

/* ══════════════════════════════════════════════════════════════════
   HUB & MODE SHARED STYLES
   ══════════════════════════════════════════════════════════════════ */

/* ── App screen system ──────────────────────────────────────────── */
.app-screen {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: radial-gradient(ellipse at 30% 20%, #1e1b4b 0%, #0d0d1a 60%);
  padding-top:    env(safe-area-inset-top,    0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left:   env(safe-area-inset-left,   0px);
  padding-right:  env(safe-area-inset-right,  0px);
}

.app-screen.hidden { display: none !important; }

/* Make the match-3 screen fill like before */
#screen-match {
  overflow: hidden;
}
#screen-match #app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Mode screens (non-match) scroll freely */
.mode-screen {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* ── Hub wrapper ────────────────────────────────────────────────── */
.hub-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 0 24px;
}

/* ── Hub top bar ────────────────────────────────────────────────── */
.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.hub-logo {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #06b6d4, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hub-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-dust-badge {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 20px;
  padding: 4px 10px;
}

.icon-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.icon-btn:active { transform: scale(0.9); }

/* ── Streak bar ─────────────────────────────────────────────────── */
.hub-streak-bar {
  background: rgba(124,58,237,0.15);
  border-bottom: 1px solid rgba(124,58,237,0.25);
  padding: 6px 14px;
  text-align: center;
}
.hub-streak-text {
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
}

/* ── Date label ─────────────────────────────────────────────────── */
.hub-date {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 14px 0;
  letter-spacing: 0.5px;
}

/* ── Hub card grid ──────────────────────────────────────────────── */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 14px;
  flex: 1;
}

.hub-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font);
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.hub-card:active { transform: scale(0.96); }

.hub-card:hover, .hub-card:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 20px rgba(124,58,237,0.2);
}

.hub-card-done {
  border-color: rgba(34,197,94,0.4);
  background: linear-gradient(135deg, rgba(34,197,94,0.08), var(--surface));
}

.hub-card-icon {
  font-size: 32px;
  margin-bottom: 4px;
  line-height: 1;
}

.hub-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.hub-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.hub-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 4px;
}
.hub-card-badge.daily { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.hub-card-badge.done  { background: rgba(34,197,94,0.2);  color: #86efac; border: 1px solid rgba(34,197,94,0.3);  }

.hub-card-best {
  font-size: 10px;
  color: #fbbf24;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Shared mode header ─────────────────────────────────────────── */
.mode-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  background: rgba(13,13,26,0.95);
  backdrop-filter: blur(8px);
  z-index: 10;
  flex-shrink: 0;
}

.mode-title {
  font-size: 18px;
  font-weight: 800;
  flex: 1;
  text-align: center;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
  min-height: 32px !important;
}

/* ── Result cards ───────────────────────────────────────────────── */
.result-card {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin: 12px;
}
.result-card.success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
}
.result-card.fail {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
}
.result-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
}
.result-dust {
  color: #fbbf24;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.result-streak {
  color: #f97316;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.result-time, .result-mistakes {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 6px;
}

/* ════════════════════════════════════════════════════════════════
   CONNECTOR MODE
   ════════════════════════════════════════════════════════════════ */
.connector-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.conn-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 14px 0;
}

.conn-status {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mistake-pip {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
}
.mistake-pip.used {
  background: #ef4444;
  border-color: #ef4444;
}

.conn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px;
  flex: 1;
}

.conn-word {
  background: var(--surface);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 6px;
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.1s, border-color 0.1s, transform 0.1s;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.conn-word:active { transform: scale(0.95); }
.conn-word.selected {
  background: #7c3aed;
  border-color: #a78bfa;
  color: #fff;
}

.conn-solved-row {
  grid-column: 1 / -1;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.conn-solved-theme {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(0,0,0,0.7);
  margin-bottom: 4px;
}
.conn-solved-words {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.8);
}

.conn-actions {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  justify-content: center;
}

.conn-streak {
  font-size: 14px;
  font-weight: 700;
  color: #f97316;
}

/* ════════════════════════════════════════════════════════════════
   WORDLE MODE
   ════════════════════════════════════════════════════════════════ */
.wordle-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrd-streak {
  font-size: 14px;
  font-weight: 700;
  color: #f97316;
}

.wrd-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  flex: 1;
}

.wrd-row {
  display: flex;
  gap: 6px;
}

.wrd-cell {
  width: clamp(44px, 12vw, 60px);
  height: clamp(44px, 12vw, 60px);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 900;
  color: #fff;
  background: var(--surface);
  perspective: 250px;
  transition: background 0.3s, border-color 0.3s, transform 0.1s;
}

.wrd-cell.wrd-filled { border-color: rgba(255,255,255,0.4); transform: scale(1.05); }
.wrd-cell.wrd-correct { background: #22c55e; border-color: #22c55e; }
.wrd-cell.wrd-present { background: #f59e0b; border-color: #f59e0b; }
.wrd-cell.wrd-absent  { background: #374151; border-color: #374151; }

@keyframes wrdShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.wrd-shake { animation: wrdShake 0.4s ease; }

.wrd-keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 12px;
}

.wrd-kb-row {
  display: flex;
  gap: 5px;
}

.wrd-kb-key {
  min-width: clamp(26px, 8vw, 36px);
  height: clamp(42px, 11vw, 52px);
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wrd-kb-key:active { transform: scale(0.9); }
.wrd-kb-wide { min-width: clamp(40px, 11vw, 52px); font-size: clamp(12px, 3vw, 14px); }
.wrd-kb-key.wrd-correct { background: #22c55e; }
.wrd-kb-key.wrd-present { background: #f59e0b; }
.wrd-kb-key.wrd-absent  { background: #374151; }

.wrd-result {
  padding: 0 12px 12px;
  text-align: center;
}

/* ── Wordle header additions ────────────────────────────────────── */
.wrd-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wrd-puzzle-info {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.wrd-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wrd-stats-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.wrd-stats-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Mode buttons (Daily / Practice) ────────────────────────────── */
.wrd-mode-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 4px 12px 0;
}
.wrd-mode-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.wrd-mode-btn.active,
.wrd-mode-btn:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(139,92,246,0.15);
}

/* ── Hard mode toggle ───────────────────────────────────────────── */
.wrd-hard-row {
  display: flex;
  justify-content: center;
  padding: 4px 12px 0;
}
.wrd-hard-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  user-select: none;
}
.wrd-hard-checkbox {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.wrd-hard-text { transition: color 0.2s; }
.wrd-hard-checkbox:checked + .wrd-hard-text { color: #a78bfa; }

/* ── Tile flip animation ────────────────────────────────────────── */
@keyframes wrdFlip {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}
.wrd-cell.wrd-flip {
  animation: wrdFlip 350ms ease-in-out forwards;
}

/* ── Cell pop animation when typing ────────────────────────────── */
@keyframes wrdPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.wrd-cell.wrd-pop {
  animation: wrdPop 100ms ease-out;
}

/* ── Win bounce / celebration ───────────────────────────────────── */
@keyframes wrdBounce {
  0%,100% { transform: translateY(0); }
  30%      { transform: translateY(-14px); }
  60%      { transform: translateY(-6px); }
}
.wrd-cell.wrd-bounce {
  animation: wrdBounce 600ms ease-in-out;
}

/* ── Result puzzle label ────────────────────────────────────────── */
.wrd-result-puzzle {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
  font-weight: 600;
}

/* ── Stats overlay panel ────────────────────────────────────────── */
.wrd-stats {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wrd-stats.hidden { display: none; }

.wrd-stats-panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  color: #fff;
}
.wrd-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}
.wrd-stats-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.wrd-stats-close:hover { background: rgba(255,255,255,0.1); }

.wrd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.wrd-stat {
  text-align: center;
}
.wrd-stat-num {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
}
.wrd-stat-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wrd-dist-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}
.wrd-dist {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wrd-dist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.wrd-dist-label {
  width: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
  text-align: right;
}
.wrd-dist-bar-wrap {
  flex: 1;
}
.wrd-dist-bar {
  background: #374151;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 24px;
  text-align: right;
  transition: width 0.4s ease;
}

/* Colorblind: keep stats bar neutral (not color-coded) */
body.colorblind .wrd-dist-bar { background: #2563eb; }

/* ════════════════════════════════════════════════════════════════
   MINI WORD GRID MODE
   ════════════════════════════════════════════════════════════════ */
.mwg-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mwg-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  gap: 12px;
  flex: 1;
}

@media (min-width: 500px) {
  .mwg-layout { flex-direction: row; align-items: flex-start; }
}

.mwg-grid-wrap {
  display: flex;
  justify-content: center;
}

.mwg-grid {
  display: grid;
  gap: 2px;
}

.mwg-cell {
  width: clamp(44px, 12vw, 58px);
  height: clamp(44px, 12vw, 58px);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mwg-black {
  background: #111;
  border-color: #111;
}

.mwg-cell-num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.mwg-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  text-align: center;
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 900;
  color: var(--text);
  font-family: var(--font);
  text-transform: uppercase;
  outline: none;
  cursor: pointer;
  padding-top: 10px;
}

.mwg-cell.mwg-correct { background: rgba(34,197,94,0.2); border-color: #22c55e; }
.mwg-cell.mwg-wrong   { background: rgba(239,68,68,0.2); border-color: #ef4444; }

.mwg-clues {
  flex: 1;
  max-width: 300px;
  width: 100%;
}

.mwg-clue-section { margin-bottom: 12px; }

.mwg-clue-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #a78bfa;
  margin-bottom: 6px;
}

.mwg-clue {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  gap: 6px;
}

.mwg-clue-num {
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  min-width: 16px;
}

.mwg-actions {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  justify-content: center;
}

.mwg-result { padding: 0 12px 16px; }

/* ════════════════════════════════════════════════════════════════
   MINESWEEPER MODE
   ════════════════════════════════════════════════════════════════ */
.ms-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ms-info {
  display: flex;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.ms-difficulty, .ms-toolbar {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  justify-content: center;
}

.ms-grid-wrap {
  overflow: auto;
  padding: 8px 12px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.ms-grid {
  display: grid;
  gap: 2px;
  width: max-content;
  margin: auto;
}

.ms-cell {
  width: clamp(30px, 9vw, 44px);
  height: clamp(30px, 9vw, 44px);
  border-radius: 4px;
  border: none;
  font-size: clamp(12px, 3.5vw, 18px);
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.ms-hidden   { background: rgba(255,255,255,0.12); color: transparent; }
.ms-hidden:active { background: rgba(255,255,255,0.2); }
.ms-revealed { background: rgba(255,255,255,0.04); cursor: default; color: var(--text); }
.ms-flagged  { background: rgba(239,68,68,0.2); }
.ms-mine-hit { background: #ef4444 !important; }

.ms-adj-1 { color: #3b82f6; }
.ms-adj-2 { color: #22c55e; }
.ms-adj-3 { color: #ef4444; }
.ms-adj-4 { color: #7c3aed; }
.ms-adj-5 { color: #dc2626; }
.ms-adj-6 { color: #06b6d4; }
.ms-adj-7 { color: #111827; }
.ms-adj-8 { color: var(--text-muted); }

.ms-result { padding: 8px 12px 16px; }

/* ════════════════════════════════════════════════════════════════
   WATER SORT MODE
   ════════════════════════════════════════════════════════════════ */
.ws-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ws-level-label {
  font-size: 13px;
  font-weight: 700;
  color: #06b6d4;
}

.ws-actions {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  justify-content: center;
}

.ws-tubes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 12px;
  justify-content: center;
  flex: 1;
  align-content: center;
}

.ws-tube {
  width: clamp(40px, 10vw, 54px);
  height: clamp(140px, 35vw, 180px);
  display: flex;
  flex-direction: column-reverse;
  border: 3px solid rgba(255,255,255,0.25);
  border-top: none;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
  background: rgba(255,255,255,0.04);
}

.ws-tube:active { transform: scale(0.96); }

.ws-tube.ws-selected {
  border-color: #a78bfa;
  transform: translateY(-12px);
}

.ws-segment {
  height: 25%;
  width: 100%;
  transition: background 0.2s;
}

.ws-tube-outline {
  position: absolute;
  inset: 0;
  border-radius: 0 0 28px 28px;
  border: 2px solid rgba(255,255,255,0.05);
  pointer-events: none;
}

.ws-result { padding: 8px 12px 16px; }

/* ════════════════════════════════════════════════════════════════
   MAHJONG MODE
   ════════════════════════════════════════════════════════════════ */
.mj-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mj-info {
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.mj-layout-btns, .mj-toolbar {
  display: flex;
  gap: 8px;
  padding: 5px 12px;
  justify-content: center;
}

.mj-board-wrap {
  overflow: auto;
  padding: 12px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.mj-board {
  position: relative;
  margin: auto;
  min-width: 200px;
  min-height: 200px;
}

.mj-tile {
  position: absolute;
  width: 44px;
  height: 58px;
  background: #e8e0d0;
  border: 2px solid #b0a090;
  border-radius: 6px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.1s, transform 0.1s, opacity 0.1s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  color: #222;
}

.mj-tile:active { transform: scale(0.95); }

.mj-tile.mj-blocked {
  opacity: 0.6;
  cursor: default;
  filter: brightness(0.85);
}

.mj-tile.mj-selected {
  box-shadow: 0 0 0 3px #a78bfa, 2px 2px 0 rgba(0,0,0,0.4);
  transform: scale(1.05);
  background: #f0eaff;
}

.mj-tile.mj-hint {
  box-shadow: 0 0 0 3px #22c55e, 2px 2px 0 rgba(0,0,0,0.4);
  animation: pulse 0.6s ease infinite;
}

.mj-result { padding: 8px 12px 16px; }

/* ════════════════════════════════════════════════════════════════
   SETTINGS / STATS / SHOP
   ════════════════════════════════════════════════════════════════ */
.settings-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 24px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 14px;
  margin-top: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}

.settings-row input[type=checkbox] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #7c3aed;
}

.stats-streak {
  text-align: center;
  padding: 24px;
}
.stats-streak-count {
  font-size: 48px;
  font-weight: 900;
  color: #f97316;
}
.stats-streak-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stats-dust {
  text-align: center;
  padding: 0 14px 16px;
  font-size: 20px;
  font-weight: 700;
}
.stats-table {
  width: calc(100% - 28px);
  margin: 0 14px;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th, .stats-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  color: var(--text);
}
.stats-table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Shop */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 14px;
}

.shop-item {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.shop-item:active { transform: scale(0.96); }
.shop-item.owned  { border-color: rgba(124,58,237,0.4); }
.shop-item.equipped { border-color: #22c55e; background: rgba(34,197,94,0.08); }

.shop-item-icon { font-size: 28px; margin-bottom: 6px; }
.shop-item-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.shop-item-cost { font-size: 11px; color: #fbbf24; font-weight: 600; }

@keyframes shopShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.shop-item-shake { animation: shopShake 0.4s ease; border-color: #ef4444 !important; }

/* ════════════════════════════════════════════════════════════════
   COSMETIC THEMES
   ════════════════════════════════════════════════════════════════ */
body[data-theme="sunset"] {
  --bg: #1a0a0a;
  --surface: #2a1010;
  --accent: #ea580c;
  --accent2: #f59e0b;
}
body[data-theme="ocean"] {
  --bg: #020c18;
  --surface: #061525;
  --accent: #0284c7;
  --accent2: #06b6d4;
}
body[data-theme="forest"] {
  --bg: #0a1a0a;
  --surface: #102010;
  --accent: #15803d;
  --accent2: #22c55e;
}

/* Colorblind mode: replace green/red reliance */
body.colorblind .wrd-cell.wrd-correct,
body.colorblind .wrd-kb-key.wrd-correct { background: #2563eb; }
body.colorblind .wrd-cell.wrd-present,
body.colorblind .wrd-kb-key.wrd-present { background: #d97706; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .hub-cards { grid-template-columns: 1fr; }
  .conn-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 600px) {
  .hub-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ── Wordle toast notification ──────────────────────────────────── */
.wrd-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 500;
  white-space: nowrap;
}
.wrd-toast.wrd-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
