/* Aftershock Network — Puzzle Pack shared styles
 * Common chrome for the daily-puzzle games (Tango, Mini Sudoku, Zip, Queens).
 * Each game adds its own board rules in its local styles.css. */
:root {
  --bg: #060A05;
  --bg-card: #0B130A;
  --border: #1B2B17;
  --border-bright: #2E4628;
  --text: #F4F0DA;
  --text-muted: #7E8E73;
  --acid: #B8FF40;
  --acid-bright: #D2FF6E;
  --acid-dim: #5BC020;
  --gold: #F4C430;
  --orange: #FF8C42;
  --board-bg: #0B1612;
  --board-grid: #14211A;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(184, 255, 64, 0.08), transparent 45%),
    radial-gradient(ellipse at 110% 110%, rgba(244, 196, 48, 0.05), transparent 45%),
    var(--bg);
  touch-action: pan-x pan-y;
}

.bs-header {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top));
  z-index: 5; pointer-events: none;
}
.bs-header > * { pointer-events: auto; }
.bs-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text); font-size: 14px;
  background: rgba(11, 19, 10, 0.85); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px;
}
.bs-brand img { width: 22px; }
.bs-brand strong { color: var(--acid); font-weight: 800; }
.bs-header-right { display: flex; gap: 6px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(11, 19, 10, 0.85);
  backdrop-filter: blur(8px); color: var(--text-muted); font-size: 16px;
  cursor: pointer; text-decoration: none;
}
.btn-icon:hover { color: var(--text); border-color: var(--border-bright); }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 36px; border-radius: 8px;
  border: 1px solid rgba(184, 255, 64, 0.45);
  background: linear-gradient(135deg, rgba(184,255,64,0.18) 0%, rgba(91,192,32,0.18) 100%);
  color: var(--acid); font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer; transition: all 0.15s;
}
.btn-back:hover { background: linear-gradient(135deg, rgba(184,255,64,0.28) 0%, rgba(91,192,32,0.28) 100%); color: #fff; border-color: rgba(184, 255, 64, 0.7); }
.btn-back .ba-arrow { font-size: 16px; line-height: 1; }
@media (max-width: 540px) { .btn-back { padding: 0 10px; font-size: 12px; } }

.screen { display: none; min-height: 100vh; padding: 80px 20px 40px; align-items: center; justify-content: center; }
.screen.active { display: flex; }

.title-card { max-width: 520px; width: 100%; text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 36px 28px; }
.title-card h1 { font-size: clamp(48px, 9vw, 72px); font-weight: 900; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1; }
.title-card h1 .green { color: var(--acid); }
.title-tag { margin: 0 0 24px; color: var(--text-muted); font-size: 15px; }
.title-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.title-best { font-size: 13px; color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border); }
.title-best span { color: var(--gold); font-weight: 800; }

