/* =========================================================
   Bingo With Friends — 2027 Tactile Multi-Theme Stylesheet
   Themes: crimson (Gala) | editorial (Linen) | midnight (Velvet) | deco (Art Deco NYE)
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Default fallback tokens (Crimson Gala) */
  --bg-page: #24070d;
  --bg-grad: radial-gradient(ellipse 60% 60% at 62% 38%, rgba(168, 98, 48, 0.34) 0%, rgba(78, 16, 28, 0.55) 42%, rgba(28, 4, 9, 0.98) 100%), linear-gradient(155deg, #2d0911 0%, #1e050a 52%, #130306 100%);
  --bg-section: rgba(16, 3, 6, 0.44);
  --ink: #fbf4e8;
  --ink-muted: #e0ccb8;
  --ink-year: #dfc084;
  --accent: #caa45d;
  --accent-strong: #e3c485;
  --accent-ink: #1f1305;
  --header-link: #efe1ce;
  --nav-btn-bg: #f6f0e4;
  --nav-btn-ink: #250b10;
  --nav-btn-border: rgba(212, 180, 114, 0.55);

  --panel-bg: #f6f1e6;
  --panel-ink: #231214;
  --panel-muted: #5c4641;
  --panel-border: #c5a463;
  --input-bg: #fbf8f1;
  --input-border: #cbbca3;
  --input-ink: #211214;
  --input-placeholder: #6a564f;

  --card-surface: rgba(246, 241, 230, 0.06);
  --card-surface-border: rgba(214, 180, 114, 0.24);
  --prose-bg: rgba(246, 241, 230, 0.05);
  --modal-bg: #f8f3e9;
  --modal-ink: #231214;
  --modal-muted: #59443e;
  --modal-border: #cbb382;

  --btn-bg: linear-gradient(180deg, #dfbf7e 0%, #c19b53 58%, #ad8742 100%);
  --btn-ink: #1e1205;
  --btn-border: rgba(247, 229, 184, 0.72);
  --btn-shadow: 0 8px 22px rgba(15, 4, 6, 0.34), inset 0 1px 0 rgba(255, 247, 224, 0.65);

  --brand-dot: #c9a258;
  --radius-xl: 20px;
  --radius-pill: 999px;
}

/* ---------- Theme 1: Editorial Linen & Wax Seal ---------- */
html[data-theme="editorial"] {
  --bg-page: #ede6da;
  --bg-grad: linear-gradient(142deg, #f3ede2 0%, #eae1d2 56%, #dfd5c4 100%);
  --bg-section: rgba(255, 252, 246, 0.55);
  --ink: #1f1a16;
  --ink-muted: #4b4238;
  --ink-year: #1f1a16;
  --accent: #9b1d2c;
  --accent-strong: #841623;
  --accent-ink: #ffffff;
  --header-link: #2b241d;
  --nav-btn-bg: #faf7f1;
  --nav-btn-ink: #221c16;
  --nav-btn-border: rgba(70, 56, 40, 0.16);

  --panel-bg: #f8f4ec;
  --panel-ink: #1f1a16;
  --panel-muted: #52473b;
  --panel-border: rgba(75, 60, 44, 0.12);
  --input-bg: #f0ebe1;
  --input-border: #cfc5b4;
  --input-ink: #1f1a16;
  --input-placeholder: #5c5145;

  --card-surface: rgba(255, 252, 247, 0.84);
  --card-surface-border: rgba(82, 68, 52, 0.14);
  --prose-bg: rgba(255, 252, 247, 0.72);
  --modal-bg: #faf6ee;
  --modal-ink: #1f1a16;
  --modal-muted: #51463b;
  --modal-border: #d8cebd;

  --btn-bg: linear-gradient(180deg, #b12233 0%, #961a29 100%);
  --btn-ink: #ffffff;
  --btn-border: rgba(255, 210, 210, 0.25);
  --btn-shadow: 0 8px 20px rgba(130, 22, 36, 0.28), inset 0 1px 0 rgba(255, 196, 202, 0.35);

  --brand-dot: #9b1d2c;
}

/* ---------- Theme 2: Midnight Velvet & Champagne Gold ---------- */
html[data-theme="midnight"] {
  --bg-page: #0c0d15;
  --bg-grad: radial-gradient(ellipse 56% 56% at 68% 42%, rgba(196, 155, 84, 0.22) 0%, rgba(30, 29, 46, 0.45) 48%, rgba(10, 11, 18, 0.99) 100%), linear-gradient(160deg, #111320 0%, #0b0c14 60%, #07080e 100%);
  --bg-section: rgba(8, 9, 16, 0.55);
  --ink: #faf4e8;
  --ink-muted: #cfc5b4;
  --ink-year: #e5c889;
  --accent: #dfbe78;
  --accent-strong: #eed49b;
  --accent-ink: #141008;
  --header-link: #e4d2ad;
  --nav-btn-bg: rgba(255, 255, 255, 0.09);
  --nav-btn-ink: #f8f0df;
  --nav-btn-border: rgba(226, 196, 134, 0.32);

  --panel-bg: rgba(20, 22, 34, 0.86);
  --panel-ink: #faf4e8;
  --panel-muted: #cec4b2;
  --panel-border: rgba(224, 194, 132, 0.34);
  --input-bg: rgba(11, 13, 22, 0.84);
  --input-border: rgba(224, 194, 132, 0.38);
  --input-ink: #fbf6ec;
  --input-placeholder: #b2a796;

  --card-surface: rgba(22, 25, 38, 0.72);
  --card-surface-border: rgba(224, 194, 132, 0.22);
  --prose-bg: rgba(18, 21, 33, 0.65);
  --modal-bg: #151826;
  --modal-ink: #faf4e8;
  --modal-muted: #ccc2b0;
  --modal-border: rgba(224, 194, 132, 0.35);

  --btn-bg: linear-gradient(95deg, #d7b268 0%, #ebd299 52%, #c99f52 100%);
  --btn-ink: #151107;
  --btn-border: rgba(255, 244, 212, 0.65);
  --btn-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 250, 232, 0.7);

  --brand-dot: #e2c17b;
}

/* ---------- Theme 5: Midnight Fireworks & Art Deco NYE ---------- */
html[data-theme="deco"] {
  --bg-page: #071529;
  --bg-grad: radial-gradient(ellipse 65% 55% at 72% 45%, rgba(28, 62, 112, 0.36) 0%, rgba(7, 21, 41, 0.96) 100%), linear-gradient(155deg, #0b1c36 0%, #071428 60%, #040d1b 100%);
  --bg-section: rgba(4, 13, 27, 0.55);
  --ink: #faf5ea;
  --ink-muted: #d3d7df;
  --ink-year: #d9b96f;
  --accent: #d8b76c;
  --accent-strong: #ebd08f;
  --accent-ink: #081528;
  --header-link: #e5d2a6;
  --nav-btn-bg: rgba(9, 25, 48, 0.65);
  --nav-btn-ink: #f4e4bc;
  --nav-btn-border: rgba(218, 185, 112, 0.65);

  --panel-bg: #0c1d36;
  --panel-ink: #faf5ea;
  --panel-muted: #cbd2dd;
  --panel-border: rgba(216, 183, 108, 0.48);
  --input-bg: #081529;
  --input-border: rgba(216, 183, 108, 0.34);
  --input-ink: #fbf6ec;
  --input-placeholder: #a8b5c7;

  --card-surface: rgba(12, 29, 54, 0.76);
  --card-surface-border: rgba(216, 183, 108, 0.28);
  --prose-bg: rgba(11, 26, 48, 0.72);
  --modal-bg: #0d1f3a;
  --modal-ink: #faf5ea;
  --modal-muted: #ccd3de;
  --modal-border: rgba(216, 183, 108, 0.42);

  --btn-bg: linear-gradient(92deg, #c6a052 0%, #e4c986 52%, #b99144 100%);
  --btn-ink: #091628;
  --btn-border: rgba(255, 243, 206, 0.55);
  --btn-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 248, 224, 0.65);

  --brand-dot: #d9b96f;
}

html {
  background-color: var(--bg-page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-grad);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.35s ease, color 0.3s ease;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: -9999px; top: 8px; z-index: 9999;
  padding: 10px 16px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 12px; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}

/* ---------- Ambient Theme Backdrop Layer ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Crisp SVG micro-grain paper/velvet texture */
.amb-grain {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

html[data-theme="editorial"] .amb-grain {
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(0deg, rgba(110, 92, 68, 0.024) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(110, 92, 68, 0.022) 0 1px, transparent 1px 4px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}

/* Diagonal sunlit window shadows (Editorial Linen) */
.amb-light {
  position: absolute;
  inset: -20%;
  opacity: 0;
  transition: opacity 0.45s ease;
}
html[data-theme="editorial"] .amb-light {
  opacity: 1;
  background: linear-gradient(
    56deg,
    rgba(255, 250, 240, 0.46) 0%,
    rgba(255, 250, 240, 0.25) 28%,
    rgba(130, 108, 84, 0.14) 36%,
    rgba(130, 108, 84, 0.06) 44%,
    rgba(255, 251, 243, 0.35) 52%,
    rgba(120, 98, 76, 0.17) 64%,
    rgba(120, 98, 76, 0.19) 100%
  );
}
html[data-theme="crimson"] .amb-light {
  opacity: 1;
  background: radial-gradient(circle at 55% 36%, rgba(212, 134, 62, 0.22) 0%, rgba(120, 24, 38, 0.08) 38%, transparent 66%);
}

/* Bokeh orbs (Midnight Velvet) */
.amb-bokeh {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease;
}
html[data-theme="midnight"] .amb-bokeh { opacity: 1; }
.bk {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 212, 146, 0.55) 0%, rgba(212, 168, 88, 0.08) 65%, transparent 100%);
  filter: blur(4px);
}
.bk-1 { width: 34px; height: 34px; right: 4%; top: 44%; opacity: .55; }
.bk-2 { width: 22px; height: 22px; right: 9%; top: 53%; opacity: .45; }
.bk-3 { width: 14px; height: 14px; left: 48%; top: 24%; opacity: .5; }
.bk-4 { width: 46px; height: 46px; right: 2%; top: 68%; opacity: .28; filter: blur(9px); }
.bk-5 { width: 12px; height: 12px; left: 50%; bottom: 26%; opacity: .45; }
.bk-6 { width: 18px; height: 18px; right: 16%; top: 14%; opacity: .35; }

/* Sparkle stars & foil confetti (Crimson Gala & Midnight) */
.amb-sparkles {
  position: absolute; inset: 0; color: #ead095; opacity: 0; transition: opacity 0.45s ease;
}
html[data-theme="crimson"] .amb-sparkles { opacity: 0.78; }
html[data-theme="midnight"] .amb-sparkles { opacity: 0.55; }
.sp-star { position: absolute; width: 42px; height: 42px; opacity: .75; }
.sp-l { left: 1.5%; bottom: 28%; width: 34px; height: 34px; }
.sp-r { right: 1.8%; top: 21%; width: 44px; height: 44px; }
.confetti-dot {
  position: absolute; width: 5px; height: 5px; background: #e8cb88; transform: rotate(28deg); opacity: .65;
}
.cd-1 { left: 5%; bottom: 16%; width: 6px; height: 4px; }
.cd-2 { left: 13%; bottom: 8%; width: 4px; height: 6px; transform: rotate(-18deg); }
.cd-3 { right: 4%; top: 34%; width: 5px; height: 3px; }
.cd-4 { right: 2.5%; top: 47%; width: 4px; height: 4px; }
.cd-5 { left: 46%; top: 15%; width: 3px; height: 3px; border-radius: 50%; }
.cd-6 { right: 10%; bottom: 14%; width: 3px; height: 3px; border-radius: 50%; }

/* Hand-drawn gold starburst fireworks (Art Deco NYE) */
.amb-fireworks {
  position: absolute;
  color: #dfc078;
  opacity: 0;
  transition: opacity 0.5s ease;
}
html[data-theme="deco"] .amb-fireworks { opacity: 0.52; }
.fw-left { width: 300px; height: 300px; left: -105px; bottom: 8%; }
.fw-right { width: 340px; height: 340px; right: -115px; top: 12%; }
.fw-mid { width: 220px; height: 220px; left: 41%; bottom: -68px; opacity: 0; }
html[data-theme="deco"] .fw-mid { opacity: 0.42; }

/* ---------- Header (Clean, Editorial, Uncluttered) ---------- */
.site-header {
  position: relative;
  z-index: 20;
  padding: 15px 0 6px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
html[data-theme="crimson"] .brand-mark,
html[data-theme="midnight"] .brand-mark,
html[data-theme="deco"] .brand-mark {
  color: #e9d3a0;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark-dot { fill: var(--brand-dot); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--header-link);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}
.site-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.nav-my-btn {
  appearance: none;
  border: 1px solid var(--nav-btn-border);
  background: var(--nav-btn-bg);
  color: var(--nav-btn-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.nav-my-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22); }

/* ---------- Hero Stage ---------- */
.hero-stage {
  position: relative;
  z-index: 2;
  padding: 12px 0 58px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.96fr) minmax(400px, 1.04fr);
  gap: 44px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 3.65vw, 3.28rem);
  font-weight: 700;
  font-variant-numeric: lining-nums;
  line-height: 1.07;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero-year {
  color: var(--ink-year);
  font-variant-numeric: lining-nums;
}

.hero-sub {
  margin: 0 0 20px;
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  line-height: 1.52;
  color: var(--ink-muted);
  max-width: 420px;
}

/* ---------- Create Card Form Panel (Adapts to all 4 themes!) ---------- */
.create-box {
  position: relative;
  background: var(--panel-bg);
  color: var(--panel-ink);
  border-radius: 14px;
  padding: 21px 22px 17px;
  max-width: 442px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Crimson Gala double gold hairline frame on ivory card */
html[data-theme="crimson"] .create-box {
  border-radius: 6px;
  border: 1.5px solid #c5a463;
  box-shadow:
    inset 0 0 0 4px #f6f1e6,
    inset 0 0 0 5.2px rgba(197, 164, 99, 0.78),
    0 24px 50px rgba(10, 1, 3, 0.52);
}

/* Editorial Linen soft tactile letterpress paper card */
html[data-theme="editorial"] .create-box {
  border-radius: 12px;
  border: 1px solid rgba(90, 74, 56, 0.12);
  box-shadow:
    0 18px 36px rgba(72, 58, 42, 0.13),
    0 3px 8px rgba(72, 58, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Midnight Velvet smoked obsidian frosted panel */
html[data-theme="midnight"] .create-box {
  border-radius: 16px;
  border: 1px solid rgba(224, 194, 132, 0.36);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.56), inset 0 1px 0 rgba(244, 224, 174, 0.14);
}

/* Art Deco stepped corner bracket panel */
html[data-theme="deco"] .create-box {
  border-radius: 8px;
  border: 1px solid rgba(216, 183, 108, 0.26);
  padding: 25px 22px 19px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.52);
}

.deco-bracket {
  display: none;
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  border-color: #d5b469;
  border-style: solid;
  border-width: 0;
}
html[data-theme="deco"] .deco-bracket { display: block; }
.deco-bracket::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(213, 180, 105, 0.65);
  border-style: solid;
  border-width: 0;
}
.db-tl { top: 10px; left: 10px; border-top-width: 1.5px; border-left-width: 1.5px; }
.db-tl::after { top: 4px; left: 4px; border-top-width: 1px; border-left-width: 1px; }
.db-tr { top: 10px; right: 10px; border-top-width: 1.5px; border-right-width: 1.5px; }
.db-tr::after { top: 4px; right: 4px; border-top-width: 1px; border-right-width: 1px; }
.db-bl { bottom: 10px; left: 10px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.db-bl::after { bottom: 4px; left: 4px; border-bottom-width: 1px; border-left-width: 1px; }
.db-br { bottom: 10px; right: 10px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.db-br::after { bottom: 4px; right: 4px; border-bottom-width: 1px; border-right-width: 1px; }

.create-inputs {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
}
html[data-theme="deco"] .create-inputs {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row label, .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--modal-ink);
}

.create-box input[type="text"],
.code-form input[type="text"],
.modal-card input[type="text"],
.modal-card textarea,
.modal-card select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10.5px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.modal-card textarea { border-radius: 14px; resize: vertical; line-height: 1.45; }
.modal-card select { border-radius: 12px; padding: 10px 14px; }

.create-box input::placeholder,
.code-form input::placeholder,
.modal-card input::placeholder,
.modal-card textarea::placeholder {
  color: var(--input-placeholder);
}
.create-box input:focus,
.code-form input:focus,
.modal-card input:focus,
.modal-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(202, 164, 93, 0.22);
}

html[data-theme="editorial"] .create-box input[type="text"] {
  box-shadow: inset 0 1px 3px rgba(68, 52, 34, 0.1);
}
html[data-theme="midnight"] .create-box input[type="text"] {
  border-radius: 10px;
}

/* Tactile circular theme swatches */
.swatch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.theme-picker {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(155, 132, 96, 0.42);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.sw-crimson { background: radial-gradient(circle at 30% 30%, #7d192c 0%, #440915 70%, #2a050c 100%); }
.sw-editorial { background: radial-gradient(circle at 30% 30%, #fcf9f2 0%, #e7decb 100%); }
.sw-midnight { background: linear-gradient(135deg, #161826 0%, #161826 48%, #e4c681 52%, #b99145 100%); }
.sw-deco { background: radial-gradient(circle at 30% 30%, #17345e 0%, #09182e 72%, #d8b76c 100%); }

.theme-opt:hover .swatch { transform: scale(1.08); }
.theme-opt.is-active .swatch {
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px var(--accent), 0 4px 10px rgba(0, 0, 0, 0.22);
}

.swatch-lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--panel-muted);
}
.theme-opt.is-active .swatch-lbl { color: var(--panel-ink); }

.active-theme-tag {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--panel-muted);
  white-space: nowrap;
  padding-bottom: 14px;
}

/* Segmented Reveal Mode Toggle */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  margin-bottom: 14px;
}

.mode-pill {
  position: relative;
  text-align: center;
  padding: 8px 10px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--panel-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.mode-pill input { position: absolute; opacity: 0; pointer-events: none; }
.mode-pill.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}
html[data-theme="crimson"] .mode-pill.is-active {
  background: #4e0e1b;
  color: #f9efe0;
}
html[data-theme="deco"] .mode-pill.is-active {
  background: #f5ebd5;
  color: #0b1a30;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary {
  padding: 12px 22px;
  font-size: 14.5px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-border);
  box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; transform: none; }

.btn-secondary {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--input-bg);
  color: var(--panel-ink);
  border: 1px solid var(--input-border);
}
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-full { width: 100%; }

.btn-tiny-ghost {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
html[data-theme="crimson"] .modal-card .btn-tiny-ghost { color: #7a1527; }
.btn-tiny-ghost:hover { text-decoration: underline; }

.form-footnote {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--panel-muted);
}
.form-footnote a {
  color: var(--panel-ink);
  font-weight: 600;
  text-underline-offset: 3px;
}


/* =========================================================
   PHYSICAL 5x5 BINGO BOARD STAGE & 4-THEME CRAFTSMANSHIP
   ========================================================= */

.hero-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 24px;
}

.board-stage {
  position: relative;
  width: 100%;
  max-width: 486px;
  margin: 0 auto;
}
.card-layout .board-stage { max-width: 536px; }

/* Overhanging physical clips & washi tape */
.board-clip,
.washi-strip {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

/* Theme 4 (Crimson Gala): Antique brass bulldog clip + burgundy silk V ribbon */
.board-stage.theme-crimson .clip-crimson {
  display: block;
  width: 80px;
  height: auto;
  top: -48px;
  z-index: 9;
  filter: drop-shadow(0 9px 14px rgba(18, 3, 6, 0.56));
}

/* Theme 1 (Editorial Linen): Translucent pastel diagonal washi tape + antique wire clip */
.board-stage.theme-editorial .washi-strip {
  display: block;
  width: 142px;
  height: 28px;
  top: -11px;
  z-index: 7;
  opacity: 0.88;
  background:
    repeating-linear-gradient(
      -52deg,
      rgba(232, 189, 193, 0.88) 0 10px,
      rgba(248, 244, 236, 0.86) 10px 18px,
      rgba(191, 214, 198, 0.86) 18px 28px,
      rgba(247, 233, 182, 0.86) 28px 36px,
      rgba(187, 211, 224, 0.86) 36px 46px
    );
  clip-path: polygon(
    0% 8%, 2.5% 22%, 0.5% 42%, 3% 62%, 0.5% 82%, 2% 96%,
    98% 96%, 99.5% 78%, 97% 58%, 99.5% 38%, 97.5% 18%, 100% 4%
  );
  box-shadow: 0 2px 6px rgba(72, 56, 38, 0.14);
}
.board-stage.theme-editorial .clip-editorial {
  display: block;
  width: 42px;
  height: auto;
  top: -47px;
  z-index: 9;
  filter: drop-shadow(0 8px 11px rgba(58, 44, 28, 0.34));
}

/* Main sheet container */
.bingo-sheet {
  position: relative;
  width: 100%;
  padding: 28px 24px 18px;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.sheet-frame { display: none; position: absolute; pointer-events: none; z-index: 1; }

/* ---- Crimson Gala Sheet ---- */
.bingo-sheet.theme-crimson {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.04'/%3E%3C/svg%3E"),
    linear-gradient(168deg, #faf7f0 0%, #f4efe4 60%, #ede6d8 100%);
  color: #251315;
  border-radius: 3px;
  padding: 36px 24px 20px;
  box-shadow:
    0 34px 72px rgba(6, 0, 2, 0.68),
    0 8px 20px rgba(6, 0, 2, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.bingo-sheet.theme-crimson .frame-crimson {
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- Editorial Linen Sheet ---- */
.bingo-sheet.theme-editorial {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.055'/%3E%3C/svg%3E"),
    linear-gradient(158deg, #faf6ef 0%, #f5f0e7 55%, #eee7db 100%);
  color: #2c241d;
  border-radius: 8px;
  padding: 36px 22px 16px;
  box-shadow:
    0 28px 54px rgba(64, 50, 36, 0.22),
    0 6px 14px rgba(64, 50, 36, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---- Midnight Velvet Beveled Gold Tray ---- */
.bingo-sheet.theme-midnight {
  background: linear-gradient(162deg, #16192a 0%, #101321 55%, #0c0e19 100%);
  color: #f6ecd7;
  border-radius: 10px;
  padding: 28px 22px 18px;
  border: 6px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px #f2dc9f,
    0 0 0 5px #b99144,
    0 0 0 6.5px #6b5122,
    0 34px 74px rgba(0, 0, 0, 0.78),
    inset 0 1px 10px rgba(0, 0, 0, 0.65);
}

/* ---- Art Deco NYE Parchment Sheet ---- */
.bingo-sheet.theme-deco {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.04'/%3E%3C/svg%3E"),
    linear-gradient(168deg, #faf5e8 0%, #f6efe0 100%);
  color: #0b1c35;
  border-radius: 8px;
  padding: 32px 26px 20px;
  box-shadow:
    0 32px 68px rgba(0, 4, 14, 0.68),
    0 8px 18px rgba(0, 4, 14, 0.35);
}
.bingo-sheet.theme-deco .frame-deco {
  display: block;
  inset: 10px;
  border: 1.4px solid #c7a55b;
  box-shadow: inset 0 0 0 3px #f8f2e4, inset 0 0 0 4px rgba(199, 165, 91, 0.62);
  border-radius: 2px;
}
.deco-fan { position: absolute; width: 40px; height: 40px; }
.df-tl { top: 2px; left: 2px; }
.df-tr { top: 2px; right: 2px; }
.df-bl { bottom: 2px; left: 2px; }
.df-br { bottom: 2px; right: 2px; }

/* Board Header Title */
.sheet-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 16px;
  padding: 0 18px;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2.35vw, 1.88rem);
  font-weight: 700;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bingo-sheet.theme-crimson .sheet-title { color: #8c6d36; }
.bingo-sheet.theme-editorial .sheet-title { color: #4e4236; letter-spacing: 0.12em; }
.bingo-sheet.theme-midnight .sheet-title {
  color: #e6c989;
  font-size: clamp(1.22rem, 2.3vw, 1.72rem);
  letter-spacing: 0.09em;
  text-shadow: 0 1px 10px rgba(230, 201, 137, 0.24);
}
.bingo-sheet.theme-deco .sheet-title {
  font-family: var(--font-serif);
  color: #0b1c35;
  font-size: clamp(1.25rem, 2.35vw, 1.76rem);
  letter-spacing: 0.04em;
}

.sheet-sub-seal {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

/* 5x5 Grid */
.bingo-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}
.bingo-sheet.theme-midnight .bingo-grid { gap: 8px; }
.bingo-sheet.theme-deco .bingo-grid { gap: 10px; }

/* Base Cell Wrapper */
.b-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
  cursor: default;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease, z-index 0s;
}
button.b-cell { cursor: pointer; }
button.b-cell:hover {
  transform: rotate(0deg) translateY(-2px) scale(1.045);
  z-index: 8;
}
button.b-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 9;
}

/* ---------- EMPTY SQUARES ---------- */
.b-cell.is-empty {
  flex-direction: column;
  gap: 2px;
}
.b-cell-num {
  font-weight: 600;
  line-height: 1;
  transition: opacity 0.18s ease;
}
.b-cell-plus {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
button.b-cell.is-empty:hover .b-cell-plus { opacity: 1; transform: translateY(0); }
button.b-cell.is-empty:hover .b-cell-num { opacity: 0.2; }

/* Crimson empty: crisp ivory cotton cell, top-left #num */
.theme-crimson .b-cell.is-empty {
  background: rgba(255, 253, 248, 0.65);
  border: 1px solid #d5cab4;
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(105, 84, 52, 0.07);
  color: #4f4135;
}
.theme-crimson .b-cell.is-empty .b-cell-num {
  position: absolute;
  top: 6px;
  left: 7px;
  font-family: var(--font-sans);
  font-size: clamp(9px, 1.05vw, 11px);
  font-weight: 600;
  color: #4c3d31;
}
.theme-crimson button.b-cell.is-empty:hover {
  border-color: #9e7e42;
  background: #fffdf8;
}

/* Editorial empty: Letterpress debossed recessed pocket */
.theme-editorial .b-cell.is-empty {
  background: linear-gradient(145deg, #e5ded2 0%, #ede7dc 100%);
  border: 1px solid rgba(112, 95, 75, 0.18);
  border-radius: 6px;
  box-shadow:
    inset 1.5px 2px 4px rgba(84, 68, 48, 0.16),
    inset -1px -1px 2px rgba(255, 255, 255, 0.72);
  color: #706253;
}
.theme-editorial .b-cell.is-empty .b-cell-num {
  font-size: clamp(10px, 1.25vw, 13px);
  font-weight: 500;
}
.theme-editorial button.b-cell.is-empty:hover {
  background: #f6f1e8;
  border-color: #9b1d2c;
  color: #9b1d2c;
}

/* Midnight empty: dark recessed velvet pocket + dashed antique-gold stitching */
.theme-midnight .b-cell.is-empty {
  background: linear-gradient(155deg, #0b0e19 0%, #101423 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.72), 0 1px 0 rgba(235, 208, 145, 0.09);
  color: #bfb08e;
}
.theme-midnight .b-cell.is-empty::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(212, 180, 112, 0.34);
  border-radius: 6px;
  pointer-events: none;
}
.theme-midnight .b-cell.is-empty .b-cell-num {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: clamp(8.5px, 0.95vw, 10px);
  opacity: 0.78;
}
.theme-midnight button.b-cell.is-empty:hover::after {
  border-color: rgba(235, 204, 134, 0.85);
}

/* Art Deco empty: double midnight-navy hairline frame + bold serif #num */
.theme-deco .b-cell.is-empty {
  background: #fbf7ec;
  border: 1.5px solid #0e223d;
  border-radius: 1px;
  box-shadow: inset 0 0 0 2.5px #fbf7ec, inset 0 0 0 3.5px #0e223d;
  color: #0d2039;
}
.theme-deco .b-cell.is-empty .b-cell-num {
  font-family: var(--font-serif);
  font-variant-numeric: lining-nums;
  font-size: clamp(13px, 1.75vw, 18px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.theme-deco button.b-cell.is-empty:hover {
  background: #f1e5c8;
}

/* ---------- FILLED SQUARES (Inner .b-tile gets the physical cut shape!) ---------- */
.b-tile {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 6px 5px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  overflow: hidden;
}

.b-ico {
  width: clamp(14px, 2.2vw, 22px);
  height: clamp(14px, 2.2vw, 22px);
  flex-shrink: 0;
  display: block;
}

.b-cell-txt {
  font-size: clamp(7.8px, 1.02vw, 10.6px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}

.b-cell-by {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(7px, 0.86vw, 9.2px);
  font-weight: 600;
  opacity: 0.84;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
  line-height: 1.05;
}

/* ---- 1. CRIMSON GALA: Serrated Postage Stamp Tiles ---- */
.theme-crimson .b-cell.is-filled {
  filter: drop-shadow(0 5px 8px rgba(42, 16, 18, 0.28));
  z-index: 3;
}
.theme-crimson button.b-cell.is-filled:hover {
  filter: drop-shadow(0 10px 14px rgba(42, 16, 18, 0.38));
}
.theme-crimson .b-tile {
  padding: 9px 7px 7px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23000' d='M0,0 L7.4,0 a2.6,2.6 0 0 0 5.2,0 L17.4,0 a2.6,2.6 0 0 0 5.2,0 L27.4,0 a2.6,2.6 0 0 0 5.2,0 L37.4,0 a2.6,2.6 0 0 0 5.2,0 L47.4,0 a2.6,2.6 0 0 0 5.2,0 L57.4,0 a2.6,2.6 0 0 0 5.2,0 L67.4,0 a2.6,2.6 0 0 0 5.2,0 L77.4,0 a2.6,2.6 0 0 0 5.2,0 L87.4,0 a2.6,2.6 0 0 0 5.2,0 L100,0 L100,7.4 a2.6,2.6 0 0 0 0,5.2 L100,17.4 a2.6,2.6 0 0 0 0,5.2 L100,27.4 a2.6,2.6 0 0 0 0,5.2 L100,37.4 a2.6,2.6 0 0 0 0,5.2 L100,47.4 a2.6,2.6 0 0 0 0,5.2 L100,57.4 a2.6,2.6 0 0 0 0,5.2 L100,67.4 a2.6,2.6 0 0 0 0,5.2 L100,77.4 a2.6,2.6 0 0 0 0,5.2 L100,87.4 a2.6,2.6 0 0 0 0,5.2 L100,100 L92.6,100 a2.6,2.6 0 0 0 -5.2,0 L82.6,100 a2.6,2.6 0 0 0 -5.2,0 L72.6,100 a2.6,2.6 0 0 0 -5.2,0 L62.6,100 a2.6,2.6 0 0 0 -5.2,0 L52.6,100 a2.6,2.6 0 0 0 -5.2,0 L42.6,100 a2.6,2.6 0 0 0 -5.2,0 L32.6,100 a2.6,2.6 0 0 0 -5.2,0 L22.6,100 a2.6,2.6 0 0 0 -5.2,0 L12.6,100 a2.6,2.6 0 0 0 -5.2,0 L0,100 L0,92.6 a2.6,2.6 0 0 0 0,-5.2 L0,82.6 a2.6,2.6 0 0 0 0,-5.2 L0,72.6 a2.6,2.6 0 0 0 0,-5.2 L0,62.6 a2.6,2.6 0 0 0 0,-5.2 L0,52.6 a2.6,2.6 0 0 0 0,-5.2 L0,42.6 a2.6,2.6 0 0 0 0,-5.2 L0,32.6 a2.6,2.6 0 0 0 0,-5.2 L0,22.6 a2.6,2.6 0 0 0 0,-5.2 L0,12.6 a2.6,2.6 0 0 0 0,-5.2 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23000' d='M0,0 L7.4,0 a2.6,2.6 0 0 0 5.2,0 L17.4,0 a2.6,2.6 0 0 0 5.2,0 L27.4,0 a2.6,2.6 0 0 0 5.2,0 L37.4,0 a2.6,2.6 0 0 0 5.2,0 L47.4,0 a2.6,2.6 0 0 0 5.2,0 L57.4,0 a2.6,2.6 0 0 0 5.2,0 L67.4,0 a2.6,2.6 0 0 0 5.2,0 L77.4,0 a2.6,2.6 0 0 0 5.2,0 L87.4,0 a2.6,2.6 0 0 0 5.2,0 L100,0 L100,7.4 a2.6,2.6 0 0 0 0,5.2 L100,17.4 a2.6,2.6 0 0 0 0,5.2 L100,27.4 a2.6,2.6 0 0 0 0,5.2 L100,37.4 a2.6,2.6 0 0 0 0,5.2 L100,47.4 a2.6,2.6 0 0 0 0,5.2 L100,57.4 a2.6,2.6 0 0 0 0,5.2 L100,67.4 a2.6,2.6 0 0 0 0,5.2 L100,77.4 a2.6,2.6 0 0 0 0,5.2 L100,87.4 a2.6,2.6 0 0 0 0,5.2 L100,100 L92.6,100 a2.6,2.6 0 0 0 -5.2,0 L82.6,100 a2.6,2.6 0 0 0 -5.2,0 L72.6,100 a2.6,2.6 0 0 0 -5.2,0 L62.6,100 a2.6,2.6 0 0 0 -5.2,0 L52.6,100 a2.6,2.6 0 0 0 -5.2,0 L42.6,100 a2.6,2.6 0 0 0 -5.2,0 L32.6,100 a2.6,2.6 0 0 0 -5.2,0 L22.6,100 a2.6,2.6 0 0 0 -5.2,0 L12.6,100 a2.6,2.6 0 0 0 -5.2,0 L0,100 L0,92.6 a2.6,2.6 0 0 0 0,-5.2 L0,82.6 a2.6,2.6 0 0 0 0,-5.2 L0,72.6 a2.6,2.6 0 0 0 0,-5.2 L0,62.6 a2.6,2.6 0 0 0 0,-5.2 L0,52.6 a2.6,2.6 0 0 0 0,-5.2 L0,42.6 a2.6,2.6 0 0 0 0,-5.2 L0,32.6 a2.6,2.6 0 0 0 0,-5.2 L0,22.6 a2.6,2.6 0 0 0 0,-5.2 L0,12.6 a2.6,2.6 0 0 0 0,-5.2 Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.theme-crimson .b-tile::before {
  content: "";
  position: absolute;
  inset: 4.5px;
  border: 1px solid rgba(255, 243, 214, 0.36);
  pointer-events: none;
}
.theme-crimson .cat-love .b-tile {
  background: linear-gradient(145deg, #741628 0%, #4b0b17 100%);
  color: #f8eed9;
}
.theme-crimson .cat-love .b-ico { color: #ebd19a; }
.theme-crimson .cat-chaos .b-tile {
  background: linear-gradient(135deg, #f3e1a9 0%, #c8a258 56%, #ebd290 100%);
  color: #251507;
}
.theme-crimson .cat-chaos .b-tile::before { border-color: rgba(88, 52, 16, 0.28); }
.theme-crimson .cat-chaos .b-ico { color: #5b1220; }
.theme-crimson .cat-money .b-tile {
  background: linear-gradient(145deg, #195945 0%, #0d3629 100%);
  color: #f7eedc;
}
.theme-crimson .cat-money .b-ico { color: #ebd19a; }
.theme-crimson .cat-glow .b-tile {
  background: linear-gradient(138deg, #f0d7d1 0%, #cfaba2 62%, #e6c7bf 100%);
  color: #2c1518;
}
.theme-crimson .cat-glow .b-tile::before { border-color: rgba(110, 62, 56, 0.25); }
.theme-crimson .cat-glow .b-ico { color: #8c6a34; }

/* ---- 2. EDITORIAL LINEN: Tilted Pastel Stationery Sticky Notes ---- */
.theme-editorial .b-cell.is-filled {
  filter: drop-shadow(0 6px 8px rgba(62, 48, 32, 0.22));
  z-index: 3;
}
.theme-editorial button.b-cell.is-filled:hover {
  filter: drop-shadow(0 11px 15px rgba(62, 48, 32, 0.3));
}
.theme-editorial .b-tile {
  border-radius: 2px;
  padding: 7px 6px 6px;
  box-shadow: inset 0 8px 10px -8px rgba(255, 255, 255, 0.65), inset 0 -10px 14px -12px rgba(70, 52, 30, 0.22);
}
.theme-editorial .cat-chaos .b-tile { background: linear-gradient(165deg, #f7e9a8 0%, #eedb87 100%); color: #262015; }
.theme-editorial .cat-chaos .b-ico { color: #a8541c; }
.theme-editorial .cat-love .b-tile { background: linear-gradient(165deg, #f0c9c9 0%, #e4b2b2 100%); color: #2b1a1b; }
.theme-editorial .cat-love .b-ico { color: #a12030; }
.theme-editorial .cat-money .b-tile { background: linear-gradient(165deg, #cde0d0 0%, #b7cebc 100%); color: #19261d; }
.theme-editorial .cat-money .b-ico { color: #366844; }
.theme-editorial .cat-glow .b-tile { background: linear-gradient(165deg, #c9dfe9 0%, #b1cddb 100%); color: #17242c; }
.theme-editorial .cat-glow .b-ico { color: #2e5d7a; }

/* ---- 3. MIDNIGHT VELVET: Beveled 3D Jewel Satin & Brushed Gold Foil ---- */
.theme-midnight .b-cell.is-filled {
  --rot: 0deg !important;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.58));
  z-index: 3;
}
.theme-midnight .b-tile {
  border-radius: 9px;
  padding: 7px 5px 6px;
  border: 1px solid rgba(246, 224, 168, 0.35);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 250, 232, 0.42),
    inset 0 -2px 4px rgba(0, 0, 0, 0.44);
}
.theme-midnight .b-tile::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(240, 214, 152, 0.24);
  border-radius: 6px;
  pointer-events: none;
}
.theme-midnight .cat-money .b-tile {
  background: radial-gradient(circle at 26% 18%, #25805d 0%, #0f4631 58%, #092b1e 100%);
  color: #f8f0dc;
}
.theme-midnight .cat-money .b-ico { color: #f0d79a; }
.theme-midnight .cat-love .b-tile {
  background: radial-gradient(circle at 26% 18%, #9f2036 0%, #5c0c1b 58%, #3c0610 100%);
  color: #f9f0de;
}
.theme-midnight .cat-love .b-ico { color: #f2daa2; }
.theme-midnight .cat-glow .b-tile {
  background: radial-gradient(circle at 26% 18%, #2b548d 0%, #152d52 58%, #0c1b33 100%);
  color: #f7f0df;
}
.theme-midnight .cat-glow .b-ico { color: #efd69c; }
.theme-midnight .cat-chaos .b-tile {
  background: linear-gradient(132deg, #f8eac1 0%, #d4ae60 44%, #f2deaa 72%, #b98f42 100%);
  color: #1c1306;
  border-color: rgba(255, 248, 224, 0.8);
}
.theme-midnight .cat-chaos .b-tile::before { border-color: rgba(74, 48, 12, 0.25); }
.theme-midnight .cat-chaos .b-ico { color: #54380c; }

/* ---- 4. ART DECO NYE: Notched Vintage Ticket-Stub Tiles ---- */
.theme-deco .b-cell.is-filled {
  --rot: 0deg !important;
  filter: drop-shadow(0 4px 7px rgba(8, 20, 38, 0.26));
  z-index: 3;
}
.theme-deco .b-tile {
  padding: 7px 6px 6px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23000' d='M9,0 L91,0 A9,9 0 0 0 100,9 L100,44 A6,6 0 0 0 100,56 L100,91 A9,9 0 0 0 91,100 L9,100 A9,9 0 0 0 0,91 L0,56 A6,6 0 0 0 0,44 L0,9 A9,9 0 0 0 9,0 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23000' d='M9,0 L91,0 A9,9 0 0 0 100,9 L100,44 A6,6 0 0 0 100,56 L100,91 A9,9 0 0 0 91,100 L9,100 A9,9 0 0 0 0,91 L0,56 A6,6 0 0 0 0,44 L0,9 A9,9 0 0 0 9,0 Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.theme-deco .b-tile::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(235, 206, 138, 0.35);
  border-radius: 4px;
  pointer-events: none;
}
.theme-deco .b-cell-txt {
  font-family: var(--font-serif);
  font-size: clamp(8.2px, 1.06vw, 11.2px);
}
.theme-deco .cat-glow .b-tile { background: linear-gradient(155deg, #132847 0%, #0a1930 100%); color: #f6e9cc; }
.theme-deco .cat-glow .b-ico { color: #e4c57a; }
.theme-deco .cat-chaos .b-tile { background: linear-gradient(135deg, #f0dc9e 0%, #c8a254 58%, #e4ca82 100%); color: #0c1b30; }
.theme-deco .cat-chaos .b-tile::before { border-color: rgba(12, 27, 48, 0.28); }
.theme-deco .cat-chaos .b-ico { color: #0c1b30; }
.theme-deco .cat-money .b-tile { background: linear-gradient(150deg, #cf4c28 0%, #a53417 100%); color: #fdf5e7; }
.theme-deco .cat-money .b-ico { color: #f8e2b2; }
.theme-deco .cat-love .b-tile { background: linear-gradient(142deg, #f4ead2 0%, #dcc696 100%); color: #0c1b30; }
.theme-deco .cat-love .b-tile::before { border-color: rgba(132, 98, 42, 0.34); }
.theme-deco .cat-love .b-ico { color: #c44123; }

/* Golden Stamp Highlight Badge */
.b-cell.is-gold .b-tile::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.8px solid #f5d882;
  pointer-events: none;
  box-shadow: inset 0 0 12px rgba(255, 224, 130, 0.35);
}
.b-gold-pip {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  line-height: 1;
  color: #f7dc84;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

/* Happened Ink Stamp & BINGO 5-in-a-row win */
.b-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.b-stamp span {
  font-size: clamp(7.5px, 0.9vw, 9.5px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 1.8px solid #16a34a;
  color: #ffffff;
  background: rgba(15, 118, 56, 0.88);
  border-radius: 3px;
  transform: rotate(-14deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.b-cell.is-bingo-win {
  filter: drop-shadow(0 0 10px rgba(235, 198, 102, 0.95)) !important;
  z-index: 6;
}

/* ---------- CENTER FREE SPACE PHYSICAL MEDALLIONS ---------- */
.b-cell.is-center {
  --rot: 0deg !important;
  z-index: 5;
  overflow: visible;
}
.center-seal-img {
  width: 112%;
  height: 112%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  display: block;
}
.theme-crimson .center-seal-img {
  width: 114%;
  height: 114%;
  filter: drop-shadow(0 7px 11px rgba(42, 24, 6, 0.36));
}
.theme-editorial .center-seal-img {
  width: 112%;
  height: 112%;
  filter: drop-shadow(0 7px 11px rgba(78, 12, 18, 0.34));
}
.theme-midnight .center-seal-img {
  width: 118%;
  height: 118%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.72));
}
.theme-deco .center-seal-img {
  width: 124%;
  height: 124%;
  filter: drop-shadow(0 6px 12px rgba(8, 20, 40, 0.35));
}

/* Dynamic center goal engraved label inside blank Midnight fluted gold medallion */
.center-seal-overlay {
  position: absolute;
  inset: 16%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3a2709;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  text-shadow: 0 1px 0 rgba(255, 248, 224, 0.55);
  pointer-events: none;
}
.theme-midnight .center-seal-overlay { display: flex; }
.cso-top {
  font-family: var(--font-sans);
  font-size: clamp(5.8px, 0.7vw, 7.8px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cso-year {
  font-family: var(--font-serif);
  font-variant-numeric: lining-nums;
  font-size: clamp(11px, 1.35vw, 15px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 1px;
}

/* Subtle custom-goal pill ribbon when user enters a custom goal on seal themes */
.center-goal-chip {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 118%;
  padding: 1.5px 6px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(34, 18, 12, 0.88);
  color: #f9eed9;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.theme-midnight .center-goal-chip { display: none; }

/* Board Footer */
.sheet-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 11px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.66;
}
.theme-midnight .sheet-foot { color: #d8c7a2; }
.theme-crimson .sheet-foot { color: #6a5640; padding: 0 12px; }
.theme-editorial .sheet-foot { color: #655748; }
.theme-deco .sheet-foot { color: #243854; padding: 0 38px; }


/* =========================================================
   /CARD PLAY PAGE, SIDEBAR PANELS & INTERACTIVE CONTROLS
   ========================================================= */

.card-app-section {
  position: relative;
  z-index: 2;
  padding: 20px 0 80px;
}

.card-loading {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-muted);
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(212, 180, 114, 0.25);
  border-top-color: var(--accent);
  animation: bwfSpin 0.8s linear infinite;
}
@keyframes bwfSpin { to { transform: rotate(360deg); } }

.bingo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  margin-bottom: 24px;
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--btn-shadow);
}

.card-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(300px, 0.85fr);
  gap: 42px;
  align-items: start;
}

.card-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 28px;
}

.panel-box {
  position: relative;
  background: var(--panel-bg);
  color: var(--panel-ink);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}
html[data-theme="crimson"] .panel-box {
  border-radius: 6px;
  border: 1.4px solid #c5a463;
  box-shadow: inset 0 0 0 3.5px #f6f1e6, inset 0 0 0 4.5px rgba(197, 164, 99, 0.65), 0 18px 40px rgba(8, 1, 3, 0.44);
}
html[data-theme="editorial"] .panel-box {
  box-shadow: 0 12px 28px rgba(68, 54, 38, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
html[data-theme="midnight"] .panel-box {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-box h2, .panel-box h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  line-height: 1.2;
  color: var(--panel-ink);
}
.panel-box h3 { font-size: 1.1rem; }

.panel-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--panel-muted);
}

.sheet-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--panel-muted);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

.action-stack { display: flex; flex-direction: column; gap: 10px; }
.action-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.code-chip-box {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px dashed var(--input-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--panel-muted);
}
.code-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--panel-ink);
  font-size: 13.5px;
}

.era-title {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--panel-ink);
  margin-bottom: 6px;
}
.era-bars {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.era-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--panel-ink);
}

.theme-switcher-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--panel-ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease;
}
.theme-mini-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-mini-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}
.mini-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(150, 128, 90, 0.5);
}

.panel-report {
  text-align: center;
  padding: 6px 0;
}
.panel-report .btn-tiny-ghost { color: var(--ink-muted); }

/* =========================================================
   MODALS
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 4, 8, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--modal-bg);
  color: var(--modal-ink);
  border: 1.5px solid var(--modal-border);
  border-radius: 18px;
  padding: 24px 24px 22px;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.52);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.38rem;
  color: var(--modal-ink);
}
.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--modal-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-close:hover { border-color: var(--accent); }

.modal-fill .field-row { margin-bottom: 13px; }
.label-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.char-counter { text-align: right; font-size: 11.5px; color: var(--modal-muted); }

.cat-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cat-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--modal-ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.cat-pill input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pill.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
html[data-theme="crimson"] .cat-pill.is-active { background: #5a101f; color: #faf0e0; border-color: #5a101f; }

.check-box-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0 18px;
}
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.8px;
  line-height: 1.4;
  color: var(--modal-ink);
  cursor: pointer;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}
.check-line input { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.check-viral { border-color: var(--accent); }
.hint-row { padding: 4px 2px 6px; display: flex; flex-direction: column; gap: 6px; }
.hint-row[hidden] { display: none; }
.hint-row label { font-size: 12px; font-weight: 600; color: var(--modal-muted); }

.sq-detail-quote {
  font-family: var(--font-serif);
  font-size: 1.48rem;
  font-weight: 600;
  line-height: 1.32;
  padding: 20px 18px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--modal-ink);
  margin-bottom: 14px;
  text-align: center;
}
.sq-meta-line {
  font-size: 13px;
  color: var(--modal-muted);
  text-align: center;
  margin-bottom: 16px;
}
.guess-box {
  padding: 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px dashed var(--accent);
  font-size: 13px;
  margin-bottom: 14px;
}
.guess-row { display: flex; gap: 8px; margin-top: 10px; }
.guess-row input { flex: 1; padding: 10px 14px !important; }

.fortune-ticket {
  padding: 22px 18px;
  border-radius: 12px;
  border: 1.5px dashed var(--accent);
  background: var(--input-bg);
  text-align: center;
  margin-bottom: 16px;
}
.fortune-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--modal-muted);
  margin-bottom: 8px;
}
.fortune-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.24rem;
  line-height: 1.4;
  color: var(--modal-ink);
}

.my-cards-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.my-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
}
.modal-tip { font-size: 12px; color: var(--modal-muted); margin: 0; line-height: 1.45; }

/* =========================================================
   BELOW-THE-FOLD SECTIONS, /CODE & CONTENT GUIDE PAGES
   ========================================================= */

.section-steps,
.section-compare,
.section-faq {
  position: relative;
  z-index: 2;
  padding: 64px 0;
  border-top: 1px solid var(--card-surface-border);
}
.section-steps { background: var(--bg-section); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 42px;
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2,
.section-faq h2,
.prose-wrap h2 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
  color: var(--ink);
}

.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 14px;
  padding: 24px 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.step-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.step-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--ink);
}
.step-card p {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.58;
  color: var(--ink-muted);
}

.prose-wrap { max-width: 820px; margin: 0 auto; }
.prose-wrap h3 {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  color: var(--ink);
  margin: 28px 0 10px;
}
.prose-wrap p, .prose-wrap li {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-muted);
}
.prose-wrap strong { color: var(--ink); }
.prose-wrap a { color: var(--accent); text-underline-offset: 3px; }
.prose-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}
.prose-wrap th, .prose-wrap td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid var(--card-surface-border);
  color: var(--ink-muted);
}
.prose-wrap th { color: var(--ink); font-weight: 700; }

/* FAQ Accordion */
.faq-list { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.faq-item {
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 12px;
  padding: 16px 20px;
}
.faq-item summary {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-sans); font-size: 18px; color: var(--accent); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 12px 0 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-muted); }

/* /code Page */
.code-section { padding: 48px 0 88px; position: relative; z-index: 2; }
.code-card {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
  background: var(--panel-bg);
  color: var(--panel-ink);
  border: 1.5px solid var(--panel-border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.34);
}
.code-card h1 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  color: var(--panel-ink);
}
.code-card .hero-year { color: var(--accent); }
html[data-theme="crimson"] .code-card .hero-year { color: #7a1527; }
.code-sub { margin: 0 0 24px; font-size: 14.8px; line-height: 1.6; color: var(--panel-muted); }
.code-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.code-form input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.code-tips {
  text-align: left;
  padding-top: 18px;
  border-top: 1px solid var(--input-border);
  font-size: 13.5px;
  color: var(--panel-muted);
}
.code-tips h2 { margin: 0 0 8px; font-size: 14px; color: var(--panel-ink); font-family: var(--font-sans); }
.code-tips ul { margin: 0; padding-left: 18px; line-height: 1.65; }
.code-tips a { color: var(--panel-ink); font-weight: 600; }
.code-prose { margin-top: 48px; }

/* Content Guide Pages */
.content-page { padding: 36px 0 84px; position: relative; z-index: 2; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.content-page h1 {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.8vw, 3rem);
  line-height: 1.1;
  color: var(--ink);
}
.page-lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink-muted); margin: 0 0 28px; }

.inline-cta-card, .bottom-cta-banner {
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 28px 0;
}
.inline-cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.inline-cta-card p { margin: 4px 0 0; font-size: 14px; }
.bottom-cta-banner { text-align: center; padding: 34px 24px; margin-top: 42px; }
.bottom-cta-banner p { margin: 0 auto 18px; max-width: 520px; }
.faq-block { margin-top: 44px; }

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--card-surface-border);
  background: var(--bg-section);
  padding: 46px 0 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}
.footer-brand-col { max-width: 340px; }
.footer-brand { font-size: 18px; margin-bottom: 10px; }
.footer-desc { margin: 8px 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); }
.footer-ver { margin: 0; font-size: 12px; color: var(--ink-muted); opacity: 0.78; }
.footer-links-col { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-group { display: flex; flex-direction: column; gap: 9px; }
.footer-heading {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 2px;
}
.footer-group a { color: var(--ink-muted); text-decoration: none; font-size: 13.5px; }
.footer-group a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 2000;
  padding: 11px 20px;
  border-radius: 999px;
  background: #141218;
  color: #faf4e8;
  border: 1px solid rgba(224, 194, 132, 0.45);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (max-width: 980px) {
  .hero-grid,
  .card-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .hero-copy { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .create-box { margin: 0 auto; text-align: left; }
  .card-sidebar { padding-top: 0; max-width: 552px; margin: 0 auto; width: 100%; }
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-left, .fw-right { opacity: 0.28 !important; }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .site-header { padding: 16px 0 8px; }
  .brand { font-size: 17.5px; gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .site-nav { gap: 12px; }
  .site-nav a:first-child { display: none; }
  .site-nav a { font-size: 13px; }
  .nav-my-btn { padding: 7px 13px; font-size: 12.5px; }

  .hero-stage { padding: 16px 0 48px; }
  .hero-copy h1 { font-size: 2.1rem; }
  .create-box { padding: 20px 16px 18px; }
  html[data-theme="deco"] .create-inputs { grid-template-columns: 1fr; }
  .active-theme-tag { display: none; }
  .theme-picker { width: 100%; justify-content: space-between; }

  .board-stage.theme-crimson .clip-crimson { width: 82px; top: -40px; }
  .board-stage.theme-editorial .clip-editorial { width: 46px; top: -46px; }
  .board-stage.theme-editorial .washi-strip { width: 112px; height: 22px; top: -9px; }

  .bingo-sheet,
  .bingo-sheet.theme-crimson,
  .bingo-sheet.theme-editorial,
  .bingo-sheet.theme-midnight,
  .bingo-sheet.theme-deco {
    padding: 24px 12px 14px;
  }
  .bingo-grid,
  .bingo-sheet.theme-deco .bingo-grid { gap: 5px; }
  .deco-fan { width: 26px; height: 26px; }
  .sheet-header { margin-bottom: 11px; }

  .b-tile,
  .theme-crimson .b-tile,
  .theme-editorial .b-tile,
  .theme-midnight .b-tile,
  .theme-deco .b-tile {
    padding: 4px 3px 3px;
    gap: 1.5px;
  }
  .b-ico { width: 13px; height: 13px; }
  .b-cell-txt { font-size: 7.4px; line-height: 1.12; }
  .b-cell-by { display: none; }
  .theme-crimson .b-cell.is-empty .b-cell-num { top: 3px; left: 4px; font-size: 8.5px; }
  .theme-deco .b-cell.is-empty .b-cell-num { font-size: 12px; }
  .theme-deco .b-cell.is-empty { box-shadow: inset 0 0 0 1.5px #fbf7ec, inset 0 0 0 2.3px #0e223d; }

  .steps-grid { grid-template-columns: 1fr; }
  .code-card { padding: 26px 18px; }
  .action-row-2 { grid-template-columns: 1fr; }
}

/* =========================================================
   REFINED MOTION, AMBIENT LIFE & TACTILE MICRO-INTERACTIONS
   ========================================================= */

/* 1. Ambient theme backdrops (GPU transform/opacity only) */
@keyframes candlePulse {
  0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.9; }
  50%      { transform: scale(1.07) translate3d(-1.2%, 1%, 0); opacity: 1; }
}
@keyframes sunSway {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.94; }
  50%      { transform: translate3d(2.4%, -1.4%, 0) scale(1.03); opacity: 1; }
}
@keyframes bokehFloatA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-10px, -22px, 0) scale(1.16); }
}
@keyframes bokehFloatB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(12px, -16px, 0) scale(0.88); }
}
@keyframes starTwinkle {
  0%, 100% { transform: scale(0.88) rotate(0deg); opacity: 0.45; }
  50%      { transform: scale(1.14) rotate(12deg); opacity: 0.95; }
}
@keyframes confettiDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(22deg); opacity: 0.45; }
  50%      { transform: translate3d(6px, -14px, 0) rotate(58deg); opacity: 0.88; }
}
@keyframes fwShimmer {
  0%, 100% { transform: scale(0.96) rotate(0deg); opacity: 0.42; }
  50%      { transform: scale(1.055) rotate(8deg); opacity: 0.68; }
}
@keyframes fwShimmerAlt {
  0%, 100% { transform: scale(1.03) rotate(0deg); opacity: 0.56; }
  50%      { transform: scale(0.95) rotate(-7deg); opacity: 0.34; }
}

html[data-theme="crimson"] .amb-light {
  animation: candlePulse 6.8s ease-in-out infinite;
  will-change: transform, opacity;
}
html[data-theme="editorial"] .amb-light {
  animation: sunSway 14s ease-in-out infinite;
  will-change: transform, opacity;
}
html[data-theme="midnight"] .bk-1 { animation: bokehFloatA 7.4s ease-in-out infinite; }
html[data-theme="midnight"] .bk-2 { animation: bokehFloatB 9.2s ease-in-out -2.1s infinite; }
html[data-theme="midnight"] .bk-3 { animation: bokehFloatA 8.5s ease-in-out -4s infinite; }
html[data-theme="midnight"] .bk-4 { animation: bokehFloatB 11.4s ease-in-out -1.5s infinite; }
html[data-theme="midnight"] .bk-5 { animation: bokehFloatA 6.9s ease-in-out -3.2s infinite; }
html[data-theme="midnight"] .bk-6 { animation: bokehFloatB 10.1s ease-in-out -5s infinite; }

html[data-theme="crimson"] .sp-l,
html[data-theme="midnight"] .sp-l { animation: starTwinkle 4.2s ease-in-out infinite; }
html[data-theme="crimson"] .sp-r,
html[data-theme="midnight"] .sp-r { animation: starTwinkle 5.1s ease-in-out -1.9s infinite; }

html[data-theme="crimson"] .cd-1,
html[data-theme="midnight"] .cd-1 { animation: confettiDrift 6.4s ease-in-out infinite; }
html[data-theme="crimson"] .cd-2,
html[data-theme="midnight"] .cd-2 { animation: confettiDrift 7.8s ease-in-out -2.2s infinite; }
html[data-theme="crimson"] .cd-3,
html[data-theme="midnight"] .cd-3 { animation: confettiDrift 6.9s ease-in-out -1.1s infinite; }
html[data-theme="crimson"] .cd-4,
html[data-theme="midnight"] .cd-4 { animation: confettiDrift 8.5s ease-in-out -3.6s infinite; }
html[data-theme="crimson"] .cd-5,
html[data-theme="midnight"] .cd-5 { animation: confettiDrift 5.9s ease-in-out -0.7s infinite; }
html[data-theme="crimson"] .cd-6,
html[data-theme="midnight"] .cd-6 { animation: confettiDrift 7.3s ease-in-out -4.1s infinite; }

html[data-theme="deco"] .fw-left  { animation: fwShimmer 11s ease-in-out infinite; }
html[data-theme="deco"] .fw-right { animation: fwShimmerAlt 13.5s ease-in-out -3s infinite; }
html[data-theme="deco"] .fw-mid   { animation: fwShimmer 12s ease-in-out -5.5s infinite; }

/* 2. Hero entrance choreography */
@keyframes heroRise {
  0%   { opacity: 0; transform: translate3d(0, 18px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes boardEnter {
  0%   { opacity: 0; transform: translate3d(0, 26px, 0) scale(0.97); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.hero-copy h1      { animation: heroRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero-copy .hero-sub { animation: heroRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
.create-box        { animation: heroRise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both; }
.hero-preview-wrap { animation: boardEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }

/* 3. Interactive subtle 3D physical board tilt */
.hero-preview-wrap { perspective: 1200px; }
.board-stage {
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.board-stage.is-tilting {
  transition: transform 0.09s ease-out;
}

/* 4. Theme-switch tactile settle, clip pendulum & staggered stamp drop */
@keyframes sheetSwap {
  0%   { transform: scale(0.976) translate3d(0, 6px, 0); }
  55%  { transform: scale(1.008) translate3d(0, -2px, 0); }
  100% { transform: scale(1) translate3d(0, 0, 0); }
}
@keyframes clipSwing {
  0%   { transform: translateX(-50%) translateY(-10px) rotate(-5deg); opacity: 0.75; }
  45%  { transform: translateX(-50%) translateY(1px) rotate(2.6deg); opacity: 1; }
  75%  { transform: translateX(-50%) translateY(0) rotate(-1deg); }
  100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
}
@keyframes tileStamp {
  0%   { opacity: 0; transform: rotate(calc(var(--rot, 0deg) * 1.9)) scale(1.16) translate3d(0, -7px, 0); }
  65%  { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(0.97) translate3d(0, 1px, 0); }
  100% { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(1) translate3d(0, 0, 0); }
}
@keyframes sealPress {
  0%   { opacity: 0.2; transform: scale(1.24) rotate(-8deg); }
  60%  { opacity: 1; transform: scale(0.94) rotate(1.8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.board-stage.is-switching .bingo-sheet {
  animation: sheetSwap 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.board-stage.is-switching .board-clip {
  transform-origin: 50% 25%;
  animation: clipSwing 0.56s cubic-bezier(0.22, 1, 0.36, 1);
}
.b-cell.is-filled.is-anim {
  animation: tileStamp 0.4s cubic-bezier(0.22, 1, 0.36, 1) var(--stagger, 0ms) both;
}
.b-cell.is-center.is-anim .center-seal-img,
.b-cell.is-center.is-anim .center-seal-overlay {
  animation: sealPress 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

/* 5. Playful preview tile hover + center seal spring rock */
.preview-grid .b-cell.is-filled,
.preview-grid .b-cell.is-center {
  cursor: pointer;
}
.preview-grid .b-cell.is-filled:hover {
  transform: rotate(0deg) translate3d(0, -4px, 0) scale(1.065);
  z-index: 8;
}
.b-cell.is-center:hover .center-seal-img {
  transform: scale(1.075) rotate(-2.5deg);
}
.center-seal-img {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}
@keyframes cellPop {
  0%   { transform: rotate(var(--rot, 0deg)) scale(1); }
  38%  { transform: rotate(0deg) scale(1.13) translateY(-4px); }
  72%  { transform: rotate(var(--rot, 0deg)) scale(0.97); }
  100% { transform: rotate(var(--rot, 0deg)) scale(1); }
}
.b-cell.is-pop {
  animation: cellPop 0.38s cubic-bezier(0.22, 1, 0.36, 1) !important;
  z-index: 10;
}

/* 6. Subtle metallic diagonal foil glint on tiles & primary CTA button */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -75%;
  width: 48%;
  height: 140%;
  background: linear-gradient(108deg, transparent 0%, rgba(255, 252, 238, 0.48) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  opacity: 0;
}
@keyframes ctaAutoSheen {
  0%, 72%, 100% { left: -75%; opacity: 0; }
  76%           { opacity: 0.9; }
  92%           { left: 130%; opacity: 0; }
}
#createSubmitBtn::after {
  animation: ctaAutoSheen 5.6s ease-in-out 1.4s infinite;
}
.btn-primary:hover::after {
  animation: none;
  left: 130%;
  opacity: 1;
  transition: left 0.58s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}
.btn-arrow {
  display: inline-block;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Foil tile shimmer glint (on hover + gentle periodic ambient glint) */
.b-tile-glint {
  position: absolute;
  top: -25%;
  left: -95%;
  width: 60%;
  height: 150%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 250, 232, 0.42) 50%, transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 3;
}
@keyframes tileGlintSweep {
  0%   { left: -95%; opacity: 0; }
  20%  { opacity: 1; }
  100% { left: 145%; opacity: 0; }
}
.b-cell.is-filled:hover .b-tile-glint,
.b-cell.is-filled.is-glint .b-tile-glint {
  animation: tileGlintSweep 0.78s cubic-bezier(0.22, 1, 0.36, 1);
}
.theme-editorial .b-tile-glint {
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.32) 50%, transparent 100%);
}

/* Empty cell subtle alive pulse on homepage */
@keyframes emptyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.72; transform: scale(0.975); }
}
.b-cell.is-empty.is-hint-pulse {
  animation: emptyPulse 1.1s ease-in-out;
}

/* Swatch press spring */
@keyframes swatchBounce {
  0%   { transform: scale(0.92); }
  55%  { transform: scale(1.18); }
  100% { transform: scale(1.1); }
}
.theme-opt.is-active .swatch {
  animation: swatchBounce 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Modal spring entrance */
@keyframes modalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalPop {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.955); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.modal-backdrop:not([hidden]) {
  animation: modalFade 0.2s ease-out;
}
.modal-backdrop:not([hidden]) .modal-card {
  animation: modalPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Below-the-fold scroll reveal */
.reveal-ready {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--rv-d, 0ms);
}
.reveal-ready.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Celebratory micro foil confetti particles */
@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  70% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -60px), 0) rotate(var(--sr, 180deg)) scale(0.25);
  }
}
.bwf-spark {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  pointer-events: none;
  z-index: 3000;
  animation: sparkFly var(--dur, 720ms) cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
  will-change: transform, opacity;
}
.bwf-spark.is-round { border-radius: 50%; width: 5px; height: 5px; }
.bwf-spark.is-star  {
  width: 9px; height: 9px;
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
}

/* =========================================================
   VISIBLE INVITE LINK BOX & INLINE HOMEPAGE SHARE PANEL
   ========================================================= */

.create-box[hidden] { display: none; }

@keyframes createdSwapIn {
  0%   { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.created-box:not([hidden]) {
  padding: 16px 20px 14px;
  animation: createdSwapIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.live-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #166534;
  background: rgba(22, 163, 74, 0.14);
  border: 1px solid rgba(22, 163, 74, 0.32);
  padding: 3px 10px;
  border-radius: 999px;
}
html[data-theme="midnight"] .live-pill,
html[data-theme="deco"] .live-pill {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(134, 239, 172, 0.35);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}
html[data-theme="midnight"] .live-dot,
html[data-theme="deco"] .live-dot { background: #4ade80; }

.live-progress-txt {
  font-size: 12px;
  font-weight: 600;
  color: var(--panel-muted);
}

.created-sub {
  margin: 0 0 11px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--panel-muted);
}

/* Visible read-only share URL box with inline Copy button */
.share-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1.5px solid var(--accent);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.07);
}
.share-url-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 7px 4px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 12.2px !important;
  font-weight: 600;
  color: var(--panel-ink) !important;
  text-overflow: ellipsis;
}
.share-url-input:focus { outline: none; box-shadow: none !important; }

.btn-copy-mini {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
html[data-theme="crimson"] .btn-copy-mini { background: #5a101f; color: #fbf2e4; }
.btn-copy-mini:hover { filter: brightness(1.08); transform: translateY(-0.5px); }
.btn-copy-mini.is-copied {
  background: #15803d !important;
  color: #ffffff !important;
}

.share-quick-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.share-quick-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--panel-muted);
  margin-right: 2px;
}
.share-chip-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--panel-ink);
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.14s ease;
}
.share-chip-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.share-chip-btn[hidden] { display: none; }

button.code-chip-box.is-clickable {
  width: 100%;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-top: 10px;
  transition: border-color 0.16s ease, background 0.16s ease;
}
button.code-chip-box.is-clickable:hover { border-color: var(--accent); }

.created-swatch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--input-border);
}
.created-swatches { display: flex; align-items: center; gap: 8px; }
.mini-sw-btn {
  padding: 2px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mini-sw-btn .mini-dot { width: 20px; height: 20px; }
.mini-sw-btn:hover { transform: scale(1.1); }
.mini-sw-btn.is-active { border-color: var(--accent); transform: scale(1.12); }

.created-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--input-border);
  font-size: 12.5px;
}
.created-link-strong {
  color: var(--panel-ink);
  font-weight: 700;
  text-decoration: none;
}
.created-link-strong:hover { text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="crimson"] .created-foot .btn-tiny-ghost { color: #7a1527; }

.nav-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-ink);
  vertical-align: middle;
}

/* Owner empty-state nudge banner & friends-only invite modal */
.empty-nudge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 22px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--panel-bg);
  color: var(--panel-ink);
  border: 1.5px solid var(--panel-border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}
html[data-theme="crimson"] .empty-nudge-banner { border-radius: 6px; border-color: #c5a463; }
.nudge-copy { max-width: 600px; }
.nudge-copy strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--panel-ink);
  margin-bottom: 2px;
}
.nudge-copy span {
  font-size: 13px;
  color: var(--panel-muted);
  line-height: 1.45;
}
.nudge-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.inv-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--modal-ink);
  margin-bottom: 10px;
}

.b-cell.is-owner-empty .b-cell-plus {
  font-size: 9px;
  letter-spacing: 0.03em;
}

/* =========================================================
   WARM SOCIAL UX: COUNTDOWN, URGENCY BOX, AVATARS & OVERLAY
   ========================================================= */

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  margin-bottom: 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  color: var(--ink);
  animation: heroRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html[data-theme="editorial"] .countdown-pill {
  background: rgba(255, 252, 246, 0.9);
  border-color: rgba(155, 29, 44, 0.22);
  color: #3a2320;
}
.cd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 29, 44, 0.2);
}
html[data-theme="crimson"] .cd-dot,
html[data-theme="midnight"] .cd-dot,
html[data-theme="deco"] .cd-dot {
  box-shadow: 0 0 0 3px rgba(223, 192, 132, 0.25);
}
.cd-sep { opacity: 0.45; }

/* Unmissable warm urgency box when spots are empty */
.urgency-box {
  padding: 11px 13px;
  margin-bottom: 11px;
  border-radius: 11px;
  background: rgba(155, 29, 44, 0.08);
  border: 1.5px solid rgba(155, 29, 44, 0.36);
}
html[data-theme="crimson"] .urgency-box {
  background: #f9ecda;
  border-color: #b43c2f;
}
html[data-theme="midnight"] .urgency-box,
html[data-theme="deco"] .urgency-box {
  background: rgba(226, 188, 108, 0.14);
  border-color: rgba(235, 200, 124, 0.62);
}
.urgency-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.urgency-top strong {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: #841623;
}
html[data-theme="midnight"] .urgency-top strong,
html[data-theme="deco"] .urgency-top strong {
  color: #f6df9d;
}
.urgency-need {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #8f1a28;
  color: #ffffff;
  white-space: nowrap;
}
html[data-theme="midnight"] .urgency-need,
html[data-theme="deco"] .urgency-need {
  background: #e5c67d;
  color: #131008;
}
.urgency-track { margin-bottom: 6px !important; height: 6px !important; }
.urgency-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--panel-ink);
}

/* Ready-to-send chat caption bubble */
.group-msg-chip {
  width: 100%;
  margin-top: 9px;
  padding: 8px 12px;
  text-align: left;
  border-radius: 11px;
  border: 1px dashed var(--input-border);
  background: var(--input-bg);
  color: var(--panel-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-sans);
  transition: border-color 0.16s ease, transform 0.14s ease;
}
.group-msg-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.gmc-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--panel-muted);
}
.gmc-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.8px;
  line-height: 1.35;
  color: var(--panel-ink);
}

/* Floating translucent empty-board callout (shown ONLY when 0/24 empty!) */
.board-empty-overlay {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: 46px;
  z-index: 12;
  width: min(86%, 342px);
  padding: 16px 18px 14px;
  text-align: center;
  border-radius: 16px;
  background: rgba(252, 248, 241, 0.96);
  color: #211613;
  border: 1.5px solid rgba(155, 29, 44, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 22px 46px rgba(12, 5, 6, 0.32);
  animation: createdSwapIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.board-empty-overlay[hidden] { display: none; }
.theme-midnight .board-empty-overlay {
  background: rgba(19, 22, 36, 0.94);
  color: #faf4e8;
  border-color: rgba(230, 198, 126, 0.58);
}
.theme-deco .board-empty-overlay {
  border-color: #c5a258;
  box-shadow: 0 22px 48px rgba(4, 12, 26, 0.42);
}
.ov-close {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(120, 100, 80, 0.14);
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.ov-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(155, 29, 44, 0.12);
  color: #8b1826;
  margin-bottom: 6px;
}
.theme-midnight .ov-kicker { background: rgba(229, 198, 125, 0.2); color: #f4dc98; }
.theme-deco .ov-kicker { background: rgba(14, 34, 61, 0.1); color: #0e223d; }
.board-empty-overlay strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.22;
  margin-bottom: 5px;
}
.board-empty-overlay p {
  margin: 0 0 12px;
  font-size: 12.2px;
  line-height: 1.42;
  opacity: 0.82;
}
.ov-btn { width: 100%; padding: 10px 14px; font-size: 13px; }

/* Playful soft placeholder friend seat labels on blank boards */
.seat-hint {
  position: absolute;
  bottom: 5px;
  left: 3px;
  right: 3px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(7px, 0.78vw, 8.6px);
  line-height: 1.05;
  opacity: 0.62;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s ease;
}
button.b-cell.is-empty:hover .seat-hint { opacity: 0; }
.theme-midnight .b-cell.is-empty .seat-hint { bottom: auto; top: 6px; left: 5px; right: 5px; text-align: left; }

/* Overlapping mini friend avatars in board footer */
.foot-social {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.avatar-stack {
  display: inline-flex;
  align-items: center;
}
.avatar-stack[hidden] { display: none; }
.av {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -5px;
  border: 1.5px solid #f8f4ec;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.av:first-child { margin-left: 0; }
.av-1 { background: #e9bcbc; color: #3a1416; }
.av-2 { background: #c2d6c6; color: #162e1c; }
.av-3 { background: #f3e29a; color: #33270d; }
.av-4 { background: #2c241d; color: #faf4e8; }
.theme-midnight .av { border-color: #111424; }
.theme-deco .av { border-color: #f8f2e4; }

.sheet-foot { opacity: 0.86; }

@media (max-width: 640px) {
  .countdown-pill { font-size: 11px; padding: 4px 10px; }
  .seat-hint { display: none; }
  .board-empty-overlay { width: 90%; padding: 14px 13px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal-ready { opacity: 1 !important; transform: none !important; }
  .bwf-spark { display: none !important; }
}
