:root {
  --bg: #0e2a1f;
  --felt: #1f6b4a;
  --felt-dark: #144a33;
  --sheet: #173b2c;
  --ink: #f4f0e6;
  --muted: rgba(244, 240, 230, 0.66);
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(0, 0, 0, 0.24);
  --gold: #f2c14e;
  --gold-ink: #2b2000;
  --team0: #6cb8ff;
  --team1: #ff8f6b;
  --good: #8fe0a6;
  --bad: #ffb199;
  --danger: #e5484d;
  --card: #fdfbf5;
  --card-red: #c62828;
  --card-black: #1d1d1f;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
  margin: 0;
}

h2 {
  font-size: 18px;
}

button {
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6em 1em;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

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

button.primary {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: transparent;
  font-weight: 700;
}

button.primary:hover:not(:disabled) {
  background: #f7cf6d;
}

button.big {
  padding: 0.85em 1em;
  font-size: 17px;
}

button.small {
  padding: 0.3em 0.8em;
  font-size: 14px;
}

button.link {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
}

button.icon {
  padding: 0.3em 0.6em;
  line-height: 1;
}

button.danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

input {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65em 0.8em;
  width: 100%;
}

input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

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

.center {
  text-align: center;
}

.red {
  color: var(--card-red);
}

.t0 {
  --team: var(--team0);
}

.t1 {
  --team: var(--team1);
}

/* Home and lobby ------------------------------------------------------------ */

.home,
.lobby,
.center-screen {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.center-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo {
  margin-top: 24px;
  text-align: center;
  font: 700 56px/1.1 Georgia, 'Times New Roman', serif;
}

.logo .suits {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 28px;
}

.logo .suits .red {
  color: #ff6b6b;
}

.tagline {
  text-align: center;
  color: var(--muted);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.invite {
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

.row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-code {
  display: flex;
  flex-direction: column;
}

.room-code span {
  color: var(--muted);
  font-size: 13px;
}

.room-code strong {
  font: 700 34px/1 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  letter-spacing: 0.12em;
}

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

.segmented {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 3px;
}

.segmented button {
  border: none;
  background: none;
  border-radius: 8px;
  padding: 0.3em 0.85em;
}

.segmented button.on {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
}

.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: seat;
}

.seat {
  counter-increment: seat;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border-left: 4px solid var(--team, rgba(255, 255, 255, 0.18));
}

.seat.moving {
  outline: 2px solid var(--gold);
}

.seat::before {
  content: counter(seat);
  width: 1.1em;
  font-weight: 700;
  color: var(--muted);
}

.seat.me {
  background: rgba(255, 255, 255, 0.09);
}

.seat.free {
  border-left-style: dashed;
}

.seat.offline b {
  opacity: 0.55;
}

.seat .who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.seat .who b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat small {
  font-size: 12px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.team-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--team);
  white-space: nowrap;
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

.how {
  padding: 0.85em 1em;
}

/* Game ---------------------------------------------------------------------- */

.game {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, var(--felt) 0%, var(--felt-dark) 65%, var(--bg) 100%);
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.28);
}

.score {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.score .games {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
}

.score b,
.match-score b {
  font-size: 20px;
  color: var(--team);
}

.score small {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  align-self: center;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 999px;
}

.rounds-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.rounds-info small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rounds-info b {
  margin-top: 5px;
  font-size: 16px;
  white-space: nowrap;
}

.rounds-info.last b {
  color: var(--gold);
}

.trump-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.trump-info small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trump-info .suit {
  font-size: 26px;
  margin-top: 2px;
  background: var(--card);
  border-radius: 6px;
  padding: 1px 6px 3px;
  color: var(--card-black);
}

.trump-info .suit.red {
  color: var(--card-red);
}


.table {
  position: relative;
  flex: 1;
  min-height: 0;
  width: min(100%, 900px);
  margin: 0 auto;
}

.player {
  position: absolute;
  translate: -50% -50%;
  min-width: 64px;
  max-width: 30%;
  padding: 4px 10px 5px;
  text-align: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.38);
  border: 2px solid color-mix(in srgb, var(--team) 65%, transparent);
  transition: box-shadow 0.2s;
  z-index: 2;
}

.player.turn {
  box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(242, 193, 78, 0.6);
}

.player.offline {
  opacity: 0.5;
}

.player .name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player .meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 18px;
  font-size: 12px;
}

