/* ROOT THEME */
:root {
  color-scheme: dark;

  --bg: #04040a;
  --bg-deep: #020208;

  --card-bg: #101020;
  --card-bg-soft: #14142a;

  --accent: #ff3b82;
  --accent2: #ff7b52;

  --text-main: #f6f6ff;
  --text-dim: #b0b0c7;

  --radius-card: 18px;
  --shadow-card: 0 16px 40px rgba(0,0,0,0.8);

  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  font-family: var(--font-main);
  color: var(--text-main);
  height: 100%;
  overflow: hidden; /* app handles its own scroll */
}

/* APP LAYOUT */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  background: radial-gradient(circle at top, #14142a, #02020a);
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #0a0a14;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.top-left {
  display: flex;
  align-items: center;
}

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
}

.top-title {
  margin-left: 8px;
}

.title-main {
  font-size: 18px;
  font-weight: 700;
}

.title-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.icon-btn {
  background: #202042;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 16px;
  color: #fff;
}

/* MAIN – scrollable area */
.main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 10px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 430px;
}

/* TITLES / TEXT */
.card-title {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 700;
}

.lead-text {
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.inline-strong {
  font-weight: 700;
  color: #fff;
}

/* CARD / OBJECT TOGGLE */
.scan-domain-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}

.scan-domain-pill {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.05;
  text-align: center;
}


/* Poker row under domain pills (home screen) */
.scan-domain-toggle-poker{
  margin-top: 8px;
}
.scan-domain-pill {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #15152a;
  color: var(--text-dim);
  font-size: 13px;
  padding: 6px 8px;
}

/* ACTIVE pill uses theme accent colours */
.scan-domain-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}



/* Mind Game chip under Cards/Objects toggle (Cards tab only) */
.mindgame-row{
  display:flex;
  justify-content:flex-end;
  margin: 0 0 10px;
}
.mindgame-chip{
  border-radius:999px;
  padding:6px 10px;
  font-size:13px;
  font-weight:800;
  border:1px solid rgba(255,255,255,0.25);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color:#fff;
  box-shadow:
    0 6px 14px rgba(0,0,0,0.7),
    0 0 14px rgba(0,0,0,0.25);
}
.mindgame-chip:active{
  transform: scale(0.99);
}
/* SCAN VISUAL */
.scan-visual {
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Orbit slightly smaller so everything fits */
.scan-orbit {
  width: 140px;
  height: 140px;
  position: relative;
  margin-bottom: 4px;
}

/* PINK CORE */
.scan-core {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff, #ffd1df, #ff3b82 70%);
  box-shadow:
    0 0 20px rgba(255,255,255,0.6),
    0 0 48px rgba(255,59,130,0.8);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* RINGS */
.scan-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
}

.ring-outer {
  inset: 0;
}

.ring-middle {
  inset: 14px;
}

.ring-inner {
  inset: 28px;
}

/* SWEEP ARM */
.scan-sweep {
  position: absolute;
  width: 4px;
  height: 80px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.0),
    rgba(255,255,255,0.8),
    rgba(255,255,255,0.0)
  );
  top: 50%;
  left: 50%;
  transform-origin: 50% 100%;
  animation: sweep 2.5s linear infinite;
  opacity: 0.8;
}

@keyframes sweep {
  0% {
    transform: translate(-50%, -100%) rotate(0deg);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -100%) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -100%) rotate(360deg);
    opacity: 0.4;
  }
}

/* ACTIVE / IDLE STATES – class toggled in JS */
.scan-orbit.scanning {
  animation: orbit-bob 3.5s ease-in-out infinite;
}

@keyframes orbit-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

.scan-status {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* BUTTONS BASE */
.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  color: #fff;
}

