/* ── VARIABLES & RESET ─────────────────────────────────────── */
:root {
  --felt: #1b3d2a;
  --felt-light: #234d38;
  --felt-dark: #0f2218;
  --felt-stripe: rgba(255,255,255,0.018);
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --cream: #f5eedc;
  --card-bg: #faf7f0;
  --card-shadow: rgba(0,0,0,0.5);
  --red: #c0392b;
  --black: #1a1a1a;
  --valid-glow: #4ecb71;
  --radius: 7px;
  --cw: 64px;
  --ch: 90px;
  --card-back-url: url('../images/cards/backs/back-default.png');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* ← prevents double-tap zoom */
}

/* ── BODY ──────────────────────────────────────────────────── */
body {
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, var(--felt-stripe) 3px, var(--felt-stripe) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, var(--felt-stripe) 3px, var(--felt-stripe) 4px),
    radial-gradient(ellipse at 15% 15%, rgba(255,255,255,0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(0,0,0,0.25) 0%, transparent 55%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;  /* ← key */
  font-family: 'DM Mono', monospace;
  color: var(--cream);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ── HEADER ────────────────────────────────────────────────── */
/* ── HEADER SHIMMER ANIMATION ──────────────────────────────── */
@keyframes suit-shimmer {
  0%   { color: var(--gold); text-shadow: none; }
  48%  { color: var(--gold); text-shadow: none; }
  50%  { color: #fff8e7; text-shadow: 0 0 12px rgba(255,240,180,0.9), 0 0 24px rgba(201,168,76,0.6); }
  54%  { color: var(--gold-light); text-shadow: 0 0 8px rgba(255,240,180,0.5); }
  58%  { color: var(--gold); text-shadow: none; }
  100% { color: var(--gold); text-shadow: none; }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
header h1::before {
  display: none;
}
.header-suits {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.hs {
  font-size: 0.8rem;
  color: var(--gold);
  animation: suit-shimmer 5s ease-in-out infinite;
}
.hs-h { animation-delay: 0.15s; }
.hs-d { animation-delay: 0.3s;  }
.hs-c { animation-delay: 0.45s; }
.hs-word {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  color: rgba(201,168,76,0.6);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 6px;
}
header .sub {
  font-size: 0.58rem;
  color: rgba(245,238,220,0.35);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── STATUS BAR ────────────────────────────────────────────── */
#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 28px;
  min-height: 28px;
  flex-shrink: 0;
  overflow: hidden;
}
#status-msg {
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  line-height: 1;
  height: 1em;
  display: flex;
  align-items: center;
  letter-spacing: 0.04em;
}
#score-info {
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.1em;
}

/* ── MAIN TABLE GRID ───────────────────────────────────────── */
#table {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  padding: 8px 10px 10px;
  gap: 0;
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
}

/* ── COLUMN A ──────────────────────────────────────────────── */
#col-a {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 12px;
  padding-right: 6px;
  padding-top: 2px;
}
.stack-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  height: calc(var(--ch) + 16px);
  flex-shrink: 0;
}
.stack-num {
  display: none;   /* ← hide the 1/2/3/4 numbers entirely */
}
.stack-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.stack-visual {
  position: relative;
  width: var(--cw);
  height: var(--ch);
  overflow: visible;
}
.stack-cnt {
  font-size: 0.54rem;
  color: rgba(245,238,220,0.35);
  letter-spacing: 0.04em;
  text-align: center;
}
/* ── ANCHOR ABOVE DECK ─────────────────────────────────────── */
.anchor-above-deck {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 4px;
}
.anchor-deck-lbl {
  font-size: 0.54rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#anchor-above-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.0rem;
  color: rgba(255,255,255,0.9);
  line-height: 1;
  text-shadow: 0 1px 8px rgba(201,168,76,0.35);
}