.player .meta:empty {
  display: none;
}

.count {
  white-space: nowrap;
}

.count::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 13px;
  margin-right: 3px;
  vertical-align: -2px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, #a3283a, #5a0f1a);
}

.chip {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
}

.status {
  min-height: 1.6em;
  text-align: center;
  font-weight: 600;
  padding: 0 16px;
}

.status.mine {
  color: var(--gold);
}

.status.good {
  color: var(--good);
}

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

.last-trick-btn,
.won-btn {
  position: absolute;
  bottom: 8px;
  font-size: 13px;
  padding: 0.3em 0.7em;
  z-index: 3;
}

.last-trick-btn {
  left: 8px;
}

.won-btn {
  right: 8px;
}

/* Cards --------------------------------------------------------------------- */

.card {
  --w: var(--cw, 64px);
  position: relative;
  flex: none;
  width: var(--w);
  aspect-ratio: 5 / 7;
  padding: 0;
  border-radius: calc(var(--w) * 0.12);
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--card);
  color: var(--card-black);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-family: Georgia, 'Times New Roman', serif;
}

/* Cards in the hand and on the rules page are buttons; keep their face white. */
button.card:hover:not(:disabled) {
  background: var(--card);
}

.card.red {
  color: var(--card-red);
}

.card .corner {
  position: absolute;
  top: 5%;
  left: 9%;
  font-size: calc(var(--w) * 0.25);
  font-weight: 700;
  line-height: 0.95;
  text-align: center;
}

.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: 18%;
  font-size: calc(var(--w) * 0.48);
}

.card.back {
  background: linear-gradient(135deg, #a3283a, #5a0f1a);
  border-color: rgba(255, 255, 255, 0.7);
}

.card.mini {
  --w: 22px;
  display: inline-block;
  border-radius: 3px;
}

.card.mini .corner {
  inset: 0;
  display: grid;
  place-content: center;
  font-size: 9px;
}

.card.mini .pip {
  display: none;
}

.on-table {
  --cw: clamp(42px, 12vmin, 78px);
  position: absolute;
  translate: -50% -50%;
  z-index: 1;
}

.game.n6 .on-table,
.game.n8 .on-table {
  --cw: clamp(36px, 9.5vmin, 64px);
}

/* The deck in the middle, under the played cards. Turned sideways, the trump
   is 1.4 cards wide; with its right edge on the group's, half of it shows
   past the deck, corner included. Sized to fit inside the ring of played
   cards for 4, 6 and 8 players. */
.table-deck {
  --cw: clamp(40px, 12vmin, 68px);
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--cw) * 1.7);
  height: calc(var(--cw) * 1.4);
  translate: -50% -50%;
  z-index: 0;
}

.table-deck .card {
  position: absolute;
  top: 0;
  left: 0;
}

