.app-shell {
  max-width: 480px;
  margin: 0 auto;
  /* Respect the notch and the home indicator on phones. */
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh; /* 100vh is wrong while mobile browser chrome is showing */
}

/* Reconnecting / offline banner */
.conn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--accent-coral);
  color: #2a0f0b;
  font-size: 13px;
  font-weight: 700;
}
.conn-banner.fatal { background: #7a2b22; color: var(--text-light); }
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.screen { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.brand { text-align: center; margin: 30px 0 26px; }
.brand h1 {
  font-family: var(--font-display);
  font-size: 44px;
  margin: 0;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}
.tagline { color: var(--text-muted); margin: 4px 0 0; }

.field-label { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 8px; }

#name-input, .code-input {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-raised);
  color: var(--text-light);
  font-size: 20px;
  font-family: var(--font-display);
}
.code-input { text-align: center; letter-spacing: 0.3em; text-transform: uppercase; }

.error-text { color: var(--accent-coral); font-size: 14px; margin: 10px 0 0; font-weight: 600; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.eyebrow { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.hello-name { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 18px; margin: 4px 0 0; }

.section-title { font-family: var(--font-display); font-size: 22px; margin: 6px 0 14px; }

/* ---- Gallery: app bar ---- */
.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;
}

/* The bar and chip row bleed to the shell edges so the blur runs edge to edge. */
.app-bar, .chip-bar { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  margin-top: -8px;
  margin-bottom: 10px;
  background: rgba(11, 19, 38, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.app-bar-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
  color: var(--accent-gold);
  letter-spacing: 0.3px;
}
.app-bar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border-radius: 50%; color: var(--text-muted);
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:active { background: var(--bg-card); }
.app-bar-avatar {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border-radius: 50%;
}

.search-wrap { margin-bottom: 14px; }
.search-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
}

/* ---- Gallery: featured game ---- */
.hero {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 18px;
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-align: left;
  color: var(--text-light);
  min-height: 250px;
  background:
    linear-gradient(160deg, var(--art-a, #ffc700) 0%, var(--art-b, #5e3a00) 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
}
.hero-art {
  position: absolute;
  right: -14px;
  top: -22px;
  font-size: 150px;
  line-height: 1;
  opacity: 0.26;
  transform: rotate(-10deg);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 14, 32, 0.94) 12%, rgba(6, 14, 32, 0.45) 52%, transparent 100%);
}
.hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; padding: 18px; gap: 6px; }
.hero-badge {
  align-self: flex-start;
  background: rgba(255, 199, 0, 0.18);
  border: 1px solid rgba(255, 199, 0, 0.4);
  color: var(--accent-gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
}
.hero-title { font-family: var(--font-display); font-size: 30px; line-height: 1.1; margin-top: 4px; }
.hero-tag { font-size: 14px; color: var(--text-muted); line-height: 1.4; max-width: 90%; }
.hero-cta {
  align-self: flex-start;
  margin-top: 10px;
  background: var(--accent-gold);
  color: #201400;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 199, 0, 0.3);
}

/* ---- Gallery: filter chips ---- */
.chip-bar {
  position: sticky;
  top: 58px;
  z-index: 25;
  padding-top: 6px;
  padding-bottom: 12px;
  background: rgba(11, 19, 38, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #201400;
  box-shadow: 0 0 12px rgba(255, 199, 0, 0.22);
}

/* ---- Gallery: game cards ---- */
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 0.72;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  color: var(--text-light);
  background: linear-gradient(155deg, var(--art-a, #ffc700) 0%, var(--art-b, #5e3a00) 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}
.game-card:active { transform: scale(0.96); }
.card-art {
  position: absolute;
  top: 6px;
  right: -8px;
  font-size: 76px;
  line-height: 1;
  opacity: 0.32;
  transform: rotate(-8deg);
  pointer-events: none;
}
/* The title has to stay legible over any of the eight gradients, so the scrim
   is deliberately heavier than it looks like it needs to be. */
.game-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 14, 32, 0.97) 26%, rgba(6, 14, 32, 0.62) 55%, rgba(6, 14, 32, 0.1) 100%);
}
.card-body { position: relative; z-index: 1; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.game-card .gname { font-family: var(--font-display); font-size: 15px; line-height: 1.2; }

.gmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.gchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(218, 226, 253, 0.82);
}
.gchip svg { width: 12px; height: 12px; fill: currentColor; opacity: 0.85; }
.hero .gmeta { margin-top: 2px; }
.hero .gchip { font-size: 12px; }

@supports not (aspect-ratio: 1) {
  .game-card { min-height: 170px; }
}

.back-btn { margin: 0 0 12px -14px; }

.game-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.game-emoji { font-size: 40px; }
.game-header h2 { font-family: var(--font-display); margin: 0 0 2px; }
.muted { color: var(--text-muted); margin: 0; font-size: 14px; }

.action-buttons { display: flex; flex-direction: column; gap: 12px; }

#create-maxplayers, .opt-number, .opt-select {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-raised);
  color: var(--text-light);
  font-size: 16px;
  margin-bottom: 14px;
}
.opt-group { margin-top: 14px; }

.lobby-game-name { text-align: center; font-family: var(--font-display); font-size: 18px; margin: 14px 0 20px; color: var(--text-muted); }

.player-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.player-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.player-list .badge {
  font-size: 11px;
  background: var(--accent-gold);
  color: #201400;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  margin-left: auto;
}
.player-list .badge-quiet {
  background: var(--bg-card-raised);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  margin-left: auto;
}
.player-list .badge-quiet + .badge { margin-left: 6px; }
.player-list .offline { opacity: 0.45; }

#lobby-start, #lobby-wait, #lobby-leave { margin-top: 16px; }
.center { text-align: center; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card-raised);
  border: 1px solid var(--accent-coral);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 50;
}