.primary-btn {
  background: linear-gradient(135deg, #ff3b82, #ff7b52);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.8),
    0 0 16px rgba(255,59,130,0.7);
}

.primary-btn-lg {
  padding: 11px 16px;
  font-size: 17px;
  width: 100%;
}

.secondary-btn {
  background: radial-gradient(circle at top, #3a3a68, #202042);
}

/* YES/NO ROW */
.controls-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Special styling for the Yes/No buttons row */
.question-buttons {
  margin-top: 10px;
  justify-content: space-between;
}

/* Wider, fancier Yes/No buttons */
.primary-btn-yes,
.secondary-btn-no {
  flex: 1;
  min-width: 0;
  padding: 11px 10px;
  font-size: 16px;
  border-radius: 999px;
}

.primary-btn-yes {
  background: linear-gradient(135deg, #10b981, #22c55e);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.75),
    0 0 12px rgba(34,197,94,0.6);
}

.secondary-btn-no {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.75),
    0 0 12px rgba(248,113,113,0.55);
}

/* RESET BUTTON (spectator mis-press) */
.reset-btn {
  margin-top: 8px;
  width: 100%;
  font-size: 14px;
}

/* QUESTION AREA */
.question-block {
  margin-top: 8px;
  padding: 8px 8px 10px;
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    rgba(10,10,24,0.96),
    rgba(16,16,40,0.98)
  );
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 12px 30px rgba(0,0,0,0.85);
}

.question-title {
  font-size: 15px;
  margin-bottom: 4px;
  text-align: center;
}

.question-body {
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
  color: #ffffff;
  font-weight: 600;
  margin: 4px 0 8px;
}

/* VALUE CHIP ROW */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* Suit YES/NO split layout (Cards normal+glimpse suit questions) */
.suit-split-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}

.suit-col{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 6px;
}

.suit-col-label{
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 800;
}


.chip {
  background: #34345f;
  border-radius: 999px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,0.22);
  font-weight: 600;
  font-size: 14px;
}

/* STEP HINT */
.step-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* OBJECT GRID BUTTON */
.object-grid-btn {
  margin-top: 8px;
  width: 100%;
}

/* FOOTER */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 8px;
  background: #050510;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.footer-left,
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-center {
  justify-content: center;
  flex: 1;
}

.footer-brand {
  opacity: 0.7;
}

.footer-link {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 999px;
}

/* MODE DOT: normal vs force vs glimpse */
.mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #55596a; /* normal mode = grey */
}

.mode-dot.force {
  background: #3f9cff; /* force mode = subtle blue */
}

.mode-dot.glimpse {
  background: #f97373; /* glimpse mode = soft red */
}

/* CARD HINT: tiny secret card code */
.card-hint {
  font-size: 11px;
  opacity: 0.65;
}


/* --- TOP BAR: keep all 4 buttons in one row on small screens --- */
.top-left{min-width:0; flex:1 1 auto;}
.top-title{min-width:0;}
.title-main,.title-sub{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.top-right{flex:0 0 auto; display:flex; align-items:center; gap:10px; flex-wrap:nowrap;}
@media (max-width:420px){
  .title-sub{display:none;}
  .top-bar{padding:10px 10px;}
  .top-right{gap:8px;}
  .icon-btn{padding:6px 8px;}
}

/* MODALS */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
}

.modal-body {
  position: relative;
  background: #101022;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 20px;
  width: min(380px, 90vw);
  box-shadow: 0 22px 55px rgba(0,0,0,0.9);
  text-align: center;
}

/* instructions modal: allow more scrolling text */
.instructions-body {
  max-height: 80dvh;
  overflow-y: auto;
  text-align: left;
}

.instructions-body h3 {
  text-align: center;
  margin-top: 0;
}

.instructions-body h4 {
  margin: 12px 0 4px;
  font-size: 15px;
}

.instructions-body h5 {
  margin: 8px 0 4px;
  font-size: 14px;
}

