/* Phone / controller layout */
html, body {
  height: 100vh; /* fallback for older browsers */
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
body {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.player-tag { font-weight: 900; font-size: 1.05rem; color: var(--accent-cyan); }
.room-tag { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.08em; }

.phone-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 14px;
  overflow-y: auto;
  padding: 10px 0;
}

.hero { text-align: center; padding: 8px 0 4px; }
.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.05;
  color: var(--text-main);
}
.hero p { color: var(--text-muted); font-weight: 700; margin-top: 6px; font-size: 0.9rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
}
.section-label { font-size: 0.8rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.06em; }

input[type="text"] {
  width: 100%;
  background: var(--bg-deep);
  border: 2px solid var(--border-subtle);
  color: var(--text-main);
  padding: 14px;
  border-radius: 12px;
  font-size: 1.05rem; /* >=16px so iPhones don't zoom in */
  font-weight: 700;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent-cyan); }
.code-input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 900; }

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  background: var(--accent-cyan);
  color: #12172A;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; }
.btn-pink { background: var(--accent-pink); color: #FFFFFF; }
.btn-yellow { background: var(--accent-yellow); color: #12172A; }
.btn-secondary { background: var(--bg-elevated); color: var(--text-main); border: 1px solid var(--border-subtle); }
.btn-small { padding: 10px; font-size: 0.85rem; }

.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}
.choice-btn:disabled { opacity: 0.6; }
.choice-btn.picked { border-color: var(--accent-green); background: rgba(93, 201, 139, 0.14); opacity: 1; }

.mini-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.75rem;
}

.roster-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.roster-row { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding: 4px 0; }
.roster-row.offline { opacity: 0.45; }

.vip-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.timer-mini { font-weight: 900; color: var(--accent-yellow); min-width: 56px; }

.toast {
  background: rgba(228, 87, 46, 0.2);
  border: 1px solid var(--accent-pink);
  color: #FFFFFF;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-top: 8px;
}

/* Drawing pad (Sketch Bluff) */
.sketch-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#sketch-pad {
  background: #FFFFFF;
  border-radius: 14px;
  border: 3px solid var(--accent-cyan);
  touch-action: none;
}
.tool-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #FFFFFF; cursor: pointer; padding: 0; }
.swatch.active { transform: scale(1.2); box-shadow: 0 0 0 2px var(--accent-cyan); }

.site-footer { text-align: center; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; }
.site-footer a { color: var(--text-muted); }

