:root {
  --bg-dark: #09090b;
  --bg-elevated: #141418;
  --bg-panel: #18181d;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --card-black: #0c0c0e;
  --card-white: #ffffff;
  --radius-card: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  user-select: none;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.hidden {
  display: none !important;
}

#app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

/* =========================================================
   TOPO LIMPO: RANKING EM TEMPO REAL + 1 BOTÃO DE MENU
   ========================================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(16, 16, 20, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
  flex-shrink: 0;
}

.scoreboard-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  padding: 2px 0;
}

.scoreboard-strip::-webkit-scrollbar {
  display: none;
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #1f1f26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-chip.rank-1 {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(31, 31, 38, 0.95));
  border-color: rgba(245, 158, 11, 0.6);
}

.rank-chip.is-me {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

.rank-chip.is-ready {
  border-color: var(--accent-green);
}

.rank-pos {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--accent-gold);
}

.rank-name {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-pts {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.rank-chip.rank-1 .rank-pts {
  background: var(--accent-gold);
  color: #000;
}

.rank-status-dot {
  font-size: 0.72rem;
}

.menu-trigger-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1f1f27;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* =========================================================
   TELAS GERAIS
   ========================================================= */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* =========================================================
   1. TELA DE ENTRADA (ESTILO CARTAS CONTRA A HUMANIDADE)
   ========================================================= */
.join-container {
  padding: 20px 16px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: auto 0;
}

.cah-hero-cards {
  position: relative;
  width: 220px;
  height: 210px;
  margin-bottom: 4px;
}

.hero-card {
  position: absolute;
  width: 155px;
  height: 195px;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
}

.hero-card-white-back {
  background: #ffffff;
  color: #09090b;
  right: 8px;
  top: 8px;
  transform: rotate(9deg);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.15;
}

.hero-card-black-front {
  background: #0c0c0e;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  left: 10px;
  top: 4px;
  transform: rotate(-6deg);
}

.hero-card-title {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.corp-subtitle {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-top: 2px;
}

.hero-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.85;
}

.cah-mini-cards-icon {
  display: inline-block;
  width: 12px;
  height: 14px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}

.card-panel {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
}

.returning-profile-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.returning-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.returning-avatar {
  font-size: 1.7rem;
}

.returning-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.06em;
}

.returning-name {
  font-size: 0.95rem;
  font-weight: 800;
}

.returning-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.text-input, .textarea-input {
  width: 100%;
  background: #0e0e12;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  outline: none;
}

.text-input:focus, .textarea-input:focus {
  border-color: #fff;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.avatar-btn {
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: #101015;
  font-size: 1.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-btn.selected {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.06);
}

.btn-primary {
  background: #ffffff;
  color: #09090b;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #09090b;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 14px 18px;
  cursor: pointer;
}

.btn-secondary {
  background: #23232b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 13px 18px;
  cursor: pointer;
}

.btn-large {
  width: 100%;
}