/* ── BOARD ─────────────────────────────────────────────────── */
#board {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
  padding-left: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.board-row-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  height: calc(var(--ch) + 16px);
  flex-shrink: 0;
}
.row-pip {
  display: none;
}
.fan {
  position: relative;
  flex-shrink: 0;
}
.fan-card {
  position: absolute !important;
  top: 0 !important;
  display: grid;
}
.row-count {
  font-size: 0.54rem;
  color: rgba(255,255,255,0.25);
  padding: 6px 0 0 6px;
  align-self: flex-start;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* ── BOTTOM ROW ────────────────────────────────────────────── */
#bottom-row {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-top: 1px solid rgba(255,255,255,0.25);
  margin-top: 4px;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
#hand-area {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}
.hand-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.hand-lbl {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hand-cnt {
  font-size: 0.56rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  text-align: center;
  height: 13px;
  margin-top: 6px;
}
#deck-pile {
  width: var(--cw);
  height: var(--ch);
  overflow: visible;
  position: relative;
  flex-shrink: 0;
}
#waste-fan {
  position: relative;
  height: var(--ch);
  width: 110px;  /* fixed — prevents undo button from shifting */
  flex-shrink: 0;
  overflow: visible;
}
.waste-undo-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  width: 140px; /* fixed width — waste fan + undo never shifts */
}

/* ── CONTROLS ──────────────────────────────────────────────── */
#controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;  /* ← was 5px, tiny tighten */
}
#anchor-badge {
  font-size: 0.52rem;  /* ← slightly smaller */
  padding: 2px 6px;    /* ← less padding */
}
#anchor-badge b {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 400;
}
.btn-row {
  display: flex;
  gap: 7px;
}
.btn {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}
.btn:hover  { background: rgba(201,168,76,0.1); border-color: var(--gold); }
.btn:active { background: rgba(201,168,76,0.2); transform: scale(0.97); }
.btn.primary { background: rgba(201,168,76,0.15); border-color: var(--gold); }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  width: var(--cw);
  height: var(--ch);
  border-radius: var(--radius);
  background: transparent;
  border: none;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.5);
  position: relative;
  overflow: visible;
  padding: 0;
  display: block;
}
.card img {
  width: 108%;
  height: 108%;
  display: block;
  margin: -4% 0 0 -4%;
  border-radius: var(--radius);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}
.card.tappable { cursor: pointer; }
.card.tappable:active { transform: scale(0.95) !important; }
.card.valid-target {
  /* Green Glow */
  box-shadow: 2px 4px 12px rgba(0,0,0,0.5), 0 0 0 2px rgba(78,203,113,0.85), 0 0 14px 6px rgba(78,203,113,0.95);
  /* Gold Glow */
  /* box-shadow: 2px 4px 12px rgba(0,0,0,0.5), 0 0 10px 3px rgba(201,168,76,0.8); */
  /* White glow */
  /* box-shadow: 2px 4px 12px rgba(0,0,0,0.5), 0 0 10px 3px rgba(255,255,255,0.6); */
}

/* pip styles removed — using SVG card faces */
.pip-top, .pip-bot, .pip-r, .pip-s, .card-mid { display: none; }
.red { color: var(--red); }
.blk { color: var(--black); }

/* ── CARD BACK ─────────────────────────────────────────────── */
.card-back {
  width: calc(var(--cw) * 1.08);
  height: calc(var(--ch) * 1.08);
  margin: -4% 0 0 -4%;
  border-radius: var(--radius);
  background: #121216 var(--card-back-url) center/cover no-repeat;
  border: none;
  box-shadow: 2px 4px 12px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.card-back:active { transform: scale(0.95); }
.card-back::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

/* ── EMPTY SLOT ────────────────────────────────────────────── */
.empty-slot {
  width: var(--cw);
  height: var(--ch);
  border-radius: var(--radius);
  border: 1px dashed rgba(201,168,76,0.18);
  background: rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* ── MODALS ────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
#modal-overlay.show { display: flex; }
#modal {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
#modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 12px;
}
#modal p {
  font-size: 0.88rem;
  color: rgba(245,238,220,0.7);
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ── RULES PANEL ───────────────────────────────────────────── */
#rules-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#rules-panel.show { display: flex; }
#rules-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 32px 28px;
  max-width: 420px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
#rules-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 14px;
}
#rules-content h4 {
  color: var(--gold-light);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 16px 0 6px;
}
#rules-content p {
  font-size: 0.85rem;
  color: rgba(245,238,220,0.72);
  line-height: 1.68;
  margin-bottom: 5px;
}
.rule-eg {
  background: rgba(201,168,76,0.07);
  border-left: 2px solid rgba(201,168,76,0.45);
  padding: 8px 12px;
  border-radius: 0 5px 5px 0;
  font-size: 0.68rem;
  color: rgba(245,238,220,0.55);
  margin: 7px 0;
  font-style: italic;
  line-height: 1.6;
}

