:root {
  --ink: #142033;
  --muted: #61708a;
  --line: #c9d5e8;
  --paper: #fff9df;
  --surface: #ffffff;
  --surface-soft: #eef6ff;
  --teal: #007f89;
  --teal-dark: #00606d;
  --coral: #f05a3f;
  --amber: #ffc83d;
  --blue: #1b77e8;
  --green: #19a15f;
  --danger: #d93532;
  --toy-blue: #1777d4;
  --toy-blue-dark: #0a4e9c;
  --toy-yellow: #ffd43d;
  --toy-red: #f04438;
  --toy-cream: #fff8dc;
  --shadow: 0 18px 45px rgba(20, 32, 51, 0.13);
  --radius: 8px;
  --focus: 0 0 0 4px rgba(47, 111, 237, 0.18);
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(27, 119, 232, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(27, 119, 232, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 212, 61, 0.25), transparent 34%),
    linear-gradient(315deg, rgba(240, 90, 63, 0.16), transparent 32%),
    var(--paper);
  background-size:
    38px 38px,
    38px 38px,
    auto,
    auto,
    auto;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid rgba(20, 32, 51, 0.12);
  background: rgba(255, 253, 243, 0.88);
  box-shadow: 0 12px 30px rgba(20, 32, 51, 0.06);
  backdrop-filter: blur(14px);
}

body.is-playing {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #0f65bd, #0a4f9e 54%, #083c7b);
  background-size: 32px 32px, 32px 32px, auto;
}

body.is-playing .app-shell {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

body.is-playing .topbar {
  min-height: 58px;
  padding: 8px clamp(14px, 2.2vw, 28px);
  border-bottom: 3px solid rgba(13, 27, 45, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 223, 0.96));
}

body.is-playing .brand {
  gap: 10px;
}

body.is-playing .brand-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

body.is-playing .brand strong {
  font-size: 0.98rem;
}

body.is-playing .brand small {
  display: none;
}

body.is-playing .connection-pill {
  min-height: 32px;
  padding: 6px 11px;
}

body.is-playing h2,
body.is-playing h3,
body.is-playing p {
  margin-top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 2px solid #0d1b2d;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #ffe782, var(--toy-yellow) 54%, #f2a91f);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 4px 0 #0d1b2d;
  font-size: 0.86rem;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.connection-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.connection-pill.online::before {
  background: var(--green);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rules-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.rules-button:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 119, 232, 0.28);
  background: #fff;
}

body.is-playing .rules-button {
  display: none;
}

.auth-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-link-button,
.auth-cta-button,
.auth-user-button,
.auth-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.auth-link-button,
.auth-logout-button {
  padding: 0 12px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.auth-cta-button {
  padding: 0 14px;
  border: 1px solid rgba(13, 27, 45, 0.2);
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 3px 0 rgba(13, 27, 45, 0.22);
}

.auth-user-button {
  gap: 8px;
  padding: 0 12px 0 5px;
  border: 1px solid rgba(27, 119, 232, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.auth-avatar,
.account-avatar {
  display: grid;
  place-items: center;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  font-weight: 950;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

.auth-link-button:hover,
.auth-cta-button:hover,
.auth-user-button:hover,
.auth-logout-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 32, 51, 0.12);
}

body.is-playing .auth-logout-button,
body.is-playing .auth-link-button,
body.is-playing .auth-cta-button {
  display: none;
}

.app-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.loading-screen {
  display: grid;
  place-items: center;
  min-height: 52vh;
  color: var(--muted);
}

.loader {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(47, 111, 237, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 24px;
  align-items: stretch;
}

.home-stage,
.panel,
.side-panel,
.game-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.home-stage {
  display: grid;
  align-content: end;
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(145deg, var(--toy-blue), var(--toy-blue-dark));
  color: #fff;
}

.sample-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 16%),
    transparent;
}

.sample-face {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  border: 3px solid rgba(13, 27, 45, 0.75);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--toy-yellow) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.95) 0 18%, transparent 19%),
    linear-gradient(180deg, var(--tile-color), color-mix(in srgb, var(--tile-color), #000 12%));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    0 6px 0 rgba(13, 27, 45, 0.28);
}

.sample-face::before,
.sample-face::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(29, 36, 51, 0.82);
}

.sample-face::before {
  top: 44px;
  width: 46px;
  height: 28px;
  clip-path: polygon(18% 22%, 82% 22%, 100% 78%, 0 78%);
}

.sample-face::after {
  bottom: 18px;
  width: 70%;
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.home-copy {
  padding: 4px 28px 30px;
}

.home-stage .eyebrow,
.home-stage .lede {
  color: rgba(255, 255, 255, 0.88);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 650px;
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel.tight {
  padding: 18px;
}

.choice-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.choice-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 92px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.choice-button:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 14px 28px rgba(28, 36, 51, 0.1);
}

.choice-icon,
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #e9f6ff, #d5ecff);
  color: var(--teal);
  font-weight: 900;
}

.choice-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.choice-button span:not(.choice-icon):not(.arrow) {
  color: var(--muted);
  line-height: 1.4;
}

