:root {
  color-scheme: dark;
  --gold: #efd08b;
  --ink: #f3f0e5;
  --muted: #aec5b9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #082d25;
  color: var(--ink);
  font:
    16px/1.5 system-ui,
    sans-serif;
}

header {
  padding: 20px 4%;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #ffffff18;
  align-items: center;
}

.brand {
  display: flex;
  gap: 12px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand>span {
  color: var(--gold);
  font-size: 42px;
}

.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}

nav,
.roomline,
.tags {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

a {
  color: var(--gold);
}

button,
input,
select {
  font: inherit;
  border-radius: 9px;
  border: 1px solid #ffffff38;
  padding: 12px 15px;
  background: #173e35;
  color: var(--ink);
  min-height: 46px;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:hover {
  background: #285647;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.primary {
  background: var(--gold);
  color: #163a2d;
  font-weight: 800;
  border: 0;
}

.primary:hover {
  background: #ffe3a3;
}

main {
  max-width: 1180px;
  margin: 30px auto;
  padding: 0 24px;
}

.panel {
  background: #123c31;
  border: 1px solid #ffffff20;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 18px;
}

.setup {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  padding: 48px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--gold);
  font-weight: 700;
}

h1 {
  font:
    normal clamp(18px, 5vw, 32px) / 1.07 Georgia,
    serif;
  margin: 20px 0;
}

h1 em {
  color: var(--gold);
}

h2 {
  font:
    normal 29px Georgia,
    serif;
  margin: 0 0 18px;
}

h3 {
  font-size: 17px;
}

p {
  color: var(--muted);
}

label {
  display: block;
  margin: 12px 0 6px;
}

input,
select {
  width: 100%;
}

.entry-form button {
  width: 100%;
  margin-top: 14px;
}

.divider {
  margin-top: 26px;
  color: var(--muted);
  border-top: 1px solid #ffffff20;
  padding-top: 20px;
}

.tags span {
  border: 1px solid #ffffff25;
  border-radius: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.paper {
  margin-top: 30px;
  background: #f8f1dc;
  color: #244539;
  padding: 20px;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: 10px 10px 0 #0002;
  font:
    14px/2.5 Georgia,
    serif;
}

.paper b {
  display: block;
  text-align: center;
  letter-spacing: 3px;
}

.paper div {
  border-bottom: 1px solid #24453955;
}

.roomline {
  justify-content: space-between;
  margin-bottom: 16px;
}

.players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.player {
  background: #173e35;
  border: 1px solid #ffffff20;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.player b {
  color: var(--gold);
}

.muted,
small {
  color: var(--muted);
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ffffff25;
  border-radius: 9px;
  padding: 10px;
  margin: 0;
}

.choice input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--gold);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.letter {
  font:
    700 60px Georgia,
    serif;
  color: var(--gold);
}

.timer {
  font: 700 26px system-ui;
  font-variant-numeric: tabular-nums;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 20px;
}

.stop {
  width: 100%;
  margin-top: 24px;
  background: #efd08b;
  color: #173e35;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
}

.review-category {
  margin: 22px 0;
  padding-top: 10px;
  border-top: 1px solid #ffffff25;
}

.review-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff15;
  overflow-wrap: anywhere;
}

.vote-buttons {
  display: flex;
  gap: 6px;
}

.vote-buttons button {
  font-size: 13px;
  padding: 9px;
}

.selected {
  outline: 2px solid var(--gold);
  background: #285647;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #ffffff25;
}

th {
  color: var(--gold);
}

.scroll {
  overflow: auto;
}

.ranking {
  list-style: none;
  padding: 0;
}

.ranking li {
  display: flex;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid #ffffff25;
}

.ranking li:first-child {
  color: var(--gold);
  font-size: 22px;
}

#notice:not(:empty) {
  padding: 12px;
  background: #624824;
  border-radius: 9px;
  margin-bottom: 16px;
}

footer {
  text-align: center;
  padding: 25px;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(640px, 94vw);
  max-height: 85dvh;
  overflow: auto;
  background: #123c31;
  color: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 18px;
  padding: 28px;
}

dialog::backdrop {
  background: #001b17c9;
}

dialog li {
  margin-bottom: 12px;
}

.close {
  float: right;
}

summary {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .brand {
    font-size: 20px;
  }

  nav button,
  nav a {
    font-size: 12px;
  }

  main {
    padding: 0 12px;
    margin: 18px auto;
  }

  .setup {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 30px;
  }

  .paper {
    margin-top: 20px;
    font-size: 12px;
  }

  .panel {
    padding: 18px;
  }

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

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

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

  .vote-buttons {
    grid-column: 1/-1;
  }

  .vote-buttons button {
    flex: 1;
  }

  .toolbar {
    position: sticky;
    top: 0;
    background: #123c31;
    padding: 8px 0;
    z-index: 1;
  }

  .letter {
    font-size: 44px;
  }

  .timer {
    font-size: 22px;
  }

  .stop {
    position: sticky;
    bottom: 8px;
    box-shadow: 0 3px 20px #0006;
  }

  .roomline button {
    font-size: 12px;
    padding: 9px;
  }

  .choices .choice {
    font-size: 13px;
    padding: 8px;
  }
}

.entry-form .entry-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.entry-form .entry-tabs button {
  width: auto;
  flex: 1;
  margin: 0;
  font-size: 14px;
}

.entry-form form h2 {
  font-size: 26px;
}

.entry-form form p {
  font-size: 14px;
}

/* Cabecera compacta siguiendo las medidas de Conga Online. */
.mobile-round-hud {
  display: none;
}

.guide-result {
  padding: 14px;
  margin: 12px 0;
  background: #082d25;
  border: 1px solid #ffffff30;
  border-radius: 10px;
}

.guide-result h4 {
  margin: 0 0 8px;
  color: #efd08b;
  font-size: 17px;
}

