:root {
  color-scheme: light;
  --bg: #f6f4ed;
  --panel: #fffefa;
  --soft: #fbf8ee;
  --control: #ece7d8;
  --control-alt: #e7eef3;
  --ink: #16201d;
  --muted: #67716d;
  --line: #d8d4c6;
  --green: #176b5d;
  --blue: #285f9f;
  --red: #b9433b;
  --yellow: #d59b28;
  --shadow: 0 18px 50px rgba(22, 32, 29, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101513;
  --panel: #18201d;
  --soft: #202a26;
  --control: #2a332f;
  --control-alt: #21303a;
  --ink: #f2f5ef;
  --muted: #a7b0aa;
  --line: #36423d;
  --green: #36a88f;
  --blue: #78a9df;
  --red: #ef7d72;
  --yellow: #e7bb58;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.topbar,
.tabs,
.stage,
.rooms,
.ad-panel,
.history {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  grid-column: 1 / -1;
  min-height: 92px;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.tabs {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.tab,
.text-button,
.icon-button,
.primary,
.secondary,
.tile,
.cup,
.balloon,
.straw {
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--control);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tab {
  padding: 0 8px;
  font-size: 0.88rem;
  font-weight: 750;
  white-space: nowrap;
}

.tab.active,
.primary {
  background: var(--green);
  color: white;
}

.secondary {
  background: var(--control-alt);
  color: var(--blue);
}

.danger {
  background: var(--red);
  color: white;
}

.tab:hover,
.text-button:hover,
.icon-button:hover,
.primary:hover,
.secondary:hover,
.tile:hover,
.cup:hover,
.balloon:hover,
.straw:hover {
  transform: translateY(-1px);
}

.stage,
.rooms,
.ad-panel,
.history {
  border-radius: 8px;
  padding: 18px;
}

.side-panel {
  display: grid;
  gap: 18px;
  align-self: start;
}

.rooms {
  display: grid;
  gap: 14px;
}

.ad-panel {
  display: grid;
  gap: 8px;
  min-height: 120px;
}

.ad-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.adsbygoogle {
  min-height: 90px;
}

.room-head,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-head p,
.share-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.room-actions,
.copy-row {
  display: grid;
  gap: 8px;
}

.copy-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.share-card {
  display: grid;
  gap: 8px;
}

.game {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.game-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.game-head p,
.muted {
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary,
.secondary,
.text-button,
.icon-button {
  padding: 0 14px;
  font-weight: 800;
}

.text-button {
  min-height: 34px;
  background: transparent;
  color: var(--green);
}

.pwf-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  background: var(--green);
  color: white;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pwf-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--green) 85%, black);
}

.icon-button {
  background: var(--ink);
  color: var(--panel);
}

[data-theme="dark"] .icon-button {
  background: var(--control);
  color: white;
}

.result {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  text-align: center;
  padding: 18px;
}

.result.compact {
  min-height: 160px;
}

.result.compact strong {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.result strong {
  display: block;
  font-size: clamp(2.2rem, 10vw, 7rem);
  line-height: 1;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat,
.option-row,
.history li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.stat {
  padding: 12px;
}

.stat b {
  display: block;
  font-size: 1.5rem;
}

.coin-wrap {
  perspective: 500px;
  width: 130px;
  height: 130px;
  margin: 0 auto 20px;
}

.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.coin.tails-up {
  transform: rotateY(180deg);
}

.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 900;
  user-select: none;
}

.coin-face.heads {
  background: radial-gradient(circle at 35% 32%, #fff8dc, #ffd700 55%, #b8860b);
  color: #6b3a00;
  box-shadow: inset 0 0 0 6px #8b6914, 0 8px 24px rgba(0,0,0,0.2);
}

.coin-face.tails {
  background: radial-gradient(circle at 65% 32%, #fff0a0, #daa520 55%, #8b6914);
  color: #5a3200;
  transform: rotateY(180deg);
  box-shadow: inset 0 0 0 6px #8b6914, 0 8px 24px rgba(0,0,0,0.2);
}

.grid {
  display: grid;
  gap: 10px;
}

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

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.cup-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.cup,
.balloon,
.straw,
.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  font-weight: 900;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cup {
  gap: 8px;
}

.cup-shape {
  position: relative;
  width: min(58px, 70%);
  aspect-ratio: 1 / 0.82;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(135deg, #f3f6f3, #cad3cd);
  border: 2px solid rgba(22, 32, 29, 0.16);
  box-shadow: inset 10px 0 18px rgba(255, 255, 255, 0.48);
}

.cup-shape::before {
  content: "";
  position: absolute;
  inset: -10px -5px auto;
  height: 18px;
  border-radius: 50%;
  background: #f9fbf8;
  border: 2px solid rgba(22, 32, 29, 0.16);
}

.cup.safe .cup-shape {
  background: linear-gradient(135deg, #e7f5df, #86bd78);
}

.cup.bad .cup-shape {
  background: linear-gradient(135deg, #f6d0ca, #d86b61);
}

.cup.safe,
.balloon.safe,
.straw.safe {
  background: #dfeede;
  color: #1f6f35;
}

.cup.bad,
.balloon.bad,
.straw.bad {
  background: #f1d5d1;
  color: var(--red);
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
}

.wheel-pointer {
  position: absolute;
  top: 6px;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid var(--ink);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
}

.wheel {
  width: min(320px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  border: 14px solid #284056;
  color: white;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.72), var(--shadow-xl);
  transition: transform 0s linear;
  overflow: hidden;
}

.wheel.spinning {
  transition: transform var(--spin-duration, 5000ms) cubic-bezier(0.1, 0.7, 0.25, 1);
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--label-angle)) translateY(-105px) rotate(calc(var(--label-angle) * -1));
  font-size: 0.85rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(22, 32, 29, 0.45);
  pointer-events: none;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 50%;
  background: rgba(22, 32, 29, 0.85);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wheel {
    transition: none;
  }

  .wheel.spinning {
    transition: opacity 600ms ease-out;
    opacity: 0.7;
  }
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 36px;
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

code {
  color: var(--green);
  font-weight: 800;
}

.chooser-pad {
  position: relative;
  min-height: 320px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  touch-action: none;
  overflow: hidden;
}

.finger-dot {
  position: absolute;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.finger-dot.winner {
  background: var(--yellow);
  color: #231b08;
  transform: scale(1.18);
}

.card-table {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 260px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at top, rgba(23, 107, 93, 0.16), transparent 55%), var(--soft);
  padding: 18px;
}

.playing-card {
  width: min(210px, 100%);
  aspect-ratio: 2.5 / 3.5;
  justify-self: center;
  border-radius: 12px;
  border: 1px solid #d8d4c6;
  background: #fffefa;
  color: #121816;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 14px;
  box-shadow: 0 18px 35px rgba(22, 32, 29, 0.16);
  font-weight: 900;
}

.playing-card.red,
.mini-deck .red {
  color: #b72721;
}

.playing-card.back {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    #176b5d;
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  border-color: #124f44;
  box-shadow: 0 18px 35px rgba(22, 32, 29, 0.22), inset 0 0 0 10px rgba(255,255,255,0.06);
}

.playing-card.back span,
.playing-card.back strong {
  visibility: hidden;
}

.playing-card strong {
  place-items: center;
  display: grid;
  font-size: clamp(3rem, 12vw, 6rem);
}

.playing-card span:last-child {
  justify-self: end;
  transform: rotate(180deg);
}

.mini-deck {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-deck span {
  min-width: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
  text-align: center;
  font-weight: 900;
}

.rps-arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

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

.rps-online {
  display: grid;
  gap: 12px;
}

.rps-matchbar {
  display: grid;
  grid-template-columns: auto 110px minmax(120px, auto) minmax(120px, auto);
  gap: 10px;
  align-items: center;
}

.rps-room-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  padding: 12px;
  font-weight: 800;
}

.rps-room-status.bad {
  color: var(--red);
}

.rps-card {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px;
}

.rps-card.you {
  border-color: color-mix(in srgb, var(--green), var(--line) 38%);
}

.rps-card span {
  color: var(--muted);
}

.rps-card strong {
  font-size: clamp(1.6rem, 5vw, 3rem);
}

.rps-card em {
  color: var(--muted);
  font-style: normal;
  text-transform: capitalize;
}

.rps-card b {
  font-size: 1.4rem;
}

.rps-moves {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.rps-move {
  aspect-ratio: auto;
  min-height: 72px;
}

.history {
  align-self: start;
  height: clamp(260px, calc(100vh - 260px), 560px);
  min-height: 260px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: var(--green) var(--control);
  scrollbar-width: thin;
}

.history ol::-webkit-scrollbar {
  width: 10px;
}

.history ol::-webkit-scrollbar-track {
  background: var(--control);
  border-radius: 999px;
}

.history ol::-webkit-scrollbar-thumb {
  background: var(--green);
  border: 2px solid var(--control);
  border-radius: 999px;
}

.history li {
  padding: 10px;
  color: var(--muted);
}

.history b {
  display: block;
  color: var(--ink);
}

.room-feed {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.room-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 800;
}

.room-feed-list {
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--green) var(--control);
  scrollbar-width: thin;
}

.room-feed-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.room-feed-item:last-child {
  border-bottom: none;
}

.room-feed-item.self .room-feed-who {
  color: var(--blue);
}

.room-feed-who {
  font-weight: 800;
  color: var(--green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-feed-what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-feed-when {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.room-feed-empty {
  padding: 14px 16px;
  margin: 0;
  font-size: 0.88rem;
}

.hilo-info {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hilo-buttons {
  display: flex;
  gap: 10px;
}

.hilo-btn {
  flex: 1;
  min-height: 56px;
  font-size: 1.05rem;
}

.hilo-trail {
  position: relative;
  height: 72px;
  margin-bottom: 4px;
}

.hilo-trail-card {
  position: absolute;
  width: 46px;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 4px 5px;
  font-weight: 900;
  font-size: 0.82rem;
  box-shadow: 2px 3px 8px rgba(22, 32, 29, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.18s ease;
}

.hilo-trail-card:hover {
  transform: translateY(-4px);
}

.trail-label {
  line-height: 1.1;
  white-space: nowrap;
}

.trail-marker {
  font-size: 0.7rem;
  opacity: 0.85;
}

.hilo-trail-card.red { color: #b72721; }

.hilo-trail-card.correct {
  border-color: color-mix(in srgb, var(--green) 60%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--panel));
}

.hilo-trail-card.wrong {
  border-color: color-mix(in srgb, var(--red) 60%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--panel));
  color: var(--red);
}

.hilo-trail-card.current {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--panel));
}

.hilo-message {
  font-weight: 800;
  font-size: 1.1rem;
  margin: 0;
  color: var(--ink);
}

.room-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 21, 19, 0.6);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}

.room-modal[hidden] {
  display: none !important;
}

.room-modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
}

.room-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-modal-head h2 {
  margin: 0;
}

.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 21, 19, 0.6);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}

.history-modal[hidden] {
  display: none !important;
}

.history-modal-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  width: min(480px, 100%);
  max-height: 80vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  box-shadow: var(--shadow);
}

.history-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-modal-head h2 {
  margin: 0;
}

.history-modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-modal-content ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: var(--green) var(--control);
  scrollbar-width: thin;
}

.history-modal-content li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
  color: var(--muted);
}

.history-modal-content b {
  display: block;
  color: var(--ink);
}

.history-modal-content span {
  font-size: 0.85rem;
}

.bottom-ad-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 6px 18px 8px;
  z-index: 50;
  display: grid;
  gap: 2px;
}

.has-bottom-ad {
  padding-bottom: 110px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .history {
    height: min(420px, 70vh);
  }

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

  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .card-table,
  .rps-arena {
    grid-template-columns: 1fr;
  }

  .rps-arena.online,
  .rps-matchbar {
    grid-template-columns: 1fr;
  }
}

/* Polls */
.poll-welcome {
  display: grid;
  gap: 18px;
}

.poll-welcome p {
  color: var(--muted);
  margin: 0;
}

.poll-start-actions {
  display: grid;
  gap: 12px;
  max-width: 460px;
}

.poll-create {
  display: grid;
  gap: 12px;
}

.poll-create label {
  font-weight: 800;
}

.poll-options-list {
  display: grid;
  gap: 8px;
}

.poll-option-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
}

