/* palette / type */
:root {
  --cyan: #29B6F6;
  --cyan-deep: #1E9ED9;
  --cyan-light: #4FC3F7;
  --white: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: rgba(26, 26, 26, 0.65);
  --ink-muted: rgba(26, 26, 26, 0.45);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow-hover: 6px 6px 0 var(--ink);
  --radius: 20px;
  --radius-sm: 14px;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --danger: #FF5252;
  --danger-bg: #FFEBEE;
  --accent: #FFD54F;
  --accent-bg: #FFF8E1;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--cyan);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* background */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.shape-1 { width: 280px; height: 280px; top: -80px; right: -60px; }
.shape-2 { width: 200px; height: 200px; bottom: 10%; left: -50px; }
.shape-3 { width: 120px; height: 120px; top: 45%; right: 8%; background: rgba(255,255,255,0.08); }
.shape-4 { width: 160px; height: 160px; top: 18%; left: -70px; background: rgba(255,255,255,0.09); }
.shape-5 { width: 90px; height: 90px; bottom: 22%; right: -20px; background: rgba(255,255,255,0.1); }

.float-emoji {
  position: absolute;
  font-size: 1.75rem;
  opacity: 0.35;
  animation: floatBob 4s ease-in-out infinite;
  user-select: none;
}
.float-1 { top: 12%; left: 8%; animation-delay: 0s; }
.float-2 { top: 22%; right: 12%; animation-delay: -1s; font-size: 1.4rem; }
.float-3 { bottom: 28%; left: 10%; animation-delay: -2s; font-size: 1.5rem; }
.float-4 { bottom: 18%; right: 6%; animation-delay: -3s; }
.float-5 { top: 6%; right: 22%; animation-delay: -0.6s; font-size: 1.55rem; opacity: 0.32; }
.float-6 { top: 34%; left: 3%; animation-delay: -2.4s; font-size: 1.25rem; opacity: 0.28; }
.float-7 { top: 58%; right: 5%; animation-delay: -1.5s; font-size: 1.7rem; opacity: 0.3; }
.float-8 { top: 41%; left: 6%; animation-delay: -3.2s; font-size: 1.2rem; opacity: 0.3; }
.float-9 { top: 48%; right: 18%; animation-delay: -4.1s; font-size: 1.35rem; opacity: 0.26; }
.float-10 { bottom: 8%; left: 20%; animation-delay: -2.8s; font-size: 1.3rem; opacity: 0.3; }
.float-11 { top: 72%; left: 4%; animation-delay: -1.8s; font-size: 1.15rem; opacity: 0.26; }
.float-12 { bottom: 34%; right: 9%; animation-delay: -3.6s; font-size: 1.25rem; opacity: 0.28; }
.float-13 { bottom: 6%; right: 28%; animation-delay: -0.9s; font-size: 1.45rem; opacity: 0.3; }
.float-14 { top: 16%; left: 22%; animation-delay: -4.5s; font-size: 1.2rem; opacity: 0.24; }
.float-15 { top: 3%; left: 38%; animation-delay: -1.2s; font-size: 1.35rem; opacity: 0.28; }
.float-16 { top: 8%; right: 7%; animation-delay: -3.8s; font-size: 1.3rem; opacity: 0.26; }
.float-17 { bottom: 4%; left: 8%; animation-delay: -2.2s; font-size: 1.4rem; opacity: 0.3; }

@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-10px) rotate(5deg); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  min-height: 100dvh;
}

.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* home */
.home-topbar {
  display: flex;
  justify-content: center;
  padding: 0.1rem 0 1rem;
}

.wordmark-logo--compact {
  width: 110px;
  max-width: 110px;
  max-height: none;
}

.phone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.phone-grid .poster:nth-child(n+3) {
  grid-column: 1 / -1;
  padding: 1.15rem 1.2rem;
  border-radius: 24px;
  border-left-width: 10px;
}

