:root {
  --bg-app: #f1f5f9;
  --surface: #ffffff;
  --surface-sub: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #4f46e5;
  --accent-light: #e0e7ff;
  --accent-dark: #3730a3;
  --cell-bg: #ffffff;
  --cell-given: #f1f5f9;
  --cell-selected: #c7d2fe;
  --cell-highlight: #f0f3ff;
  --cell-same: #ddd6fe;
  --cell-border: #cbd5e1;
  --grid-border: #475569;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --radius-xl: 32px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.hidden { display: none !important; }

[data-theme="dark"] {
  --bg-app: #0b0f19;
  --surface: #151e2e;
  --surface-sub: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #6366f1;
  --accent-light: #2e2a72;
  --accent-dark: #818cf8;
  --cell-bg: #1e293b;
  --cell-given: #0f172a;
  --cell-selected: #4338ca;
  --cell-highlight: #1e2044;
  --cell-same: #312e81;
  --cell-border: #334155;
  --grid-border: #94a3b8;
}

[data-theme="neon"] {
  --bg-app: #03030c;
  --surface: #0a0a1f;
  --surface-sub: #141336;
  --text-primary: #00ffcc;
  --text-secondary: #ff007f;
  --accent: #ff007f;
  --accent-light: #2a0835;
  --accent-dark: #00ffcc;
  --cell-bg: #0d0d2b;
  --cell-given: #151442;
  --cell-selected: #ff007f55;
  --cell-highlight: #00ffcc15;
  --cell-same: #ff007f22;
  --cell-border: #222159;
  --grid-border: #00ffcc;
}

[data-theme="paper"] {
  --bg-app: #f4ebd9;
  --surface: #fdfbf7;
  --surface-sub: #e8dfcb;
  --text-primary: #4a3e3d;
  --text-secondary: #8c7a6b;
  --accent: #b85b32;
  --accent-light: #f3e5d8;
  --accent-dark: #8c3a18;
  --cell-bg: #fffdf9;
  --cell-given: #eee5d3;
  --cell-selected: #e2c2a4;
  --cell-highlight: #f7eedf;
  --cell-same: #d9bca3;
  --cell-border: #d1c2a5;
  --grid-border: #8c7a6b;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

body {
  margin: 0; padding: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; justify-content: center; align-items: center;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-app); color: var(--text-primary);
}

.app-viewport {
  width: 100%; max-width: 420px; height: 100vh; height: 100dvh; max-height: 880px;
  background: var(--surface); display: flex; flex-direction: column;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}

@media (min-height: 720px) and (min-width: 440px) {
  .app-viewport { border-radius: var(--radius-xl); height: 95vh; border: 1px solid var(--cell-border); }
}

.top-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.account-shortcut { color: white; background: linear-gradient(145deg,#0891b2,#4f46e5); box-shadow: 0 5px 14px rgba(79,70,229,.22); }
.account-shortcut.is-connected { background: linear-gradient(145deg,#059669,#0d9488); }

.resource-pill {
  background: var(--surface-sub); padding: 8px 14px; border-radius: 30px;
  font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--cell-border);
}

.screen { display: none; flex-direction: column; height: 100%; justify-content: space-between; overflow-y: auto; }
.screen.active { display: flex; }

.menu-header { text-align: center; margin-bottom: 12px; }
.brand-tag { font-size: 0.75rem; font-weight: 800; letter-spacing: 2.5px; color: var(--accent); text-transform: uppercase; }
.app-title { font-size: 2rem; font-weight: 800; margin: 4px 0 0 0; letter-spacing: -0.5px; }

.mode-tabs { display: flex; gap: 6px; background: var(--surface-sub); padding: 5px; border-radius: var(--radius-lg); }
.tab-btn { flex: 1; min-width: 0; border: none; background: transparent; padding: 10px 4px; font-weight: 700; font-size: 0.72rem; color: var(--text-secondary); border-radius: var(--radius-md); cursor: pointer; }
.tab-btn.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.tab-content { display: none; margin-top: 12px; flex: 1; }
.tab-content.active { display: block; }

.levels-container {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  max-height: 400px; overflow-y: auto; padding: 4px;
}

.level-card {
  background: var(--surface-sub); aspect-ratio: 1; border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; cursor: pointer; position: relative; border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
}

.level-card:active { transform: scale(0.95); }
.level-card.locked { opacity: 0.35; cursor: not-allowed; filter: grayscale(1); }
.level-card.current { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.level-stars { font-size: 0.65rem; margin-top: 2px; }

.daily-card { background: var(--surface-sub); border-radius: var(--radius-lg); padding: 24px; text-align: center; border: 1px solid var(--cell-border); }
.badge { display: inline-block; padding: 6px 14px; border-radius: 20px; font-weight: 800; font-size: 0.8rem; background: var(--cell-border); margin-top: 10px; }
.badge.completed { background: #10b98122; color: #10b981; }

.setting-card { background: var(--surface-sub); padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--cell-border); margin-top: 10px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; }

.header-game { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-pill { background: var(--surface-sub); padding: 10px 16px; border-radius: var(--radius-md); font-weight: 800; font-size: 0.9rem; border: 1px solid var(--cell-border); }

.board-wrapper { display: flex; justify-content: center; align-items: center; margin: 10px 0; }
#board { 
  display: grid; width: 100%; max-width: 360px; aspect-ratio: 1; 
  background: var(--grid-border); border: 3px solid var(--grid-border); 
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
}

.cell { 
  display: flex; justify-content: center; align-items: center; font-weight: 700; 
  background: var(--cell-bg); color: var(--text-primary); cursor: pointer; 
  border: 1px solid var(--cell-border); 
}
.mode-6 .cell { font-size: 1.6rem; }
.mode-9 .cell { font-size: 1.25rem; }

.cell.given { background: var(--cell-given); color: var(--text-secondary); font-weight: 800; }
.cell.selected { background: var(--cell-selected) !important; color: var(--accent-dark); }
.cell.highlighted { background: var(--cell-highlight); }
.cell.same-number { background: var(--cell-same); }
.cell.user-input { color: var(--accent); font-weight: 800; }
.cell.error-val { background: var(--danger-light) !important; color: var(--danger) !important; }

.btn { font-family: inherit; border: none; border-radius: var(--radius-lg); font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .tab-btn:focus-visible, .selector-btn:focus-visible, .btn-num:focus-visible, .cell:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[data-theme-color="emerald"] { --accent: #059669; --accent-light: #d1fae5; --accent-dark: #065f46; }
[data-theme-color="sunset"] { --accent: #ea580c; --accent-light: #ffedd5; --accent-dark: #9a3412; }
[data-theme="dark"][data-theme-color="emerald"] { --accent: #34d399; --accent-light: #064e3b; --accent-dark: #6ee7b7; }
[data-theme="dark"][data-theme-color="sunset"] { --accent: #fb923c; --accent-light: #7c2d12; --accent-dark: #fdba74; }
.btn:disabled, .btn-num:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--accent); color: white; padding: 14px; font-size: 1rem; box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--surface-sub); color: var(--text-primary); padding: 12px; font-size: 0.9rem; border: 1px solid var(--cell-border); }
.btn-icon { background: var(--surface-sub); color: var(--text-primary); width: 44px; height: 44px; border-radius: var(--radius-md); font-size: 1.2rem; border: 1px solid var(--cell-border); }

.action-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-tool { flex: 1; padding: 12px 8px; background: var(--surface-sub); color: var(--text-primary); border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 800; border: 1px solid var(--cell-border); }
.btn-tool.active { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); }

.numpad { display: grid; gap: 8px; }
.numpad.grid-6 { grid-template-columns: repeat(6, 1fr); }
.numpad.grid-9 { grid-template-columns: repeat(9, 1fr); }
.btn-num { aspect-ratio: 1; background: var(--surface-sub); color: var(--text-primary); border-radius: var(--radius-md); font-size: 1.3rem; font-weight: 800; border: 1px solid var(--cell-border); box-shadow: var(--shadow-sm); }
.btn-num.completed { opacity: 0.3; pointer-events: none; }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; padding: 2px; }
.mode-6 .notes-grid { grid-template-rows: repeat(2, 1fr); }
.note-num { display: flex; align-items: center; justify-content: center; font-size: clamp(0.42rem, 1.8vw, 0.62rem); color: var(--text-secondary); }
.setting-label { font-weight: 700; }
.setting-desc { margin-top: 3px; font-size: 0.75rem; color: var(--text-secondary); }
.range-slider { width: 100%; margin-top: 12px; accent-color: var(--accent); }
.setting-row select { padding: 8px; color: var(--text-primary); border: 1px solid var(--cell-border); border-radius: 10px; background: var(--surface); }
.color-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.color-dot.active { border-color: var(--text-primary); }

@media (max-height: 680px) {
  .app-viewport { padding-top: 10px; padding-bottom: 10px; }
  .menu-header { margin-bottom: 6px; }
  .board-wrapper { margin: 4px 0; }
  #board { max-width: min(330px, 50vh); }
}

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

@keyframes popSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); color: #10b981; }
  100% { transform: scale(1); }
}

@keyframes lineComplete {
  0% { background-color: var(--accent); }
  100% { background-color: var(--cell-bg); }
}

.cell-pop { animation: popSuccess 0.3s ease-out; }
.cell-completed-line { animation: lineComplete 0.6s ease-out; }

.pause-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--surface); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 10; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(6px); }
.modal-overlay.hidden { display: none; }
.modal-content { background: var(--surface); color: var(--text-primary); padding: 2rem; border-radius: var(--radius-xl); max-width: 360px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); }
.stars-row { font-size: 2.2rem; margin: 12px 0; }
.stats-container { display: flex; justify-content: space-around; margin: 1rem 0; background: var(--surface-sub); padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--cell-border); }
.stat-box { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); font-weight: 700; }
.stat-value { font-size: 1.2rem; font-weight: 800; }
.selector-group { background: var(--surface-sub); padding: 4px; border-radius: var(--radius-md); display: flex; gap: 4px; border: 1px solid var(--cell-border); }
.selector-btn { flex: 1; padding: 10px; border: none; background: transparent; font-weight: 700; color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-md); }
.selector-btn.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.section-label { font-size: 0.75rem; font-weight: 800; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 1px; }