/* ── SCORING PANEL ─────────────────────────────────────────── */
#scoring-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#scoring-panel.show { display: flex; }
#scoring-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 32px 28px;
  max-width: 420px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
#scoring-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 14px;
}
#scoring-content h4 {
  color: var(--gold-light);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 16px 0 6px;
}
#scoring-content p {
  font-size: 0.85rem;
  color: rgba(245,238,220,0.72);
  line-height: 1.68;
  margin-bottom: 5px;
}

/* ── WIN CONFETTI ──────────────────────────────────────────── */
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) rotate(35deg) scale(1.5); }
}
.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 300;
  animation: floatUp 1.4s ease-out forwards;
  font-size: 1.8rem;
}

/* ── AD BANNER ─────────────────────────────────────────────────── */
#ad-banner {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 50px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(201,168,76,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ad-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px;
}
.ad-label {
  font-size: 0.55rem;
  color: rgba(245,238,220,0.25);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ad-remove {
  font-size: 0.58rem;
  color: rgba(201,168,76,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ad-remove:hover { color: var(--gold); }

/* Hide remove-ads button in modal if user already purchased */
body.no-ads #remove-ads-btn,
body.no-ads #burger-remove-ads-btn { display: none; }

/* ── SHARE BUTTON ──────────────────────────────────────────────── */
.es-share-btn-style {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.5);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.14s;
}
.es-share-btn-style:hover  { background: rgba(201,168,76,0.16); border-color: var(--gold); }
.es-share-btn-style:active { background: rgba(201,168,76,0.24); transform: scale(0.97); }
.es-share-btn-style:disabled { opacity: 0.7; cursor: default; transform: none; }

/* ── UNDO CIRCLE BUTTON ────────────────────────────────────── */
.undo-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.35);
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.14s;
  flex-shrink: 0;
  position: absolute;
  right: 16px;
  bottom: 30px;
}
.undo-btn:hover  { background: rgba(201,168,76,0.1); border-color: var(--gold); }
.undo-btn:active { background: rgba(201,168,76,0.2); transform: scale(0.94) rotate(-20deg); }
.undo-btn svg {
  width: 22px;
  height: 22px;
  color: rgba(255,255,255,0.85);
}
.undo-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-bottom: 13px;
  padding-right: 4px;
}
.undo-group .undo-btn {
  position: static;
}
.undo-group .hand-lbl {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.55);
}
/* ── FOOTER  ─────────────────────────────────────────────────── */
/* footer removed — privacy and branding moved to header and burger menu */

/* ── HEADER BRAND LINE ─────────────────────────────────────────── */
.header-brand {
  font-size: 0.42rem;
  color: rgba(245,238,220,0.2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  margin-top: 1px;
}

/* ── STATS  ─────────────────────────────────────────────────── */
#stats-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#stats-panel.show { display: flex; }
#stats-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  text-align: center;
}
#stats-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 24px;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-block {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 10px;
  padding: 20px 8px;
}
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-lbl {
  font-size: 0.68rem;
  color: rgba(245,238,220,0.5);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* ── PRIVACY PANEL ─────────────────────────────────────────────── */
#privacy-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#privacy-panel.show { display: flex; }
#privacy-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 32px 28px;
  max-width: 420px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
#privacy-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 6px;
  text-align: center;
}
.privacy-effective {
  font-size: 0.68rem;
  color: rgba(245,238,220,0.35);
  font-style: italic;
  text-align: center;
  margin-bottom: 20px;
}
#privacy-content h4 {
  color: var(--gold-light);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 18px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}
#privacy-content p {
  font-size: 0.8rem;
  color: rgba(245,238,220,0.72);
  line-height: 1.65;
  margin-bottom: 6px;
}
#privacy-content a {
  color: var(--gold);
  text-underline-offset: 3px;
}

/* ── SPLASH SCREEN ─────────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--felt-dark);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.012) 3px, rgba(255,255,255,0.012) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.012) 3px, rgba(255,255,255,0.012) 4px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
#splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
#splash-screen.hidden {
  display: none;
}
#splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

/* Company logo */
#splash-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  margin: 0 auto;
}