.join-panel { max-width: 680px; }
.room-entry-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.room-entry-card {
  min-width: 0;
  padding: 14px;
  background: #101014;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
}
.public-rooms-card { grid-column: 1 / -1; }
.room-entry-heading, .room-list-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-entry-heading > span { font-size: 1.35rem; }
.room-entry-heading h2 { font-size: .96rem; font-weight: 900; }
.room-entry-heading p { color: var(--text-muted); font-size: .72rem; margin-top: 3px; }
.room-entry-card > .room-entry-heading, .room-entry-card > label:first-of-type { margin-bottom: 10px; }
.room-entry-card .input-label { margin-top: 10px; }
.room-entry-card .text-input { margin-bottom: 2px; }
.room-entry-card .btn-large { margin-top: 12px; }
.room-privacy-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  margin: 10px 0 4px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}
.room-privacy-toggle input { accent-color: var(--accent-green); margin-top: 2px; }
.room-privacy-toggle strong, .room-privacy-toggle small { display: block; }
.room-privacy-toggle strong { font-size: .8rem; }
.room-privacy-toggle small { color: var(--text-muted); font-size: .68rem; line-height: 1.35; margin-top: 3px; }
.room-code-input { text-transform: uppercase; letter-spacing: .12em; }
.room-list-heading { justify-content: space-between; }
.public-rooms-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.public-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.public-room-details { min-width: 0; }
.public-room-name { display: block; font-size: .8rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-room-meta { display: block; color: var(--text-muted); font-size: .68rem; margin-top: 3px; }
.public-room-password { width: 100%; margin: 7px 0 0; padding: 7px 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: #0e0e12; color: #fff; font-size: .75rem; }
.public-room-join { border: 0; border-radius: 8px; padding: 7px 9px; background: rgba(16,185,129,.2); color: #34d399; font-weight: 900; cursor: pointer; }
.room-list-empty { grid-column: 1 / -1; color: var(--text-muted); font-size: .78rem; padding: 10px 2px; }
.room-entry-error { max-width: 680px; width: 100%; color: #fecaca; background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.35); border-radius: 10px; padding: 10px 12px; font-size: .8rem; }
.copy-room-code { border: 0; background: transparent; color: #fff; font-size: .95rem; margin-left: 4px; cursor: pointer; }
.room-controls-disabled { opacity: .58; cursor: not-allowed; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* =========================================================
   2. TELA DE LOBBY (/sala-caos)
   ========================================================= */
.lobby-container {
  padding: 12px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-header-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 14px;
}

.lobby-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.room-code-pill > span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lobby-header-top h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.lobby-quick-btns {
  display: flex;
  gap: 6px;
}

.btn-bot {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-outline-sm {
  background: #23232b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.lobby-players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.lobby-player-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #101014;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.bot-remove-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: none;
  border-radius: 6px;
  width: 20px;
  height: 20px;
  font-size: 0.72rem;
  cursor: pointer;
}

.lobby-section h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.mode-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 520px) {
  .room-entry-grid { grid-template-columns: 1fr; }
  .public-rooms-card { grid-column: auto; }
  .public-rooms-list { grid-template-columns: 1fr; }
  .join-container { margin: 0; }
  .mode-selector-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  text-align: left;
  background: #101015;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-card.active {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px #ffffff;
}

.mode-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mode-icon {
  font-size: 1.25rem;
}

.mode-badge {
  font-size: 0.62rem;
  font-weight: 900;
  background: var(--accent-green);
  color: #000;
  padding: 2px 7px;
  border-radius: 999px;
}

.mode-badge-alt {
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
}

.mode-title {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.mode-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.settings-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .settings-two-col {
    grid-template-columns: 1fr;
  }
}

.setting-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
}

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

.pill-opt {
  background: #101015;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.pill-opt.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.btn-xs {
  background: #25252e;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

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

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

.pack-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #101015;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.pack-card.enabled {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
}

.pack-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pack-icon {
  font-size: 1.35rem;
}

.pack-name {
  font-size: 0.84rem;
  font-weight: 800;
}

.pack-counts {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pack-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.pack-card.enabled .pack-check {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* =========================================================
   3. TELA DE JOGO (/play-caos) - DESIGN LIMPO DE CARTA FÍSICA
   ========================================================= */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #111115;
  flex-shrink: 0;
}

.round-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.round-pill {
  background: #272730;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.round-status-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-pill {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.14);
  padding: 3px 8px;
  border-radius: 999px;
}

.timer-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 1s linear;
}

/* MESA CENTRAL */
.table-stage {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CARTA PRETA OFICIAL (IGUAL À FOTO ENVIADA) */
.cah-black-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  min-height: 185px;
  margin: 0 auto;
  background: #08080a;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-card);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.75);
  flex-shrink: 0;
}

.black-card-tts {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
}

.cah-black-card-text {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.02em;
  padding-right: 26px;
}

.cah-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 8px;
}

.cah-footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.78;
}

.cah-pick-badge {
  background: #ffffff;
  color: #000000;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
}

/* RESPOSTAS NA MESA / VOTAÇÃO */
.table-submissions-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.submissions-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 2px;
}

.submissions-counter {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

/* CARTA BRANCA NA MESA */
.table-white-card {
  background: #ffffff;
  color: #09090b;
  border-radius: 14px;
  padding: 14px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
  position: relative;
}

.table-white-card.face-down {
  background: linear-gradient(145deg, #1b1b22, #121217);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
}

.table-white-card.selected-for-vote {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.35);
}

.table-white-card.is-own-submission {
  opacity: 0.78;
}

.table-white-card.winner-card {
  border-color: var(--accent-green);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.45);
}

.table-card-text {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.table-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 800;
  color: #52525b;
  margin-top: 12px;
}

.own-card-pill {
  background: #27272a;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
}

.votes-badge {
  background: var(--accent-gold);
  color: #000;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

/* DOCK DE BOTÃO DE CONFIRMAÇÃO */
.action-dock {
  padding: 8px 12px;
  background: rgba(9, 9, 11, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  z-index: 30;
}

.btn-dock {
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   MÃO DO JOGADOR EM LEQUE (ESTILO FOTO DO CELULAR)
   ========================================================= */
.hand-section {
  background: #111116;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 0 12px;
  flex-shrink: 0;
}

.hand-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 6px;
}

.hand-title {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.btn-redraw {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.hand-fan {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 16px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.hand-fan::-webkit-scrollbar {
  display: none;
}

.cah-white-card {
  width: 148px;
  min-width: 148px;
  height: 186px;
  background: #ffffff;
  color: #09090b;
  border-radius: 14px;
  padding: 14px 13px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  border: 3px solid transparent;
  scroll-snap-align: center;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.cah-white-card.selected {
  transform: translateY(-12px) scale(1.03);
  border-color: var(--accent-red);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.38);
}

.cah-white-card-text {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.015em;
  overflow-y: auto;
}

.cah-white-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.56rem;
  font-weight: 800;
  color: #71717a;
  padding-top: 6px;
}

.pick-order-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================================
   4. PÓDIO FINAL (/podio-caos)
   ========================================================= */
.gameover-container {
  padding: 16px;
}

.gameover-panel {
  text-align: center;
}

.gameover-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.gameover-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.podium-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.podium-pillar {
  flex: 1;
  max-width: 110px;
  background: #121217;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px 14px 8px 8px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.podium-pillar.place-1 {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.25), #14141a);
  border-color: var(--accent-gold);
  min-height: 150px;
}

.podium-pillar.place-2 {
  min-height: 125px;
}

.podium-pillar.place-3 {
  min-height: 110px;
}

.final-standings-box {
  text-align: left;
  margin: 16px 0;
}

.final-standings-box h3 {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.final-scoreboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.departed-players-panel {
  margin: 16px 0;
  padding: 12px;
  text-align: left;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .22);
  border-radius: 12px;
}
.departed-players-panel h3 { margin-bottom: 8px; color: #fca5a5; font-size: .84rem; }
.departed-players-list { display: flex; flex-direction: column; gap: 6px; }
.departed-player-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 8px; background: rgba(0,0,0,.2); font-size: .75rem; }
.departed-player-row span:last-child { color: var(--text-muted); text-align: right; }

.final-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101015;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================================
   MODAIS E DRAWER DE MENU
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.modal-card {
  width: 100%;
  max-width: 400px;
  max-height: 88dvh;
  overflow-y: auto;
  background: #18181f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 18px;
}

.modal-card-wide {
  max-width: 520px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.menu-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #101015;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
}

.menu-action-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.menu-item-icon {
  font-size: 1.35rem;
}

.menu-item-text {
  display: flex;
  flex-direction: column;
}

.menu-item-text strong {
  font-size: 0.88rem;
}

.menu-item-text span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  width: fit-content;
  margin: 12px auto;
}

.qr-box img {
  width: 200px;
  height: 200px;
  display: block;
}

.lan-url-pill {
  text-align: center;
  background: #101015;
  padding: 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

.custom-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.type-tab {
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #101015;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.type-tab.active {
  background: #fff;
  color: #000;
}

.history-section {
  margin-bottom: 16px;
}

.history-section h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.career-list, .match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.career-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #101015;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}

/* TOASTS */
.toast-container {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 300;
  width: 92%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 20, 26, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  text-align: center;
}