/* Nueva dirección visual: calma, contraste y jerarquía para juego móvil. */
body { background: radial-gradient(circle at 50% 0%, var(--accent-light), var(--bg-app) 42%); }
.app-viewport { background: color-mix(in srgb, var(--surface) 94%, transparent); }
.top-bar { justify-content: flex-end; }
.top-bar .resource-pill:first-child { margin-right: auto; }
.top-bar .resource-pill { padding-inline: 10px; }
.gem-pill { color: #2563eb; }
.streak-pill { gap: 4px; }
.streak-pill strong { color: var(--text-primary); }
.resource-pill { box-shadow: none; background: color-mix(in srgb, var(--surface-sub) 88%, transparent); }
.screen { scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
#screen-menu { justify-content: flex-start; overflow: hidden; }
#screen-menu > .home-heading, #screen-menu > .continue-card, #screen-menu > .daily-shortcut, #screen-menu > .section-heading, #screen-menu > .mode-tabs { flex: 0 0 auto; }
#screen-menu > .tab-content.active { min-height: 0; overflow: hidden; }
#tab-levels.active { display: flex; }
#tab-levels .levels-container { flex: 1; max-height: none; }
.hidden-card { display: none; }
.new-game-cta { width: 100%; margin-top: 14px; padding: 17px 18px; justify-content: space-between; text-align: left; color: white; background: linear-gradient(135deg, #111827, #293249); box-shadow: var(--shadow-md); }
.new-game-cta span { display: flex; flex-direction: column; gap: 2px; }
.new-game-cta small { color: #a5b4fc; font-size: .6rem; font-weight: 800; letter-spacing: 1.2px; }
.new-game-cta strong { font-size: 1.05rem; }
.new-game-cta b { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 1.35rem; }
.ad-banner-slot { min-height: 52px; margin-top: auto; padding: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); border: 1px dashed var(--cell-border); border-radius: 14px; background: color-mix(in srgb, var(--surface-sub) 65%, transparent); }
.ad-banner-slot span { font-size: .54rem; font-weight: 800; letter-spacing: 1.4px; }
.ad-banner-slot small { margin-top: 2px; font-size: .58rem; opacity: .65; }
.ad-banner-slot.ads-hidden { display: none; }

.screen-titlebar { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.screen-titlebar h2 { margin: 1px 0 0; font-size: 1.25rem; }
.titlebar-spacer { width: 44px; margin-left: auto; }
#screen-shop .screen-titlebar, #screen-settings .screen-titlebar { flex: 0 0 auto; }
#screen-shop .screen-titlebar .shop-wallet { margin-left: auto; }
.new-game-intro { display: flex; align-items: center; gap: 12px; padding: 15px; margin-bottom: 13px; border-radius: 19px; background: var(--accent-light); color: var(--accent-dark); }
.new-game-intro > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: var(--surface); }
.new-game-intro div { display: flex; flex-direction: column; }
.new-game-intro small { margin-top: 2px; color: var(--text-secondary); font-size: .7rem; }
#screen-new-game { justify-content: flex-start; overflow: hidden; }
#screen-new-game > .mode-tabs { flex: 0 0 auto; }
#screen-new-game > .tab-content.active { min-height: 0; overflow-y: auto; }
#screen-new-game #tab-levels.active { display: flex; }

.home-heading { display: flex; align-items: center; justify-content: space-between; text-align: left; margin: 8px 2px 16px; }
.home-heading .app-title { max-width: 270px; font-size: 1.85rem; line-height: 1.05; }
.zen-orb { width: 54px; height: 54px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; color: white; font-weight: 800; font-size: 1.4rem; background: linear-gradient(145deg, var(--accent), var(--accent-dark)); box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 30%, transparent); transform: rotate(8deg); }
.zen-orb span { transform: rotate(-8deg); }
.eyebrow { color: var(--text-secondary); font-size: .65rem; font-weight: 800; letter-spacing: 1.25px; }

.continue-card { position: relative; overflow: hidden; padding: 18px; border-radius: 26px; color: white; background: linear-gradient(135deg, var(--accent-dark), var(--accent) 60%, color-mix(in srgb, var(--accent) 72%, white)); box-shadow: 0 18px 35px color-mix(in srgb, var(--accent) 25%, transparent); }
.continue-card::after { content: ''; position: absolute; width: 180px; height: 180px; right: -80px; top: -90px; border: 30px solid rgba(255,255,255,.07); border-radius: 50%; pointer-events: none; }
.continue-card .eyebrow { color: rgba(255,255,255,.7); }
.continue-card__top, .continue-card__body { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.continue-card__body { margin: 15px 0; }
.continue-card h2 { margin: 0 0 5px; font-size: 1.5rem; }
.continue-card p { margin: 0; color: rgba(255,255,255,.75); font-weight: 600; font-size: .85rem; }
.live-badge { padding: 6px 9px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); border-radius: 99px; font-size: .66rem; font-weight: 800; }
.mini-board { width: 68px; height: 68px; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 14px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); }
.mini-board span { display: grid; place-items: center; font-size: .62rem; border: 1px solid rgba(255,255,255,.12); }
.btn-hero { width: 100%; padding: 13px; position: relative; z-index: 1; color: var(--accent-dark); background: white; border-radius: 15px; }

.daily-shortcut { width: 100%; margin: 12px 0 16px; padding: 11px 13px; display: flex; align-items: center; gap: 11px; text-align: left; color: var(--text-primary); font-family: inherit; background: var(--surface-sub); border: 1px solid var(--cell-border); border-radius: 18px; cursor: pointer; }
.daily-shortcut__icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); background: var(--accent-light); border-radius: 12px; }
.daily-shortcut__copy { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.daily-shortcut__copy strong { font-size: .81rem; }
.daily-shortcut__copy small { color: var(--text-secondary); font-size: .67rem; }
.daily-shortcut__arrow { color: var(--accent); font-size: 1.5rem; }
.daily-shortcut.completed { display: none; }
.section-heading { margin: 0 2px 9px; }
.section-heading h2 { margin: 2px 0 0; font-size: 1.05rem; }
.mode-tabs { border: 1px solid var(--cell-border); }
.levels-container { gap: 9px; }
.level-card { border-radius: 16px; box-shadow: none; }

.premium-card { display: flex; align-items: center; gap: 11px; padding: 15px; color: white; border-radius: 20px; background: linear-gradient(135deg, #151827, #303755); box-shadow: var(--shadow-md); }
.premium-card__icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; color: #fde68a; background: rgba(255,255,255,.1); font-size: 1.5rem; }
.premium-card__copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.premium-card__copy strong { font-size: .88rem; }
.premium-card__copy small { margin-top: 2px; color: #cbd5e1; font-size: .65rem; }
.premium-kicker { color: #fde68a; font-size: .56rem; font-weight: 800; letter-spacing: 1px; }
.premium-price { flex: 0 0 auto; padding: 10px; color: #111827; background: #fde68a; border-radius: 12px; font-size: .78rem; }
.premium-card.purchased { background: linear-gradient(135deg, #064e3b, #059669); }
.shop-wallet { display: flex; gap: 5px; }
.shop-wallet span { padding: 8px 9px; border: 1px solid var(--cell-border); border-radius: 99px; background: var(--surface-sub); font-size: .75rem; }
.shop-product-grid { display: flex; flex-direction: column; gap: 8px; }
.shop-product { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--cell-border); border-radius: 18px; background: var(--surface-sub); }
.shop-product > div { display: flex; flex-direction: column; }
.shop-product strong { font-size: .82rem; }
.shop-product small { margin-top: 2px; color: var(--text-secondary); font-size: .65rem; }
.product-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; font-size: 1.25rem; }
.product-icon.hint { background: #fef3c7; }
.product-icon.shield { background: #dbeafe; }
.product-icon.streak { background: #ffedd5; }
.product-price { padding: 10px; color: white; background: var(--accent); border-radius: 12px; font-size: .7rem; }
.product-price.gem { background: #2563eb; }
.rewarded-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; color: white; border-radius: 18px; background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.rewarded-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.14); }
.rewarded-card > div:nth-child(2) { display: flex; flex-direction: column; }
.rewarded-card strong { font-size: .8rem; }
.rewarded-card small { margin-top: 2px; color: #ddd6fe; font-size: .63rem; }
.rewarded-button { padding: 9px 12px; color: #4c1d95; background: white; border-radius: 11px; font-size: .72rem; }
.reward-note { margin: 7px 4px 0; color: var(--text-secondary); font-size: .66rem; }

#screen-game { overflow: hidden; }
.header-game { padding-bottom: 4px; }
.game-context { margin-top: 3px; text-align: center; color: var(--text-secondary); font-size: .62rem; font-weight: 700; }
.cell { transition-duration: .12s; }
.cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.btn-tool { min-height: 45px; }

@media (max-height: 780px) {
  .home-heading { margin-bottom: 10px; }
  .continue-card { padding: 14px; min-height: 170px; }
  .continue-card__body { margin: 10px 0; }
  .mini-board { width: 58px; height: 58px; }
  .daily-shortcut { margin: 9px 0 11px; }
}

.progress-link { width: 100%; margin-top: 9px; padding: 11px 13px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; text-align: left; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 17px; background: var(--surface-sub); cursor: pointer; }
.progress-link > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); border-radius: 12px; background: var(--accent-light); font-size: 1.2rem; }
.progress-link div { display: flex; flex-direction: column; }
.progress-link strong { font-size: .8rem; }
.progress-link small { margin-top: 2px; color: var(--text-secondary); font-size: .65rem; }
.progress-link b { color: var(--accent); font-size: 1.4rem; }

#screen-progress { justify-content: flex-start; overflow: hidden; }
.profile-scroll { display: flex; flex-direction: column; gap: 20px; padding-bottom: 20px; overflow-y: auto; scrollbar-width: none; }
.profile-scroll::-webkit-scrollbar { display: none; }
.content-title { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 8px; }
.content-title h3 { margin: 2px 0 0; font-size: 1rem; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 5px; }
.calendar-nav button { width: 28px; height: 28px; color: var(--text-primary); border: 1px solid var(--cell-border); border-radius: 9px; background: var(--surface-sub); cursor: pointer; }
.profile-hero { padding: 18px; color: white; border-radius: 24px; background: linear-gradient(135deg, #111827, #4338ca); box-shadow: var(--shadow-md); }
.profile-level { display: flex; align-items: center; gap: 11px; }
.profile-level > span { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 15px; background: rgba(255,255,255,.12); font-size: 1.3rem; }
.profile-level div { display: flex; flex-direction: column; }
.profile-level small { color: #c7d2fe; font-size: .55rem; font-weight: 800; letter-spacing: 1px; }
.profile-level strong { margin-top: 2px; font-size: 1rem; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 16px; }
.profile-stats div { padding: 9px 3px; display: flex; flex-direction: column; align-items: center; border-radius: 12px; background: rgba(255,255,255,.08); }
.profile-stats strong { font-size: .88rem; }
.profile-stats small { margin-top: 2px; color: #c7d2fe; font-size: .52rem; }
.mission-list { display: flex; flex-direction: column; gap: 7px; }
.mission-card { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--cell-border); border-radius: 16px; background: var(--surface-sub); }
.mission-check { width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-secondary); border-radius: 11px; background: var(--surface); font-weight: 800; }
.mission-card.complete .mission-check { color: #047857; background: #d1fae5; }
.mission-copy { min-width: 0; display: grid; grid-template-columns: 1fr auto; }
.mission-copy strong, .mission-copy small { grid-column: 1 / -1; }
.mission-copy strong { font-size: .75rem; }
.mission-copy small { margin: 1px 0 5px; color: var(--text-secondary); font-size: .6rem; }
.mission-copy em { color: var(--text-secondary); font-size: .56rem; font-style: normal; }
.mission-progress { height: 5px; margin-right: 6px; overflow: hidden; border-radius: 99px; background: var(--cell-border); }
.mission-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.mission-reward { padding: 8px; color: white; border-radius: 10px; background: var(--accent); font-size: .62rem; }
.chest-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chest-card { padding: 12px 5px; display: flex; flex-direction: column; align-items: center; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 16px; background: var(--surface-sub); }
.chest-card span { font-size: 1.3rem; }
.chest-card strong { margin-top: 4px; font-size: .7rem; }
.chest-card small { margin-top: 2px; color: var(--text-secondary); font-size: .6rem; }
.chest-card.ready { border-color: #f59e0b; background: #fffbeb; }
.daily-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.daily-calendar b, .daily-calendar span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: .65rem; }
.daily-calendar b { aspect-ratio: auto; color: var(--text-secondary); font-size: .55rem; }
.daily-calendar span:not(:empty) { background: var(--surface-sub); border: 1px solid var(--cell-border); }
.daily-calendar span.today { border-color: var(--accent); color: var(--accent); font-weight: 800; }
.daily-calendar span.done { color: white; border-color: var(--accent); background: var(--accent); }
.achievement-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.achievement-card { padding: 12px; opacity: .45; border: 1px solid var(--cell-border); border-radius: 15px; background: var(--surface-sub); }
.achievement-card.unlocked { opacity: 1; border-color: color-mix(in srgb, var(--accent) 45%, var(--cell-border)); }
.achievement-icon { font-size: 1.3rem; }
.achievement-info h4 { margin: 6px 0 2px; font-size: .7rem; }
.achievement-info p { margin: 0; color: var(--text-secondary); font-size: .57rem; }
.collection-list { display: flex; flex-direction: column; gap: 12px; }
.collection-group > strong { display: block; margin-bottom: 7px; font-size: .72rem; }
.collection-group > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.collection-item { padding: 10px 4px; display: flex; flex-direction: column; align-items: center; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 14px; background: var(--surface-sub); }
.collection-item.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-light); }
.collection-item span { font-size: 1.25rem; }
.collection-item small { margin-top: 4px; font-weight: 700; font-size: .62rem; }
.collection-item em { margin-top: 3px; color: var(--text-secondary); font-size: .53rem; font-style: normal; }

.action-bar { gap: 5px; }
.btn-tool { min-width: 0; padding: 8px 3px; flex-direction: column; gap: 2px; }
.btn-tool > span { font-size: 1rem; }
.btn-tool small { font-size: .52rem; white-space: nowrap; }
.btn-tool small b { font-size: inherit; }
.game-toast { position: absolute; left: 50%; bottom: 105px; z-index: 2000; padding: 10px 15px; opacity: 0; pointer-events: none; color: white; border-radius: 99px; background: #111827; box-shadow: var(--shadow-md); font-size: .72rem; font-weight: 700; transform: translate(-50%, 12px); transition: .2s ease; }
.game-toast.visible { opacity: 1; transform: translate(-50%, 0); }

[data-board="soft"] #board { --grid-border: #94a3b8; border-color: #94a3b8; box-shadow: 0 12px 30px rgba(99,102,241,.12); }
[data-board="soft"] .cell { border-color: #e2e8f0; }
[data-board="contrast"] #board { --grid-border: #0f172a; border-radius: 8px; }
[data-board="contrast"] .cell { font-weight: 800; }
[data-high-contrast] { --cell-border: #64748b; --grid-border: #0f172a; --text-secondary: #475569; }
[data-theme="dark"][data-high-contrast] { --cell-border: #94a3b8; --grid-border: #f8fafc; --text-secondary: #cbd5e1; }
[data-high-contrast] .cell, [data-high-contrast] .btn, [data-high-contrast] .setting-card { border-width: 2px; }
.victory-burst { position: absolute; inset: 0; z-index: 999; overflow: hidden; pointer-events: none; }
.victory-particle { position: absolute; left: 50%; top: 56%; width: 10px; height: 10px; border-radius: 3px; background: var(--particle-color); animation: localBurst .9s cubic-bezier(.2,.7,.3,1) forwards; transform: translate(-50%,-50%) rotate(var(--angle)); }
@keyframes localBurst { to { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(calc(var(--angle) + 220deg)) scale(.4); } }
.variant-selector { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 15px; }
.variant-card { padding: 10px 3px; display: flex; flex-direction: column; align-items: center; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 13px; background: var(--surface); cursor: pointer; }
.variant-card span { font-size: 1rem; }
.variant-card strong { margin-top: 3px; font-size: .64rem; }
.variant-card small { margin-top: 2px; color: var(--text-secondary); font-size: .52rem; }
.variant-card.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-light); }
.event-game-card { padding: 20px; display: grid; grid-template-columns: 48px 1fr; gap: 13px; color: white; border-radius: 22px; background: linear-gradient(145deg,#581c87,#4f46e5); }
.event-game-card > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: rgba(255,255,255,.13); font-size: 1.4rem; }
.event-game-card small { color: #ddd6fe; font-size: .57rem; font-weight: 800; letter-spacing: 1px; }
.event-game-card h3 { margin: 4px 0; }
.event-game-card p { margin: 0 0 14px; color: #e9d5ff; font-size: .7rem; }
.tutorial-card { width: min(350px,90%); padding: 25px; text-align: center; border-radius: 28px; color: var(--text-primary); background: var(--surface); box-shadow: var(--shadow-lg); }
.tutorial-visual { width: 86px; height: 86px; margin: 0 auto 20px; display: grid; place-items: center; color: white; border-radius: 28px; background: linear-gradient(145deg,var(--accent),var(--accent-dark)); box-shadow: 0 15px 30px color-mix(in srgb,var(--accent) 28%,transparent); font-size: 2rem; font-weight: 800; transform: rotate(4deg); }
.tutorial-card h2 { margin: 8px 0; font-size: 1.35rem; }
.tutorial-card p { min-height: 42px; margin: 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.5; }
.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0; }
.tutorial-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--cell-border); transition: .2s; }
.tutorial-dots i.active { width: 22px; background: var(--accent); }
.tutorial-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
.season-card { padding: 16px; border: 1px solid #fbbf24; border-radius: 21px; background: linear-gradient(145deg,#fffbeb,#fef3c7); color: #422006; }
[data-theme="dark"] .season-card { color: #fef3c7; background: linear-gradient(145deg,#451a03,#78350f); }
.season-top { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; }
.season-top > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: white; background: #d97706; }
.season-top div { display: flex; flex-direction: column; }
.season-top small { font-size: .52rem; font-weight: 800; letter-spacing: .8px; }
.season-top strong { margin-top: 2px; font-size: .9rem; }
.season-top em { font-size: .7rem; font-style: normal; font-weight: 800; }
.season-card > p { margin: 10px 0 8px; font-size: .65rem; }
.season-progress { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(146,64,14,.15); }
.season-progress i { display: block; height: 100%; border-radius: inherit; background: #d97706; }
.season-claim { width: 100%; margin-top: 9px; padding: 8px; color: white; border: 0; border-radius: 10px; background: #d97706; font-size: .65rem; font-weight: 800; }
.season-claim:disabled { opacity: .45; }
.cloud-row { margin-top: 10px; padding-top: 9px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(146,64,14,.15); font-size: .6rem; }
.cloud-row button { padding: 6px 8px; color: inherit; border: 1px solid currentColor; border-radius: 8px; background: transparent; font-size: .58rem; }
.difficulty-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 7px; }
.difficulty-stats span { padding: 7px 4px; display: flex; flex-direction: column; align-items: center; border-radius: 10px; background: rgba(255,255,255,.06); }
.difficulty-stats b { font-size: .58rem; }
.difficulty-stats small { margin-top: 2px; color: #c7d2fe; font-size: .5rem; }
.community-link { width: 100%; padding: 12px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; text-align: left; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 17px; background: var(--surface-sub); }
.community-link > span { width: 38px; height: 38px; display: grid; place-items: center; color: white; border-radius: 13px; background: linear-gradient(145deg,#0891b2,#4f46e5); }
.community-link div { display: flex; flex-direction: column; }
.community-link strong { font-size: .76rem; }
.community-link small { color: var(--text-secondary); font-size: .61rem; }
#screen-community, #screen-editor { justify-content: flex-start; overflow: hidden; }
.community-scroll, .editor-scroll { overflow-y: auto; padding-bottom: 20px; scrollbar-width: none; }
.auth-panel { padding: 22px; text-align: center; border: 1px solid var(--cell-border); border-radius: 24px; background: var(--surface-sub); }
.auth-logo { width: 58px; height: 58px; margin: 0 auto; display: grid; place-items: center; color: white; border-radius: 19px; background: linear-gradient(145deg,var(--accent),var(--accent-dark)); font-size: 1.4rem; }
.auth-panel h3 { margin: 13px 0 5px; }
.auth-panel p { margin: 0 0 15px; color: var(--text-secondary); font-size: .7rem; }
.auth-panel input, .social-form input, .editor-scroll input, .editor-scroll textarea { width: 100%; margin-bottom: 8px; padding: 12px; color: var(--text-primary); font-family: inherit; border: 1px solid var(--cell-border); border-radius: 12px; background: var(--surface); outline: none; }
.auth-panel > div:not(.auth-logo) { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.auth-panel small { display: block; margin-top: 12px; color: var(--text-secondary); font-size: .56rem; }
.auth-panel .google-auth { width: 100%; margin-top: 9px; grid-column: 1 / -1; color: #1f2937; border: 1px solid #d1d5db; background: white; }
.google-auth span { width: 22px; height: 22px; display: inline-grid; place-items: center; margin-right: 7px; color: #4285f4; font-weight: 900; }
.community-user { padding: 13px; display: flex; align-items: center; justify-content: space-between; border-radius: 17px; color: white; background: linear-gradient(145deg,#111827,#4338ca); }
.community-user > div { display: flex; align-items: center; gap: 9px; }
.community-user > div > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); }
.community-user div div { display: flex; flex-direction: column; }
.community-user small { color: #c7d2fe; font-size: .5rem; }
.community-user button { color: white; border: 0; background: transparent; font-size: .65rem; }
.social-tabs { display: flex; gap: 4px; margin: 12px 0; padding: 4px; border-radius: 13px; background: var(--surface-sub); }
.social-tabs button { flex: 1; padding: 8px 2px; color: var(--text-secondary); border: 0; border-radius: 10px; background: transparent; font-size: .62rem; }
.social-tabs button.active { color: var(--text-primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.social-content { min-height: 180px; }
.social-loading, .empty-social { padding: 25px 10px; text-align: center; color: var(--text-secondary); font-size: .68rem; }
.social-form { display: flex; gap: 5px; margin-bottom: 9px; }
.social-form input { margin: 0; min-width: 0; }
.social-form button, .social-row button { padding: 8px; color: white; border: 0; border-radius: 10px; background: var(--accent); font-size: .62rem; }
.social-row { padding: 10px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--cell-border); }
.social-row > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-light); }
.social-row div { display: flex; flex-direction: column; }
.social-row strong { font-size: .72rem; }.social-row small { color: var(--text-secondary); font-size: .56rem; }
.ranking-switch { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .65rem; }
.ranking-switch small { color: var(--text-secondary); }
.ranking-row { padding: 10px; display: grid; grid-template-columns: 30px 1fr auto; border-bottom: 1px solid var(--cell-border); font-size: .7rem; }
.ranking-row b { color: var(--accent); }.ranking-row strong { font-size: .67rem; }
.league-row { padding: 11px; display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--cell-border); }
.league-row strong { font-size: .72rem; }.league-row span,.league-row small { color: var(--text-secondary); font-size: .57rem; }.league-row small { grid-column: 1 / -1; }
.editor-help { padding: 14px; margin-bottom: 10px; border-radius: 16px; color: var(--accent-dark); background: var(--accent-light); }
.editor-help strong { font-size: .78rem; }.editor-help p { margin: 4px 0 0; font-size: .65rem; }
.editor-scroll textarea { height: 115px; resize: vertical; font-family: ui-monospace, monospace; letter-spacing: 1px; }
.editor-result p { padding: 10px; border-radius: 12px; font-size: .65rem; }.editor-error { color: #991b1b; background: #fee2e2; }.editor-success { color: #065f46; background: #d1fae5; }
.editor-levels article { padding: 10px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--cell-border); }
.editor-levels article > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-sub); }
.editor-levels article div { display: flex; flex-direction: column; }.editor-levels strong { font-size: .72rem; }.editor-levels small { color: var(--text-secondary); font-size: .56rem; }.editor-levels button { padding: 7px 9px; color: white; border: 0; border-radius: 9px; background: var(--accent); font-size: .6rem; }
.consent-card { width: min(360px,92%); padding: 24px; color: var(--text-primary); border-radius: 27px; background: var(--surface); }
.consent-icon { width: 50px; height: 50px; display: grid; place-items: center; color: white; border-radius: 16px; background: var(--accent); font-size: 1.4rem; }
.consent-card h2 { margin: 14px 0 7px; }.consent-card > p { margin: 0 0 14px; color: var(--text-secondary); font-size: .72rem; line-height: 1.45; }
.consent-card label { padding: 10px 0; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--cell-border); font-size: .72rem; }
.consent-card > small { display: block; margin: 10px 0 14px; color: var(--text-secondary); font-size: .58rem; }
.consent-card > .btn { width: 100%; }.legal-links { display: flex; justify-content: center; gap: 14px; margin-top: 12px; }.legal-links a { color: var(--accent); font-size: .62rem; text-decoration: none; }
.legal-page { display: block; padding: 25px; user-select: text; background: var(--bg-app); }
.legal-page main { max-width: 720px; margin: 0 auto; padding: 30px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-md); }
.legal-page h1 { font-size: 1.8rem; }.legal-page h2 { margin-top: 24px; font-size: 1rem; }.legal-page p { color: var(--text-secondary); line-height: 1.65; font-size: .85rem; }.legal-page a { color: var(--accent); }