/* Four suits orbiting in a circle */
#splash-suits {
  width: 160px;
  height: 160px;
  margin: 0 auto 4px auto;
  position: relative;
}
.splash-suit {
  position: absolute;
  font-size: 1.9rem;
  line-height: 1;
  top: calc(50% - 1rem);
  left: calc(50% - 0.6rem);
}
.s-spade   { color: rgba(245,238,220,0.9); animation: orbitSpade   3s linear infinite; }
.s-heart   { color: var(--red);            animation: orbitHeart   3s linear infinite; }
.s-diamond { color: var(--red);            animation: orbitDiamond 3s linear infinite; }
.s-club    { color: rgba(245,238,220,0.9); animation: orbitClub    3s linear infinite; }

@keyframes orbitSpade {
  0%   { transform: translate(0px,   -52px); opacity: 1;   font-size: 2.2rem; }
  25%  { transform: translate(52px,    0px); opacity: 0.4; font-size: 1.6rem; }
  50%  { transform: translate(0px,   52px);  opacity: 1;   font-size: 2.2rem; }
  75%  { transform: translate(-52px,   0px); opacity: 0.4; font-size: 1.6rem; }
  100% { transform: translate(0px,   -52px); opacity: 1;   font-size: 2.2rem; }
}
@keyframes orbitHeart {
  0%   { transform: translate(52px,    0px); opacity: 0.4; font-size: 1.6rem; }
  25%  { transform: translate(0px,   52px);  opacity: 1;   font-size: 2.2rem; }
  50%  { transform: translate(-52px,   0px); opacity: 0.4; font-size: 1.6rem; }
  75%  { transform: translate(0px,   -52px); opacity: 1;   font-size: 2.2rem; }
  100% { transform: translate(52px,    0px); opacity: 0.4; font-size: 1.6rem; }
}
@keyframes orbitDiamond {
  0%   { transform: translate(0px,   52px);  opacity: 1;   font-size: 2.2rem; }
  25%  { transform: translate(-52px,   0px); opacity: 0.4; font-size: 1.6rem; }
  50%  { transform: translate(0px,   -52px); opacity: 1;   font-size: 2.2rem; }
  75%  { transform: translate(52px,    0px); opacity: 0.4; font-size: 1.6rem; }
  100% { transform: translate(0px,   52px);  opacity: 1;   font-size: 2.2rem; }
}
@keyframes orbitClub {
  0%   { transform: translate(-52px,   0px); opacity: 0.4; font-size: 1.6rem; }
  25%  { transform: translate(0px,   -52px); opacity: 1;   font-size: 2.2rem; }
  50%  { transform: translate(52px,    0px); opacity: 0.4; font-size: 1.6rem; }
  75%  { transform: translate(0px,   52px);  opacity: 1;   font-size: 2.2rem; }
  100% { transform: translate(-52px,   0px); opacity: 0.4; font-size: 1.6rem; }
}

#splash-title {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-shadow: 0 2px 16px rgba(201,168,76,0.4);
  line-height: 1;
}
#splash-sub {
  font-size: 0.85rem;
  color: rgba(245,238,220,0.55);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
#splash-version {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: rgba(201,168,76,0.45);
  letter-spacing: 0.18em;
  margin-top: 2px;
}
#splash-loader {
  width: 160px;
  height: 2px;
  background: rgba(201,168,76,0.15);
  border-radius: 2px;
  margin-top: 20px;
  overflow: hidden;
}
#splash-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  animation: splashLoad 1.6s ease-out forwards;
}
@keyframes splashLoad {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}

/* Company line pinned to bottom of splash */
#splash-company {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.6rem;
  color: rgba(245,238,220,0.22);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
}

/* ── WELCOME MODAL ─────────────────────────────────────────────── */
/* ── STORY MODAL ───────────────────────────────────────────────── */
#story-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#story-overlay.show { display: flex; }
#story-modal {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
#story-modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 20px;
}
#story-modal p {
  font-family: 'Playfair Display', serif;
  font-size: 0.88rem;
  color: rgba(245,238,220,0.78);
  line-height: 1.85;
  margin-bottom: 16px;
  text-align: left;
}
.story-intro, .story-outro {
  text-align: center !important;
  color: rgba(245,238,220,0.55) !important;
  font-size: 0.82rem !important;
}

/* ── WELCOME MODAL ─────────────────────────────────────────────── */
#welcome-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 150;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#welcome-overlay.show { display: flex; }
#welcome-modal {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
#welcome-modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  color: var(--gold);
  margin-bottom: 14px;
  line-height: 1.3;
}
#welcome-modal p {
  font-size: 0.88rem;
  color: rgba(245,238,220,0.7);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* ── DEAL ANIMATION ────────────────────────────────────────────── */