.poll-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.poll-settings legend {
  font-weight: 800;
  padding: 0 6px;
}

.poll-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.poll-settings input {
  width: auto;
}

.poll-error {
  color: var(--red);
  margin: 0;
}

.poll-view {
  display: grid;
  gap: 18px;
}

.poll-vote fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.poll-vote legend {
  font-weight: 800;
  padding: 0 6px;
}

.poll-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.poll-choice:hover {
  border-color: var(--green);
}

.poll-choice input {
  width: auto;
  min-width: 20px;
  min-height: 20px;
}

.poll-choice span {
  font-weight: 700;
}

.poll-results {
  display: grid;
  gap: 12px;
}

.poll-result-row {
  display: grid;
  gap: 6px;
}

.poll-result-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.poll-result-label b {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.poll-result-bar {
  background: var(--control);
  border-radius: var(--radius);
  height: 24px;
  overflow: hidden;
}

.poll-result-bar div {
  background: linear-gradient(90deg, var(--green) 0%, var(--green-light) 100%);
  height: 100%;
  border-radius: var(--radius);
  transition: width 0.4s ease;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    min-height: 76px;
  }

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

  .game-head {
    display: grid;
  }

  .stats,
  .grid.five,
  .cup-board,
  .rps-moves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .copy-row {
    grid-template-columns: 1fr;
  }
}