.arrow {
  color: var(--coral);
  font-size: 1.8rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.upload-title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

input {
  min-height: 48px;
  padding: 0 14px;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 13px 14px;
  resize: vertical;
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.upload-box {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px dashed rgba(15, 118, 110, 0.45);
  border-radius: var(--radius);
  background: rgba(15, 118, 110, 0.05);
}

.theme-picker {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 2px solid rgba(13, 27, 45, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 42%),
    linear-gradient(315deg, rgba(27, 119, 232, 0.11), transparent 44%),
    rgba(255, 255, 255, 0.72);
}

.theme-picker h3 {
  margin-bottom: 6px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.theme-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px solid rgba(13, 27, 45, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #edf7ff);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 5px 0 rgba(13, 27, 45, 0.14);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 119, 232, 0.5);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 7px 0 rgba(13, 27, 45, 0.16),
    0 18px 32px rgba(13, 27, 45, 0.12);
}

.theme-card strong {
  font-size: 1.05rem;
}

.theme-card span:not(.theme-badge) {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.theme-badge {
  width: fit-content;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--theme-accent);
  color: #10233d;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.theme-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.theme-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid #10233d;
  border-radius: 6px;
  object-fit: cover;
  background: var(--toy-yellow);
}

.theme-card em {
  width: fit-content;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 950;
}

.file-input {
  padding: 11px;
  background: var(--surface);
}

.faces-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.face-editor-card,
.face-card,
.mini-face,
.secret-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.face-editor-card {
  overflow: hidden;
}

.face-editor-card img,
.face-card img,
.secret-card img,
.result-face img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-soft);
}

.face-editor-card input {
  min-height: 42px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.actions-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #24344f, var(--ink));
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(29, 36, 51, 0.13);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button.primary {
  background:
    linear-gradient(180deg, #00a8a5, var(--teal-dark));
}

.button.blue {
  background:
    linear-gradient(180deg, #3e9cff, var(--blue));
}

.button.coral {
  background:
    linear-gradient(180deg, #ff785f, var(--coral));
}

.button.green {
  background: var(--green);
}

.button.danger {
  background:
    linear-gradient(180deg, #ff625c, var(--danger));
}

.button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.small {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.room-shell {
  display: grid;
  gap: 20px;
}

.room-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.room-code {
  display: inline-grid;
  place-items: center;
  min-height: 66px;
  padding: 4px 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--amber);
  font-size: 2rem;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.invite-box {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.player-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.player-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-badge.ready {
  background: rgba(32, 155, 98, 0.12);
  color: var(--green);
}

.status-badge.turn {
  background: rgba(47, 111, 237, 0.12);
  color: var(--blue);
}

.status-badge.offline {
  background: rgba(194, 65, 60, 0.12);
  color: var(--danger);
}

.face-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}

.face-list.compact {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}

.mini-face {
  overflow: hidden;
}

.mini-face img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.mini-face span {
  display: block;
  overflow: hidden;
  min-height: 34px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.score-card,
.turn-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.score-card {
  display: grid;
  gap: 8px;
}

.score-card small,
.turn-card small {
  color: var(--muted);
  font-weight: 750;
}

.score-card strong,
.turn-card strong {
  overflow-wrap: anywhere;
}

.turn-card {
  display: grid;
  place-items: center;
  min-width: 180px;
  text-align: center;
}

.board-panel {
  display: grid;
  gap: 14px;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

.face-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.face-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 237, 0.36);
  box-shadow: 0 12px 22px rgba(29, 36, 51, 0.12);
}

.face-card.down {
  background: #273142;
  color: #d9e2ef;
}

.face-card.down img {
  filter: grayscale(1) brightness(0.38);
}

.face-card.down::after {
  content: "Abaixado";
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  background: rgba(29, 36, 51, 0.5);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.face-card span {
  display: block;
  overflow: hidden;
  min-height: 42px;
  padding: 10px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.side-panel {
  padding: 16px;
}

.secret-card {
  overflow: hidden;
}

.secret-card strong {
  display: block;
  padding: 10px;
  text-align: center;
}

.opponent-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.opponent-mini {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.opponent-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-panel {
  display: grid;
  gap: 12px;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
}

.chip:hover {
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--teal);
}

.answer-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-button {
  min-height: 76px;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 950;
}

.answer-button.yes {
  background: var(--green);
}

.answer-button.no {
  background: var(--danger);
}

.question-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.question-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.38;
}

.answer-reveal {
  display: grid;
  place-items: center;
  min-height: 82px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 2rem;
  font-weight: 950;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
}

.history-item strong {
  overflow-wrap: anywhere;
}

.history-item small {
  color: var(--muted);
}

.app-main.game-main {
  width: min(1720px, calc(100vw - 16px));
  min-height: calc(100vh - 58px);
  height: auto;
  padding: 8px 0 22px;
  overflow: visible;
}

.game-shell {
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  min-height: calc(100vh - 88px);
  height: auto;
  overflow: visible;
}

.game-shell .disconnect-banner {
  align-self: start;
}

.game-shell .game-header {
  grid-template-columns: minmax(220px, 1fr) clamp(176px, 15vw, 230px) minmax(220px, 1fr);
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.game-shell .score-card,
.game-shell .turn-card {
  min-height: 62px;
  padding: 8px 12px;
  border: 2px solid rgba(13, 27, 45, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 255, 0.94));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 5px 0 rgba(13, 27, 45, 0.16);
}

.game-shell .score-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 10px;
  align-items: center;
  overflow: hidden;
}

.game-shell .score-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #b6c8df;
}

.game-shell .score-card.is-active {
  border-color: rgba(255, 212, 61, 0.95);
  background:
    linear-gradient(180deg, #ffffff, #edf7ff 58%),
    #fff;
}

.game-shell .score-card.is-active::after {
  background: linear-gradient(180deg, var(--toy-yellow), #ff8f1f);
}

.player-avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #ffe987, var(--toy-yellow));
  color: #10233d;
  font-size: 0.78rem;
  font-weight: 950;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    0 3px 0 rgba(13, 27, 45, 0.22);
}

.player-role {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-questions {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.game-shell .score-card small,
.game-shell .turn-card small {
  font-size: 0.74rem;
}

.game-shell .score-card strong,
.game-shell .turn-card strong {
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shell .score-card strong {
  grid-column: 2;
  font-size: 1rem;
}

.game-shell .score-card .status-badge {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}

.game-shell .turn-card {
  position: relative;
  min-width: 170px;
  background:
    linear-gradient(180deg, #fff4b0, var(--toy-yellow));
  border-color: rgba(13, 27, 45, 0.32);
  overflow: hidden;
}

.game-shell .match-status {
  align-content: center;
}

.game-shell .turn-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(13, 27, 45, 0.12);
  border-radius: 7px;
  pointer-events: none;
}

.game-shell .turn-card strong {
  max-width: 20ch;
  font-size: 0.95rem;
  white-space: normal;
  z-index: 1;
}

.game-shell .turn-card small {
  z-index: 1;
}

.vs-pill {
  position: absolute;
  right: 10px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  border: 1px solid rgba(13, 27, 45, 0.22);
  border-radius: 999px;
  background: #10233d;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 950;
}

.game-shell .status-badge {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.72rem;
  background: #e8f1ff;
  border: 1px solid rgba(27, 119, 232, 0.13);
}

.game-shell .status-badge.turn {
  background: #dcebff;
  color: #064aa3;
}

.game-shell .board-count {
  background: #fff0af;
  color: #7c4d00;
  border-color: rgba(124, 77, 0, 0.13);
}

.game-shell .game-layout {
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 372px);
  gap: 8px;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}

.game-shell .panel,
.game-shell .side-panel {
  border: 3px solid rgba(13, 27, 45, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 255, 0.94));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 8px 0 rgba(13, 27, 45, 0.22),
    0 24px 42px rgba(13, 27, 45, 0.18);
}

.game-shell .board-panel {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: clamp(10px, 1vw, 14px);
  backdrop-filter: blur(12px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 16%),
    linear-gradient(145deg, #2089e3, #0d62bb);
}

.game-shell .board-toolbar {
  gap: 8px;
}

.game-shell .board-toolbar .eyebrow {
  margin-bottom: 2px;
  color: #fff7b3;
  font-size: 0.72rem;
  text-shadow: 0 1px 0 rgba(13, 27, 45, 0.32);
}

.game-shell .board-toolbar h2 {
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(1.05rem, 1.6vw, 1.55rem);
  line-height: 1.1;
  text-shadow: 0 2px 0 rgba(13, 27, 45, 0.28);
}

.game-shell .board-grid {
  grid-template-columns: repeat(var(--board-cols, 6), minmax(0, 1fr));
  grid-template-rows: repeat(var(--board-rows, 4), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(6px, 0.72vw, 10px);
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.game-shell .face-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) clamp(26px, 3.9vh, 36px);
  border: 2px solid #10233d;
  border-radius: 7px;
  background: var(--toy-yellow);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    0 5px 0 #092e62,
    0 9px 16px rgba(13, 27, 45, 0.22);
}

.game-shell .face-card::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 2;
  width: 34px;
  height: 8px;
  border: 2px solid rgba(13, 27, 45, 0.68);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6b8, #d69618);
  transform: translateX(-50%);
}

.game-shell .face-card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
  border: 6px solid var(--toy-yellow);
  border-bottom-width: 3px;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.game-shell .face-card:hover img {
  transform: scale(1.025);
}

.game-shell .face-card span {
  min-height: 0;
  padding: 6px 7px;
  font-size: clamp(0.72rem, 0.86vw, 0.94rem);
  line-height: 1.1;
  align-content: center;
  background:
    linear-gradient(180deg, #fff3a4, var(--toy-yellow));
  color: #101a2b;
  font-weight: 950;
}

.game-shell .face-card.down {
  transform: translateY(5px) perspective(600px) rotateX(58deg);
  transform-origin: bottom;
  background: #0d2f5d;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.14),
    0 2px 0 #071d3d;
}

.game-shell .face-card.down::after {
  inset: 7px 7px calc(clamp(26px, 3.9vh, 36px) + 7px);
  font-size: 0.68rem;
  border-color: rgba(255, 212, 61, 0.9);
  background: rgba(13, 27, 45, 0.64);
}

.game-side {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 8px;
  min-height: 0;
  align-content: start;
  overflow: visible;
}

.game-shell .side-panel {
  min-height: 0;
  padding: 10px;
  overflow: visible;
  backdrop-filter: blur(12px);
}

.game-shell .side-panel h3 {
  margin-bottom: 7px;
  font-size: 0.94rem;
  line-height: 1.1;
  color: #10233d;
}

.game-intel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.secret-card-compact {
  display: grid;
  grid-template-columns: clamp(54px, 5vw, 72px) minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(255, 212, 61, 0.32), transparent 52%),
    #fff;
  border: 2px solid rgba(13, 27, 45, 0.16);
}

.secret-card-compact img {
  width: clamp(54px, 5vw, 72px);
  height: clamp(54px, 5vw, 72px);
  aspect-ratio: auto;
  object-fit: cover;
}

.secret-card-compact strong {
  overflow: hidden;
  padding: 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-intel .opponent-mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
  gap: 4px;
  min-height: 0;
  max-height: 76px;
  overflow: hidden;
  padding: 5px;
  border: 2px solid rgba(13, 27, 45, 0.12);
  border-radius: 7px;
  background: #0d62bb;
}

.game-intel .opponent-mini {
  border-radius: 4px;
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.4);
}

.game-shell .action-panel {
  overflow-x: hidden;
  overflow-y: auto;
  gap: 9px;
  background:
    linear-gradient(180deg, #fffdf4, #fff6cf);
}

.game-shell .action-panel .eyebrow {
  margin-bottom: 0;
  font-size: 0.72rem;
}

.game-shell .action-panel .field {
  gap: 6px;
}

.game-shell .action-panel .field span {
  font-size: 0.82rem;
}

.game-shell .action-panel textarea {
  min-height: clamp(56px, 9vh, 84px);
  padding: 10px;
  resize: none;
}

.game-shell .question-preset {
  min-height: 36px;
  padding: 0 9px;
  font-size: 0.84rem;
}

.game-shell .quick-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 68px;
  overflow: auto;
  padding-right: 2px;
}

.game-shell .chip {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 0 9px;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shell .button {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.game-shell .actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.game-shell .question-card {
  gap: 8px;
  padding: 10px;
}

.game-shell .question-text {
  font-size: 0.94rem;
}

.game-shell .answer-button {
  min-height: 56px;
  font-size: 1.12rem;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32);
}

.game-shell .answer-reveal {
  min-height: 58px;
  font-size: 1.45rem;
}

.game-history-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, #ffffff, #eef6ff);
}

.game-history-panel .history-list {
  max-height: none;
  min-height: 0;
  gap: 6px;
  overflow: auto;
}

.game-history-panel .history-item {
  gap: 3px;
  padding: 8px;
  font-size: 0.78rem;
}

.game-history-panel .empty-state {
  min-height: 0;
  padding: 12px;
  font-size: 0.86rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 24, 34, 0.62);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(840px, calc(100vh - 44px));
  overflow: auto;
  padding: clamp(18px, 3vw, 26px);
}

.secret-reveal {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.secret-reveal img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  object-fit: cover;
}

.guess-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.guess-card {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.guess-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
}

.guess-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.guess-card span {
  display: block;
  overflow: hidden;
  min-height: 34px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: stretch;
}

.result-hero {
  display: grid;
  align-content: center;
  min-height: 520px;
  padding: clamp(22px, 5vw, 50px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(245, 184, 75, 0.24), transparent 40%),
    linear-gradient(315deg, rgba(15, 118, 110, 0.18), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-hero h1 {
  margin-bottom: 16px;
}

.result-face {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-face strong {
  display: block;
  padding: 12px;
  text-align: center;
}

.stats-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.disconnect-banner {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(194, 65, 60, 0.24);
  border-radius: var(--radius);
  background: rgba(194, 65, 60, 0.08);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.setup-screen {
  display: grid;
  gap: 22px;
}

.setup-copy {
  max-width: 760px;
}

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

.setup-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 360px;
  overflow: hidden;
  padding: 18px;
  border: 3px solid #10233d;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.96));
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 8px 0 rgba(13, 27, 45, 0.24),
    var(--shadow);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.setup-card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 11px 0 rgba(13, 27, 45, 0.22),
    0 24px 42px rgba(13, 27, 45, 0.18);
}

.setup-card strong {
  font-size: 1.35rem;
  line-height: 1.05;
}

.setup-card > span:not(.setup-chip) {
  color: var(--muted);
  line-height: 1.45;
}

.setup-chip {
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.custom-card {
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.35), transparent 44%),
    linear-gradient(180deg, #ffffff, #eef7ff);
}

.bot-setup-card {
  background:
    linear-gradient(135deg, rgba(25, 161, 95, 0.18), transparent 44%),
    linear-gradient(180deg, #ffffff, #fff6d8);
}

.setup-premium {
  position: relative;
  gap: clamp(18px, 3vw, 30px);
}

.setup-premium::before,
.setup-premium::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.setup-premium::before {
  top: 92px;
  left: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(27, 119, 232, 0.11);
  filter: blur(4px);
}

.setup-premium::after {
  right: -80px;
  bottom: 40px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 212, 61, 0.24);
  filter: blur(5px);
}

.setup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 212, 61, 0.3), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 255, 0.9));
  box-shadow:
    0 22px 60px rgba(20, 32, 51, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.setup-copy {
  max-width: 820px;
}

.setup-copy h2 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5.5vw, 5.1rem);
  line-height: 0.96;
}

.setup-copy .lede {
  max-width: 760px;
  color: #42536e;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.setup-hero-panel {
  display: grid;
  gap: 10px;
}

.setup-hero-panel span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 850;
}

.setup-hero-panel b {
  color: var(--blue);
  font-size: 1.1rem;
}

.setup-premium .setup-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(14px, 2vw, 22px);
  align-items: stretch;
}

.mode-card {
  isolation: isolate;
  gap: 14px;
  min-height: 460px;
  padding: 18px;
  border: 1px solid rgba(16, 35, 61, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 255, 0.92));
  box-shadow:
    0 24px 60px rgba(20, 32, 51, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: modeCardIn 0.48s ease both;
}

.mode-card:nth-child(2) {
  animation-delay: 0.05s;
}

.mode-card:nth-child(3) {
  animation-delay: 0.1s;
}

.mode-card:nth-child(4) {
  animation-delay: 0.15s;
}

.mode-card:nth-child(5) {
  animation-delay: 0.2s;
}

.mode-card:nth-child(6) {
  animation-delay: 0.25s;
}

.mode-card:hover {
  transform: translateY(-7px);
  border-color: rgba(27, 119, 232, 0.32);
  box-shadow:
    0 28px 70px rgba(20, 32, 51, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mode-card:focus-visible {
  box-shadow:
    var(--focus),
    0 28px 70px rgba(20, 32, 51, 0.18);
}

.mode-glow {
  position: absolute;
  inset: auto -30px -70px auto;
  z-index: -1;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(27, 119, 232, 0.16);
  filter: blur(2px);
  transition: transform 0.2s ease;
}

.mode-card:hover .mode-glow {
  transform: scale(1.2) translate(-8px, -8px);
}

.mode-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.setup-card .mode-ribbon {
  width: fit-content;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 90, 63, 0.11);
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.setup-card .mode-ribbon.subtle {
  background: rgba(27, 119, 232, 0.08);
  color: #0b5faf;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid #10233d;
  border-radius: 20px;
  color: #10233d;
  font-size: 1.04rem;
  font-weight: 950;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 5px 0 rgba(13, 27, 45, 0.24);
}

.mode-icon-custom {
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
}

.mode-icon-brazil {
  background:
    radial-gradient(circle at 50% 50%, #1b77e8 0 25%, transparent 26%),
    linear-gradient(135deg, #ffe86b 0 50%, #18a957 51%);
}

.mode-icon-princesses {
  background:
    radial-gradient(circle at 50% 32%, #ffd43d 0 15%, transparent 16%),
    linear-gradient(135deg, #ffb3d1, #ef476f);
}

.mode-icon-streamers {
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.72) 0 14%, transparent 15%),
    linear-gradient(135deg, #bdb2ff, #7c3aed);
}

.mode-icon-youtubers {
  background:
    radial-gradient(circle at 50% 50%, #fff 0 18%, transparent 19%),
    linear-gradient(135deg, #ff6b6b, #d00000);
}

.mode-icon-bot {
  background: linear-gradient(180deg, #dff4ff, #a8d8ff);
}

.setup-card .mode-title {
  color: var(--ink);
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  font-weight: 950;
  line-height: 1;
}

.setup-card .mode-description {
  color: #53627a;
  font-size: 0.98rem;
  line-height: 1.48;
}

.mode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.setup-card .mode-meta span {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #42536e;
  font-size: 0.78rem;
  font-weight: 900;
}

.setup-card .mode-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border: 2px solid rgba(13, 27, 45, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  font-size: 0.95rem;
  font-weight: 950;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 4px 0 rgba(13, 27, 45, 0.22);
  transition: transform 0.16s ease;
}

.mode-card:hover .mode-cta {
  transform: scale(1.02);
}

.custom-card.is-featured {
  border: 2px solid rgba(27, 119, 232, 0.34);
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 212, 61, 0.34), transparent 24%),
    linear-gradient(180deg, #ffffff, #ecf7ff);
}

.theme-setup-card {
  min-height: 430px;
}

.custom-card.is-featured .mode-glow {
  background: rgba(255, 212, 61, 0.34);
}

.custom-preview {
  margin: 8px 0 2px;
  padding: 12px;
  border: 3px solid rgba(13, 27, 45, 0.42);
  border-radius: 18px;
  background: linear-gradient(145deg, #2089e3, #0b5faf);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.4),
    0 8px 0 rgba(8, 42, 85, 0.58);
}

.custom-preview i {
  border-radius: 10px;
  animation: modeFloat 3.5s ease-in-out infinite;
  animation-delay: calc(var(--delay) * -0.1s);
}

.mode-card:hover .custom-preview i,
.mode-card:hover .bot-board i,
.mode-card:hover .setup-player-card {
  transform: translateY(-3px);
}

.brazil-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 212, 61, 0.36), transparent 28%),
    linear-gradient(180deg, #ffffff, #f3fff3);
}

.brazil-card .mode-glow {
  background: rgba(25, 161, 95, 0.18);
}

.brazil-card .setup-chip {
  background: #18a957;
  color: #fff;
}

.theme-preview-strip,
.brazil-preview {
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 8px 0 2px;
  padding: 12px;
  border: 2px solid rgba(16, 35, 61, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.4), transparent 45%),
    rgba(255, 255, 255, 0.68);
}

.theme-preview-strip .setup-player-card,
.brazil-preview .setup-player-card {
  border-radius: 12px;
  transition: transform 0.18s ease;
}

.princesses-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(239, 71, 111, 0.24), transparent 28%),
    linear-gradient(180deg, #ffffff, #fff1f6);
}

.princesses-card .mode-glow {
  background: rgba(239, 71, 111, 0.18);
}

.princesses-card .setup-chip {
  background: #ef476f;
  color: #fff;
}

.princesses-card .setup-player-card img {
  border-color: #ffb3d1;
}

.streamers-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(124, 58, 237, 0.22), transparent 28%),
    linear-gradient(180deg, #ffffff, #f5f1ff);
}

.streamers-card .mode-glow {
  background: rgba(124, 58, 237, 0.18);
}

.streamers-card .setup-chip {
  background: #7c3aed;
  color: #fff;
}

.streamers-card .setup-player-card img {
  border-color: #bdb2ff;
}

.youtubers-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 59, 48, 0.22), transparent 28%),
    linear-gradient(180deg, #ffffff, #fff1f1);
}

.youtubers-card .mode-glow {
  background: rgba(255, 59, 48, 0.18);
}

.youtubers-card .setup-chip {
  background: #d00000;
  color: #fff;
}

.youtubers-card .setup-player-card img {
  border-color: #ff8f8a;
}

.bot-setup-card {
  background:
    radial-gradient(circle at 88% 10%, rgba(27, 119, 232, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff, #f5f8ff);
}

.bot-preview {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 10px 0 2px;
  padding: 14px;
  border: 2px solid rgba(16, 35, 61, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(27, 119, 232, 0.14), transparent 50%),
    rgba(255, 255, 255, 0.74);
}

.bot-head {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  place-items: center;
  width: 92px;
  height: 82px;
  border: 3px solid #10233d;
  border-radius: 24px;
  background: linear-gradient(180deg, #dff4ff, #9ed4ff);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 6px 0 rgba(13, 27, 45, 0.24);
}

.bot-head::before {
  content: "";
  position: absolute;
  top: -18px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #10233d;
}

.bot-head::after {
  content: "";
  position: absolute;
  top: -25px;
  width: 13px;
  height: 13px;
  border: 3px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
}

.bot-head span {
  width: 16px;
  height: 16px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: #10233d;
}

.bot-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.bot-board i {
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(16, 35, 61, 0.5);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.95) 0 17%, transparent 18%),
    linear-gradient(180deg, var(--tile-color), color-mix(in srgb, var(--tile-color), #000 12%));
  transition: transform 0.18s ease;
}

.setup-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(16, 35, 61, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 34px rgba(20, 32, 51, 0.08);
  backdrop-filter: blur(12px);
}

.setup-back {
  min-height: 48px;
  border-radius: 14px;
}

.setup-back span {
  font-weight: 950;
}

.setup-sound-toggle {
  width: min(260px, 100%);
  min-height: 52px;
  border-radius: 16px;
}

.sound-toggle-text {
  display: grid;
  gap: 1px;
  text-align: left;
}

.sound-toggle-text small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

@keyframes modeCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modeFloat {
  50% {
    transform: translateY(-3px);
  }
}

.setup-mini-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}

.setup-mini-board i {
  aspect-ratio: 1 / 1;
  border: 2px solid #10233d;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.94) 0 18%, transparent 19%),
    linear-gradient(180deg, var(--tile-color), color-mix(in srgb, var(--tile-color), #000 14%));
  box-shadow: 0 4px 0 rgba(13, 27, 45, 0.22);
}

.setup-theme-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: auto;
}

.setup-player-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 0.72 / 1;
  border: 2px solid #10233d;
  border-radius: 6px;
  background: var(--toy-yellow);
  box-shadow: 0 4px 0 rgba(13, 27, 45, 0.24);
}

.setup-player-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 4px solid var(--toy-yellow);
}

.setup-player-card b,
.face-number,
.guess-card b,
.mini-face b,
.result-face b,
.secret-number {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.78rem;
  font-weight: 950;
}

.setup-player-card b {
  right: 5px;
  bottom: 5px;
}

.create-summary,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 2px solid rgba(13, 27, 45, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 46%),
    #fff;
}

.settings-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto);
}

.create-summary strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 1.15rem;
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.sound-toggle strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 0.78rem;
}

.sound-toggle.is-on strong {
  background: rgba(25, 161, 95, 0.14);
  color: var(--green);
}

.create-room-page {
  display: grid;
  gap: clamp(18px, 3vw, 28px);
  animation: modeCardIn 0.42s ease both;
}

.create-room-hero {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 212, 61, 0.28), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 255, 0.9));
  box-shadow:
    0 22px 60px rgba(20, 32, 51, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.create-room-hero h2 {
  margin-bottom: 10px;
  font-size: clamp(2.5rem, 5.4vw, 5.3rem);
  line-height: 0.95;
}

.create-room-hero .lede {
  max-width: 780px;
  color: #42536e;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.create-room-form {
  display: grid;
  grid-template-columns: minmax(340px, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: start;
}

.create-config-column,
.create-preview-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.create-section,
.room-summary-card,
.create-actions {
  border: 1px solid rgba(16, 35, 61, 0.11);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.92));
  box-shadow:
    0 20px 52px rgba(20, 32, 51, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.create-section {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2vw, 22px);
}

.selected-mode-card {
  position: relative;
  overflow: hidden;
  gap: 18px;
}

.selected-mode-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -62px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(27, 119, 232, 0.12);
}