.guide-result p {
  margin: 0 0 8px;
  color: #f3f0e5;
  line-height: 1.6;
}

.guide-result a {
  font-size: 13px;
}

.query-label {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.end-round-panel {
  margin-top: 24px;
  border-top: 1px solid #ffffff30;
  padding-top: 12px;
}

.end-round-panel button {
  margin: 4px 0;
}

.kick-player {
  padding: 4px 8px;
  min-height: 36px;
  font-size: 12px;
}

.guide-button {
  grid-column: 1/-1;
  justify-self: start;
  padding: 8px 12px;
  font-size: 13px;
}

.scroll {
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (max-width: 760px) {
  .mobile-round-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: #082d25;
    border-bottom: 2px solid #efd08b;
    box-shadow: 0 4px 14px #0006;
    color: #efd08b;
    pointer-events: none;
  }

  .mobile-round-hud strong {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
  }

  .round-active {
    padding-top: 60px;
  }

  .round-active .toolbar {
    top: 60px;
  }

  .end-round-panel button {
    width: 100%;
  }
}

input:not([type='checkbox']),
select {
  color-scheme: light;
  background: #f8f1dc;
  color: #163a2d;
  border: 2px solid #d4c69e;
  caret-color: #163a2d;
}

input:not([type='checkbox'])::placeholder {
  color: #667465;
  opacity: 1;
}

input:not([type='checkbox']):focus,
select:focus {
  background: #fffaf0;
  border-color: #efd08b;
  outline: 3px solid #efd08b66;
  outline-offset: 2px;
}

input:not([type='checkbox']):disabled {
  background: #ded9ca;
  color: #536257;
}

.countdown-screen {
  text-align: center;
  padding: clamp(30px, 8vh, 80px) 12px;
}

.countdown-number {
  font:
    700 clamp(96px, 20vw, 160px) / 1.2 Georgia,
    serif;
  color: var(--gold);
  min-height: 1.2em;
}

.countdown-screen p {
  max-width: 460px;
  margin: 20px auto;
}

.topbar {
  padding: 17px clamp(16px, 4vw, 60px);
  gap: 16px;
}

.topbar .brand {
  align-items: center;
  gap: 12px;
  letter-spacing: normal;
  font-weight: 400;
}

.topbar .brand .logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #a9bc94;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 27px;
  color: var(--gold);
}

.topbar .brand strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 23px;
  letter-spacing: 5px;
  font-weight: 500;
  line-height: 1.2;
}

.topbar .brand small {
  font-size: 9px;
  letter-spacing: 2px;
  line-height: 1.5;
}

.topbar .header-actions {
  gap: 7px;
  justify-content: flex-end;
}

.topbar .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #ffffff1f;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
  min-height: 0;
}

.topbar .ghost:hover {
  background: #ffffff16;
}

.topbar .online-status {
  font-size: 12px;
  color: var(--muted);
}

.topbar nav a {
  color: var(--gold) !important;
}

footer {
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .topbar {
    padding: 14px 16px;
    gap: 12px;
  }

  .topbar .brand strong {
    font-size: 20px;
    letter-spacing: 3px;
  }

  .topbar .header-actions {
    justify-content: flex-start;
  }

  .topbar .ghost {
    min-height: 44px;
  }

  .topbar .online-status {
    flex-basis: 100%;
  }

  footer {
    padding: 22px 16px;
  }
}

.room-stats {
  grid-column: 1/-1;
  justify-self: end;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* Bingo Familiar: mesa, cartón, sorteo y charla. */
body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 55% 20%, #164b3c66, transparent 65%), #082d25;
}

.setup {
  max-width: 1040px;
  margin: 28px auto 40px;
  gap: 52px;
  padding: 40px;
  position: relative;
  padding-bottom: 70px;
}

.setup h1 {
  font:
    normal clamp(18px, 5vw, 32px) / 1.07 Georgia,
    serif;
}

.setup>div>p:not(.eyebrow) {
  line-height: 1.65;
}

.entry-form small {
  display: block;
  font-size: 12px;
  margin-top: 15px;
}

.entry-form .entry-tabs button {
  font-size: 13px;
  white-space: normal;
}

.entry-form form .submit {
  margin-top: 23px;
}

.room-stats {
  position: absolute;
  bottom: 24px;
  right: 40px;
  font-size: 11px;
}

.paper {
  margin-top: 35px;
  transform: rotate(-2deg);
  padding: 22px;
}

.paper b {
  text-align: left;
  font-size: 12px;
  letter-spacing: 2px;
}

.sample-balls {
  display: flex;
  gap: 13px;
  justify-content: space-between;
  padding: 18px 0 !important;
}

.sample-balls span {
  display: grid;
  place-items: center;
  border: 2px solid #cbb66d;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font: bold 24px Georgia;
  background: #ead18e;
}

.sample-balls span:nth-child(2n) {
  background: #d7dfbe;
}

.paper div:last-child {
  font-style: italic;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 1.18fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.game-grid .panel {
  margin-bottom: 18px;
  padding: 24px;
}

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

.section-head h2 {
  font-size: 24px;
  margin: 0;
}

.section-head .eyebrow {
  margin: 0;
}

.big-ball {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: #f8f1dc;
  color: #153e31;
  border: 10px solid #d3b674;
  box-shadow:
    0 0 0 8px #efd08b12,
    0 18px 25px #0002;
  margin: 32px auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.big-ball span {
  font: 18px Georgia;
  color: #6c794d;
}

.big-ball strong {
  font: bold 72px/0.95 Georgia;
}

.draw>h2 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 7px;
}

.draw>p {
  font-size: 12px;
  text-align: center;
  min-height: 36px;
}

.countdown {
  text-align: center;
  background: #082d25;
  border: 1px solid #ffffff18;
  border-radius: 9px;
  padding: 10px;
  margin: 18px 0;
  color: var(--gold);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.host-controls button {
  width: 100%;
  font-size: 13px;
}

.host-controls>small {
  display: block;
  text-align: center;
}

.preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 15px 0;
}

.preferences label,
.auto-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--gold);
}