.poster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 0.85rem 0.8rem 0.9rem;
  margin-bottom: 0;
  background: var(--white);
  border: 3px solid var(--ink);
  border-left: 8px solid #FF7043;
  border-radius: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.poster:hover, .poster:active {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.poster--blend {
  border-left-color: #43A047;
}

.poster-kicker {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.poster-icon { font-size: 1.85rem; margin: 0.3rem 0 0.1rem; line-height: 1; }

.poster-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.poster-desc {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.35;
}

.poster-go {
  margin-top: auto;
  padding-top: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

.phone-grid .poster:nth-child(n+3) .poster-kicker { font-size: 0.75rem; }
.phone-grid .poster:nth-child(n+3) .poster-icon { font-size: 2.5rem; }
.phone-grid .poster:nth-child(n+3) .poster-name { font-size: 2rem; }
.phone-grid .poster:nth-child(n+3) .poster-desc { font-size: 0.92rem; font-weight: 600; }
.phone-grid .poster:nth-child(n+3) .poster-go { font-size: 1rem; }

.game-meta {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.3;
}

.poster-go {
  margin-top: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 0.85rem 0.8rem 0.8rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover, .tile:active {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.tile-icon { font-size: 1.55rem; line-height: 1; }
.tile-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  margin-top: 0.4rem;
}
.tile-desc {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.35;
}
.tile .game-meta { margin-top: 0.45rem; font-size: 0.68rem; }

.tile--spy { border-bottom: 6px solid #7E57C2; }
.tile--mafia { border-bottom: 6px solid #EF5350; }
.tile--impostor { border-bottom: 6px solid #AB47BC; }
.tile--callit { border-bottom: 6px solid #FFCA28; }
.tile--wave { border-bottom: 6px solid #00897B; }
.tile--install { border-bottom: 6px solid var(--ink); }

.hero {
  text-align: center;
  padding: 0.5rem 0 1.75rem;
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin: 0 0 1rem;
}

.wordmark {
  display: flex;
  justify-content: center;
  margin: 0 0 0.85rem;
  line-height: 0;
}

.wordmark-logo {
  display: block;
  width: min(240px, 64vw);
  max-width: 240px;
  max-height: 160px;
  height: auto;
  background: transparent;
}

.tagline {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  max-width: 16rem;
  margin: 0 auto;
  line-height: 1.45;
}

.section-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
  margin-bottom: 0.85rem;
  padding-left: 0.15rem;
}

.section-label--follow {
  margin-top: 1.35rem;
}

.game-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
  color: var(--ink);
  font-family: var(--font-body);
}

.game-card:hover, .game-card:active {
  transform: translate(-2px, -2px) rotate(-0.5deg);
  box-shadow: var(--shadow-hover);
}

.game-card--hottakes { border-left: 8px solid #FF7043; }
.game-card--spy { border-left: 8px solid #7E57C2; }
.game-card--mafia { border-left: 8px solid #EF5350; }
.game-card--impostor { border-left: 8px solid #AB47BC; }
.game-card--callit { border-left: 8px solid #FFCA28; }
.game-card--wavelength { border-left: 8px solid #00897B; }
.game-card--install { border-left: 8px solid #29B6F6; }

.reveal-card .word-reveal {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  padding: 1rem 0;
  line-height: 1.2;
}


.game-card-icon {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  width: 3rem;
  text-align: center;
}

.game-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.game-card-go {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.game-card:hover .game-card-go {
  transform: translateX(3px);
  color: var(--ink);
}

.game-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.game-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.35;
}

.install-list {
  margin: 0;
  padding-left: 1.2rem;
}

.install-list li {
  margin-bottom: 0.35rem;
}

.install-soon {
  display: inline-block;
  margin-top: 1.1rem;
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--accent-bg);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.home-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

/* in-game chrome */
.game-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-back,
.btn-switch {
  background: var(--white);
  border: 3px solid var(--ink);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.btn-switch {
  font-size: 1.15rem;
  letter-spacing: -0.04em;
}

.btn-back:hover,
.btn-switch:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.game-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

/* confirm / switcher */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: rgba(26, 26, 26, 0.45);
}

.modal-root[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 1.35rem 1.35rem 1.15rem;
}

.sheet-kicker {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.sheet-copy {
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.sheet-actions {
  display: flex;
  gap: 0.65rem;
}

.sheet-actions .btn {
  flex: 1;
  margin-top: 1rem;
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0 0.25rem;
}

.switch-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.switch-item:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.switch-item.is-current {
  background: var(--accent-bg);
  cursor: default;
  box-shadow: none;
}

.switch-item-icon { font-size: 1.35rem; }
.switch-item-name { flex: 1; }

.switch-item-now {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.panel {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.panel p, .panel li {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 500;
}

.panel ul { padding-left: 1.2rem; }

.game-instance { min-height: 100%; }

.howto-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.howto-toggle h2 { margin-bottom: 0; }

.howto:not(.is-collapsed) .howto-toggle { margin-bottom: 0.75rem; }

.howto-caret {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.howto.is-collapsed .howto-body { display: none; }

.location-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0;
  margin: 0;
}

.location-item,
button.location-item {
  display: block;
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: #f7f7f7;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: default;
}

button.location-item {
  cursor: pointer;
}

button.location-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.location-item.is-actual {
  background: var(--cyan-light);
}

.location-item.is-guess {
  box-shadow: inset 0 0 0 3px var(--ink);
}

.location-item.is-actual.is-guess {
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.helper-text {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-stepper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-stepper:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.stepper-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  min-width: 3rem;
  text-align: center;
  color: var(--ink);
}

select, input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #f5f5f5;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: box-shadow 0.15s;
}

select:focus, input:focus {
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.4);
}

.btn {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 0.75rem;
}

.btn-primary {
  background: var(--white);
  color: var(--ink);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: #f0f0f0;
  color: var(--ink);
}

.btn-secondary:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}

.btn-ghost {
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  box-shadow: none;
  color: var(--white);
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

/* Pass-and-play */
.pass-screen {
  text-align: center;
  padding: 2rem 1rem;
  min-height: 55dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.pass-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.pass-player {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--white);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.pass-hidden {
  width: 100%;
  padding: 3rem 1.5rem;
  background: var(--white);
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pass-hidden:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.pass-hidden .tap-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.pass-hidden p { color: var(--ink-soft); font-size: 0.95rem; font-weight: 600; }

.reveal-card {
  width: 100%;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  animation: revealPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes revealPop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.reveal-card.spy {
  background: var(--danger-bg);
  border-color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}

.reveal-card.innocent,
.reveal-card.town {
  background: var(--white);
}

.reveal-card.mafia {
  background: var(--danger-bg);
  border-color: var(--danger);
  box-shadow: 3px 3px 0 var(--danger);
}

.reveal-card.special {
  background: var(--accent-bg);
  border-color: #F9A825;
  box-shadow: 3px 3px 0 #F9A825;
}

.reveal-role {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.reveal-detail {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-weight: 500;
}

/* Timer */
.timer-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 1.5rem auto;
}

.timer-ring svg { transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 8; }
.timer-bg { stroke: rgba(255, 255, 255, 0.35); }
.timer-fg {
  stroke: var(--white);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.12);
}

/* Phase banner */
.phase-banner {
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

/* Player list */
.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.player-item:hover, .player-item.selected {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.player-item.eliminated,
.player-item.dead {
  opacity: 0.4;
  text-decoration: line-through;
  pointer-events: none;
}

/* Call It */
.word-display {
  font-family: var(--font-display);
  font-size: clamp(2rem, 10vw, 3.2rem);
  font-weight: 700;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--white);
  line-height: 1.2;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.category-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  margin-bottom: 1rem;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.score-card {
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.score-card .name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-card .pts {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

/* Results */
.result-box {
  text-align: center;
  padding: 2rem 1rem;
}

.result-box .result-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--white);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
}

.result-box .result-sub {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.result-box .result-sub strong {
  color: var(--white);
}

.hint-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-top: 0.75rem;
  font-weight: 500;
}

/* Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.chip.active {
  background: var(--ink);
  color: var(--white);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.panel-private {
  border-color: #F9A825;
  box-shadow: 3px 3px 0 #F9A825;
}

.dawn-story p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 500;
}

.dawn-story strong {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

/* Call It teams */
.team-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.team-score {
  flex: 1;
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.team-score--a { border-left: 8px solid #7E57C2; }
.team-score--b { border-left: 8px solid #FFCA28; }
.team-score--winning { box-shadow: var(--shadow); transform: scale(1.02); }

.team-score-name {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-score-pts {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.team-score-vs {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.score-target {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1rem;
}

.challenge-panel {
  text-align: center;
}

.challenge-prompt {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  margin-top: 0.5rem;
}

.challenge-prompt strong {
  color: var(--ink);
}

.panel .helper-text {
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Read the Room */
.wave-number-card {
  text-align: center;
  padding: 2rem 1rem 1.75rem;
  margin-bottom: 1rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.wave-number-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}

.wave-number {
  font-family: var(--font-display);
  font-size: clamp(5rem, 28vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  color: var(--ink);
}

.wave-number-scale {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.wave-dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.5rem 0 1.25rem;
}

.wave-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: transparent;
}

.wave-dot.on {
  background: var(--ink);
}

.wave-guess-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.wave-guess-btn {
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.wave-guess-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.wave-guess-btn.active {
  background: var(--ink);
  color: var(--white);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.wave-result-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.wave-result-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.wave-result-value {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.wave-meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.25rem;
}

.wave-meter-tick {
  text-align: center;
  padding: 0.45rem 0;
  border: 3px solid var(--ink);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  background: #f5f5f5;
  color: var(--ink-soft);
}

.wave-meter-tick.is-actual {
  background: var(--cyan);
  color: var(--ink);
}

.wave-meter-tick.is-guess {
  box-shadow: inset 0 0 0 3px var(--ink);
}

.wave-meter-tick.is-actual.is-guess {
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
}

/* Allegedly */
.room-code-card {
  text-align: center;
  padding: 1.5rem 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.room-code-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

.room-code {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 16vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  color: var(--ink);
  padding-left: 0.18em;
}

.room-code-input {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #f5f5f5;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  outline: none;
  resize: vertical;
  min-height: 6.5rem;
}

textarea:focus {
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.4);
}

.player-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pfp-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.pfp-pick {
  aspect-ratio: 1;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  line-height: 0;
}

.pfp-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pfp-pick.is-on {
  box-shadow: var(--shadow);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.pfp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  background: #ddd;
}

.pfp--sm { width: 28px; height: 28px; }
.pfp--xs { width: 22px; height: 22px; }

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: #f5f5f5;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
}

.player-pill.is-host {
  background: var(--accent);
}

.player-pill.is-you {
  background: var(--ink);
  color: var(--white);
}

.player-pill.is-host.is-you {
  background: var(--ink);
  color: var(--white);
}

.take-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.take-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  padding: 1rem 1.05rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}

button.take-card:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.take-card.is-mine,
.take-card:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.take-card.is-result {
  cursor: default;
  pointer-events: none;
}

.take-card.is-winner {
  background: var(--accent-bg);
  box-shadow: var(--shadow);
}

.take-card-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.take-card-tag,
.take-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.score-rows {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.score-row {
  display: grid;
  grid-template-columns: 1.6rem 2rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  background: #f5f5f5;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.score-row.is-you {
  background: var(--ink);
  color: var(--white);
}

.score-row-place {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-muted);
}

.score-row.is-you .score-row-place {
  color: rgba(255, 255, 255, 0.7);
}

.score-row-name {
  font-weight: 700;
}

.score-row-pts {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.blend-secret {
  text-align: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--accent-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pick-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.pick-person:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.pick-person.is-on {
  background: var(--ink);
  color: var(--white);
}

.pick-log {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pick-log li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 960px) {
  #app {
    max-width: 1080px;
    padding: 2.25rem 2.75rem 3.25rem;
  }

  .home-topbar {
    padding: 0.4rem 0 1.6rem;
  }

  .wordmark-logo--compact {
    width: 168px;
    max-width: 168px;
  }

  .section-label {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .section-label--follow {
    margin-top: 2rem;
  }

  .phone-grid {
    gap: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .poster {
    min-height: 292px;
    padding: 1.35rem 1.45rem 1.3rem;
    border-radius: 24px;
    border-left-width: 10px;
  }

  .poster-kicker { font-size: 0.78rem; }
  .poster-icon { font-size: 2.45rem; margin: 0.45rem 0 0.15rem; }
  .poster-name { font-size: 1.9rem; }
  .poster-desc {
    font-size: 0.92rem;
    font-weight: 600;
    margin-top: 0.5rem;
  }
  .poster .game-meta { font-size: 0.85rem; margin-top: 0.7rem; }
  .poster-go { font-size: 1.12rem; padding-top: 0.85rem; }

  .tile-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.9rem;
  }

  .tile {
    min-height: 188px;
    padding: 1.1rem 1.05rem 1rem;
    border-radius: 18px;
  }

  .tile-icon { font-size: 1.9rem; }
  .tile-name { font-size: 1.2rem; margin-top: 0.5rem; }
  .tile-desc { font-size: 0.82rem; }
  .tile .game-meta { font-size: 0.75rem; }

  #screen-game.active {
    max-width: 680px;
    margin: 0 auto;
  }

  .game-title { font-size: 1.75rem; }

  .btn-back,
  .btn-switch {
    width: 48px;
    height: 48px;
  }

  .modal-root {
    align-items: center;
    padding: 2rem;
  }

  .sheet {
    max-width: 440px;
  }

  .switch-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .room-code {
    font-size: 3.5rem;
  }

  .pass-player { font-size: 2.4rem; }

  .float-emoji { opacity: 0.28; }
}

@media (hover: hover) and (min-width: 960px) {
  .poster:hover,
  .tile:hover {
    transform: translate(-3px, -3px);
  }
}