@keyframes dealIn {
  0%   { transform: scale(0.6) translateY(-20px); opacity: 0; }
  60%  { transform: scale(1.05) translateY(2px);  opacity: 1; }
  100% { transform: scale(1) translateY(0);        opacity: 1; }
}
.deal-in {
  animation: dealIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── CARD FLYING ANIMATION ─────────────────────────────────────── */
.card-flying {
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid rgba(200,190,170,0.6);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 3px 4px;
  overflow: hidden;
}

/* ── CARD FLIP ANIMATION ───────────────────────────────────────── */
@keyframes cardFlipOut {
  0%   { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
@keyframes cardFlipIn {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
.card-flipping {
  animation: cardFlipOut 0.175s ease-in forwards;
  transform-origin: center;
}
.card-flipping-in {
  animation: cardFlipIn 0.175s ease-out forwards;
  transform-origin: center;
}

/* ── ICON BUTTON (gear) ────────────────────────────────────────── */
.icon-btn {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn svg { display: block; }

/* ── OPTIONS PANEL ─────────────────────────────────────────────── */
#options-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#options-panel.show { display: flex; }
#options-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 32px 28px;
  max-width: 420px;
  width: 92%;
}
#options-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 22px;
  text-align: center;
}
.opt-section-lbl {
  font-size: 0.6rem;
  color: rgba(201,168,76,0.5);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 4px 0 10px;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.opt-radio-row { cursor: pointer; }
.opt-info { flex: 1; }
.opt-label {
  font-size: 0.78rem;
  color: var(--cream);
  margin-bottom: 2px;
}
.opt-desc {
  font-size: 0.6rem;
  color: rgba(245,238,220,0.38);
  letter-spacing: 0.04em;
}
.opt-divider {
  height: 1px;
  background: rgba(201,168,76,0.1);
  margin: 14px 0 12px;
}

/* Toggle switch */
.toggle { position: relative; flex-shrink: 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  display: block;
  width: 42px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.toggle input:checked + .toggle-track {
  background: rgba(201,168,76,0.25);
  border-color: var(--gold);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(245,238,220,0.4);
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: var(--gold);
}

/* Radio button */
.radio-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.radio-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(201,168,76,0.3);
  background: rgba(255,255,255,0.05);
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.radio-wrap input:checked + .radio-dot {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
}
.radio-wrap input:checked + .radio-dot::after { transform: translate(-50%, -50%) scale(1); }

/* ── CONFIRM MODAL ─────────────────────────────────────────────── */
#confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#confirm-overlay.show { display: flex; }
#confirm-modal {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
#confirm-modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--gold);
  margin-bottom: 12px;
}
#confirm-modal p {
  font-size: 0.88rem;
  color: rgba(245,238,220,0.6);
  margin-bottom: 24px;
}

/* ── HEADER RIGHT ──────────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── BURGER BUTTON ─────────────────────────────────────────── */
.burger-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.14s;
}
.burger-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.14s;
}
.burger-btn:hover  { background: rgba(201,168,76,0.1); border-color: var(--gold); }
.burger-btn:active { background: rgba(201,168,76,0.2); transform: scale(0.95); }

/* ── BURGER MENU DROPDOWN ──────────────────────────────────── */
#burger-menu {
  position: fixed;
  top: 58px;
  right: 12px;
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 10px;
  padding: 6px 0;
  z-index: 400;
  min-width: 160px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
#burger-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.burger-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 18px;
  cursor: pointer;
  transition: background 0.12s;
}
.burger-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.75;
}
.burger-item:hover svg { opacity: 1; }
.burger-item:hover  { background: rgba(201,168,76,0.1); color: var(--gold); }
.burger-item:active { background: rgba(201,168,76,0.18); }
.burger-item-primary {
  color: var(--gold);
  font-weight: 500;
}
.burger-divider {
  height: 1px;
  background: rgba(201,168,76,0.1);
  margin: 3px 12px;
}
#burger-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 399;
}
#burger-backdrop.show { display: block; }

/* Card sizing handled dynamically by fitCards() in game.js */

/* ── HISTORY PANEL ─────────────────────────────────────────────── */
#history-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#history-panel.show { display: flex; }
#history-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 32px 28px;
  max-width: 420px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