.selected-mode-card.mode-brazil {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 212, 61, 0.34), transparent 28%),
    linear-gradient(135deg, #ffffff, #f1fff1);
}

.selected-mode-card.mode-princesses {
  background:
    radial-gradient(circle at 86% 18%, rgba(239, 71, 111, 0.22), transparent 28%),
    linear-gradient(135deg, #ffffff, #fff1f6);
}

.selected-mode-card.mode-streamers {
  background:
    radial-gradient(circle at 86% 18%, rgba(124, 58, 237, 0.2), transparent 28%),
    linear-gradient(135deg, #ffffff, #f5f1ff);
}

.selected-mode-card.mode-youtubers {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 59, 48, 0.2), transparent 28%),
    linear-gradient(135deg, #ffffff, #fff1f1);
}

.selected-mode-card.mode-custom {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 212, 61, 0.32), transparent 28%),
    linear-gradient(135deg, #ffffff, #edf7ff);
}

.selected-mode-card.mode-bot {
  background:
    radial-gradient(circle at 86% 18%, rgba(27, 119, 232, 0.18), transparent 28%),
    linear-gradient(135deg, #ffffff, #f5f7ff);
}

.selected-mode-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.selected-mode-main h3,
.section-heading h3,
.room-summary-card h3,
.preview-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.1;
}