/* ---- in-game shared layout ---- */
.game-title-row { text-align: center; margin-bottom: 18px; }
.game-title-row h2 { font-family: var(--font-display); margin: 0; }
.round-pill {
  display: inline-block;
  background: var(--bg-card-raised);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 6px;
}
.timer-bar {
  height: 6px;
  background: var(--bg-card-raised);
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0;
}
.timer-bar-fill { height: 100%; background: var(--accent-teal); transition: width 1s linear; }
.timer-bar-fill.urgent { background: var(--accent-coral); }

.wyr-option {
  width: 100%;
  padding: 22px 16px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 17px;
  text-align: left;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.wyr-option.chosen { border-color: var(--accent-gold); }
.wyr-option.majority { border-color: var(--accent-teal); }
.wyr-option:disabled { opacity: 1; cursor: default; }

/* Who sided with whom, shown under each option on the reveal. */
.wyr-voters { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.voter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  background: var(--bg-card-raised);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 600;
}
.voter-chip .avatar { width: 22px; height: 22px; font-size: 11px; }
.wyr-silent { font-size: 13px; margin-top: 4px; }
.wyr-option .bar {
  position: absolute; inset: 0; background: rgba(62,193,166,0.18); width: 0%; transition: width 0.6s ease; z-index: 0;
}
.wyr-option .content { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wyr-option .pct { font-family: var(--font-display); font-size: 20px; color: var(--accent-teal); }

.role-card {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius-lg);
}
.role-card.crew { background: linear-gradient(160deg, var(--bg-card), var(--bg-card-raised)); }
.role-card.imp { background: linear-gradient(160deg, #3a1c22, #201216); border: 2px solid var(--accent-coral); }
.role-word { font-family: var(--font-display); font-size: 34px; margin: 10px 0; }
.role-sub { color: var(--text-muted); font-size: 14px; }

.vote-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.vote-option {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 2px solid var(--border-soft);
  font-weight: 700;
}
.vote-option.selected { border-color: var(--accent-coral); }
.vote-option.offline { opacity: 0.5; }

.result-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.result-row:last-child { border-bottom: none; }
.result-row .votes { margin-left: auto; font-family: var(--font-display); color: var(--text-muted); }
.result-row.was-imposter .votes { color: var(--accent-coral); }
.result-row .rank { font-family: var(--font-display); color: var(--text-muted); font-size: 14px; min-width: 26px; }
.result-row.leader .rank { color: var(--accent-gold); }
.result-row .result-name { display: flex; flex-direction: column; }
.result-row .result-name small { color: var(--text-muted); font-size: 12px; }

.first-speaker { margin-top: 14px; }
.first-speaker strong { color: var(--accent-teal); }

/* The caught imposter's shortlist. */
.guess-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.guess-option {
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid var(--border-soft);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 16px;
  min-height: 60px;
}
.guess-option.selected { border-color: var(--accent-coral); background: var(--bg-card-raised); }
.guess-option:disabled { opacity: 0.35; }
.guess-option.selected:disabled { opacity: 1; }
@media (max-width: 360px) { .guess-list { grid-template-columns: 1fr; } }

.join-cta { margin-bottom: 22px; }

.end-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ---- Trivia Quiz ---- */
.quiz-question p { font-family: var(--font-display); font-size: 19px; margin: 0; line-height: 1.35; }
.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.quiz-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  min-height: 68px;
}
.quiz-choice .shape { font-size: 17px; flex-shrink: 0; }
.quiz-choice.c0 .shape { color: var(--accent-coral); }
.quiz-choice.c1 .shape { color: var(--accent-gold); }
.quiz-choice.c2 .shape { color: var(--accent-teal); }
.quiz-choice.c3 .shape { color: #6c8cff; }
.quiz-choice .count { margin-left: auto; font-family: var(--font-display); color: var(--text-muted); }
.quiz-choice.chosen { border-color: var(--accent-gold); }
.quiz-choice.right { border-color: var(--accent-teal); background: rgba(62, 193, 166, 0.14); }
.quiz-choice.wrong { opacity: 0.55; }
.quiz-choice:disabled { cursor: default; }
.round-pill.good { background: var(--accent-teal); color: #0a1f1a; }

/* ---- Most Likely To ---- */
.ml-prompt p { font-family: var(--font-display); font-size: 19px; margin: 0; line-height: 1.35; }
.ml-breakdown .bd-line { font-size: 13px; margin: 3px 0; }

/* ---- Fake Answers ---- */
.fake-prompt p { font-family: var(--font-display); font-size: 18px; margin: 0; line-height: 1.4; }
.fake-option { text-align: left; font-weight: 600; }
.fake-option.mine { opacity: 0.45; }
.fake-option .badge-quiet { margin-left: auto; }
.fake-row.truth { background: rgba(62, 193, 166, 0.12); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }

/* ---- Story Builder ---- */
.story-previous {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent-gold);
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 16px;
  line-height: 1.45;
}
.story-card .story-line { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.story-card .story-line.opener { font-family: var(--font-display); color: var(--accent-gold); }
.story-card .story-line small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 3px; }

/* ---- Hot Potato ---- */
.potato-card { padding: 28px 16px; }
.potato-emoji { font-size: 64px; line-height: 1; }
.potato-card.holding { border: 2px solid var(--accent-coral); animation: thump 0.9s ease-in-out infinite; }
.potato-card.boom { border: 2px solid var(--accent-coral); background: rgba(255, 107, 93, 0.12); }
.potato-status { font-family: var(--font-display); font-size: 17px; margin: 12px 0 0; }
@keyframes thump { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.potato-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.potato-target { justify-content: flex-start; }
.potato-roster { margin-top: 14px; }
.result-row.out { opacity: 0.45; }

/* ---- Truth or Dare ---- */
.td-current { padding: 24px 16px; }
.td-whose { font-family: var(--font-display); font-size: 18px; margin: 0; }
.td-choice { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.td-prompt-card { padding: 24px 16px; border: 2px solid var(--border-soft); }
.td-prompt-card.truth { border-color: #6c8cff; }
.td-prompt-card.dare { border-color: var(--accent-coral); }
.td-for { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.td-text { font-family: var(--font-display); font-size: 20px; line-height: 1.4; margin: 0; }

/* ---- Guess the Word (Taboo) ---- */
.taboo-card { padding: 24px 16px; }
.taboo-word { font-family: var(--font-display); font-size: 30px; margin: 0; color: var(--accent-gold); }
.taboo-forbidden { font-size: 15px; color: var(--accent-coral); font-weight: 700; margin: 0 0 14px; }
.taboo-guess-row { display: flex; gap: 10px; margin-top: 14px; }
.taboo-guess-input { flex: 1; }
.taboo-feed { margin-top: 14px; max-height: 180px; overflow-y: auto; }
.taboo-feed-line { font-size: 14px; color: var(--text-muted); margin: 4px 0; }
.taboo-feed-line.correct { color: var(--accent-teal); font-weight: 700; }

/* ---- Meme Contest ---- */
.meme-scene { padding: 26px 16px; }
.meme-emoji { font-size: 56px; line-height: 1.15; letter-spacing: 4px; }
.meme-option { text-align: left; font-weight: 600; }
.meme-option.mine { opacity: 0.45; }
.meme-option .badge-quiet { margin-left: auto; }
.meme-row.winner { background: rgba(242, 183, 5, 0.12); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }

/* ---- Market Auction ---- */
.auc-item { padding: 24px 16px; }
.auc-item-name { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; color: var(--accent-gold); }
.auc-value { font-family: var(--font-display); font-size: 18px; color: var(--accent-teal); margin: 12px 0 0; }
.auc-bidbox { margin-top: 14px; padding: 16px; }
.auc-bid-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.auc-bid-input { flex: 1; }
.auc-range { width: 100%; margin-top: 14px; accent-color: var(--accent-gold); }
.auc-verdict { font-family: var(--font-display); font-size: 16px; margin: 12px 0 0; }

/* ---- Secret Mission ---- */
.msn-card { padding: 26px 18px; border: 2px solid var(--accent-gold); }
.msn-text { font-family: var(--font-display); font-size: 20px; line-height: 1.4; margin: 0; }
.msn-text.small { font-size: 16px; margin: 8px 0 4px; }
.msn-option { text-align: left; font-weight: 600; font-size: 14px; }

/* ---- Mafia ---- */
.maf-role.mafia { background: linear-gradient(160deg, #3a1c22, #201216); border: 2px solid var(--accent-coral); }
.maf-role.doctor { border: 2px solid var(--accent-teal); }
.maf-role.detective { border: 2px solid #6c8cff; }
.maf-daybreak { padding: 28px 16px; }
.maf-daybreak p { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }

/* ---- Drawing Telephone ---- */
.draw-canvas {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #ffffff;
  touch-action: none; /* drawing must not scroll the page */
  display: block;
}
.draw-prompt-card { padding: 14px 16px; margin-bottom: 12px; }
.draw-prompt-card p { font-family: var(--font-display); font-size: 19px; margin: 0; }
.draw-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.draw-color {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--border-soft);
  padding: 0;
}
.draw-color.eraser { border-style: dashed; }
.draw-color.active { border-color: var(--accent-gold); transform: scale(1.12); }
.draw-width {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.draw-width span { background: var(--text-light); border-radius: 50%; display: block; }
.draw-width.active { border-color: var(--accent-gold); }
.draw-sep { flex: 1; }
.draw-actions { display: flex; gap: 10px; margin-top: 12px; }
.draw-actions .btn { flex: 1; }
.draw-chain-nav { display: flex; gap: 10px; margin: 16px 0; }
.draw-chain-nav .btn { flex: 1; }
.draw-chain-text { font-family: var(--font-display); font-size: 17px; margin: 0; }

/* ---- Shared text entry (writing games) ---- */
.text-prompt { margin-top: 14px; }
.text-input {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-card-raised);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}
.text-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.text-count { color: var(--text-muted); font-size: 12px; }
.text-foot .btn { margin-left: auto; padding: 12px 18px; font-size: 15px; }
.text-prompt.locked .text-input { opacity: 0.6; }

/* ---- Ludo ---- */
.ludo-board-wrap { margin: 6px 0 12px; }
#ludo-board {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  overflow: visible;
}
.lu-bg { fill: #f5f1e8; }
.lu-yard { opacity: 0.9; }
.lu-yard-in { fill: #f5f1e8; }
.lu-cell { fill: #fffdf7; stroke: #c9c2b4; stroke-width: 0.04; }
.lu-cell.safe { stroke-width: 0.08; stroke: #8a8274; }
.lu-run { stroke: rgba(0,0,0,0.12); }
.lu-star { fill: #b9b1a2; }
.lu-home { opacity: 0.92; }

.lu-token { cursor: default; transition: transform 0.11s linear; }
.lu-token-hit { fill: transparent; }
.lu-token.movable .lu-token-hit { cursor: pointer; }
.lu-token-shadow { fill: rgba(0,0,0,0.28); }
.lu-token-body { stroke: rgba(0,0,0,0.35); stroke-width: 0.05; }
.lu-token-dot { fill: rgba(255,255,255,0.85); }
.lu-token.movable { cursor: pointer; }
.lu-token.movable .lu-token-body {
  stroke: #1c2c48;
  stroke-width: 0.12;
  animation: luPulse 0.9s ease-in-out infinite;
}
@keyframes luPulse { 0%, 100% { stroke-opacity: 0.35; } 50% { stroke-opacity: 1; } }
.lu-token.captured .lu-token-body { animation: luHit 0.45s ease; }
@keyframes luHit { 0% { r: 0.34; } 45% { r: 0.5; } 100% { r: 0.34; } }

.ludo-panel { display: flex; align-items: center; gap: 14px; }
.ludo-die {
  font-size: 46px;
  line-height: 1;
  min-width: 52px;
  text-align: center;
  color: var(--text-light);
}
.ludo-die.rolling { opacity: 0.75; }
.ludo-actions { flex: 1; display: flex; justify-content: flex-end; }
.ludo-actions .btn { padding: 14px 26px; }
.ludo-actions .muted { margin: 0; }
.ludo-move-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ludo-move-btn { padding: 12px 16px; font-size: 14px; min-height: 44px; }

.ludo-seats { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.ludo-seat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid transparent;
  font-size: 14px;
}
.ludo-seat.active { border-color: var(--accent-gold); }
.ludo-seat.gone { opacity: 0.45; }
.ludo-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.ludo-name { font-weight: 600; }
.ludo-home-count { margin-left: auto; color: var(--text-muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .lu-token { transition: none; }
  .lu-token.movable .lu-token-body { animation: none; stroke-opacity: 1; }
}

/* ---- Letter Rush ---- */
.lr-secret { margin-bottom: 12px; }
.lr-alphabet { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.lr-letter {
  aspect-ratio: 1;
  min-height: 46px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
}
.lr-letter.picked { background: var(--accent-gold); color: #201400; border-color: var(--accent-gold); }
.lr-letter:disabled:not(.picked) { opacity: 0.3; }

.lr-vs { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px 0; font-size: 17px; }
.lr-vs span {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  background: var(--bg-card-raised); color: var(--text-muted);
  padding: 3px 8px; border-radius: 999px;
}

.lr-reveal { display: flex; justify-content: center; gap: 14px; margin: 26px 0 10px; }
.lr-big {
  width: 92px; height: 112px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gold); color: #201400;
  border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: 62px; font-weight: 800;
  box-shadow: 0 8px 0 rgba(0,0,0,0.3);
  animation: lrPop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.lr-reveal .lr-big:last-child { animation-delay: 0.18s; }
@keyframes lrPop { from { transform: scale(0.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.lr-credit { margin-top: 4px; }

.lr-target {
  text-align: center;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  margin: 6px 0 14px;
}
.lr-input { font-size: 20px; text-align: center; font-family: var(--font-display); }
.lr-words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.lr-word {
  display: inline-flex; flex-direction: column;
  padding: 6px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
}
.lr-word.good { background: rgba(62,193,166,0.18); color: var(--accent-teal); }
.lr-word.bad { background: rgba(255,107,93,0.15); color: var(--accent-coral); text-decoration: line-through; }
.lr-word small { font-size: 10px; opacity: 0.8; text-decoration: none; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { .lr-big { animation: none; } }

/* Tap targets: 44px is the accessibility floor on touch screens. */
.btn, .game-card, .vote-option, .wyr-option { min-height: 44px; }

@media (max-width: 360px) {
  .code-tile { width: 44px; height: 52px; font-size: 24px; }
  .game-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .conn-dot { animation: none; opacity: 1; }
  .timer-bar-fill, .wyr-option .bar { transition: none; }
  .btn:active, .game-card:active { transform: none; }
}