/* Daily strip on the title card */
.daily-strip {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 12px; margin: 4px 0 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(244,196,48,0.08), rgba(184,255,64,0.08));
  border: 1px solid rgba(244,196,48,0.25);
}
.daily-strip .ds-item { text-align: center; }
.daily-strip .ds-label { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.daily-strip .ds-value { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 20px; font-weight: 700; margin-top: 2px; color: var(--text); }
.daily-strip .ds-value.streak { color: var(--orange); }
.daily-strip .ds-value.done { color: var(--acid); }
.daily-strip .ds-sep { width: 1px; align-self: stretch; background: var(--border); }

.btn { font: inherit; font-weight: 700; font-size: 14px; padding: 11px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: all 0.15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { background: linear-gradient(135deg, #B8FF40 0%, #5BC020 100%); color: #082010; font-weight: 800; box-shadow: 0 4px 16px rgba(184, 255, 64, 0.25); }
.btn-primary:hover { background: linear-gradient(135deg, #D2FF6E 0%, #80E830 100%); }
.btn-primary:disabled { background: #1A2818; color: #4A5848; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: rgba(184, 255, 64, 0.10); color: var(--acid); border-color: rgba(184, 255, 64, 0.35); }
.btn-secondary:hover { background: rgba(184, 255, 64, 0.20); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-bright); }
.hidden { display: none !important; }

.screen-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px 24px; width: 100%; max-width: 540px; position: relative; }
.screen-card.narrow { max-width: 380px; text-align: center; }
.screen-card h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.btn-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.btn-close:hover { color: var(--text); border-color: var(--border-bright); }
.howto-list { margin: 12px 0 16px; padding-left: 18px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.howto-list li { margin-bottom: 8px; }
.howto-list strong { color: var(--text); }
.howto-tip { background: rgba(184, 255, 64, 0.08); border: 1px solid rgba(184, 255, 64, 0.25); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--text-muted); }

/* Game board chrome */
.game-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 560px; gap: 14px; }
.game-status { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; width: 100%; }
.status-cell { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; text-align: center; }
.status-label { font-size: 10px; font-weight: 800; letter-spacing: 0.18em; color: var(--text-muted); text-transform: uppercase; }
.status-value { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }
.status-value.streak { color: var(--orange); }
.status-value.mode-daily { color: var(--gold); font-size: 15px; }
.status-value.mode-practice { color: var(--acid); font-size: 15px; }
.board-wrap { width: 100%; display: flex; justify-content: center; position: relative; }
.board-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6, 11, 8, 0.88); backdrop-filter: blur(4px); border-radius: 12px; z-index: 3; }
.board-overlay[hidden] { display: none; }
.overlay-card { text-align: center; padding: 22px 28px; max-width: 360px; }
.overlay-card h3 { margin: 0 0 8px; font-size: 26px; font-weight: 800; color: var(--acid); letter-spacing: 0.02em; }
.overlay-card p { margin: 0 0 16px; color: var(--text-muted); font-size: 14px; }
.overlay-card .big-time { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 40px; font-weight: 900; color: var(--gold); margin: 4px 0 6px; text-shadow: 0 0 20px rgba(244,196,48,0.4); }
.overlay-card .streak-line { font-size: 14px; color: var(--orange); font-weight: 700; margin-bottom: 14px; }
.overlay-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.game-hint { font-size: 12px; color: var(--text-muted); text-align: center; }
.game-toolbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* HS modal + leaderboard + rate */
.hs-card { padding-top: 28px; text-align: center; }
.hs-trophy { font-size: 44px; margin-bottom: 4px; }
.hs-card h2 { margin-bottom: 6px; }
.hs-sub { margin: 0 0 18px; color: var(--text-muted); font-size: 13px; }
.hs-score-display { background: linear-gradient(135deg, rgba(244,196,48,0.10) 0%, rgba(184,255,64,0.10) 100%); border: 1px solid rgba(244,196,48,0.3); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.hs-score-num { font-size: 36px; font-weight: 900; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--gold); letter-spacing: -0.02em; text-shadow: 0 0 20px rgba(244,196,48,0.4); }
.hs-rank { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.hs-rank.high { color: var(--acid); font-weight: 700; }
.hs-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; text-align: left; }
.hs-form input { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.hs-form input:focus { border-color: var(--acid); }
.hs-disclaimer { margin: 4px 0 8px; font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.hs-status { min-height: 18px; font-size: 12px; margin-bottom: 6px; color: var(--text-muted); text-align: center; }
.hs-status.error { color: var(--orange); }
.hs-status.success { color: var(--acid); }

.lb-card { padding-top: 36px; max-width: 480px; }
.lb-sub { margin: 0 0 16px; color: var(--text-muted); font-size: 13px; }
.lb-list { list-style: none; padding: 0; margin: 0; }
.lb-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.lb-list li.you { background: rgba(184, 255, 64, 0.12); border-color: rgba(184, 255, 64, 0.4); }
.lb-list li.lb-empty { justify-content: center; color: var(--text-muted); font-size: 13px; }
.lb-rank { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--board-grid); font-weight: 800; font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.lb-rank.gold { background: linear-gradient(135deg, #F4C430 0%, #D9A410 100%); color: #2A1F00; box-shadow: 0 0 14px rgba(244,196,48,0.4); }
.lb-rank.silver { background: linear-gradient(135deg, #C0C8C4 0%, #94A097 100%); color: #1A1F1B; }
.lb-rank.bronze { background: linear-gradient(135deg, #C58E5C 0%, #8E6238 100%); color: #1F1208; }
.lb-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 800; font-size: 15px; color: var(--gold); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.rate-card { padding-top: 36px; }
.rate-sub { margin: 4px 0 14px; color: var(--text-muted); font-size: 13px; }
.rate-stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0 16px; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 32px; line-height: 1; color: rgba(244, 196, 48, 0.22); padding: 4px 6px; border-radius: 6px; transition: color 0.12s, transform 0.12s; }
.star-btn:hover { color: rgba(244, 196, 48, 0.65); transform: scale(1.08); }
.star-btn.lit { color: var(--gold); text-shadow: 0 0 14px rgba(244, 196, 48, 0.5); }
.rate-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; text-align: left; }
.rate-form input, .rate-form textarea { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; resize: vertical; outline: none; }
.rate-form input:focus, .rate-form textarea:focus { border-color: var(--acid); }
.rate-status { min-height: 18px; font-size: 12px; margin-bottom: 6px; color: var(--text-muted); text-align: center; }
.rate-status.error { color: var(--orange); }
.rate-status.success { color: var(--acid); }
.rate-signup { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--text-muted); line-height: 1.4; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(184,255,64,0.05); cursor: pointer; user-select: none; text-align: left; }
.rate-signup input[type="checkbox"] { margin-top: 2px; accent-color: var(--acid); }
.rate-signup small { display: block; opacity: 0.75; font-size: 11px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }

/* Social share sheet (injected by puzzle-core) */
.share-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(4, 8, 5, 0.72); backdrop-filter: blur(4px); padding: 20px; }
.share-sheet[hidden] { display: none; }
.share-card { position: relative; width: 100%; max-width: 360px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 26px 22px 20px; text-align: center; }
.share-card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.share-preview { font-size: 13px; color: var(--text-muted); background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 14px; line-height: 1.5; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.share-btn { font: inherit; font-weight: 700; font-size: 14px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; color: var(--text); background: rgba(255,255,255,0.04); transition: all 0.15s; }
.share-btn:hover { border-color: var(--border-bright); }
.share-btn.x { background: #0b0b0b; border-color: #333; color: #fff; }
.share-btn.fb { background: #1877F2; border-color: #1877F2; color: #fff; }
.share-btn.copy { background: rgba(184,255,64,0.10); border-color: rgba(184,255,64,0.35); color: var(--acid); }
.share-btn.native { background: rgba(244,196,48,0.12); border-color: rgba(244,196,48,0.35); color: var(--gold); }
.share-note { font-size: 11px; color: var(--text-muted); min-height: 16px; }
.share-note.ok { color: var(--acid); }