.recent {
  border-top: 1px solid #ffffff20;
  padding-top: 18px;
}

.recent>div {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px;
}

.recent>div>span {
  border: 1px solid #efd08b66;
  border-radius: 50%;
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  font: 16px Georgia;
  color: var(--gold);
}

summary {
  font-size: 12px;
  color: var(--muted);
}

.number-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 15px;
}

.number-board span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 4px;
  font-size: 10px;
  background: #082d25;
  color: #638777;
}

.number-board .called {
  background: var(--gold);
  color: #163a2d;
}

.ticket .section-head h2 {
  margin: 8px 0 15px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.score-box {
  background: #efd08b12;
  border: 1px solid #efd08b55;
  border-radius: 10px;
  text-align: center;
  padding: 9px 14px;
  min-width: 80px;
}

.score-box strong {
  display: block;
  color: var(--gold);
  font: 30px Georgia;
}

.score-box small {
  font-size: 8px;
  letter-spacing: 2px;
}

.bingo-head,
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.bingo-head {
  text-align: center;
  color: var(--gold);
  font: 24px Georgia;
  margin: 14px 0;
}

.card-grid button {
  padding: 0;
  aspect-ratio: 1;
  font: bold 28px Georgia;
  border: 1px solid #bbae86;
  background: #f8f1dc;
  color: #244539;
  border-radius: 8px;
  min-height: 0;
}

.card-grid button.marked {
  background: #efd08b;
  border-color: #efd08b;
  box-shadow: inset 0 0 0 4px #e8c676;
}

.card-grid button.free {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1c5741;
  border-color: #9ab88c;
  color: var(--gold);
}

.card-grid .free small {
  font: 8px system-ui;
  letter-spacing: 1px;
  color: var(--gold);
  margin-top: 3px;
}

.card-grid .new-number {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.auto-label {
  margin: 18px 0 8px;
}

.hint {
  font-size: 11px;
  line-height: 1.6;
  margin: 8px 0;
  color: var(--muted);
}

.progress-area {
  border-top: 1px solid #ffffff20;
  padding-top: 18px;
  margin-top: 18px;
}

.progress-area>div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.progress-area strong {
  color: var(--gold);
}

progress {
  width: 100%;
  height: 7px;
  display: block;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  accent-color: var(--gold);
}

progress::-webkit-progress-bar {
  background: #082d25;
}

progress::-webkit-progress-value {
  background: var(--gold);
}

progress::-moz-progress-bar {
  background: var(--gold);
}

.ticket h3 {
  font: 18px Georgia;
  margin: 22px 0 12px;
}

.awards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 36px;
}

.achievement {
  border: 1px solid #efd08b44;
  background: #efd08b0d;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 10px;
  animation: pop 0.25s;
}

.achievement b {
  color: var(--gold);
  margin-left: 5px;
}

.reactions {
  display: flex;
  gap: 7px;
  border-top: 1px solid #ffffff20;
  margin-top: 20px;
  padding-top: 18px;
}

.reactions button {
  flex: 1;
  min-height: 42px;
  padding: 5px;
  font-size: 21px;
}

.ranking {
  margin: 10px 0 0;
}

.ranking li,
.ranking li:first-child {
  padding: 12px 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.ranking .rank {
  min-width: 21px;
  color: var(--gold);
  font: 22px Georgia;
}

.ranking li>div {
  flex: 1;
  min-width: 0;
}

.ranking li strong {
  display: block;
  overflow-wrap: anywhere;
}

.ranking li small {
  display: block;
  font-size: 9px;
  font-weight: 400;
}

.ranking li strong small {
  display: inline;
  color: var(--gold);
  margin-left: 4px;
}

.ranking li>b {
  font-size: 18px;
  color: var(--gold);
  text-align: right;
}

.ranking .me {
  background: #efd08b0a;
  border-radius: 8px;
}

.chat h2 {
  font-size: 21px;
}

.chat .section-head>span {
  color: var(--gold);
}

.messages {
  height: 245px;
  overflow: auto;
  margin: 18px -4px 14px;
  padding: 0 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #50735d #082d25;
}

.chat-message {
  border-radius: 9px;
  background: #082d25;
  padding: 10px 12px;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.chat-message.own {
  background: #245242;
}

.chat-message>div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-message b {
  font-size: 11px;
  color: var(--gold);
}

.chat-message time {
  font-size: 9px;
  color: var(--muted);
}

.chat-message p {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--ink);
  white-space: pre-wrap;
}

.chat form {
  display: flex;
  gap: 7px;
}

.chat form input {
  min-width: 0;
  padding: 10px;
  font-size: 12px;
}

.chat form button {
  padding: 8px 12px;
}

.chat>small {
  display: block;
  font-size: 9px;
  margin-top: 10px;
}

.winner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px;
  border: 1px solid var(--gold);
  border-radius: 15px;
  background: linear-gradient(110deg, #245541, #123c31);
  margin-bottom: 20px;
}

.winner h2 {
  margin: 5px 0;
  font-size: 30px;
  color: var(--gold);
}

.winner p {
  margin: 0;
  font-size: 13px;
}

.activity h2 {
  font-size: 23px;
  margin-bottom: 15px;
}

.events {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 25px;
}

.events p {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid #ffffff14;
  font-size: 12px;
}

.events span {
  color: var(--gold);
}

.roomline h2 {
  margin: 8px 0 3px;
  font-size: 28px;
}

.roomline .muted {
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pop {
  animation: pop 0.35s ease-out;
}

@keyframes pop {
  from {
    transform: scale(0.87);
  }

  to {
    transform: scale(1);
  }
}

@media (min-width: 1400px) {
  main {
    max-width: 1320px;
  }
}

@media (max-width: 1050px) {
  .game-grid {
    grid-template-columns: 1fr 1.3fr;
  }

  .game-grid aside {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .setup {
    gap: 30px;
    padding: 30px;
    padding-bottom: 65px;
  }

  .setup h1 {
    font-size: 32px;
  }

  .number-board {
    grid-template-columns: repeat(10, 1fr);
  }
}

@media (max-width: 760px) {
  .setup {
    padding: 25px;
    padding-bottom: 65px;
    gap: 35px;
    margin-top: 12px;
  }

  .setup h1 {
    font-size: 24px;
  }

  .paper {
    margin-top: 25px;
  }

  .room-stats {
    bottom: 20px;
    right: 25px;
  }

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

  .game-grid aside {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .game-grid .panel {
    padding: 22px;
  }

  .game-grid .ticket {
    grid-row: 1;
  }

  .big-ball {
    width: 135px;
    height: 135px;
    margin: 20px auto;
  }

  .big-ball strong {
    font-size: 58px;
  }

  .card-grid button {
    font-size: 30px;
  }

  .bingo-head {
    margin-top: 8px;
  }

  .roomline h2 {
    font-size: 23px;
  }

  .roomline .actions {
    width: 100%;
  }

  .roomline .actions button:first-child {
    flex: 1;
  }

  .winner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }

  .winner h2 {
    font-size: 26px;
  }

  .winner button {
    width: 100%;
  }

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

  .messages {
    height: 260px;
  }

  .topbar nav {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
  }

  .topbar nav button {
    font-size: 11px;
    padding: 8px 10px;
    min-height: 42px;
  }

  .topbar nav a {
    font-size: 12px;
  }

  .number-board {
    grid-template-columns: repeat(15, 1fr);
  }

  .preferences {
    justify-content: center;
  }

  .draw>p {
    min-height: 0;
  }

  .draw .number-details {
    margin-top: 8px;
  }

  .entry-form .entry-tabs {
    flex-wrap: nowrap;
  }

  .entry-form .entry-tabs button {
    font-size: 12px;
    padding: 10px;
  }

  .sample-balls span {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* v1.0.1: cabecera compacta y distribución de mesa. */
.topbar {
  padding: 12px clamp(16px, 3vw, 58px);
  min-height: 70px;
}

.topbar .header-actions .ghost {
  padding: 8px 11px;
  font-size: 12px;
  min-height: 36px;
}

.topbar .brand strong {
  font-size: 22px;
  letter-spacing: 4px;
}

.topbar .brand .logo {
  width: 42px;
  height: 42px;
  font-size: 25px;
}

.mobile-hud,
.game-tabs {
  display: none;
}

.game-active main {
  max-width: 1800px;
  margin: 20px auto;
  padding: 0 24px;
}

.game-active .roomline {
  margin-bottom: 14px;
}

.game-active .roomline .eyebrow {
  font-size: 9px;
}

.game-active .roomline h2 {
  font-size: 24px;
  margin: 4px 0;
}

.game-active .roomline .actions button {
  min-height: 36px;
  padding: 8px 12px;
}

.game-grid .panel {
  padding: 18px;
  min-width: 0;
}

.game-grid .ticket {
  width: 100%;
}

.ticket .section-head h2 {
  font-size: 25px;
  margin: 5px 0 8px;
}

.score-box {
  padding: 5px 10px;
  min-width: 65px;
}

.score-box strong {
  font-size: 26px;
}

.bingo-head {
  font-size: 21px;
  margin: 10px auto;
  max-width: 330px;
}

.card-grid {
  max-width: 330px;
  margin: auto;
  gap: 6px;
}

.card-grid button {
  font-size: 26px;
}

.auto-label {
  margin: 12px 0 5px;
}

.ticket>.hint {
  font-size: 10px;
  margin: 5px 0;
}

.progress-area {
  padding-top: 10px;
  margin-top: 10px;
}

.my-achievements {
  margin-top: 14px;
}

.my-achievements summary {
  color: var(--gold);
  font-size: 13px;
  min-height: 30px;
}

.awards {
  margin-top: 8px;
  max-height: 100px;
  overflow: auto;
}

.reactions {
  padding-top: 10px;
  margin-top: 10px;
  gap: 6px;
}

.reactions button {
  min-height: 36px;
  font-size: 19px;
}

.big-ball {
  width: 124px;
  height: 124px;
  margin: 20px auto 16px;
  border-width: 8px;
}

.big-ball strong {
  font-size: 55px;
}

.draw>h2 {
  font-size: 22px;
}

.draw>p {
  min-height: 0;
  margin: 7px 0;
}

.countdown {
  padding: 8px;
  margin: 13px 0;
}

.preferences {
  margin: 10px 0;
}

.preferences label {
  margin: 6px 0;
}

.recent {
  padding-top: 12px;
}

.recent>div {
  margin: 10px 0 14px;
}

.chat .messages {
  height: 260px;
  max-height: 38dvh;
}

.standings .ranking {
  max-height: 350px;
  overflow: auto;
}

.activity {
  padding: 16px 20px;
}

.activity h2 {
  font-size: 21px;
  margin: 0 0 8px;
}

.events {
  max-height: 115px;
  overflow: auto;
}

.game-active footer {
  padding: 15px;
  font-size: 11px;
}

.winner {
  padding: 16px 22px;
}

.winner h2 {
  font-size: 25px;
}

@media (min-width: 1250px) {
  .game-grid {
    grid-template-columns: minmax(210px, 0.8fr) minmax(330px, 1.1fr) minmax(220px, 0.85fr) minmax(270px,
        1fr);
    gap: 14px;
  }

  .game-grid aside {
    display: contents;
  }

  .game-grid .panel {
    margin-bottom: 14px;
  }

  .standings .section-head h2,
  .chat .section-head h2 {
    font-size: 22px;
  }

  .chat .messages {
    height: 320px;
    max-height: 43dvh;
  }

  .activity {
    margin-top: 0;
  }

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

@media (min-width: 761px) and (max-width: 1249px) {
  .game-grid {
    grid-template-columns: minmax(220px, 0.85fr) minmax(330px, 1.15fr);
    gap: 16px;
  }

  .game-grid aside {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .chat .messages {
    height: 190px;
  }

  .standings .ranking {
    max-height: 240px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
    align-items: stretch;
    min-height: 0;
  }

  .topbar .brand {
    gap: 9px;
  }

  .topbar .brand strong {
    font-size: 18px;
    letter-spacing: 2.7px;
  }

  .topbar .brand small {
    font-size: 8px;
    letter-spacing: 1.3px;
  }

  .topbar .brand .logo {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .topbar .header-actions {
    gap: 6px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .topbar .header-actions .ghost {
    padding: 7px 8px;
    font-size: 11px;
    min-height: 36px;
    white-space: nowrap;
  }

  .game-active main {
    padding: 0 10px;
    margin: 12px auto;
  }

  .roomline {
    gap: 8px;
  }

  .roomline>.actions {
    width: auto;
    margin-left: auto;
  }

  .roomline .eyebrow {
    display: none;
  }

  .game-active .roomline h2 {
    font-size: 19px;
  }

  .roomline .muted {
    font-size: 10px;
  }

  .game-active .roomline .actions button {
    font-size: 10px;
    padding: 7px 9px;
    min-height: 34px;
  }

  .roomline .actions button:first-child {
    flex: initial;
  }

  .mobile-hud {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #082d25;
    border: 1px solid #efd08b66;
    border-radius: 10px;
    padding: 8px 11px;
    box-shadow: 0 5px 12px #0003;
  }

  .mobile-hud>div {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-hud small {
    font-size: 8px;
    letter-spacing: 1px;
    max-width: 45px;
    line-height: 1.3;
  }

  .mobile-hud strong {
    font: 26px Georgia;
    color: var(--gold);
    white-space: nowrap;
  }

  .mobile-hud>span {
    font-size: 11px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
  }

  .mobile-hud button {
    padding: 6px 8px;
    font-size: 10px;
    min-height: 34px;
  }

  .game-tabs {
    display: flex;
    position: sticky;
    top: 58px;
    z-index: 9;
    flex-wrap: nowrap;
    gap: 4px;
    background: #082d25;
    padding: 8px 0;
    margin: 0 0 10px;
  }

  .game-tabs button {
    flex: 1;
    min-width: 0;
    padding: 8px 3px;
    font-size: 10px;
    min-height: 38px;
  }

  .game-tabs button[aria-pressed='true'] {
    background: var(--gold);
    color: #163a2d;
    border-color: var(--gold);
    font-weight: 700;
  }

  .game-grid,
  .game-grid aside {
    display: contents;
  }

  .game-grid .panel {
    padding: 16px;
    margin-bottom: 12px;
  }

  .game-grid .draw,
  .game-grid .ticket,
  .game-grid .standings,
  .game-grid .chat,
  .activity {
    display: none;
  }

  #game[data-view='ticket'] .ticket,
  #game[data-view='draw'] .draw,
  #game[data-view='standings'] .standings,
  #game[data-view='chat'] .chat,
  #game[data-view='activity'] .activity {
    display: block;
  }

  .card-grid,
  .bingo-head {
    max-width: 310px;
  }

  .card-grid button {
    font-size: 27px;
    min-height: 44px;
  }

  .ticket .section-head h2 {
    font-size: 23px;
  }

  .ticket .section-head .eyebrow {
    font-size: 9px;
  }

  .score-box {
    padding: 4px 9px;
  }

  .score-box strong {
    font-size: 24px;
  }

  .ticket .auto-label {
    font-size: 11px;
  }

  .ticket .reactions button {
    min-height: 40px;
  }

  .my-achievements {
    margin-top: 12px;
  }

  .chat .messages {
    height: clamp(150px, 35dvh, 260px);
    max-height: none;
  }

  .chat form input {
    font-size: 16px;
  }

  .chat form button {
    min-height: 44px;
  }

  .standings .ranking {
    max-height: none;
  }

  .events {
    max-height: none;
    grid-template-columns: 1fr;
  }

  .activity {
    margin-top: 0;
  }

  .winner {
    padding: 14px;
    margin-bottom: 12px;
    gap: 10px;
  }

  .winner h2 {
    font-size: 23px;
  }

  .winner p {
    font-size: 11px;
  }

  .setup {
    padding: 24px;
    padding-bottom: 60px;
  }

  .setup h1 {
    font-size: 32px;
  }

  .paper {
    font-size: 12px;
  }

  .sample-balls span {
    width: 38px;
    height: 38px;
  }

  .game-active footer {
    font-size: 10px;
    padding: 12px;
  }

  .draw .big-ball {
    margin-top: 15px;
  }

  .draw .preferences {
    justify-content: flex-start;
  }

  .draw .host-controls button {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .topbar .brand strong {
    font-size: 16px;
  }

  .topbar .header-actions .ghost {
    font-size: 10px;
    padding: 6px;
  }

  .game-tabs button {
    font-size: 9px;
  }

  .mobile-hud {
    gap: 5px;
    padding: 7px;
  }

  .mobile-hud>span {
    font-size: 10px;
  }

  .roomline {
    align-items: flex-start;
  }

  .roomline>.actions {
    width: 100%;
    margin: 0;
  }

  .card-grid {
    gap: 4px;
  }

  .game-grid .ticket {
    padding: 12px;
  }
}

.session-recovery {
  max-width: 1040px;
  margin: 20px auto;
  padding: 20px;
}

.session-recovery p {
  margin: 0 0 12px;
}

.session-recovery .actions {
  flex-wrap: wrap;
}

.session-recovery .actions button {
  min-height: 44px;
}

@media (max-width: 760px) {
  .session-recovery .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 1.0.3: menú compartido con Tutti Frutti. */
.topbar .header-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.topbar .header-actions .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #ffffff1f;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 0;
  white-space: nowrap;
}

.topbar .header-actions .ghost:hover {
  background: #ffffff16;
}

.topbar .header-actions .online-status {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar .header-actions {
    justify-content: flex-start;
    gap: 7px;
    flex-wrap: wrap;
  }

  .topbar .header-actions .online-status {
    flex-basis: 100%;
    font-size: 11px;
  }

  .topbar .header-actions .ghost {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* 1.0.4: identidad de jugadores y selector de emoticones. */
.avatar-picker {
  border: 1px solid #ffffff26;
  border-radius: 12px;
  margin: 0 0 22px;
  padding: 12px 14px;
  min-width: 0;
}

.avatar-picker legend {
  color: var(--gold);
  font-size: 14px;
  padding: 0 6px;
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 10px;
}

.player-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #efd08b;
  color: #173e35;
  font-family: system-ui, sans-serif;
  font-size: 23px;
  line-height: 1;
  vertical-align: middle;
}

.avatar-preview .player-avatar {
  width: 44px;
  height: 44px;
  font-size: 30px;
}

.avatar-picker summary {
  color: var(--ink);
  font-size: 14px;
  min-height: 28px;
}

.avatar-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding-top: 12px;
}

.entry-form .avatar-choices button {
  margin: 0;
  padding: 5px;
  min-height: 44px;
  font-size: 25px;
  width: 100%;
}

.avatar-choices button[aria-pressed='true'] {
  border-color: var(--gold);
  background: #efd08b30;
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

#playerName {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rank-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-player>div {
  min-width: 0;
  flex: 1;
}

.rank-player .player-avatar {
  width: 30px;
  height: 30px;
  font-size: 21px;
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.chat-person .player-avatar {
  width: 27px;
  height: 27px;
  font-size: 19px;
}

.chat-person b {
  overflow-wrap: anywhere;
}

.winner h2 .player-avatar {
  margin: 0 5px;
}

.events .player-avatar {
  width: 24px;
  height: 24px;
  font-size: 17px;
  margin-right: 4px;
}

.emoji-panel {
  border: 1px solid #efd08b44;
  border-radius: 10px;
  background: #082d25;
  padding: 10px;
  margin-bottom: 10px;
}

.emoji-panel .section-head strong {
  font-size: 12px;
  color: var(--gold);
}

.emoji-panel #closeEmoji {
  padding: 0 9px;
  min-height: 32px;
  font-size: 20px;
}

.emoji-choices {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  max-height: 210px;
  overflow: auto;
  padding: 10px 2px 2px;
}

.emoji-choices button {
  padding: 4px;
  min-height: 36px;
  font-size: 22px;
}

.chat #openEmoji {
  font-size: 22px;
  padding: 6px;
  min-width: 40px;
}

.chat #chatForm {
  align-items: stretch;
}

.chat #chatForm input {
  flex: 1;
  width: 0;
  min-width: 0;
}

.chat .chat-message .chat-person {
  max-width: calc(100% - 42px);
}

@media (max-width: 760px) {
  .avatar-choices {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .emoji-choices button {
    min-height: 44px;
  }

  .emoji-choices {
    max-height: 190px;
  }

  .chat #chatForm input {
    font-size: 16px;
  }

  .chat #openEmoji {
    min-height: 44px;
  }

  #playerName .player-avatar {
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
}

/* 1.0.5: catálogo WebP compartido con los otros juegos. */
.player-avatar {
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  background: #efd08b;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-choices {
  max-height: min(280px, 40dvh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  margin-top: 12px;
  scrollbar-width: thin;
  scrollbar-color: #efd08b #082d25;
}

.entry-form .avatar-choices button {
  min-height: 48px;
  margin: 0;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-choices .player-avatar {
  width: 32px;
  height: 32px;
  flex: none;
}

.avatar-preview .player-avatar {
  width: 44px;
  height: 44px;
}

@media (max-width: 760px) {
  .avatar-choices {
    max-height: min(250px, 38dvh);
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  }
}

/* 1.0.8: inicio equilibrado, cartones y categorías. */
.setup {
  align-items: start;
  padding-bottom: 28px;
  row-gap: 22px;
}

.setup .room-stats {
  position: static;
  grid-column: 1/-1;
  justify-self: end;
  margin: 0;
}

.entry-tips {
  margin-top: 28px;
  border-top: 1px solid #ffffff24;
  padding-top: 15px;
}

.entry-tips h3 {
  font: 22px Georgia;
  margin: 5px 0 12px;
  color: var(--gold);
}

.entry-tips p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.entry-tips small {
  font-size: 12px;
  line-height: 1.7;
  display: block;
}

.entry-form form label {
  margin-top: 12px;
}

.card-tabs {
  display: flex;
  gap: 7px;
  margin: 10px 0 14px;
}

.card-tabs button {
  flex: 1;
  font-size: 12px;
  padding: 8px 6px;
  min-height: 42px;
}

.card-tabs button small {
  display: block;
  font-size: 10px;
}

.card-tabs button[aria-pressed='true'] {
  background: var(--gold);
  color: #173e35;
  border-color: var(--gold);
}

.card-tabs button[aria-pressed='true'] small {
  color: #385746;
}

.emoji-panel .section-head {
  position: static;
}

.emoji-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 10px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: #efd08b #082d25;
}

.emoji-categories button {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 7px 9px;
  min-height: 36px;
  white-space: nowrap;
}

.emoji-categories button[aria-pressed='true'] {
  background: var(--gold);
  color: #173e35;
}

.emoji-choices {
  max-height: 210px;
  overflow: auto;
}

.emoji-panel {
  max-width: 100%;
  min-width: 0;
}

.emoji-categories:focus-within {
  scroll-behavior: auto;
}

.standings .ranking li>b {
  font-size: 15px;
}

.achievement {
  line-height: 1.5;
}

@media (max-width: 760px) {
  .setup {
    padding-bottom: 24px;
  }

  .entry-tips {
    margin-top: 22px;
  }

  .entry-tips h3 {
    font-size: 20px;
  }

  .entry-tips p {
    font-size: 13px;
  }

  .emoji-categories button {
    min-height: 44px;
  }

  .emoji-choices {
    max-height: min(230px, 32dvh);
  }

  .card-tabs button {
    min-height: 44px;
  }

  .room-stats {
    font-size: 10px;
  }

  .standings .ranking li>b {
    font-size: 16px;
  }
}

/* Ranking de medallas acumuladas por sala. */
.room-medals {
  margin-top: 18px;
  border-top: 1px solid #ffffff25;
  padding-top: 16px;
  min-width: 0;
}

.room-medals h3 {
  font: 21px Georgia;
  margin: 0;
}

.room-medals .section-head small {
  font-size: 10px;
}

.medal-ranking {
  max-height: 260px;
  overflow: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.medal-ranking table {
  width: 100%;
  white-space: normal;
  font-size: 12px;
}

.medal-ranking th,
.medal-ranking td {
  padding: 9px 4px;
}

.medal-ranking thead th {
  font-size: 16px;
  text-align: center;
}

.medal-ranking thead th:first-child {
  text-align: left;
  font-size: 11px;
}

.medal-ranking tbody th {
  text-align: left;
  color: var(--ink);
  font-weight: 500;
}

.medal-ranking td {
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--gold);
  font-weight: 700;
}

.medal-ranking .me {
  background: #efd08b0a;
}

.medal-person {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.medal-person>span:last-child {
  overflow-wrap: anywhere;
  min-width: 0;
}

.medal-person small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
}

.medal-person .player-avatar {
  width: 27px;
  height: 27px;
}

.medal-place {
  font-size: 13px;
  color: var(--gold);
  min-width: 12px;
}

@media (max-width: 760px) {
  .medal-ranking {
    max-height: none;
  }

  .game-tabs button {
    font-size: 11px;
  }

  .room-medals h3 {
    font-size: 21px;
  }
}

/* 1.1.0: modales y cartones simultáneos en marcado manual. */
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 27px;
}

.dialog-heading button {
  padding: 4px 12px;
  min-width: 44px;
  min-height: 44px;
  font-size: 24px;
}

.avatar-dialog {
  width: min(680px, 94vw);
  max-height: 85dvh;
  padding: 24px;
}

.avatar-dialog .avatar-choices {
  max-height: min(480px, 62dvh);
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  padding: 4px;
}

.avatar-dialog .avatar-choices button {
  margin: 0;
  padding: 7px;
  min-height: 48px;
  display: grid;
  place-items: center;
}

.avatar-dialog .player-avatar {
  width: 38px;
  height: 38px;
}

.entry-form .avatar-open {
  width: auto;
  margin: 0;
  padding: 7px 0;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 13px;
  min-height: 36px;
  color: var(--gold);
}

.message-dialog {
  width: min(520px, 94vw);
  padding: 28px;
}

.message-dialog h2 {
  margin: 0 0 16px;
  font-size: 27px;
}

.message-dialog p {
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.dialog-actions button {
  min-height: 44px;
  min-width: 110px;
}

.cards-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.cards-display .card-board {
  min-width: 0;
}

.card-board-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 330px;
  margin: 0 auto 6px;
  font-size: 12px;
  color: var(--gold);
}

.card-board-heading small {
  color: var(--muted);
  font-size: 10px;
}

.cards-display .bingo-head {
  margin-top: 8px;
}

.all-cards-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin: 13px 0;
}

.all-cards-option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--gold);
}

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

.show-all .card-board {
  border: 1px solid #ffffff24;
  border-radius: 12px;
  padding: 10px;
  background: #082d2533;
}

.show-all .card-board-heading,
.show-all .card-grid,
.show-all .bingo-head {
  max-width: none;
}

.show-all .card-grid {
  gap: 4px;
}

.show-all .card-grid button {
  min-height: 44px;
  font-size: 24px;
}

.show-all .bingo-head {
  font-size: 20px;
  gap: 4px;
}

.multi-cards .ticket {
  min-width: 0;
}

@media (min-width: 1450px) {
  .multi-cards .game-grid {
    grid-template-columns: minmax(210px, 0.75fr) minmax(860px, 2.6fr) minmax(270px, 1fr);
  }

  .multi-cards .game-grid aside {
    display: block;
  }

  .multi-cards .cards-display.show-all {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .multi-cards .cards-display.show-all[data-count='2'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .multi-cards .show-all .card-grid {
    max-width: 330px;
  }

  .multi-cards .show-all .card-board {
    align-self: start;
  }
}

@media (min-width: 761px) and (max-width: 1449px) {
  .multi-cards .game-grid {
    grid-template-columns: minmax(200px, 0.7fr) minmax(300px, 1.5fr);
  }

  .multi-cards .game-grid aside {
    display: grid;
    grid-column: 1/-1;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .multi-cards .cards-display.show-all {
    grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
  }
}

@media (max-width: 760px) {

  .avatar-dialog,
  .message-dialog {
    padding: 20px;
  }

  .avatar-dialog .avatar-choices {
    max-height: 58dvh;
  }

  .dialog-actions button {
    flex: 1;
    min-width: 0;
  }

  .cards-display.show-all {
    grid-template-columns: 1fr;
  }

  .show-all .card-board {
    padding: 12px;
  }

  .show-all .card-grid,
  .show-all .bingo-head,
  .show-all .card-board-heading {
    max-width: 330px;
  }

  .show-all .card-grid button {
    font-size: 27px;
  }

  .all-cards-option {
    font-size: 11px;
  }

  .message-dialog h2,
  .dialog-heading h2 {
    font-size: 24px;
  }
}

/* Bingo 1.2: mesa viva, objetivos claros y movimiento moderado. */
body {
  background: radial-gradient(ellipse at 22% 0%, #19534488, transparent 55%), #082d25;
}

.setup {
  border-color: #d7b66b40;
  box-shadow: 0 24px 80px #001a1640;
}

.setup h1 {
  font-size: clamp(36px, 3.4vw, 58px);
  line-height: 1.08;
}

.paper {
  background: linear-gradient(125deg, #fff9e9, #f4edce);
  box-shadow: 9px 12px 0 #001e1b60;
}

.mode-picker {
  border: 0;
  padding: 0;
  margin: 18px 0;
  display: grid;
  gap: 8px;
}

.mode-picker legend {
  padding: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
}

.mode-picker label {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #ffffff30;
  border-radius: 12px;
  padding: 12px;
  margin: 0;
  cursor: pointer;
  background: #082d2544;
}

.mode-picker label:has(input:checked) {
  border-color: var(--gold);
  background: #eed28b12;
  box-shadow: inset 3px 0 var(--gold);
}

.mode-picker input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--gold);
  flex: none;
}

.mode-picker span {
  display: grid;
  gap: 4px;
}

.mode-picker small {
  color: var(--muted);
  font-size: 11px;
}

.objective-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #d7b66b66;
  background: linear-gradient(110deg, #234e3f, #123a31);
  border-radius: 16px;
  padding: 16px 22px;
  margin: 0 0 18px;
  box-shadow: 0 8px 30px #001b1728;
}

.objective-banner h2 {
  margin: 5px 0;
  font-size: 26px;
}

.objective-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.pattern-mini {
  display: grid;
  grid-template-columns: repeat(5, 9px);
  gap: 3px;
  flex: none;
}

.pattern-mini span {
  height: 9px;
  border-radius: 2px;
  background: #ffffff18;
}

.pattern-mini .lit {
  background: var(--gold);
  box-shadow: 0 0 9px #f1d48e33;
}

.round-track {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.round-track span {
  border: 1px solid #ffffff20;
  padding: 8px 12px;
  border-radius: 30px;
  color: var(--muted);
  font-size: 12px;
}

.round-track .active {
  color: #133e32;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: bold;
}

.round-track .done {
  color: var(--gold);
}

.card-grid .target-cell {
  box-shadow: inset 0 0 0 3px #bf8f36;
}

.card-grid .outside-target:not(.marked):not(.free) {
  background: #d5d6be;
  color: #36574b;
}

.card-grid .target-cell.marked {
  background: #efd083;
  box-shadow: inset 0 0 0 3px #a66b18;
}

.near-win {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border: 1px solid #edce7a99;
  background: #eed28b16;
  border-radius: 12px;
  color: var(--gold);
  margin-bottom: 14px;
  font-size: 13px;
  animation: near-glow 2s ease-in-out 2;
}

.near-win .player-avatar {
  width: 25px;
  height: 25px;
}

.goal-progress {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  font-size: 12px;
}

.goal-progress progress {
  width: 100%;
  height: 7px;
}

.winner {
  border: 1px solid #e9c371;
  background: linear-gradient(120deg, #ebcc81, #fff0bb);
  color: #123a31;
  box-shadow: 0 8px 30px #e9c37122;
}

.winner .eyebrow {
  color: #5b481d;
}

.winner p {
  color: #325341;
}

.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

.celebration span {
  position: absolute;
  top: -60px;
  font-size: 35px;
  color: #f3d28a;
  animation: celebrate 3s ease-in forwards;
}

.celebration span:nth-child(1) {
  left: 8%;
  animation-delay: 0s;
}

.celebration span:nth-child(2) {
  left: 22%;
  animation-delay: 0.1s;
  color: #99d6bf;
}

.celebration span:nth-child(3) {
  left: 36%;
  animation-delay: 0.2s;
}

.celebration span:nth-child(4) {
  left: 50%;
  animation-delay: 0.05s;
  color: #e5a487;
}

.celebration span:nth-child(5) {
  left: 64%;
  animation-delay: 0.25s;
}

.celebration span:nth-child(6) {
  left: 78%;
  animation-delay: 0.15s;
  color: #99d6bf;
}

.celebration span:nth-child(7) {
  left: 92%;
  animation-delay: 0.3s;
}

.challenge-rules {
  padding: 12px 16px;
  border: 1px solid #e9c37155;
  border-radius: 12px;
  margin-bottom: 20px;
}

@keyframes celebrate {
  to {
    transform: translateY(110vh) rotate(450deg);
    opacity: 0;
  }
}

@keyframes near-glow {
  50% {
    box-shadow: 0 0 20px #efd08333;
  }
}

@media (max-width: 900px) {
  .objective-banner {
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
  }

  .objective-banner h2 {
    font-size: 23px;
  }

  .round-track {
    margin: 0;
    flex-basis: 100%;
  }

  .round-track span {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .objective-banner .eyebrow {
    font-size: 9px;
  }

  .objective-banner p {
    font-size: 11px;
  }

  .pattern-mini {
    grid-template-columns: repeat(5, 7px);
    gap: 2px;
  }

  .pattern-mini span {
    height: 7px;
  }

  .setup h1 {
    font-size: 38px;
  }

  .mode-picker label {
    min-height: 62px;
  }

  .objective-banner {
    margin-bottom: 12px;
  }

  .near-win {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .celebration {
    display: none !important;
  }
}

.batch-balls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 0;
}

.batch-balls span {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  background: #f0d48e;
  color: #123a31;
  font-size: 23px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 3px 0 #ae8847;
}

.batch-balls small {
  font-size: 9px;
  padding-top: 3px;
}