#history-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
}
.version-block { margin-bottom: 28px; }
.version-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.version-num {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 500;
}
.version-tag {
  font-size: 0.58rem;
  color: var(--gold-light);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 4px;
  padding: 2px 7px;
}
.version-date {
  font-size: 0.68rem;
  color: rgba(245,238,220,0.35);
  font-style: italic;
  margin-left: auto;
}
.version-list { margin: 0 0 0 16px; }
.version-list li {
  margin-bottom: 7px;
  color: rgba(245,238,220,0.8);
  font-size: 0.78rem;
  line-height: 1.55;
  font-family: 'DM Mono', monospace;
}
.vtag {
  display: inline-block;
  font-size: 0.55rem;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
  opacity: 0.8;
}
.vtag.improved { color: #7ecfb3; }
.vtag.fixed    { color: #e07070; }
/* ── MODAL BASE (shared by stuck + newgame confirm) ────────────── */
.modal-overlay-base {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay-base.show { display: flex; }
.modal-base {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
.modal-h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.modal-p {
  font-size: 0.88rem;
  color: rgba(245,238,220,0.6);
  margin-bottom: 24px;
  line-height: 1.65;
}

/* ── END SCREEN ────────────────────────────────────────────────── */
#end-screen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#end-screen-overlay.show { display: flex; }

#end-screen-modal {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 16px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 92%;
  text-align: center;
  box-shadow: 0 28px 80px rgba(0,0,0,0.85);
}

/* Grade block */
#es-grade-wrap {
  margin-bottom: 18px;
}
#es-grade-letter {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 30px rgba(201,168,76,0.5);
  margin-bottom: 4px;
}
#es-grade-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: rgba(245,238,220,0.85);
  font-style: italic;
  margin-bottom: 4px;
}
#es-incomplete {
  font-size: 0.62rem;
  color: rgba(245,238,220,0.4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* New best badge */
#es-new-best {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--gold-light);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: newBestPulse 0.6s ease-out;
}
@keyframes newBestPulse {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Score tally */
#es-tally {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(201,168,76,0.1);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 4px;
}
.es-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}
.es-lbl {
  font-size: 0.72rem;
  color: rgba(245,238,220,0.55);
  letter-spacing: 0.06em;
  text-align: left;
}
.es-pts {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: rgba(245,238,220,0.8);
  letter-spacing: 0.04em;
}
.es-bonus {
  color: var(--gold-light);
}
.es-bonus-row .es-lbl {
  color: rgba(245,238,220,0.45);
  font-size: 0.68rem;
}
.es-divider {
  height: 1px;
  background: rgba(201,168,76,0.15);
  margin: 8px 0;
}
.es-total-row .es-lbl {
  font-size: 0.8rem;
  color: rgba(245,238,220,0.8);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#es-total-score {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}
#es-best-score {
  font-size: 0.62rem;
  color: rgba(245,238,220,0.35);
  letter-spacing: 0.12em;
  text-align: right;
  margin-top: 4px;
}

/* Grade pop animation */
@keyframes gradePop {
  0%   { transform: scale(0.5); opacity: 0; }
  65%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.es-grade-pop {
  animation: gradePop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* Bonus pop animation */
@keyframes bonusPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); color: var(--gold); }
  100% { transform: scale(1); }
}
.es-bonus-pop {
  animation: bonusPop 0.4s ease-out forwards;
}
/* ── STATS v2.5 — SECTION LABELS & ACCENT BLOCK ──────────────── */
.stat-section-lbl {
  font-size: 0.58rem;
  color: rgba(201,168,76,0.5);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.stat-accent-block {
  background: linear-gradient(135deg, rgba(201,168,76,0.12) 0%, rgba(201,168,76,0.04) 100%);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: 10px;
  padding: 18px 8px 14px;
  text-align: center;
  margin: 12px 0 0;
}
.stat-accent-num {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 0 24px rgba(201,168,76,0.3);
}
.stat-accent-lbl {
  font-size: 0.62rem;
  color: rgba(245,238,220,0.45);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.stat-grid-3 {
  grid-template-columns: 1fr 1fr 1fr !important;
}
.stat-num-sm {
  font-size: clamp(1.1rem, 4vw, 1.8rem) !important;
}

/* ── CALENDAR PANEL ───────────────────────────────────────────── */
#calendar-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#calendar-panel.show { display: flex; }
#calendar-content {
  background: var(--felt-dark);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 14px;
  padding: 28px 22px 24px;
  max-width: 380px;
  width: 92%;
}
#calendar-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 14px;
  text-align: center;
}