.instr-list {
  margin: 4px 0 8px 16px;
  padding: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.instr-list li {
  margin-bottom: 4px;
}

.instructions-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* OBJECTS MODAL */
.objects-body {
  max-height: 80dvh;
  overflow-y: auto;
}

.objects-intro,
.objects-footnote {
  font-size: 13px;
  color: var(--text-dim);
  margin: 6px 0 10px;
}

.objects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.object-tile {
  background: #141428;
  border-radius: 14px;
  padding: 6px 6px 8px;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.object-img {
  max-width: 100%;
  height: 72px;
  object-fit: contain;
  display: block;
}

/* Make the Pen appear larger (only in the OBJECTS grid) */
#objectsModal .object-tile[data-value="1"] .object-img {
  transform: scale(2.0);
  transform-origin: center;
}

.object-label {
  margin-top: 4px;
  font-size: 13px;
}

/* REVEAL TEXT */
.reveal-header-label {
  font-size: 13px;
  color: var(--text-dim);
}

.reveal-title {
  margin: 4px 0;
  font-size: 24px;
}

.reveal-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.word-box {
  border-radius: 14px;
  padding: 14px 6px;
  background: linear-gradient(to bottom, #464674, #1a1a30);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 10px 26px rgba(0,0,0,0.85);
  font-size: 20px;
  font-weight: 900;
  text-transform: lowercase;
}

/* INFO / HELP modal button */
.modal-close-btn {
  margin-top: 10px;
  width: 100%;
}

/* TECH OVERLAY (unused here, kept for future) */
.tech-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: transparent;
}

/* LOGIN VIEW */
.login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #14142a, #02020a);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #101022;
  border-radius: 18px;
  padding: 20px 18px 16px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.9);
}

.login-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  margin: 0 auto 8px;
}

.login-title {
  text-align: center;
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 13px;
  text-align: center;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.login-label {
  font-size: 13px;
  margin-top: 8px;
  display: block;
}

.login-input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: #070712;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.login-remember input {
  width: 16px;
  height: 16px;
}

.login-btn {
  margin-top: 12px;
}

.login-error {
  margin-top: 8px;
  font-size: 12px;
  color: #f97373;
  min-height: 16px;
}

.login-footnote {
  margin-top: 8px;
  font-size: 11px;
  text-align: center;
  color: var(--text-dim);
}

/* UTILITIES */
.hidden {
  display: none !important;
}

/* ------------------------------
   THEME VARIANTS (via data-theme)
   Help button cycles these.
------------------------------ */

/* Default: current look, no extra overrides needed */

/* NEON THEME: deeper purple with hot pink/teal highlights */
body[data-theme="neon"] {
  --accent: #ff4fa3;
  --accent2: #ffb347;
}