.table-deck .trump-under {
  left: calc(var(--cw) * 0.5);
  rotate: 90deg;
  box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* A few card edges below the top one make it look like a pile. */
.table-deck .back {
  box-shadow: 1px 1px 0 #3d0a12, 2px 2px 0 #f4f0e6, 3px 3px 0 #3d0a12, 4px 4px 6px rgba(0, 0, 0, 0.45);
}

.stock-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 calc(var(--cw) * 0.36) / 1 system-ui, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.on-table.enter {
  animation: deal 0.22s ease-out;
}

.on-table.winner {
  box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(242, 193, 78, 0.7);
  z-index: 2;
}

@keyframes deal {
  from {
    opacity: 0;
    scale: 0.6;
  }
}

.hand {
  --cw: clamp(60px, 19vw, 96px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px max(12px, env(safe-area-inset-bottom));
}

/* A card just drawn from the deck slides up into the hand. */
.hand .card.drawn {
  animation: draw 0.35s ease-out;
}

@keyframes draw {
  from {
    opacity: 0;
    translate: 0 -40%;
  }
}

.hand-row {
  display: flex;
  justify-content: center;
}

.hand-row .card + .card {
  margin-left: var(--gap, 6px);
}

.hand .card {
  cursor: default;
  transition: transform 0.12s, filter 0.12s;
}

/* Trumps in your hand stand out: a glowing gold ring and a gold corner. */
.hand .card.is-trump {
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(242, 193, 78, 0.65), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* The turned-up trump once you've drawn it: the strongest highlight, a
   "da mesa" band, and a few pulses the moment it lands in your hand. */
.hand .card.table-trump {
  box-shadow: 0 0 0 4px var(--gold), 0 0 26px rgba(242, 193, 78, 0.9), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.hand .card.table-trump.drawn {
  animation: draw 0.35s ease-out, table-trump 0.9s ease-in-out 0.35s 3;
}

@keyframes table-trump {
  50% {
    scale: 1.08;
    box-shadow: 0 0 0 5px #fff3c4, 0 0 40px rgba(242, 193, 78, 1), 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}

.table-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 0;
  background: var(--gold);
  color: var(--gold-ink);
  font: 800 calc(var(--w) * 0.14) / 1 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hand .card.is-trump::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 calc(var(--w) * 0.3) calc(var(--w) * 0.3) 0;
  border-color: transparent var(--gold) transparent transparent;
}

.hand .card.playable {
  cursor: pointer;
}

.hand .card.dim {
  filter: brightness(0.55);
}

.hand .card.selected {
  transform: translateY(-18%);
}

@media (hover: hover) {
  .hand .card.playable:hover {
    transform: translateY(-14%);
  }
}

/* Sheets -------------------------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  animation: fade 0.2s;
}

.sheet {
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  text-align: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--sheet);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.result h2 {
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* End of the match: who won and the final score, big. */
.final {
  gap: 10px;
}

.final.win {
  border-color: rgba(242, 193, 78, 0.6);
  box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.35), 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(242, 193, 78, 0.25);
}

.final .kicker {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.result.final h2 {
  font: 700 44px/1.1 Georgia, 'Times New Roman', serif;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.result.final.win h2 {
  color: var(--gold);
  animation: victory 0.6s ease-out;
}

@keyframes victory {
  from {
    opacity: 0;
    scale: 0.5;
  }
  60% {
    scale: 1.12;
  }
}

.winners {
  font-size: 17px;
}

.winners b {
  color: var(--team);
}

.final-score {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 14px;
  margin: 4px 0;
  font-size: 18px;
}

.final-score b {
  font-size: 52px;
  line-height: 1;
  color: var(--team);
}

.final-score .sep {
  font-size: 32px;
  color: var(--muted);
}

.final .small {
  font-size: 13px;
}

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

.confetti span {
  position: absolute;
  top: -8%;
  color: var(--ink);
  animation: fall 3s ease-in forwards;
}

.confetti span.red {
  color: #ff6b6b;
}

@keyframes fall {
  to {
    translate: 0 115vh;
    rotate: 540deg;
  }
}

.headline {
  font-size: 22px;
  font-weight: 700;
}

.detail {
  color: var(--gold);
  font-weight: 600;
}

.points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.points > div {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 12px;
  border-top: 3px solid var(--team);
  background: rgba(0, 0, 0, 0.25);
}

.points b {
  font-size: 38px;
  line-height: 1.1;
  color: var(--team);
}

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

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

.last-trick {
  --cw: 58px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.last-trick figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.last-trick figure.winner .card {
  box-shadow: 0 0 0 3px var(--gold);
}

.last-trick figcaption {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--team);
}

.won {
  --cw: 38px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 4px;
}

.menu {
  gap: 10px;
}

/* Drawing the teams a reis ---------------------------------------------------- */

.draw {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.draw h1 {
  font: 700 30px/1.2 Georgia, 'Times New Roman', serif;
}

.draw-rows {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.draw-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
}

.draw-rows li.me {
  background: rgba(255, 255, 255, 0.09);
}

.draw-rows .who {
  width: 30%;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-cards {
  --cw: 32px;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.draw-cards .card {
  animation: deal 0.3s ease-out backwards;
}

.draw-cards .card.glow {
  box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(242, 193, 78, 0.7);
}

.draw-result {
  margin-top: 8px;
  font-size: 18px;
  animation: fade 0.4s backwards;
}

.draw-result b {
  color: var(--team);
}

/* Rules --------------------------------------------------------------------- */

#rules {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}

body.rules-open {
  overflow: hidden;
}

.rules-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(14, 42, 31, 0.94);
  border-bottom: 1px solid var(--line);
}

.rules-bar h1 {
  flex: 1;
  font: 700 20px/1.2 Georgia, 'Times New Roman', serif;
}

.turn-alert {
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 rgba(242, 193, 78, 0.7);
  }
  to {
    box-shadow: 0 0 0 6px rgba(242, 193, 78, 0);
  }
}

.rules {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rules .lead {
  font-size: 17px;
}

.rules section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel);
}

.rules section.summary {
  border-color: rgba(242, 193, 78, 0.35);
  background: rgba(242, 193, 78, 0.08);
}

.rules h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 19px/1.2 Georgia, 'Times New Roman', serif;
}

.rules h2 .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  font: 800 14px/1 system-ui, sans-serif;
}

.rules ul {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.rules .note {
  font-size: 14px;
  color: var(--muted);
}

.rules figure {
  margin: 0;
}

.rules table {
  width: 100%;
  border-collapse: collapse;
}

.rules th,
.rules td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.rules th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.rules td:last-child,
.rules th:last-child {
  text-align: right;
}

.rules td:last-child {
  font-weight: 700;
}

.suit-chip {
  display: inline-block;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--card);
  color: var(--card-black);
  font-size: 17px;
  line-height: 1.35;
}

.suit-chip.red {
  color: var(--card-red);
}

.card-row {
  --cw: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.card-row.small {
  --cw: 40px;
}

.card-row figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.card-row figcaption {
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}

.card-row figcaption b {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.rules .card.dim {
  filter: brightness(0.5);
}

.rules .card.glow {
  box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(242, 193, 78, 0.6);
}

.seating {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 10 / 7;
  margin: 6px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 45%, var(--felt) 0%, var(--felt-dark) 75%);
}

.seating svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(244, 240, 230, 0.55);
  stroke-width: 2;
  stroke-linecap: round;
}

.seating marker path {
  fill: rgba(244, 240, 230, 0.55);
  stroke: none;
}

.seat-tag {
  position: absolute;
  translate: -50% -50%;
  padding: 3px 8px;
  border-radius: 10px;
  border: 2px solid var(--team);
  background: rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--muted);
}

.legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  background: var(--team);
}

.trump-example {
  --cw: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px;
}

/* The turned-up trump sideways under the deck. */
.deck {
  position: relative;
  width: calc(var(--cw) * 2);
  height: calc(var(--cw) * 1.4);
  flex: none;
}

.deck .card {
  position: absolute;
  top: 0;
  left: 0;
}

/* Turned sideways it's 1.4 cards wide, so this puts its right edge on the
   deck's and leaves a whole card width showing past the deck. */
.deck .card.glow {
  left: calc(var(--cw) * 0.8);
  rotate: 90deg;
}

.trump-example figcaption {
  color: var(--muted);
  font-size: 14px;
}

.try-it {
  font-weight: 600;
  color: var(--gold);
}

.quiz {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.quiz-info {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.quiz .card {
  cursor: pointer;
  transition: box-shadow 0.15s, filter 0.15s;
}

.quiz.done .card {
  cursor: default;
}

.quiz.done .card:not(.right, .wrong) {
  filter: brightness(0.6);
}

.quiz .card.right {
  box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(242, 193, 78, 0.6);
}

.quiz .card.wrong {
  box-shadow: 0 0 0 3px var(--danger);
}

.quiz-feedback:empty {
  display: none;
}

.quiz-feedback .good {
  color: var(--good);
}

.quiz-feedback .bad {
  color: var(--bad);
}

/* Notices ------------------------------------------------------------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 32%;
  translate: -50% 0;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.88);
  text-align: center;
  pointer-events: none;
}

/* "Últimas cartas": pops in over the table, holds, then floats away. */
#announce {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 12;
  translate: -50% -50%;
  padding: 12px 24px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--gold);
  font: 700 clamp(28px, 9vw, 44px) / 1.1 Georgia, 'Times New Roman', serif;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(242, 193, 78, 0.45);
  pointer-events: none;
}

#announce.show {
  animation: announce 2.4s ease-in-out forwards;
}

@keyframes announce {
  0% {
    opacity: 0;
    scale: 0.4;
  }
  15% {
    opacity: 1;
    scale: 1.08;
  }
  25% {
    scale: 1;
  }
  80% {
    opacity: 1;
    translate: -50% -50%;
  }
  100% {
    opacity: 0;
    translate: -50% -90%;
  }
}

#banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 4px;
  text-align: center;
  font-weight: 600;
  background: var(--gold);
  color: var(--gold-ink);
}

[hidden] {
  display: none !important;
}