/* Month navigation bar */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.cal-nav-btn {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.14s, opacity 0.14s;
}
.cal-nav-btn:hover  { background: rgba(201,168,76,0.12); }
.cal-nav-btn:active { background: rgba(201,168,76,0.22); }
.cal-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: rgba(245,238,220,0.9);
  text-align: center;
  flex: 1;
  letter-spacing: 0.04em;
}

/* Swipe viewport — clips the sliding track */
.cal-viewport {
  overflow: hidden;
  width: 100%;
  touch-action: pan-y; /* allow vertical scroll, capture horizontal */
}

/* Track holds all month slides side by side */
.cal-track {
  display: flex;
  width: 100%;
  will-change: transform;
}

/* Each month is exactly one viewport wide */
.cal-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}

/* 7-column grid shared by header row and day rows */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.cal-dow {
  font-size: 0.5rem;
  color: rgba(201,168,76,0.4);
  letter-spacing: 0.1em;
  text-align: center;
  padding-bottom: 5px;
  text-transform: uppercase;
}
.cal-blank { display: block; } /* alignment spacer */
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border-radius: 5px;
}
.cal-today {
  background: rgba(201,168,76,0.08);
  outline: 1px solid rgba(201,168,76,0.28);
}
.cal-day-num {
  font-size: 0.58rem;
  color: rgba(245,238,220,0.55);
  line-height: 1;
}
.cal-today .cal-day-num { color: rgba(201,168,76,0.9); }
.cal-future .cal-day-num { color: rgba(245,238,220,0.18); }
.cal-future { opacity: 0.5; }

/* Dots */
.cal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-dot-empty  { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); }
.cal-dot-played { background: rgba(201,168,76,0.78); box-shadow: 0 0 5px rgba(201,168,76,0.35); }
.cal-dot-win    { background: rgba(78,203,113,0.88); box-shadow: 0 0 6px rgba(78,203,113,0.45); }

/* Legend */
.cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px 0 4px;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6rem;
  color: rgba(245,238,220,0.45);
}

/* Subtitle (days played / won this month) */
.cal-subtitle {
  font-size: 0.6rem;
  color: rgba(245,238,220,0.3);
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 14px;
  min-height: 1em;
}
/* ── WELCOME BACK — dynamic title styles ──────────────────────── */
.welcome-game-name {
  font-size: 1.1em;
  color: var(--gold);
}
.welcome-tagline {
  font-family: 'DM Mono', monospace;
  font-size: 0.38em;
  color: rgba(245,238,220,0.4);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 400;
  display: block;
  margin-top: 2px;
}
#welcome-sub strong {
  color: var(--gold-light);
}
/* ── SKIN PICKERS (theme + card back) — v2.6 ──────────────────── */
.opt-skin-section {
  margin-top: 4px;
}
.skin-scroll {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.skin-scroll::-webkit-scrollbar { display: none; }

/* ── Theme swatch item ─────────────────────────────────────────── */
.skin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  width: 72px;
  position: relative;
  transition: transform 0.14s;
}
.skin-item:active { transform: scale(0.95); }
.skin-item.selected .theme-swatch,
.skin-item.selected .back-thumb {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.skin-item.locked { opacity: 0.55; }

.theme-swatch {
  width: 62px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Card back thumbnail ───────────────────────────────────────── */
.back-thumb {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #121216;
}
.back-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.back-thumb-locked {
  background: rgba(0,0,0,0.4);
}

/* ── Shared label + badges ─────────────────────────────────────── */
.skin-label {
  font-size: 0.52rem;
  color: rgba(245,238,220,0.55);
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.3;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skin-check {
  position: absolute;
  top: -4px;
  right: 2px;
  font-size: 0.7rem;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(201,168,76,0.8);
}
.skin-badge-locked {
  font-size: 0.48rem;
  color: rgba(201,168,76,0.55);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 3px;
  padding: 1px 4px;
}
.lock-icon {
  font-size: 1rem;
  opacity: 0.5;
}

/* Options panel needs to scroll on small screens with pickers */
#options-content {
  max-height: 88vh;
  overflow-y: auto;
}