body[data-theme="neon"] .app-shell {
  background: radial-gradient(circle at top, #1a0b2f 0%, #050013 55%, #020008 100%);
}

body[data-theme="neon"] .top-bar {
  background: rgba(8, 4, 20, 0.98);
  border-bottom-color: rgba(255,255,255,0.1);
}

body[data-theme="neon"] .login-view {
  background: radial-gradient(circle at top, #1a0b2f 0%, #050013 55%, #020008 100%);
}

body[data-theme="neon"] .scan-core {
  background:
    radial-gradient(circle at 30% 20%, #ffffff, #ffd6ff, #ff4fa3 70%);
  box-shadow:
    0 0 24px rgba(255,255,255,0.7),
    0 0 60px rgba(255,79,163,0.9);
}

body[data-theme="neon"] .scan-sweep {
  background: linear-gradient(
    to bottom,
    rgba(164, 249, 255, 0.0),
    rgba(164, 249, 255, 0.9),
    rgba(164, 249, 255, 0.0)
  );
}

/* Neon primary button + yes/no + chips + word boxes */
body[data-theme="neon"] .primary-btn {
  background: linear-gradient(135deg, #ff4fa3, #ffb347);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 20px rgba(255,79,163,0.9);
}

body[data-theme="neon"] .primary-btn-yes {
  background: linear-gradient(135deg, #22c55e, #a7f3d0);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 18px rgba(16,185,129,0.8);
}

body[data-theme="neon"] .secondary-btn-no {
  background: linear-gradient(135deg, #fb7185, #f97316);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 18px rgba(248,113,113,0.8);
}

body[data-theme="neon"] .chip {
  background: rgba(76, 81, 191, 0.9);
  border-color: rgba(191, 219, 254, 0.9);
}

body[data-theme="neon"] .word-box {
  background: linear-gradient(to bottom, #6d28d9, #1e1b4b);
  border-color: rgba(221, 214, 254, 0.95);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.95);
}

/* MIDNIGHT THEME: cooler blue/teal radar */
body[data-theme="midnight"] {
  --accent: #0ea5e9;
  --accent2: #22d3ee;
}

body[data-theme="midnight"] .app-shell {
  background: radial-gradient(circle at top, #001523 0%, #00040a 55%, #000000 100%);
}

body[data-theme="midnight"] .top-bar {
  background: #020814;
  border-bottom-color: rgba(148, 163, 184, 0.25);
}

body[data-theme="midnight"] .login-view {
  background: radial-gradient(circle at top, #001523 0%, #00040a 55%, #000000 100%);
}

body[data-theme="midnight"] .scan-core {
  background:
    radial-gradient(circle at 30% 20%, #e0f2fe, #38bdf8, #0ea5e9 70%);
  box-shadow:
    0 0 24px rgba(191, 219, 254, 0.8),
    0 0 60px rgba(56, 189, 248, 0.9);
}

body[data-theme="midnight"] .scan-sweep {
  background: linear-gradient(
    to bottom,
    rgba(45, 212, 191, 0.0),
    rgba(45, 212, 191, 0.9),
    rgba(45, 212, 191, 0.0)
  );
}

/* Midnight buttons/word boxes/chips */
body[data-theme="midnight"] .primary-btn {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 20px rgba(56,189,248,0.85);
}

body[data-theme="midnight"] .primary-btn-yes {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 18px rgba(34,197,94,0.8);
}

body[data-theme="midnight"] .secondary-btn-no {
  background: linear-gradient(135deg, #f97316, #facc15);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.9),
    0 0 18px rgba(250,204,21,0.7);
}

body[data-theme="midnight"] .chip {
  background: rgba(30, 64, 175, 0.9);
  border-color: rgba(125, 211, 252, 0.9);
}

body[data-theme="midnight"] .word-box {
  background: linear-gradient(to bottom, #0f172a, #020617);
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 14px 32px rgba(15,23,42,0.95);
}

/* STEALTH THEME: pure black background with subtle pink highlights */
body[data-theme="stealth"] .app-shell {
  background: #000000;
}

body[data-theme="stealth"] .top-bar {
  background: #000000;
  border-bottom-color: rgba(255,255,255,0.16);
}

body[data-theme="stealth"] .app-footer {
  background: #000000;
  border-top-color: rgba(255,255,255,0.16);
}

body[data-theme="stealth"] .card {
  background: #050505;
}

body[data-theme="stealth"] .login-view {
  background: #000000;
}

body[data-theme="stealth"] .scan-core {
  background:
    radial-gradient(circle at 30% 20%, #ffffff, #f5f5f5, #ff3b82 70%);
  box-shadow:
    0 0 18px rgba(255,255,255,0.7),
    0 0 40px rgba(255,59,130,0.9);
}

/* ------------------------------
   EXTRA THEMES
   neon-green & funky-yellow
------------------------------ */

/* NEON GREEN THEME: vivid lime with dark teal background */
body[data-theme="neon-green"] {
  --accent: #22c55e;
  --accent2: #a3e635;
}

body[data-theme="neon-green"] .app-shell {
  background: radial-gradient(circle at top, #022c22 0%, #00110f 55%, #000000 100%);
}

body[data-theme="neon-green"] .top-bar {
  background: #001612;
  border-bottom-color: rgba(110, 231, 183, 0.5);
}

body[data-theme="neon-green"] .app-footer {
  background: #000b09;
  border-top-color: rgba(110, 231, 183, 0.4);
}

body[data-theme="neon-green"] .login-view {
  background: radial-gradient(circle at top, #022c22 0%, #00110f 55%, #000000 100%);
}

/* neon-green scanner */
body[data-theme="neon-green"] .scan-core {
  background:
    radial-gradient(circle at 30% 20%, #ecfccb, #bef264, #22c55e 70%);
  box-shadow:
    0 0 24px rgba(190, 242, 100, 0.9),
    0 0 60px rgba(16, 185, 129, 0.95);
}

body[data-theme="neon-green"] .scan-sweep {
  background: linear-gradient(
    to bottom,
    rgba(74, 222, 128, 0.0),
    rgba(74, 222, 128, 0.95),
    rgba(74, 222, 128, 0.0)
  );
}

/* neon-green buttons & chips */
body[data-theme="neon-green"] .primary-btn {
  background: linear-gradient(135deg, #22c55e, #a3e635);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 22px rgba(34, 197, 94, 0.9);
}

body[data-theme="neon-green"] .primary-btn-yes {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 20px rgba(74, 222, 128, 0.9);
}

body[data-theme="neon-green"] .secondary-btn-no {
  background: linear-gradient(135deg, #f97316, #facc15);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 18px rgba(250, 204, 21, 0.85);
}

body[data-theme="neon-green"] .chip {
  background: rgba(21, 128, 61, 0.9);
  border-color: rgba(190, 242, 100, 0.9);
}

body[data-theme="neon-green"] .word-box {
  background: linear-gradient(to bottom, #14532d, #022c22);
  border-color: rgba(190, 242, 100, 0.9);
  box-shadow: 0 14px 32px rgba(2, 44, 34, 0.95);
}

/* FUNKY YELLOW THEME: punchy yellow/orange with purple accents */
body[data-theme="funky-yellow"] {
  --accent: #facc15;
  --accent2: #f97316;
}

body[data-theme="funky-yellow"] .app-shell {
  background: radial-gradient(circle at top, #2b0b36 0%, #12000b 45%, #050008 100%);
}

body[data-theme="funky-yellow"] .top-bar {
  background: #12000b;
  border-bottom-color: rgba(251, 191, 36, 0.6);
}

body[data-theme="funky-yellow"] .app-footer {
  background: #080008;
  border-top-color: rgba(251, 191, 36, 0.6);
}

body[data-theme="funky-yellow"] .login-view {
  background: radial-gradient(circle at top, #2b0b36 0%, #12000b 45%, #050008 100%);
}

/* funky-yellow scanner */
body[data-theme="funky-yellow"] .scan-core {
  background:
    radial-gradient(circle at 30% 20%, #fef9c3, #fde047, #f97316 70%);
  box-shadow:
    0 0 24px rgba(253, 224, 71, 0.95),
    0 0 60px rgba(249, 115, 22, 0.95);
}

body[data-theme="funky-yellow"] .scan-sweep {
  background: linear-gradient(
    to bottom,
    rgba(244, 224, 94, 0.0),
    rgba(244, 224, 94, 0.95),
    rgba(244, 224, 94, 0.0)
  );
}

/* funky-yellow buttons & chips */
body[data-theme="funky-yellow"] .primary-btn {
  background: linear-gradient(135deg, #facc15, #f97316);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 22px rgba(250, 204, 21, 0.9);
}

body[data-theme="funky-yellow"] .primary-btn-yes {
  background: linear-gradient(135deg, #22c55e, #84cc16);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 20px rgba(132, 204, 22, 0.9);
}

body[data-theme="funky-yellow"] .secondary-btn-no {
  background: linear-gradient(135deg, #fb7185, #ec4899);
  box-shadow:
    0 8px 18px rgba(0,0,0,0.95),
    0 0 20px rgba(236, 72, 153, 0.9);
}

body[data-theme="funky-yellow"] .chip {
  background: rgba(147, 51, 234, 0.95);
  border-color: rgba(251, 191, 36, 0.95);
}

body[data-theme="funky-yellow"] .word-box {
  background: linear-gradient(to bottom, #4c1d95, #1e1035);
  border-color: rgba(251, 191, 36, 0.9);
  box-shadow: 0 14px 32px rgba(24, 8, 39, 0.95);
}

/* ------------------------------
   STACK MODE UI
------------------------------ */

.stack-select {
  margin-top: 10px;
  padding: 10px 8px;
  border-radius: 14px;
  background: #101022;
  border: 1px solid rgba(255,255,255,0.12);
}

.stack-select-label {
  font-size: 13px;
  margin-bottom: 6px;
}

.stack-pill-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.stack-pill {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #15152a;
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 4px;
}

.stack-pill-active {
  background: linear-gradient(135deg, #ff3b82, #ff7b52);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

.stack-note {
  font-size: 12px;
  color: var(--text-dim);
  margin: 4px 0;
}

.stack-custom-input {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #070712;
  color: #fff;
  font-size: 12px;
  box-sizing: border-box;
}

.stack-custom-hint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.stack-position-row {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.stack-position-text {
  font-size: 14px;
  color: var(--text-main);
}


/* Hide value/suit chips when Force mode uses pure Yes/No profiling */
.chips-hidden{display:none !important;}
/* =========================
   Pair + Notes overlays
   (Step 2: UI shells only)
========================= */

/* Make these modals feel "full screen" without changing global modal behaviour */
.pair-body,
.notes-body {
  width: min(420px, 94vw);
}

/* QR screen */
.pair-body {
  position: fixed;
  inset: 0;
  background: #0b0b12; /* solid dark background */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}


.pair-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.pair-qr {
  width: 260px;
  height: 260px;
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* placeholder cross-hatch so it's obvious it's a QR area */

.pair-qr::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%, transparent 50%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.08) 75%, transparent 75%, transparent);
  background-size: 24px 24px;
  opacity: 0.35;
}

.pair-link {
  font-size: 13px;
  color: var(--text-dim);
  word-break: break-all;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-block;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.pair-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.75;
}

/* Notes screen */
.notes-body {
  text-align: left;
  padding: 16px;
}

.notes-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.notes-title {
  font-size: 18px;
  font-weight: 900;
}

.notes-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

.notes-toolbar {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.notes-tool {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 16px;
}
/* ------------------------------
   Audio Peek button polish
------------------------------ */

.notes-audio {
  position: relative;
}

.notes-audio-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
}

/* OFF state */
.notes-audio:not(.active) {
  opacity: 0.6;
}

/* ON state */
.notes-audio.active {
  opacity: 1;
}

/* press feel */
.notes-audio:active {
  transform: scale(0.96);
}
.notes-paper {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 12px 12px 10px;
  line-height: 1.35;
}

.notes-paper p {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.notes-divider {
  text-align: center;
  opacity: 0.5;
}

.notes-reveal {
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.02em;
}
/* Pair screen – hide all text, QR only */
#pairModal .pair-title,
#pairModal .pair-link,
#pairModal .pair-hint {
  display: none !important;
}
/* =========================
   NOTES: force full-screen (real notes look)
========================= */

#notesModal .modal-backdrop{
  display:none !important;
}

/* override any modal-body sizing rules */
#notesModal .modal-body.notes-body{
  position:fixed !important;
  inset:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  margin:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;

  background:#ffffff !important;
  color:#111111 !important;

  padding:22px 18px 18px !important;
  display:flex !important;
  flex-direction:column !important;
}

/* Notes header layout (grid = Done aligns with Notes line) */
#notesModal .notes-top{
  display:grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-rows: auto auto !important;
  column-gap: 16px !important;
  row-gap: 2px !important;
  align-items:start !important;
  width:100% !important;
}

#notesModal .notes-title{
  grid-column: 1 !important;
  grid-row: 1 !important;
  text-align:left !important;
}

#notesModal .notes-subtitle{
  grid-column: 1 !important;
  grid-row: 2 !important;
  text-align:left !important;
}

#notesModal .notes-done{
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self:end !important;
  align-self:start !important;
  margin:0 !important;
  padding-top: 6px !important;
}

/* Header */
#notesModal .notes-title{
  font-size:34px !important;
  font-weight:800 !important;
  margin:0 !important;
  color:#111 !important;
}
#notesModal .notes-subtitle{
  font-size:14px !important;
  margin-top:2px !important;
  color:#666 !important;
}

/* Toolbar */
#notesModal .notes-toolbar{
  display:flex !important;
  gap:10px !important;
  margin:18px 0 14px !important;
  width:100% !important;
}

#notesModal .notes-tool{
  background:#f2f2f2 !important;
  border:1px solid #e0e0e0 !important;
  color:#111 !important;
  border-radius:14px !important;
  padding:12px 10px !important;
  font-size:22px !important;
  min-width:0 !important;
  flex:1 1 0 !important;

  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* underline active tool */
#notesModal .notes-tool.active{
  border-bottom:4px solid #111 !important;
}

/* Paper/content */
#notesModal .notes-paper{
  flex:1 !important;
  min-height:0 !important;          /* IMPORTANT: allows flex child to shrink & scroll */
  overflow-y:auto !important;
  -webkit-overflow-scrolling: touch !important;
  background:#ffffff !important;
  border:0 !important;
  padding:0 !important;
  margin-top:6px !important;
}

/* iOS SAFARI: force scrolling inside the notes text area only */
#notesModal .modal-body.notes-body{
  height: 100dvh !important;     /* iOS-friendly viewport */
  overflow: hidden !important;   /* prevent the whole screen from trying to scroll */
}

#notesModal .notes-paper{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: scroll !important;                 /* force scroll */
  -webkit-overflow-scrolling: touch !important;  /* smooth iOS scrolling */
  padding-bottom: 40px !important;               /* so last line isn’t hidden */
  overscroll-behavior: contain !important;
}

#notesModal .notes-paper p{
  font-size:18px !important;
  line-height:1.45 !important;
  color:#222 !important;
  margin:0 0 16px !important;
}

#notesModal .notes-reveal{
  font-weight:800 !important;
  color:#111 !important;
}
#notesModal .notes-paper p{
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
/* iOS/PWA: prevent right-edge clipping */
#notesModal .modal-body.notes-body{
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

#notesModal .notes-paper{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 2px !important; /* tiny safety */
}

#notesModal .notes-paper p{
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#notesModal .notes-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  width:100%;
}

/* align Done with the Notes title (first line) */
#notesModal .notes-done{
  margin-top: 6px;
}

#notesModal .notes-top > div{
  text-align:left;
}

#notesModal .notes-done{
  background:none;
  border:none;
  font-size:18px;
  font-weight:600;
  color:#111;               /* black */
  padding:6px 0;
  margin-left:auto;         /* push it to the right */
}



/* =========================
   POKER FORCE KEYPAD (Performer)
========================= */
.pokerforce-body { max-width: 520px; }
.pokerforce-display{
  margin: 10px 0 14px;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  text-align:center;
}
.pokerforce-code{
  font-weight: 900;
  font-size: 34px;
  letter-spacing: 0.08em;
}
.pokerforce-hint{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}
.pokerforce-pad{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pf-key, .pf-send{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
  border-radius: 14px;
  padding: 14px 10px;
  font-weight: 900;
  font-size: 18px;
}
.pf-key:active, .pf-send:active{ transform: translateY(1px); }
.pf-wide{ font-size: 14px; }
.pf-suit{ font-size: 16px; letter-spacing: 0.08em; }
.pf-send{
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.10);
  font-size: 16px;
}
.pokerforce-cats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 10px;
}
.pf-cat{
  font-size: 13px;
  padding: 12px 8px;
}
.pf-cat.active{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-color: rgba(255,255,255,0.30);
}
.lastpick-body{
  max-width: 720px;
  min-height: min(720px, 84dvh);
  padding: 24px 20px 24px;
  display: flex;
  flex-direction: column;
}
.lastpick-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:20px;
}
.lastpick-title{
  margin:0;
  font-size:24px;
  line-height:1.1;
}
.lastpick-subtitle{
  margin:4px 0 0;
  font-size:13px;
  color:var(--text-dim);
  min-height:0;
}
.lastpick-stage{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
}
.lastpick-instruction{
  text-align:center;
  font-size:18px;
  font-weight:700;
  line-height:1.3;
  margin:0 0 22px 0;
}
.lastpick-boxes{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:14px;
  margin-bottom:22px;
}
.lastpick-box{
  min-height:156px;
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.12);
  background:linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  color:#fff;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.lastpick-box.is-centre{
  border-color:rgba(255,255,255,0.22);
  transform:scale(1.02);
}
.lastpick-box.is-selected{
  outline: 3px solid rgba(255,255,255,0.45);
  outline-offset: 2px;
}
.lastpick-box.is-counting{
  background: linear-gradient(135deg, rgba(120,180,255,0.35), rgba(255,255,255,0.08));
  border-color: rgba(140,190,255,0.75);
  transform: scale(1.04);
}
.lastpick-box.is-locked{
  background: linear-gradient(135deg, rgba(180,140,255,0.30), rgba(255,255,255,0.08));
}
.lastpick-box.is-revealed{
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.lastpick-box.is-revealed img{
  width: 100%;
  max-width: 92px;
  height: 72px;
  max-height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.lastpick-reveal-title{
  font-size: 12px;
  font-weight: 700;
  opacity: 0.8;
  line-height: 1.1;
}
.lastpick-reveal-value{
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}
.lastpick-box.is-forced{
  border-color: rgba(255,215,120,0.85);
  box-shadow: 0 0 0 2px rgba(255,215,120,0.18), 0 10px 30px rgba(0,0,0,0.25);
}
.lastpick-box-label{
  font-size:17px;
  font-weight:800;
  letter-spacing:0.04em;
}
.lastpick-number-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin:0;
}
.lastpick-number-label{
  font-size:14px;
  color:var(--text-dim);
  text-align:center;
  margin:0;
}
.lastpick-number-input{
  width:100%;
  min-height:56px;
  max-width:100%;
  box-sizing:border-box;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.05);
  color:#fff;
  text-align:center;
  font-size:22px;
  font-weight:700;
  outline:none;
}
.lastpick-actions{
  display:flex;
  gap:12px;
  margin-top:auto;
  padding-top:18px;
}
.lastpick-actions > button{
  flex:1;
}
@media (max-width: 640px){
  .lastpick-body{
    max-width: 720px;
    min-height: min(760px, 88dvh);
    padding:22px 14px 22px;
  }
  .lastpick-top{
    gap:10px;
    margin-bottom:18px;
  }
  .lastpick-instruction{
    margin:0 0 18px 0;
  }
  .lastpick-boxes{
    gap:12px;
    margin-bottom:18px;
  }
  .lastpick-box{
    min-height:128px;
    padding:10px;
  }
  .lastpick-box-label{
    font-size:15px;
  }
  .lastpick-number-wrap{
    gap:10px;
  }
  .lastpick-actions{
    gap:10px;
    padding-top:14px;
  }
}
.pokerforce-status{
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.70);
  text-align:center;
}


/* ------------------------------
   Stealth Mode (Notes-only)
------------------------------ */
#notesModal .notes-tool.notes-stealth{
  /* half white / half black */
  background: linear-gradient(90deg, #ffffff 0 50%, #111111 50% 100%) !important;
  border: 1px solid #d0d0d0 !important;
  padding:12px 10px !important;
}

#notesModal .notes-tool.notes-stealth .stealth-icon{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  /* small centre dot so it reads as a button, not a blank pill */
  background: rgba(0,0,0,0.12);
  display: inline-block;
}

#notesModal .stealth-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999; /* above Notes modal content */
  background-color: #000000;
  background-image: none;          /* set by JS */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  touch-action: manipulation;
}

#notesModal .force-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999; /* above Notes modal content */
  background-color: #000000;
  background-image: none;          /* set by JS */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  touch-action: manipulation;
}