.selected-mode-main p,
.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.change-mode-button {
  position: relative;
  z-index: 1;
  width: fit-content;
  border-radius: 14px;
}

.section-heading,
.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.section-heading {
  justify-content: flex-start;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 2px solid rgba(16, 35, 61, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  font-size: 0.76rem;
  font-weight: 950;
  box-shadow: 0 4px 0 rgba(13, 27, 45, 0.16);
}

.input-with-icon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.input-with-icon:focus-within {
  border-color: rgba(27, 119, 232, 0.5);
  box-shadow: var(--focus);
  background: #fff;
}

.input-with-icon > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(27, 119, 232, 0.1);
  color: #0b5faf;
  font-size: 0.74rem;
  font-weight: 950;
}

.input-with-icon input,
.input-with-icon select {
  min-height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.match-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.68fr);
  gap: 12px;
  align-items: end;
}

.create-sound-switch {
  min-height: 76px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.create-sound-switch strong {
  min-width: 48px;
  min-height: 30px;
  border-radius: 999px;
  text-align: center;
}

.create-sound-switch.is-on {
  border-color: rgba(25, 161, 95, 0.22);
}

.upload-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 106px;
  padding: 18px;
  overflow: hidden;
  border: 2px dashed rgba(27, 119, 232, 0.32);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 44%),
    rgba(239, 248, 255, 0.72);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within,
.upload-dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: rgba(27, 119, 232, 0.58);
  background: #f4fbff;
  box-shadow: 0 18px 34px rgba(20, 32, 51, 0.1);
}

.upload-dropzone.is-loading {
  opacity: 0.78;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid #10233d;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  font-size: 1.3rem;
  font-weight: 950;
  box-shadow: 0 5px 0 rgba(13, 27, 45, 0.24);
}

.upload-dropzone strong,
.upload-dropzone small {
  display: block;
}

.upload-dropzone strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.upload-dropzone small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.upload-dropzone .file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.room-summary-card {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 2vw, 22px);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 42%),
    #fff;
}

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

.summary-list span {
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 11px;
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
}

.summary-list b {
  color: var(--blue);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.face-count-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0b5faf;
  font-size: 0.78rem;
  font-weight: 950;
}

.create-faces-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  max-height: 620px;
  overflow: auto;
  padding: 2px 4px 4px 2px;
}

.create-face-card {
  overflow: hidden;
  border: 1px solid rgba(16, 35, 61, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, #ffffff, #f6fbff);
  box-shadow: 0 12px 26px rgba(20, 32, 51, 0.1);
  cursor: text;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.create-face-card:hover {
  transform: translateY(-3px);
  border-color: rgba(27, 119, 232, 0.24);
  box-shadow: 0 18px 34px rgba(20, 32, 51, 0.14);
}

.face-image-wrap {
  position: relative;
  display: block;
  padding: 8px 8px 0;
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.2), transparent 46%),
    #fff;
}

.create-face-card img {
  overflow: hidden;
  border: 2px solid rgba(16, 35, 61, 0.14);
  border-radius: 14px;
  aspect-ratio: 0.9 / 1;
  object-fit: cover;
}

.create-face-number {
  position: absolute;
  right: 14px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.78rem;
  font-weight: 950;
}

.create-face-card .face-editor-meta {
  top: 14px;
  left: 14px;
  max-width: calc(100% - 28px);
  background: rgba(16, 35, 61, 0.82);
}

.face-name-edit {
  display: block;
  padding: 8px;
}

.create-face-card input {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.72);
  text-align: center;
  font-weight: 900;
}

.create-face-card input:focus {
  border-color: rgba(27, 119, 232, 0.35);
  background: #fff;
}

.create-empty-state {
  min-height: 260px;
}