/* How-to-play card */
.intro-steps { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.intro-steps li::marker { color: var(--accent-pink); font-weight: 900; }
.intro-score { margin-top: 12px; color: var(--accent-yellow); font-weight: 800; font-size: 0.9rem; }

/* "+500" when you score */
.score-pop {
  position: absolute;
  right: 4px;
  top: 100%;
  color: var(--accent-green);
  font-weight: 900;
  font-size: 1rem;
  animation: popDown 2.4s ease-out forwards;
  pointer-events: none;
}
@keyframes popDown {
  0% { opacity: 0; transform: translateY(-6px) scale(0.8); }
  15% { opacity: 1; transform: translateY(4px) scale(1.2); }
  75% { opacity: 1; transform: translateY(8px) scale(1); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* Someone knocking on a locked room (shown to the VIP) */
.knock-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(242, 179, 61, 0.14);
  border: 1px solid var(--accent-yellow);
  font-weight: 700;
  animation: popIn 0.25s ease-out;
}
.knock-yes { background: var(--accent-green); color: #12172A; border: none; }
.toast-good { background: rgba(93, 201, 139, 0.16); border-color: var(--accent-green); }

/* "How it works" guide on the home page */
.how-it-works summary { font-weight: 900; font-size: 1.05rem; cursor: pointer; list-style: none; }
.how-it-works summary::-webkit-details-marker { display: none; }
.how-it-works summary span { color: var(--text-muted); font-weight: 700; font-size: 0.85rem; }
.how-it-works summary::after { content: ' ▾'; color: var(--accent-cyan); }
.how-it-works[open] summary::after { content: ' ▴'; }
.how-it-works h4 { margin: 16px 0 6px; color: var(--accent-cyan); font-weight: 900; }
.how-it-works ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; line-height: 1.4; }
.how-it-works li::marker { color: var(--accent-pink); font-weight: 900; }
.how-it-works em { color: var(--accent-yellow); font-style: normal; font-weight: 800; }
.how-note { margin-top: 14px; color: var(--text-muted); font-size: 0.85rem; font-weight: 700; }

/* ---- Phone results (so the game works without seeing the TV) ---- */
.phone-results { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pr-title { font-weight: 900; font-size: 0.8rem; letter-spacing: 0.06em; color: var(--text-muted); }
.pr-row { background: var(--bg-deep, rgba(0,0,0,.25)); border: 2px solid transparent; border-radius: 12px; padding: 8px 10px; }
.pr-row.good { border-color: var(--accent-green); }
.pr-row.bad { border-color: var(--accent-pink); }
.pr-text { font-weight: 800; }
.pr-tag { display: inline-block; font-size: 0.7rem; font-weight: 900; background: var(--accent-yellow); color: #111; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; }
.pr-by { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; margin-top: 2px; }
.pr-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.phone-results .voter-pills { margin-top: 4px; }
.voter-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.voter-pill { background: var(--bg-elevated, #263049); border-radius: 999px; padding: 2px 8px; font-size: 0.72rem; font-weight: 800; }

/* ---- How-to-play: game tiles and slide-up sheet ---- */
.rules-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.rules-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px; border-radius: 14px; background: var(--bg-deep, rgba(0,0,0,.25)); border: 2px solid var(--border-subtle, rgba(255,255,255,.08)); color: inherit; cursor: pointer; font: inherit; }
.rules-tile:active { transform: scale(.97); }
.rt-icon { font-size: 1.7rem; line-height: 1; }
.rt-title { font-weight: 900; font-size: .72rem; text-align: center; line-height: 1.15; }
.rt-sub { font-size: .62rem; color: var(--text-muted); font-weight: 700; text-align: center; }
.rules-sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.rules-sheet-wrap.open { background: rgba(0,0,0,.6); }
.rules-sheet { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: var(--bg-card, #151a26); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
.rules-sheet-wrap.open .rules-sheet { transform: none; }
.rs-grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 12px; }
.rs-head { display: flex; gap: 12px; align-items: center; }
.rs-head .rt-icon { font-size: 2.4rem; }
.rs-head h2 { margin: 0; font-size: 1.35rem; }
.rs-head p { margin: 2px 0 0; color: var(--text-muted); font-size: .85rem; }
.rs-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.rs-label { font-size: .7rem; font-weight: 900; letter-spacing: .08em; color: var(--accent-cyan); margin-top: 14px; }
.rs-steps { padding-left: 22px; margin: 6px 0 0; display: flex; flex-direction: column; gap: 8px; }
.rs-steps li { font-weight: 700; line-height: 1.35; }
.rs-score { font-weight: 700; margin: 6px 0 0; }
.rs-note { color: var(--text-muted); font-size: .8rem; margin: 12px 0; }
.help-btn { background: var(--bg-elevated, #263049); color: inherit; border: 1px solid var(--border-subtle, rgba(255,255,255,.1)); border-radius: 10px; width: 36px; height: 36px; font-size: 1rem; font-weight: 900; cursor: pointer; }

/* ---- Host lobby: game list + sticky START ---- */
.host-games { display: flex; flex-direction: column; gap: 6px; }
.hg-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; background: var(--bg-card, #151a26); border: 2px solid var(--border-subtle, rgba(255,255,255,.08)); color: inherit; font: inherit; cursor: pointer; }
.hg-row.selected { border-color: var(--accent-cyan);  background: #232A40; }
.hg-row.short { opacity: .55; }
.hg-row.short.selected { opacity: 1; }
.hg-icon { font-size: 1.6rem; line-height: 1; width: 34px; text-align: center; }
.hg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hg-title { font-weight: 900; font-size: .95rem; }
.hg-sub { font-size: .72rem; color: var(--text-muted); font-weight: 700; }
.hg-status { font-size: .72rem; font-weight: 900; color: var(--accent-pink); white-space: nowrap; }
.hg-status.ok { font-size: .78rem; color: var(--accent-green); letter-spacing: .08em; }
.start-bar-space { height: 86px; }
.start-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg-deep, #0b0e15) 70%, transparent); z-index: 40; display: flex; justify-content: center; }
.start-bar .btn { max-width: 520px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; }
.start-bar .btn[disabled] { opacity: .7; }
.start-sub { font-size: .75rem; font-weight: 800; opacity: .9; }

/* ---- Home: how it works tabs ---- */
.how-card { border: 2px solid var(--accent-cyan); }
.how-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.how-tabs button { padding: 9px 4px; border-radius: 10px; font: inherit; font-weight: 900; font-size: .72rem; background: var(--bg-elevated, #263049); color: inherit; border: 2px solid transparent; cursor: pointer; }
.how-tabs button.on { border-color: var(--accent-cyan); background: rgba(86, 194, 214,.12); }
.how-steps { margin: 12px 0 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.how-steps li { line-height: 1.4; font-size: .92rem; }
.how-steps li::marker { font-weight: 900; color: var(--accent-cyan); }

.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--text-muted); font-weight: 800; font-size: .8rem; }
.or-line:before, .or-line:after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.12); }

.beta-tag { display: inline-block; vertical-align: middle; font-size: 0.7rem; font-weight: 900; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 999px; background: var(--accent-yellow, #F2B33D); color: #111; -webkit-text-fill-color: #111; }

/* ---- "Are you sure?" pop-up ---- */
.confirm-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 20px; animation: popIn .15s ease-out; }
.confirm-box { width: 100%; max-width: 380px; background: var(--bg-card, #151a26); border: 2px solid var(--accent-pink, #E4572E); border-radius: 20px; padding: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.confirm-box h2 { margin: 0 0 8px; font-size: 1.35rem; }
.confirm-box p { color: var(--text-muted); font-weight: 600; line-height: 1.4; margin: 0 0 16px; }
.confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- Hold to see the board ---- */
.peek-btn { margin-top: 10px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.peek-wrap { position: fixed; inset: 0; z-index: 110; background: #0b0e15; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.peek-inner { position: absolute; left: 50%; top: calc(50% - 16px); width: 900px; transform-origin: center center; }
.peek-inner .cp-board { height: auto !important; width: 100% !important; max-height: none !important; min-height: 0 !important; }
.peek-inner .tw-field { max-height: none !important; min-height: 0 !important; }
.peek-hint { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: .8rem; color: var(--text-muted); }

.host-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-weight: 800; font-size: .95rem; }
.host-steps span { display: inline-flex; align-items: center; gap: 7px; }
.host-steps b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-yellow); color: #12172A; font-family: 'Skeetown Cond', sans-serif; font-size: .95rem; }

/* Home page: readable width on laptops, game strip, laptop-only "this screen is the TV" */
.home-wrap { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; margin: 0 auto; }
.hero-line { font-family: 'Skeetown Cond', sans-serif; font-weight: 800; font-size: 1.35rem !important; color: var(--text-main) !important; letter-spacing: .02em; margin-top: 10px !important; }
.hero-games { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 380px; margin: 10px auto 0; }
.hero-games .gicon { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; }
.wide-only { display: none; }
@media (min-width: 700px) and (pointer: fine) { .wide-only { display: block; } }

.host-tag { font-family: 'Skeetown Cond', sans-serif; font-size: .68rem; letter-spacing: .08em; background: var(--accent-yellow); color: #12172A; border-radius: 5px; padding: 1px 5px; vertical-align: 1px; }
@media (max-width: 600px) { .home-wrap .hero .logo img { width: 84px; height: auto; } .home-wrap .hero .logo-word { font-size: 2rem !important; } }

/* Larger text (Aa button, remembered per phone) */
html.big-text { font-size: 121%; }
html.big-text body { font-size: 1.05rem; }
html.big-text .btn, html.big-text .choice-btn { min-height: 60px; font-size: 1.1rem; }
html.big-text input, html.big-text textarea { font-size: 1.2rem !important; }
html.big-text .badge { font-size: .85rem; }
.help-btn.on { background: var(--accent-yellow); color: #12172A; }
.text-size-btn { margin: 8px auto 0; display: inline-block; background: transparent; color: var(--text-main); border: 1.5px solid var(--border-subtle); border-radius: 999px; padding: 6px 14px; font-family: 'Skeetown Cond', sans-serif; font-weight: 800; letter-spacing: .06em; font-size: .85rem; cursor: pointer; }
.text-size-btn.on { background: var(--accent-yellow); color: #12172A; border-color: var(--accent-yellow); }

/* Easy aim (tap controls) */
.ea { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ea-tip { font-weight: 800; color: var(--text-muted); text-align: center; font-size: .9rem; }
.ea-label { font-family: 'Skeetown Cond', sans-serif; font-weight: 800; letter-spacing: .1em; font-size: .8rem; color: var(--text-muted); }
.ea-row { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: center; }
.ea-row button { min-height: 56px; border-radius: 14px; background: var(--bg-elevated); color: var(--text-main); border: 2px solid var(--border-subtle); font-family: 'Skeetown Cond', sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em; }
.ea-row button:active { background: var(--accent-cyan); color: #12172A; }
.ea-val { text-align: center; font-family: 'Skeetown Cond', sans-serif; font-weight: 800; font-size: 1.15rem; }
.ea-bar { position: relative; height: 40px; border-radius: 12px; background: var(--bg-deep, rgba(0,0,0,.35)); overflow: hidden; }
.ea-bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent-yellow); transition: width .15s; }
.ea-bar b { position: relative; display: flex; height: 100%; align-items: center; justify-content: center; font-family: 'Skeetown Cond', sans-serif; font-size: 1.15rem; color: var(--text-main); text-shadow: 0 1px 2px #000; }
.ea-go { min-height: 64px; font-size: 1.3rem; margin-top: 4px; }
.ea-toggle { display: block; margin: 10px auto 0; background: transparent; border: none; color: var(--accent-cyan); text-decoration: underline; font-weight: 800; font-size: .9rem; padding: 8px; }

/* Beginner mode */
.practice-bar { background: var(--accent-yellow); color: #12172A; font-weight: 800; border-radius: 12px; padding: 8px 12px; text-align: center; font-size: .9rem; }
.hint-bar { background: var(--bg-elevated); border: 2px solid var(--accent-cyan); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 1rem; line-height: 1.35; }
.hint-bar b { display: block; font-family: 'Skeetown Cond', sans-serif; letter-spacing: .1em; font-size: .75rem; color: var(--accent-cyan); margin-bottom: 2px; }
.start-tag { display: inline-block; font-family: 'Skeetown Cond', sans-serif; font-size: .62rem; letter-spacing: .08em; background: var(--accent-green); color: #12172A; border-radius: 5px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }

/* Room code: big and tappable */
.room-pill { background: transparent; border: 1.5px solid var(--accent-yellow); color: var(--text-main); border-radius: 8px; padding: 2px 8px; font-family: 'Skeetown Cond', sans-serif; font-weight: 800; letter-spacing: .08em; font-size: .85rem; cursor: pointer; }
.room-pill b { color: var(--accent-yellow); font-size: 1.05rem; letter-spacing: .14em; }
.code-card { text-align: center; border: 2px solid var(--accent-yellow); border-radius: 18px; padding: 14px 12px; background: var(--bg-card); }
.code-label { font-family: 'Skeetown Cond', sans-serif; font-weight: 800; letter-spacing: .14em; font-size: .8rem; color: var(--text-muted); }
.code-big { font-family: 'Skeetown Slab', Georgia, serif; font-size: 3.4rem; line-height: 1.05; letter-spacing: .16em; color: var(--accent-yellow); margin: 2px 0 4px; padding-left: .16em; }
.code-big.xl { font-size: 4.4rem; }
.code-how { font-weight: 700; font-size: .95rem; }
.code-btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.code-btns .btn { width: auto; flex: 1; max-width: 200px; }
.code-modal { position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 20, .86); display: flex; align-items: center; justify-content: center; padding: 18px; }
.code-sheet { background: var(--bg-card); border: 2px solid var(--accent-yellow); border-radius: 22px; padding: 20px 16px; text-align: center; width: min(420px, 100%); }
.code-qr { display: flex; justify-content: center; margin: 8px auto 10px; }
.code-qr svg { background: #fff; border-radius: 12px; padding: 8px; width: 200px; height: 200px; }

/* A / B / C / D in the same four colors as the TV */
.opt-letter { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7em; height: 1.7em; border-radius: .4em; margin-right: .55em; font-family: 'Skeetown Cond', sans-serif; font-weight: 800; color: #12172A; flex: none; }
.opt-letter.l0 { background: #56C2D6; } .opt-letter.l1 { background: #F2B33D; } .opt-letter.l2 { background: #E4572E; color: #fff; } .opt-letter.l3 { background: #5DC98B; }
.choice-btn:has(.opt-letter) { display: flex; align-items: center; font-size: 1.1rem; min-height: 58px; }