/* Slight darken so it reads like a "sleep" screen */
#notesModal .force-overlay::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
}

/* Operator hint toast */
#notesModal .force-hint{
  position: absolute;
  left: 50%;
  bottom: 68px;              /* sits above iPhone home bar / Android nav area */
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.78);
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 10002;            /* above the overlay ::after */
  pointer-events: none;      /* never blocks taps */
  user-select: none;
  white-space: nowrap;
}

#notesModal .force-hint.hidden{
  display: none;
}

/* =============================
   Hide push debug overlay (performance)
   ============================= */
#enablePushBtn,
#pushStatus {
  display: none !important;
}

/* =========================
   THOUGHTS (Performer)
   Base modal/grid styling
========================= */

.thoughts-grid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thought-tile{
  min-height: 108px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px !important;
}

.thought-word{
  width: 100%;
  text-align: center;
  font-size: clamp(16px, 3.8vw, 22px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Last Pick / reveal boxes when the category is THOUGHTS */
.lastpick-box.is-revealed .thought-word{
  font-size: clamp(14px, 3.4vw, 20px);
}

/* =========================
   THOUGHTS — Last Pick reveal
========================= */

.lastpick-box.is-revealed .lastpick-reveal-value{
  text-align:center;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.lastpick-box.is-revealed .lastpick-reveal-value.thought-only{
  font-size: clamp(22px, 4.2vw, 34px);
  font-weight: 900;
  line-height: 1.05;
  margin: auto 0;
}

.lastpick-box.is-revealed .lastpick-reveal-title.thought-only{
  margin-bottom: 4px;
}