/* Coin flip options */
.coin-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.coin-options label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.coin-options input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
}

/* Dice roller */
.dice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dice-controls label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.dice-controls input {
  width: 80px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
}

.dice-table {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  min-height: 80px;
}

.die {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.die span {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink);
}

.dice-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dice-history p {
  margin: 0;
  width: 100%;
}

/* Random number generator */
.random-number-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.random-number-controls label {
  display: grid;
  gap: 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.random-number-controls input {
  width: 100px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel);
  color: var(--ink);
}

.random-number-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.random-number-toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.random-number-toggles input {
  width: auto;
  min-width: 20px;
  min-height: 20px;
}

.random-number-output {
  min-height: 80px;
  display: grid;
  place-items: center;
}

.random-number-results {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.random-number {
  font-size: 2rem;
  font-weight: 800;
  padding: 14px 22px;
  border-radius: var(--radius);
  background: var(--soft);
  border: 1px solid var(--line);
}

/* List shuffler */
#shuffleInput {
  min-height: 140px;
}

.shuffled-list {
  padding-left: 24px;
  margin: 0;
}

.shuffled-list li {
  padding: 6px 0;
  font-weight: 700;
}

/* Higher or lower probability hint */
.hilo-hint {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.hilo-hint p {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.hilo-probabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hilo-probabilities span {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.9rem;
}

.prob-higher {
  background: color-mix(in srgb, var(--green) 15%, var(--soft));
  color: var(--green);
}

.prob-lower {
  background: color-mix(in srgb, var(--blue) 15%, var(--soft));
  color: var(--blue);
}

.prob-same {
  background: color-mix(in srgb, var(--yellow) 15%, var(--soft));
  color: var(--yellow);
}