.create-actions {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.create-submit {
  min-height: 56px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 5px 0 rgba(13, 27, 45, 0.24);
}

.create-submit:hover {
  transform: translateY(-2px);
}

.create-actions .help {
  grid-column: 1 / -1;
  text-align: center;
}

.face-editor-card {
  position: relative;
}

.face-editor-meta {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(16, 35, 61, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.invite-qr {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.invite-qr img {
  width: 116px;
  height: 116px;
  border: 2px solid #10233d;
  border-radius: 6px;
  background: #fff;
}

.lobby-board-title,
.board-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.player-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-face {
  position: relative;
}

.mini-face b {
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

.mini-face small {
  display: block;
  overflow: hidden;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-timer {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(13, 27, 45, 0.18);
  border-radius: 999px;
  background: #eaf7ff;
  color: #064aa3;
  font-weight: 950;
}

.turn-timer small {
  color: currentColor;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.turn-timer.is-danger {
  background: #ffe7e2;
  color: var(--danger);
  animation: timerPulse 0.8s ease-in-out infinite;
}

@keyframes timerPulse {
  50% {
    transform: scale(1.04);
  }
}

.game-shell .player-wins {
  display: none;
}

.game-shell .face-card {
  transform-style: preserve-3d;
  transition:
    transform 0.38s cubic-bezier(0.2, 0.85, 0.22, 1),
    box-shadow 0.28s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
}

.game-shell .face-card span {
  display: grid;
  gap: 2px;
}

.game-shell .face-card span strong,
.game-shell .face-card span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-shell .face-card span small {
  color: rgba(16, 26, 43, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
}

.face-number {
  top: 7px;
  right: 7px;
}

.game-shell .face-card.down {
  animation: cardDrop 0.42s cubic-bezier(0.2, 0.82, 0.2, 1);
}

@keyframes cardDrop {
  0% {
    transform: translateY(0) perspective(600px) rotateX(0deg);
  }
  52% {
    transform: translateY(2px) perspective(600px) rotateX(72deg);
  }
  100% {
    transform: translateY(5px) perspective(600px) rotateX(58deg);
  }
}

.secret-modal-card {
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.28), transparent 46%),
    linear-gradient(315deg, rgba(27, 119, 232, 0.15), transparent 48%),
    #fff;
}

.secret-photo-wrap {
  position: relative;
  animation: secretPop 0.45s ease both;
}

.secret-number {
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.secret-meta {
  width: fit-content;
  margin: 0 0 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eaf7ff;
  color: #064aa3;
  font-weight: 900;
}

@keyframes secretPop {
  from {
    opacity: 0;
    transform: scale(0.94) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.secret-card-compact span {
  min-width: 0;
}

.secret-card-compact small {
  display: block;
  overflow: hidden;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
}

.history-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.66rem;
  font-weight: 950;
}

.history-item.yes {
  border-color: rgba(25, 161, 95, 0.26);
  background: rgba(25, 161, 95, 0.08);
}

.history-item.no {
  border-color: rgba(217, 53, 50, 0.22);
  background: rgba(217, 53, 50, 0.07);
}

.history-item small b {
  color: var(--ink);
}

.guess-card {
  position: relative;
}

.guess-card b {
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

.danger-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(217, 53, 50, 0.24);
  border-radius: var(--radius);
  background: rgba(217, 53, 50, 0.08);
  color: var(--danger);
  font-weight: 850;
}

.result-hero {
  position: relative;
}

.result-hero.winner {
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.32), transparent 42%),
    linear-gradient(315deg, rgba(25, 161, 95, 0.2), transparent 44%),
    var(--surface);
}

.result-hero.loser {
  background:
    linear-gradient(135deg, rgba(240, 90, 63, 0.2), transparent 42%),
    linear-gradient(315deg, rgba(27, 119, 232, 0.14), transparent 44%),
    var(--surface);
}

.winner-strip {
  display: grid;
  width: fit-content;
  min-width: 220px;
  margin: 8px 0 18px;
  padding: 12px 14px;
  border: 2px solid rgba(13, 27, 45, 0.18);
  border-radius: var(--radius);
  background: #fff7c7;
}

.winner-strip span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.winner-strip strong {
  font-size: 1.2rem;
}

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  top: -24px;
  left: calc((var(--i) * 53px) % 100%);
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 37), 88%, 58%);
  animation: confettiFall 1.6s ease-in infinite;
  animation-delay: calc(var(--i) * 0.045s);
}

@keyframes confettiFall {
  to {
    transform: translateY(620px) rotate(300deg);
  }
}

.result-face {
  position: relative;
}

.result-face b {
  top: 10px;
  right: 10px;
}

.result-face small {
  display: block;
  padding: 0 12px 12px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.76fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.auth-visual-card,
.auth-card,
.account-card {
  border: 1px solid rgba(16, 35, 61, 0.12);
  border-radius: 26px;
  box-shadow:
    0 26px 70px rgba(20, 32, 51, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-visual-card {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(145deg, #1b77e8 0%, #0a55ad 58%, #08366f 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: #fff;
}

.auth-visual-card h1 {
  max-width: 680px;
  color: #fff;
  font-size: clamp(3rem, 6.5vw, 6rem);
  line-height: 0.92;
  text-shadow: 0 5px 0 rgba(5, 22, 48, 0.2);
}

.auth-visual-card .lede {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.9);
}

.auth-preview-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(520px, 100%);
  margin-top: 32px;
  padding: 16px;
  border: 3px solid rgba(13, 27, 45, 0.48);
  border-radius: 22px;
  background: linear-gradient(145deg, #2089e3, #0b5faf);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    0 12px 0 rgba(8, 42, 85, 0.68),
    0 30px 60px rgba(5, 22, 48, 0.28);
}

.auth-preview-board span {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 2px solid #10233d;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fff4a9 0 17%, transparent 18%),
    linear-gradient(180deg, var(--tile-color), color-mix(in srgb, var(--tile-color), #000 12%));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    0 5px 0 #092e62;
  animation: homeFloat 3.6s ease-in-out infinite;
  animation-delay: calc(var(--delay) * -0.13s);
}

.auth-preview-board i {
  width: 42%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #ffe0bd;
  box-shadow: inset 0 -7px 0 rgba(125, 77, 37, 0.18);
}

.auth-preview-board b {
  position: absolute;
  right: 7px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.68rem;
  font-weight: 950;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.auth-benefits span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  font-weight: 850;
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.auth-card h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
}

.auth-submit {
  min-height: 54px;
  border-radius: 16px;
  font-size: 1rem;
}

.social-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid rgba(16, 35, 61, 0.14);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(20, 32, 51, 0.08);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.social-login-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #4285f4;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #4285f4 0 25%, #34a853 25% 50%, #fbbc05 50% 75%, #ea4335 75%);
  color: #fff;
  font-weight: 950;
}

.social-login-button:hover {
  transform: translateY(-2px);
  border-color: rgba(27, 119, 232, 0.32);
  box-shadow: 0 16px 32px rgba(20, 32, 51, 0.12);
}

.social-login-button.is-unavailable {
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  box-shadow: none;
}

.social-login-help {
  margin: -6px 0 2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: rgba(16, 35, 61, 0.12);
}

.auth-switch {
  min-height: 42px;
  border-radius: 12px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 900;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(217, 53, 50, 0.2);
  border-radius: 12px;
  background: rgba(217, 53, 50, 0.08);
  color: var(--danger);
  font-weight: 850;
}

.account-screen {
  display: grid;
  place-items: center;
  min-height: 58vh;
}

.account-card {
  display: grid;
  justify-items: center;
  width: min(520px, 100%);
  padding: clamp(24px, 4vw, 40px);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.22), transparent 44%),
    #fff;
  text-align: center;
}

.account-avatar {
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  font-size: 1.35rem;
  box-shadow: 0 6px 0 rgba(13, 27, 45, 0.24);
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 22px;
}

body.is-home {
  background:
    radial-gradient(circle at 11% 14%, rgba(255, 212, 61, 0.36), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(27, 119, 232, 0.2), transparent 30%),
    linear-gradient(90deg, rgba(27, 119, 232, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(27, 119, 232, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, #fff8dd 0%, #f4fbff 52%, #fff1c3 100%);
  background-size: auto, auto, 42px 42px, 42px 42px, auto;
}

body.is-home .topbar {
  border-bottom: 1px solid rgba(20, 32, 51, 0.09);
  background: rgba(255, 253, 243, 0.82);
  box-shadow: 0 12px 30px rgba(20, 32, 51, 0.06);
}

body.is-home .brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 14px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.7),
    0 5px 0 #0d1b2d,
    0 14px 24px rgba(13, 27, 45, 0.15);
}

body.is-home .app-main {
  width: min(1240px, calc(100% - 32px));
  padding-top: clamp(18px, 3vw, 42px);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(340px, 0.86fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.premium-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  min-height: clamp(590px, 74vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(16, 35, 61, 0.14);
  border-radius: 26px;
  background:
    radial-gradient(circle at 28% 14%, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(145deg, #1b77e8 0%, #0a55ad 58%, #08366f 100%);
  color: #fff;
  box-shadow:
    0 28px 70px rgba(20, 32, 51, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.premium-stage::before,
.premium-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.premium-stage::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000, transparent 72%);
}

.premium-stage::after {
  right: -110px;
  bottom: -130px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 212, 61, 0.28);
  filter: blur(4px);
}

.hero-glass-card {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 35px rgba(5, 22, 48, 0.18);
  backdrop-filter: blur(14px);
}

.hero-room-card {
  top: 22px;
  left: 22px;
}

.hero-glass-card strong {
  font-size: 0.9rem;
}

.hero-glass-card small {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 750;
}

.live-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(25, 161, 95, 0.16);
}

.hero-board-wrap {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(640px, calc(100% - 42px));
  margin: 58px auto 12px;
  padding: 18px;
  border: 3px solid rgba(13, 27, 45, 0.46);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 18%),
    linear-gradient(145deg, #2089e3, #0b5faf);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    0 14px 0 rgba(8, 42, 85, 0.68),
    0 34px 65px rgba(5, 22, 48, 0.32);
  transform: perspective(1100px) rotateX(4deg) rotateY(-5deg);
}

.hero-board-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: #fff;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-board-top span {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.hero-board-top b {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0af;
  color: #7c4d00;
  font-size: 0.76rem;
}

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

.home-face-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(86px, 10vw, 122px);
  overflow: hidden;
  border: 2px solid #10233d;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fff4a9 0 17%, transparent 18%),
    linear-gradient(180deg, var(--tile-color), color-mix(in srgb, var(--tile-color), #000 14%));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.58),
    0 5px 0 #092e62;
  animation: homeFloat 3.4s ease-in-out infinite;
  animation-delay: calc(var(--delay) * -0.12s);
}

.home-face-card::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 34px;
  height: 8px;
  border: 2px solid rgba(13, 27, 45, 0.62);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6b8, #d69618);
  transform: translateX(-50%);
}

.home-face-card b {
  position: absolute;
  right: 7px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.68rem;
  font-weight: 950;
}

.avatar-head {
  width: 42%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.34), transparent 20%),
    #ffe0bd;
  box-shadow: inset 0 -7px 0 rgba(125, 77, 37, 0.18);
}

.avatar-body {
  width: 70%;
  height: 18%;
  border-radius: 999px 999px 10px 10px;
  background: rgba(16, 35, 61, 0.8);
}

.home-face-card.is-down {
  transform-origin: bottom;
  filter: brightness(0.78) saturate(0.8);
  animation: none;
  transform: perspective(620px) rotateX(58deg) translateY(7px);
}

.hero-question-card {
  position: absolute;
  right: -22px;
  bottom: 28px;
  display: grid;
  gap: 5px;
  width: min(230px, 46%);
  padding: 14px;
  border: 1px solid rgba(16, 35, 61, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: 0 20px 42px rgba(5, 22, 48, 0.24);
}

.hero-question-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-question-card strong {
  line-height: 1.18;
}

.hero-question-card span {
  width: fit-content;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(25, 161, 95, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

@keyframes homeFloat {
  50% {
    transform: translateY(-4px);
  }
}

.premium-stage .home-copy {
  position: relative;
  z-index: 2;
  padding: 12px clamp(22px, 4vw, 42px) clamp(24px, 4vw, 38px);
}

.premium-stage .eyebrow {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff8c9;
}

.premium-stage h1 {
  max-width: 760px;
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(3.4rem, 7vw, 6.9rem);
  letter-spacing: 0;
  text-shadow: 0 5px 0 rgba(5, 22, 48, 0.2);
}

.premium-stage .lede {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
}

.home-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.home-primary,
.home-secondary {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 1rem;
}

.home-ctas .home-primary {
  border: 2px solid rgba(13, 27, 45, 0.22);
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    0 5px 0 rgba(13, 27, 45, 0.3);
}

.home-ctas .home-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(10px);
}

.home-ctas .home-primary:hover,
.home-ctas .home-secondary:hover {
  transform: translateY(-2px) scale(1.02);
}

.start-card {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(16, 35, 61, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 26px 70px rgba(20, 32, 51, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
}

.start-card h2 {
  max-width: 360px;
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 3.2vw, 3.1rem);
}

.start-card .choice-stack {
  margin-top: 4px;
}

.start-card .choice-button {
  min-height: 104px;
  border-radius: 18px;
  border-color: rgba(16, 35, 61, 0.12);
  background:
    linear-gradient(180deg, #ffffff, #f3f9ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(20, 32, 51, 0.08);
}

.start-card .choice-button.featured {
  border: 2px solid rgba(27, 119, 232, 0.35);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.35), transparent 42%),
    linear-gradient(180deg, #ffffff, #edf7ff);
}

.start-card .choice-button:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(27, 119, 232, 0.5);
  box-shadow: 0 18px 34px rgba(20, 32, 51, 0.13);
}

.start-card .choice-icon {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(16, 35, 61, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
}

.start-card .choice-button:not(.featured) .choice-icon {
  background: linear-gradient(180deg, #eaf7ff, #d6ecff);
  color: #064aa3;
}

.start-card .choice-button strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.start-card .choice-button span:not(.choice-icon):not(.arrow) {
  color: var(--muted);
}

.resume-button {
  width: 100%;
  border-radius: 16px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 6px;
}

.benefit-grid span {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(16, 35, 61, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.benefit-grid b {
  color: var(--blue);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.connection-pill.has-room {
  cursor: pointer;
  border-color: rgba(27, 119, 232, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.94);
  color: #263a59;
  font-weight: 900;
}

.connection-pill.has-room::after {
  content: "copiar";
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(27, 119, 232, 0.1);
  color: #0b5faf;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.game-play-screen {
  animation: modeCardIn 0.36s ease both;
}

.game-shell .game-status-bar {
  gap: 10px;
}

.game-shell .score-card,
.game-shell .turn-card {
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(233, 244, 255, 0.92));
  box-shadow:
    0 14px 30px rgba(5, 22, 48, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.game-shell .score-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border-left: 5px solid rgba(182, 200, 223, 0.8);
}

.game-shell .score-card::after {
  display: none;
}

.game-shell .score-card.is-active {
  border-color: rgba(255, 212, 61, 0.9);
  border-left-color: var(--toy-yellow);
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 212, 61, 0.34), transparent 26%),
    linear-gradient(135deg, #ffffff, #eff8ff);
  animation: turnPulseSoft 1.8s ease-in-out infinite;
}

.player-avatar {
  width: 46px;
  height: 46px;
}

.game-shell .turn-card {
  min-width: 210px;
  border-color: rgba(255, 212, 61, 0.7);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.72), transparent 38%),
    linear-gradient(180deg, #fff0a0, var(--toy-yellow));
  color: #10233d;
}

.game-shell .turn-card strong {
  font-size: 1.18rem;
  font-weight: 950;
}

.turn-countdown {
  position: absolute;
  right: 12px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #10233d;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 950;
}

.turn-countdown.is-danger {
  background: var(--danger);
  animation: timerPulse 0.8s ease-in-out infinite;
}

.game-shell .game-layout {
  grid-template-columns: minmax(0, 1fr) clamp(330px, 24vw, 410px);
  gap: 12px;
}

.game-shell .panel,
.game-shell .side-panel {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 22px;
  box-shadow:
    0 22px 48px rgba(5, 22, 48, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.game-shell .game-board-panel {
  padding: clamp(12px, 1.2vw, 18px);
  border-color: rgba(255, 255, 255, 0.28);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 212, 61, 0.16), transparent 34%),
    linear-gradient(145deg, #1b77e8, #0b58ad 58%, #083d7d);
}

.board-subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.game-shell .board-toolbar {
  align-items: flex-start;
}

.game-shell .board-count {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
}

.game-shell .board-grid {
  gap: clamp(8px, 0.78vw, 12px);
}

.game-shell .character-card {
  border: 2px solid rgba(16, 35, 61, 0.9);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fff6b2 0 16%, transparent 17%),
    linear-gradient(180deg, #ffe36a, var(--toy-yellow));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    0 5px 0 #092e62,
    0 14px 22px rgba(5, 22, 48, 0.24);
}

.game-shell .character-card:hover {
  transform: translateY(-4px);
  border-color: #fff0a0;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.62),
    0 7px 0 #092e62,
    0 18px 30px rgba(5, 22, 48, 0.28);
}

.game-shell .character-card::before {
  top: 7px;
  width: 42px;
  height: 9px;
}

.character-image {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
}

.game-shell .character-card img {
  border: 7px solid var(--toy-yellow);
  border-bottom-width: 4px;
}

.character-image em {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(16, 35, 61, 0.78);
  color: #fff;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.game-shell .character-card:hover .character-image em,
.game-shell .character-card.down .character-image em {
  opacity: 1;
  transform: translateY(0);
}

.game-shell .character-meta {
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 7px 8px;
  align-content: center;
  background: linear-gradient(180deg, #fff1a0, var(--toy-yellow));
}

.game-shell .face-card.down {
  filter: saturate(0.82);
  transform: translateY(6px) perspective(620px) rotateX(58deg);
}

.game-shell .face-card.down::after {
  content: "Eliminada";
  inset: 12px 12px calc(clamp(26px, 3.9vh, 36px) + 12px);
  border-radius: 14px;
}

.game-side {
  grid-template-rows: auto auto auto auto;
  gap: 12px;
  align-content: start;
  overflow: visible;
}

.game-shell .side-panel {
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(238, 247, 255, 0.94));
}

.panel-heading,
.action-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-heading h3,
.action-heading h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

.private-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(27, 119, 232, 0.1);
  color: #0b5faf;
  font-size: 0.72rem;
  font-weight: 950;
}

.secret-panel {
  display: grid;
  gap: 10px;
}

.secret-card-compact {
  grid-template-columns: 104px minmax(0, 1fr);
  border-radius: 18px;
}

.secret-card-image {
  position: relative;
}

.secret-card-image b {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #10233d;
  border-radius: 999px;
  background: var(--toy-yellow);
  color: #10233d;
  font-size: 0.76rem;
  font-weight: 950;
}

.secret-card-compact img {
  width: 104px;
  height: 104px;
  border-radius: 16px 0 0 16px;
}

.opponent-panel {
  display: grid;
  gap: 10px;
}

.game-intel .opponent-mini-grid,
.opponent-panel .opponent-mini-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-height: none;
  padding: 8px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, #2089e3, #0b5faf);
}

.opponent-mini {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 10px rgba(5, 22, 48, 0.15);
}

.game-shell .action-panel {
  align-content: start;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 212, 61, 0.24), transparent 26%),
    linear-gradient(180deg, #fffdf4, #fff7d7);
}

.waiting-card,
.game-shell .question-card {
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 212, 61, 0.14), transparent 40%),
    rgba(255, 255, 255, 0.74);
}

.game-shell .action-panel textarea {
  min-height: 92px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.game-shell .quick-questions {
  display: flex;
  flex-wrap: nowrap;
  max-height: none;
  overflow-x: auto;
  padding-bottom: 4px;
}

.game-shell .chip {
  width: auto;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff;
}

.game-shell .ask-button {
  background: linear-gradient(180deg, #ffe77b, var(--toy-yellow));
  color: #10233d;
}

.game-shell .guess-open-button {
  background: linear-gradient(180deg, #ff7b5f, var(--coral));
}

.game-history-panel .history-item {
  border-radius: 14px;
}

.guess-modal-card {
  width: min(920px, 100%);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 212, 61, 0.18), transparent 24%),
    #fff;
}

.guess-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.guess-card {
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(20, 32, 51, 0.1);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.guess-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(20, 32, 51, 0.14);
}

.guess-image {
  position: relative;
  display: block;
}

.guess-image b {
  right: 8px;
  bottom: 8px;
}

.guess-card span:last-child {
  display: grid;
  gap: 2px;
  padding: 9px;
}

.guess-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

@keyframes turnPulseSoft {
  50% {
    transform: translateY(-1px);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-grid,
  .home-hero,
  .auth-screen,
  .game-layout,
  .result-screen,
  .setup-grid {
    grid-template-columns: 1fr;
  }

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

  .setup-hero {
    grid-template-columns: 1fr;
  }

  .setup-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .setup-hero-panel span {
    display: grid;
    justify-items: center;
    min-height: 58px;
    padding: 8px;
    text-align: center;
    font-size: 0.78rem;
  }

  .premium-stage {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .premium-stage .home-copy {
    order: 1;
    padding-top: clamp(24px, 5vw, 42px);
    text-align: center;
  }

  .premium-stage .eyebrow,
  .premium-stage .lede,
  .home-ctas {
    margin-right: auto;
    margin-left: auto;
  }

  .premium-stage h1 {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-board-wrap {
    order: 2;
    width: min(660px, calc(100% - 34px));
    margin-top: 0;
    margin-bottom: 30px;
    transform: none;
  }

  .setup-card {
    min-height: 460px;
  }

  .auth-visual-card {
    order: 2;
    min-height: auto;
  }

  .auth-card {
    order: 1;
  }

  .create-room-form {
    grid-template-columns: 1fr;
  }

  .create-preview-column {
    order: 2;
  }

  .create-config-column {
    order: 1;
  }

  .app-main.game-main {
    width: min(100% - 22px, 1180px);
    padding: 16px 0 48px;
  }

  .game-shell {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .home-stage {
    min-height: auto;
  }

  .sample-board {
    grid-template-columns: repeat(6, 1fr);
  }

  .sample-face {
    min-height: 82px;
  }

  .game-header {
    grid-template-columns: 1fr;
  }

  .game-shell .game-status-bar {
    grid-template-columns: 1fr;
  }

  .turn-card {
    min-width: 0;
  }

  .game-shell .game-layout {
    grid-template-columns: 1fr;
  }

  .game-side {
    grid-template-rows: auto;
    overflow: visible;
  }

  .game-intel {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  }

  .game-shell .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    height: auto;
    grid-template-rows: none;
  }

  .game-shell .face-card {
    grid-template-rows: auto 34px;
  }

  .game-shell .face-card img {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 680px) {
  .app-main {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    min-height: 64px;
    padding: 10px 12px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .auth-bar {
    gap: 6px;
  }

  .auth-link-button,
  .auth-logout-button,
  .auth-user-button span:not(.auth-avatar) {
    display: none;
  }

  .auth-user-button {
    min-height: 32px;
    padding: 0 4px;
  }

  .auth-cta-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .rules-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .brand small {
    display: none;
  }

  .connection-pill {
    font-size: 0.76rem;
  }

  .room-top,
  .players-grid,
  .secret-reveal,
  .game-intel,
  .create-summary,
  .settings-grid,
  .invite-qr {
    grid-template-columns: 1fr;
  }

  .invite-qr img {
    width: 132px;
    height: 132px;
  }

  .panel,
  .side-panel,
  .game-panel,
  .modal-card {
    padding: 16px;
  }

  .sample-board {
    grid-template-columns: repeat(3, 1fr);
  }

  .setup-premium .setup-grid {
    grid-template-columns: 1fr;
  }

  .setup-hero {
    padding: 18px;
    border-radius: 20px;
  }

  .setup-copy h2 {
    font-size: clamp(2.2rem, 13vw, 3.5rem);
  }

  .setup-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .setup-hero-panel span {
    display: grid;
    justify-items: center;
    min-height: 58px;
    padding: 8px;
    text-align: center;
    font-size: 0.78rem;
  }

  .mode-card {
    min-height: auto;
    border-radius: 20px;
  }

  .bot-preview {
    grid-template-columns: 1fr;
  }

  .setup-controls {
    display: grid;
  }

  .setup-back,
  .setup-sound-toggle {
    width: 100%;
  }

  .auth-visual-card,
  .auth-card,
  .account-card {
    border-radius: 20px;
  }

  .auth-preview-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
  }

  .auth-preview-board span {
    min-height: 76px;
  }

  .auth-benefits {
    display: grid;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }

  .create-room-hero,
  .create-section,
  .room-summary-card,
  .create-actions {
    border-radius: 20px;
  }

  .match-settings-grid,
  .summary-list,
  .create-actions {
    grid-template-columns: 1fr;
  }

  .selected-mode-main,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .preview-header {
    align-items: flex-start;
  }

  .create-faces-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .upload-dropzone {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .home-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .premium-stage {
    order: 1;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
  }

  .start-card {
    order: 2;
  }

  .hero-room-card {
    display: none;
  }

  .hero-board-wrap {
    order: 2;
    width: calc(100% - 24px);
    margin-top: 0;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 18px;
  }

  .hero-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .home-face-card {
    min-height: 78px;
  }

  .hero-question-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 10px;
  }

  .premium-stage .home-copy {
    order: 1;
    padding: 16px 18px 22px;
    text-align: center;
  }

  .premium-stage .eyebrow,
  .home-ctas {
    margin-right: auto;
    margin-left: auto;
  }

  .home-ctas,
  .start-card .choice-stack {
    display: grid;
  }

  .home-primary,
  .home-secondary,
  .home-ctas .button {
    width: 100%;
  }

  .start-card {
    border-radius: 20px;
  }

  .benefit-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.2rem, 14vw, 4.2rem);
  }

  .board-grid,
  .game-shell .board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .face-card span,
  .game-shell .face-card span {
    min-height: 40px;
    padding: 9px 7px;
    font-size: 0.88rem;
  }

  .game-intel .opponent-mini-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .game-shell .app-main,
  .app-main.game-main {
    height: auto;
    min-height: calc(100vh - 64px);
    overflow: visible;
  }

  body.is-playing,
  body.is-playing .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .game-shell {
    height: auto;
    overflow: visible;
  }

  .game-shell .score-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .game-shell .turn-card {
    min-height: 74px;
  }

  .secret-card-compact {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .secret-card-compact img {
    width: 82px;
    height: 82px;
  }

  .game-shell .quick-questions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  .game-shell .actions-row {
    grid-template-columns: 1fr;
  }

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

  .result-hero {
    min-height: 420px;
  }
}

@media (max-width: 440px) {
  .setup-hero-panel {
    display: none;
  }
}

@media (hover: none) {
  .choice-button:hover,
  .setup-card:hover,
  .create-face-card:hover,
  .game-shell .character-card:hover,
  .guess-card:hover,
  .button:hover {
    transform: none;
  }

  .choice-button:active,
  .setup-card:active,
  .game-shell .character-card:active,
  .guess-card:active,
  .button:active {
    transform: scale(0.985);
  }
}

@media (max-width: 1024px) {
  :root {
    --topbar-height: 64px;
  }

  .app-main,
  .app-main.game-main {
    width: min(100% - 24px, 1180px);
    padding: 18px 0 44px;
  }

  .topbar {
    min-height: var(--topbar-height);
    padding: 10px 14px;
  }

  .topbar-actions {
    gap: 8px;
    min-width: 0;
  }

  .brand {
    gap: 9px;
    min-width: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 13px;
    font-size: 0.78rem;
  }

  .brand strong {
    font-size: 0.98rem;
    white-space: nowrap;
  }

  .brand small {
    font-size: 0.7rem;
  }

  .home-hero,
  .auth-screen,
  .create-room-form,
  .result-screen {
    grid-template-columns: 1fr;
  }

  .create-config-column,
  .create-preview-column,
  .room-summary-card,
  .create-section,
  .create-actions,
  .panel,
  .side-panel,
  .modal-card {
    min-width: 0;
  }

  .create-preview-column {
    order: 2;
  }

  .create-config-column {
    order: 1;
  }

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

  .setup-card {
    min-height: 0;
  }

  .game-shell {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

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

  .game-side {
    grid-template-rows: auto;
    overflow: visible;
  }

  .game-shell .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    grid-template-rows: none;
    height: auto;
  }
}

@media (max-width: 768px) {
  :root {
    --topbar-height: 58px;
  }

  body {
    background-size: 30px 30px, 30px 30px, auto, auto, auto;
  }

  body.is-playing {
    background-size: 28px 28px, 28px 28px, auto;
  }

  .topbar {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    min-height: var(--topbar-height);
    gap: 8px;
    padding: 8px 10px;
  }

  .topbar-actions {
    flex: 0 1 auto;
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 12px;
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.65),
      0 3px 0 #0d1b2d;
  }

  .brand strong {
    max-width: 120px;
    overflow: hidden;
    font-size: 0.94rem;
    text-overflow: ellipsis;
  }

  .brand small {
    display: none;
  }

  .auth-bar {
    gap: 6px;
  }

  .auth-link-button,
  .auth-logout-button,
  .auth-user-button span:not(.auth-avatar) {
    display: none;
  }

  .auth-user-button {
    min-height: 34px;
    padding: 0 4px;
  }

  .auth-cta-button,
  .rules-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.75rem;
  }

  .connection-pill {
    min-height: 32px;
    max-width: 104px;
    padding: 6px 9px;
    overflow: hidden;
    font-size: 0.72rem;
    text-overflow: ellipsis;
  }

  .connection-pill.has-room::after {
    display: none;
  }

  .app-main,
  .app-main.game-main,
  body.is-home .app-main {
    width: 100%;
    max-width: 100%;
    padding: 14px 10px 36px;
  }

  body.is-home .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 12px;
  }

  h1 {
    font-size: clamp(2.15rem, 13vw, 3.65rem);
    line-height: 0.98;
  }

  h2,
  .create-room-hero h2,
  .setup-copy h2 {
    font-size: clamp(2rem, 11vw, 3.2rem);
    line-height: 1;
  }

  .lede {
    font-size: 0.96rem;
    line-height: 1.45;
  }

  .button,
  .choice-button,
  input,
  select,
  textarea {
    min-height: 46px;
  }

  .home-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  .premium-stage {
    order: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    margin-inline: auto;
    min-height: 0;
    border-radius: 20px;
  }

  .premium-stage .home-copy {
    order: 1;
    padding: 20px 18px 18px;
    text-align: center;
  }

  .home-ctas,
  .start-card .choice-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-ctas .button,
  .home-primary,
  .home-secondary,
  .start-card .choice-button,
  .start-card .button {
    width: 100%;
  }

  .hero-room-card {
    display: none;
  }

  .hero-board-wrap {
    order: 2;
    width: calc(100% - 20px);
    max-width: 100%;
    margin: 0 auto 14px;
    padding: 12px;
    border-radius: 18px;
    transform: none;
  }

  .home-copy,
  .home-copy .lede,
  .premium-stage h1 {
    max-width: 100%;
  }

  .premium-stage .lede,
  .home-copy .lede {
    overflow-wrap: anywhere;
  }

  .hero-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .home-face-card {
    min-height: 74px;
  }

  .hero-question-card {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .start-card,
  .auth-visual-card,
  .auth-card,
  .account-card,
  .panel,
  .side-panel,
  .game-panel,
  .modal-card,
  .create-room-hero,
  .create-section,
  .room-summary-card,
  .create-actions {
    border-radius: 20px;
  }

  .start-card {
    order: 2;
    width: min(100%, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    margin-inline: auto;
    padding: 18px;
  }

  .choice-button {
    min-height: 78px;
    padding: 14px;
  }

  .choice-icon {
    width: 38px;
    height: 38px;
  }

  .benefit-grid,
  .auth-benefits,
  .account-actions,
  .setup-controls,
  .match-settings-grid,
  .summary-list,
  .create-actions,
  .players-grid,
  .room-top,
  .invite-qr,
  .secret-reveal,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    gap: 14px;
  }

  .auth-card {
    order: 1;
  }

  .auth-visual-card {
    order: 2;
    min-height: 0;
  }

  .auth-preview-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
  }

  .auth-preview-board span {
    min-height: 72px;
  }

  .setup-screen {
    gap: 14px;
  }

  .setup-hero {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 20px;
  }

  .setup-hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .setup-hero-panel span {
    min-height: 54px;
    padding: 8px 6px;
    text-align: center;
    font-size: 0.72rem;
  }

  .setup-premium .setup-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mode-card {
    min-height: 0;
    padding: 16px;
    border-radius: 20px;
  }

  .mode-title {
    font-size: 1.24rem;
  }

  .mode-description {
    min-height: 0;
    font-size: 0.92rem;
  }

  .mode-meta {
    gap: 8px;
  }

  .mode-cta {
    min-height: 46px;
    width: 100%;
  }

  .setup-mini-board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 0;
  }

  .setup-player-card img {
    aspect-ratio: 1 / 1;
  }

  .bot-preview {
    grid-template-columns: 1fr;
  }

  .create-room-page {
    gap: 14px;
  }

  .create-room-hero {
    padding: 18px;
  }

  .create-section,
  .room-summary-card {
    gap: 14px;
    padding: 16px;
  }

  .selected-mode-main,
  .section-heading,
  .preview-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .change-mode-button,
  .create-submit,
  .create-back {
    width: 100%;
  }

  .input-with-icon,
  .create-sound-switch {
    min-height: 54px;
    border-radius: 15px;
  }

  .upload-dropzone {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 120px;
    padding: 16px;
    text-align: center;
  }

  .upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .create-faces-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    gap: 12px;
  }

  .create-face-card {
    border-radius: 16px;
  }

  .create-face-card input {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .create-actions {
    position: sticky;
    bottom: 10px;
    z-index: 35;
    padding: 12px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96));
    backdrop-filter: blur(12px);
  }

  body.is-playing .topbar {
    min-height: var(--topbar-height);
    padding: 7px 10px;
  }

  body.is-playing .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  body.is-playing .brand strong {
    font-size: 0.88rem;
  }

  .game-shell {
    display: grid;
    gap: 10px;
  }

  .game-shell .game-status-bar {
    position: sticky;
    top: var(--topbar-height);
    z-index: 25;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(84px, 0.78fr) minmax(0, 1fr);
    gap: 6px;
    padding: 0;
  }

  .game-shell .score-card,
  .game-shell .turn-card {
    min-width: 0;
    min-height: 62px;
    padding: 8px;
    border-radius: 14px;
  }

  .game-shell .score-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    border-left-width: 3px;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }

  .player-role,
  .player-questions {
    display: none;
  }

  .game-shell .score-card strong {
    min-width: 0;
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-shell .score-card .status-badge {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
    padding: 4px 7px;
    overflow: hidden;
    font-size: 0.65rem;
    text-overflow: ellipsis;
  }

  .game-shell .player-wins {
    display: none;
  }

  .game-shell .turn-card {
    display: grid;
    place-items: center;
    gap: 2px;
    text-align: center;
  }

  .game-shell .turn-card small {
    font-size: 0.65rem;
  }

  .game-shell .turn-card strong {
    font-size: 0.86rem;
    line-height: 1.05;
  }

  .vs-pill {
    display: none;
  }

  .turn-countdown {
    position: static;
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .game-shell .game-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .game-side {
    display: contents;
  }

  .game-shell .secret-panel {
    order: 1;
  }

  .game-shell .game-board-panel {
    order: 2;
    padding: 12px;
    border-radius: 20px;
  }

  .game-shell .action-panel {
    position: sticky;
    bottom: 8px;
    z-index: 28;
    order: 3;
    padding: 14px;
    border-color: rgba(255, 212, 61, 0.56);
  }

  .game-shell .opponent-panel {
    order: 4;
  }

  .game-shell .game-history-panel {
    order: 5;
  }

  .game-shell .board-toolbar {
    display: grid;
    gap: 10px;
  }

  .game-shell .board-toolbar h2 {
    margin-bottom: 4px;
    font-size: clamp(1.5rem, 8vw, 2.25rem);
  }

  .board-subtitle {
    font-size: 0.82rem;
  }

  .board-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .game-shell .board-count,
  .turn-timer {
    min-height: 30px;
    font-size: 0.74rem;
  }

  .game-shell .board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    height: auto;
    grid-template-rows: none;
  }

  .game-shell .character-card {
    grid-template-rows: auto minmax(48px, auto);
    min-width: 0;
    border-radius: 14px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.62),
      0 4px 0 #092e62,
      0 10px 16px rgba(5, 22, 48, 0.2);
  }

  .game-shell .character-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 0.92 / 1;
    border-width: 5px;
  }

  .character-image em {
    left: 6px;
    bottom: 6px;
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .face-number {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
  }

  .game-shell .character-meta {
    min-height: 48px;
    padding: 6px;
  }

  .game-shell .character-meta strong,
  .game-shell .character-meta small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-shell .character-meta strong {
    font-size: 0.8rem;
  }

  .game-shell .character-meta small {
    font-size: 0.63rem;
  }

  .game-shell .face-card.down {
    transform: translateY(4px) perspective(520px) rotateX(54deg);
  }

  .secret-card-compact {
    grid-template-columns: 76px minmax(0, 1fr);
    border-radius: 16px;
  }

  .secret-card-compact img {
    width: 76px;
    height: 76px;
    border-radius: 14px 0 0 14px;
  }

  .secret-card-compact strong {
    font-size: 0.96rem;
  }

  .secret-card-compact small {
    font-size: 0.76rem;
  }

  .game-intel .opponent-mini-grid,
  .opponent-panel .opponent-mini-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
  }

  .game-shell .action-panel textarea {
    min-height: 88px;
  }

  .game-shell .quick-questions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .game-shell .chip {
    flex: 0 0 auto;
    width: auto;
    max-width: 84vw;
    min-height: 38px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .game-shell .actions-row,
  .answer-buttons,
  .modal-card .actions-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-shell .ask-button,
  .game-shell .guess-open-button,
  .answer-button {
    width: 100%;
    min-height: 48px;
  }

  .game-history-panel .history-list {
    max-height: 260px;
  }

  .modal-backdrop {
    align-items: center;
    padding: 12px;
  }

  .modal-card {
    width: calc(100vw - 24px);
    max-height: 90dvh;
    padding: 18px;
    overflow-y: auto;
    border-radius: 22px;
  }

  .secret-reveal {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .secret-photo-wrap,
  .secret-reveal img {
    max-width: 260px;
    margin: 0 auto;
  }

  .guess-modal-card {
    width: calc(100vw - 24px);
  }

  .guess-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 54dvh;
    overflow-y: auto;
    padding-right: 2px;
  }

  .guess-card {
    min-width: 0;
  }

  .guess-card span:last-child {
    padding: 8px;
  }

  .guess-card strong,
  .guess-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .result-screen {
    gap: 14px;
  }

  .result-hero {
    min-height: 0;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .result-hero h1 {
    font-size: clamp(2.2rem, 13vw, 4rem);
  }

  .result-face img {
    max-height: 320px;
    object-fit: cover;
  }
}

@media (max-width: 480px) {
  .topbar {
    position: sticky;
    gap: 6px;
  }

  .topbar-actions {
    display: none;
  }

  .brand strong {
    max-width: 94px;
    font-size: 0.88rem;
  }

  .auth-cta-button {
    width: 34px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .auth-cta-button::before {
    content: "+";
    font-size: 1rem;
    font-weight: 950;
  }

  .rules-button {
    width: 34px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .rules-button::before {
    content: "?";
    font-size: 0.9rem;
    font-weight: 950;
  }

  .connection-pill {
    display: none;
  }

  .connection-pill::before {
    width: 9px;
    height: 9px;
  }

  .home-face-card {
    min-height: 66px;
  }

  .hero-board-wrap {
    overflow: hidden;
    width: min(100%, 300px);
  }

  .hero-board {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-board-top,
  .hero-question-card {
    font-size: 0.82rem;
  }

  .setup-hero-panel {
    display: none;
  }

  .mode-icon {
    width: 44px;
    height: 44px;
  }

  .premium-stage,
  .start-card {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .premium-stage .home-copy {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-right: 14px;
    padding-left: 14px;
  }

  .premium-stage .lede {
    width: min(100%, 300px);
    max-width: 300px;
    margin-right: auto;
    margin-left: auto;
    font-size: 0.92rem;
  }

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

  .mode-meta {
    grid-template-columns: 1fr;
  }

  .create-faces-grid {
    gap: 10px;
  }

  .face-image-wrap {
    padding: 6px 6px 0;
  }

  .create-face-number {
    right: 10px;
    bottom: 6px;
    width: 28px;
    height: 28px;
  }

  .face-editor-meta {
    font-size: 0.58rem;
  }

  .game-shell .game-status-bar {
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
    gap: 5px;
  }

  .game-shell .score-card,
  .game-shell .turn-card {
    min-height: 58px;
    padding: 6px;
    border-radius: 12px;
  }

  .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.66rem;
  }

  .game-shell .score-card strong {
    font-size: 0.74rem;
  }

  .game-shell .score-card .status-badge {
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .game-shell .turn-card strong {
    font-size: 0.78rem;
  }

  .game-shell .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .game-shell .character-card img {
    aspect-ratio: 1 / 1;
  }

  .game-shell .character-meta strong {
    font-size: 0.84rem;
  }

  .game-shell .character-meta small {
    font-size: 0.66rem;
  }

  .game-intel .opponent-mini-grid,
  .opponent-panel .opponent-mini-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .secret-card-compact {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .secret-card-compact img {
    width: 70px;
    height: 70px;
  }

  .guess-grid {
    gap: 8px;
  }

  .guess-card b,
  .guess-image b {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
  }

  .modal-card h2 {
    font-size: clamp(1.65rem, 9vw, 2.3rem);
  }
}

@media (max-width: 360px) {
  .brand strong {
    max-width: 72px;
  }

  .auth-cta-button {
    width: 34px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .auth-cta-button::before {
    content: "+";
    font-size: 1rem;
    font-weight: 950;
  }

  .game-shell .game-status-bar {
    grid-template-columns: 1fr;
    position: static;
  }

  .game-shell .turn-card {
    order: -1;
  }

  .create-faces-grid,
  .guess-grid {
    grid-template-columns: 1fr;
  }
}
