/* Estilos dedicados da Arena Block Bast */

.game-page {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  grid-template-columns: minmax(180px, 220px) minmax(320px, 480px) minmax(160px, 200px);
  grid-template-rows: auto 1fr auto;
  justify-content: center;
  align-content: start;
  gap: 16px 24px;
  padding: 12px 24px 24px;
  letter-spacing: 0;
}

/* Topbar Desktop */
.game-page .game-topbar {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 60px;
  padding: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 30;
}

.game-topbar .brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.game-topbar .brand-copy {
  display: grid;
}

.game-topbar .game-stats {
  position: static;
  transform: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-topbar .game-stat {
  background: none;
  border: 0;
  min-width: 90px;
  padding: 0;
  text-align: right;
}

.game-topbar .game-stat strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.game-topbar .game-stat .label {
  letter-spacing: 0;
  font-size: 11px;
}

.game-topbar .deposit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  background: #6b42c9;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(107, 66, 201, 0.35);
  transition: background 0.15s ease, transform 0.12s ease;
}

.game-topbar .deposit-link:hover {
  background: #7d52e6;
  transform: translateY(-1px);
}

.visitor-mode .header-wallet,
.free-mode .header-wallet {
  display: none !important;
}

/* Coluna 1: Resumo da rodada */
.round-summary {
  z-index: 2;
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 8px;
}

.round-summary > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.round-summary span,
.round-history span {
  display: block;
  font-size: 11px;
  color: #b7add4;
}

.round-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.round-summary .reward-value {
  color: #69e5b1;
  font-size: 21px;
}

.round-summary .score-value {
  font-size: 20px;
}

.round-summary .game-stat {
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}

/* Indicador de progresso no modo gratuito */
.visitor-progress {
  padding: 14px 0 6px;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.visitor-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #b7add4;
  margin-bottom: 6px;
}

.visitor-progress-info strong {
  font-size: 13px;
  color: #f0eaff;
  font-variant-numeric: tabular-nums;
}

.visitor-progress-bar {
  width: 100%;
  height: 6px;
  background: #20174a;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(130, 110, 180, 0.2);
}

.visitor-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  border-radius: 3px;
  transition: width 0.25s ease;
}

/* Coluna 3: Sua rodada */
.round-history {
  grid-column: 3;
  grid-row: 2;
  z-index: 2;
  align-self: start;
  padding-top: 8px;
}

.round-history h2 {
  font-size: 14px;
  margin: 14px 0 10px;
}

.round-history p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.round-history strong {
  font-variant-numeric: tabular-nums;
}

/* Coluna 2: Palco e Canvas */
.game-page .game-stage {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
}

.game-page #jogo {
  width: 100%;
  height: auto;
  max-height: none;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  display: block;
}

/* Controles de aposta e CTA */
.game-page .game-controls {
  position: relative;
  grid-column: 2;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  gap: 12px;
  justify-content: stretch;
}

.game-page .stake-control {
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  min-height: 0;
}

.game-page .stake-copy {
  display: none;
}

.game-page .stake-stepper {
  width: 100%;
  grid-template-columns: 44px 1fr 44px;
}

.game-page .stake-chips {
  grid-column: 1;
  grid-template-columns: repeat(5, 1fr);
}

.stake-input-wrapper {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.stake-input-wrapper b {
  font-size: 14px;
  color: #c4b5fd;
  font-weight: 700;
}

.stake-input-wrapper input {
    width: 60px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border-bottom: 2px solid transparent !important;
    transition: border-color 0.2s;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: bold !important;
    font-variant-numeric: tabular-nums !important;
    text-align: left !important;
  }
  
  .stake-input-wrapper input:focus {
    border-bottom-color: #8b5cf6 !important;
  }

/* Remove arrows from number input */
.stake-input-wrapper input::-webkit-outer-spin-button,
.stake-input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stake-input-wrapper input[type=number] {
  -moz-appearance: textfield;
}

.game-page .stake-control.is-disabled {
  display: none;
}

/* Botão principal CTA (#apostar) */
.game-page #apostar {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  letter-spacing: 0.5px;
  color: #291800;
  background: linear-gradient(180deg, #ffe970 0%, #ffbd24 100%);
  text-shadow: none;
  box-shadow: 0 4px 0 #a9680c;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.game-page #apostar:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.game-page #apostar:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a9680c;
}

.game-page #apostar:focus-visible {
  outline: 2px solid #ffe970;
  outline-offset: 3px;
}

.game-page #apostar:disabled {
  box-shadow: none !important;
  background: #251d45 !important;
  color: #8c82ab !important;
  filter: none !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.game-page .game-message {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(100%, 560px);
  box-sizing: border-box;
  margin: 0 !important;
  padding: 9px 12px !important;
  min-height: 0;
  border: 1px solid rgba(177, 158, 236, 0.28);
  border-radius: 10px;
  background: rgba(18, 11, 53, 0.94);
  box-shadow: 0 10px 30px rgba(1, 0, 18, 0.4);
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 5px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.game-page .game-message:not(:empty) {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.game-page .game-message[data-tipo="erro"] {
  padding: 9px 12px !important;
}

.game-page .game-tip {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  margin: 8px 0 0;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  border-radius: 8px;
  box-shadow: none;
}

.game-tip p {
  flex: 1;
}

.game-page .game-tip button {
  flex: none;
}

/* Menu Mobile (<details class="arena-menu">) */
.arena-menu {
  position: relative;
  display: none;
}

.arena-menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #21174d;
  color: #ffffff;
  transition: background 0.15s ease;
}

.arena-menu summary:hover {
  background: #2c1f66;
}

.arena-menu summary::-webkit-details-marker {
  display: none;
}

.menu-bars {
  width: 18px;
  height: 14px;
  border-block: 2px solid currentColor;
  position: relative;
}

.menu-bars:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 2px solid currentColor;
}

.arena-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: rgba(18, 11, 53, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 181, 253, 0.25);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.arena-menu-panel a,
.arena-menu-panel button {
  display: flex !important;
  width: 100%;
  align-items: center;
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #eee8ff;
  text-align: left;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.arena-menu-panel a:hover,
.arena-menu-panel button:hover {
  background: #2b2054;
  color: #ffffff;
}

.arena-menu-panel a:focus-visible,
.arena-menu-panel button:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: -2px;
}

/* Diálogos modais */
.game-page .game-over,
.game-page .game-alert,
.game-page .game-confirm {
  position: fixed;
  z-index: 50;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  box-shadow: 0 0 0 100vmax rgba(3, 0, 20, 0.72);
}

/* O fundo escuro não pode ser recortado pela rolagem do diálogo. */
.game-page :is(.game-alert, .game-over)::before {
  display: none;
}

.game-page .game-confirm {
  transform: none;
}

/* Foco perceptível também nos controles que usam o estilo nativo. */
.game-page :is(a, button, summary):focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 3px;
}

.game-page [hidden] {
  display: none !important;
}

/* Modal de confirmação de encerramento / cashout rigorosamente centralizado no mobile e desktop */
.game-page .game-confirm[hidden],
.game-page #game-confirm[hidden] {
  display: none !important;
}

.game-page .game-confirm:not([hidden]),
.game-page #game-confirm:not([hidden]) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: min(92vw, 390px) !important;
  max-width: calc(100vw - 24px) !important;
  height: auto !important;
  max-height: 88dvh !important;
  padding: 24px 20px !important;
  background: #150f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8), 0 0 45px rgba(124, 58, 237, 0.3) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 16px !important;
  z-index: 9999 !important;
  box-sizing: border-box !important;
  animation: none !important;
}

.game-page #game-confirm.is-entering {
  animation: confirm-modal-enter 0.26s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

@keyframes confirm-modal-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.game-page #game-confirm .game-alert-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  margin: 0 auto !important;
}

.game-page #game-confirm h2 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  margin: 0 0 6px 0 !important;
}

.game-page #game-confirm p {
  font-size: 13px !important;
  color: #c4b5fd !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}

.game-page #game-confirm .game-alert-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 6px !important;
}

.game-page #game-confirm .game-alert-actions button,
.game-page #game-confirm .game-alert-actions .btn {
  width: 100% !important;
  min-height: 48px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  word-break: break-word !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

.game-page #game-confirm #game-confirm-accept {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
}

.game-page #game-confirm #game-confirm-cancel {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Números tabulares */
#saldo,
#round-stake,
#round-reward,
#pontos,
#round-moves,
#round-lines,
#visitor-moves-counter,
#game-over-score,
#game-over-prize,
#stake-display {
  font-variant-numeric: tabular-nums;
}

/* Breakpoints responsivos */

/* Desktop grande (>= 1440px) */
@media (min-width: 1440px) {
  .game-page {
    grid-template-columns: 210px minmax(360px, 480px) 190px;
    gap: 16px 32px;
    padding: 16px 32px 24px;
  }
}

/* Notebook e Desktop padrão (1024px – 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .game-page {
    grid-template-columns: 190px minmax(320px, 440px) 170px;
    gap: 14px 20px;
    padding: 10px 20px 20px;
  }
}

/* Tablet (768px – 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .game-page {
    grid-template-columns: 180px minmax(320px, 460px);
    gap: 16px;
    padding: 10px 16px 20px;
  }
  .round-history {
    display: none;
  }
  .game-topbar .brand-copy {
    display: none;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .game-page {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 6px max(10px, env(safe-area-inset-bottom)) 6px;
    background-attachment: scroll;
    max-width: 100vw;
    margin: 0 auto;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .game-page .game-topbar {
    order: 0;
    min-height: 52px;
    padding: 0 0 6px;
    gap: 8px;
  }

  .game-topbar .brand-copy {
    display: none;
  }

  .game-topbar .brand-mark {
    width: 42px;
  }

  .game-topbar .game-stats {
    margin-left: auto;
  }

  .game-topbar .game-stat strong {
    font-size: 16px;
  }

  .game-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #jogo {
    max-height: 100%;
    width: auto;
    object-fit: contain;
  }

  .game-page .game-nav {
    display: none;
  }

  .arena-menu {
    display: block;
    margin-left: 6px;
  }

  .visitor-mode .arena-menu,
  .free-mode .arena-menu {
    margin-left: auto;
  }

  .round-summary {
    order: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #17103c;
  }

  .round-summary > div,
  .round-summary .game-stat {
    padding: 0;
    border: 0;
    min-width: 0;
    text-align: left;
  }

  .round-summary strong,
  .round-summary .reward-value,
  .round-summary .score-value {
    font-size: 16px;
    margin-top: 4px;
  }

  .round-summary span {
    font-size: 10px;
  }

  .round-summary .visitor-progress {
    grid-column: 1 / -1;
    padding: 6px 0 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .round-history {
    display: none;
  }

  .game-page .game-stage {
    order: 2;
    width: 100%;
  }

  .game-page .game-controls {
    order: 3;
    gap: 8px;
  }

  .game-page .game-tip p span {
    display: block;
    font-size: 11px;
  }

  .game-page .game-tip-icon {
    display: none;
  }

  .game-page #apostar {
    min-height: 54px;
  }

  .game-page .game-over {
    max-height: 90dvh;
    overflow: auto;
  }
}

/* Acessibilidade de redução de movimento */

/* Botão de Cash Out / Encerrar Aposta Dourado */
.game-page #apostar.btn-cashout {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  cursor: pointer !important;
  animation: pulse-cashout 2s infinite ease-in-out;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.25 !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
}

.game-page #apostar.btn-cashout:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(245, 158, 11, 0.6) !important;
}

@media (max-width: 420px) {
  .game-page #apostar.btn-cashout {
    font-size: 13px !important;
    padding: 6px 8px !important;
  }
}

@keyframes pulse-cashout {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.45);
  }
  50% {
    box-shadow: 0 4px 28px rgba(245, 158, 11, 0.85);
  }
}

/* Indicador de Meta de Saque no Resumo da Arena */
.round-summary .summary-goal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-goal .goal-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
}

.summary-goal .goal-info strong {
  font-size: 12px;
  color: #f59e0b;
}

.summary-goal .goal-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.summary-goal .goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.summary-goal.goal-reached .goal-info strong {
  color: #10b981;
}

.summary-goal.goal-reached .goal-bar-fill {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

@media (max-width: 767px) {
  .round-summary .summary-goal {
    grid-column: 1 / -1;
    padding: 6px 0 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .game-page :is(a, button):hover,
  .game-page :is(a, button):active {
    transform: none !important;
  }

  .game-page,
  .game-page * {
    scroll-behavior: auto !important;
  }
}

/* Backdrop de encerramento: esconde a poluição visual do fundo */
.game-over-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 995 !important;
  background: rgba(4, 2, 16, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  animation: game-backdrop-fade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes game-backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Quando game-over estiver aberto, oculta botões duplicados e escurece o tabuleiro */
body.game-over-active .game-controls {
  display: none !important;
}

body.game-over-active .game-tip {
  display: none !important;
}

body.game-over-active #jogo {
  opacity: 0.1 !important;
  filter: blur(6px) !important;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

body.game-over-active .game-topbar {
  opacity: 0.3 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}

/* Modal de resultado: rápido, limpo, intuitivo e sem excesso de texto/números */
.game-page .game-over {
  position: fixed !important;
  z-index: 1000 !important;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(90vw, 390px);
  max-height: min(600px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px 24px;
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(28, 17, 68, 0.96) 0%, rgba(12, 7, 34, 0.98) 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 45px rgba(255, 190, 0, 0.15);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.game-page .game-over.show {
  animation: dialog-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.game-page .game-over-badge {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(255, 226, 90, 0.35);
  border-radius: 18px;
  background: radial-gradient(circle, rgba(255, 226, 90, 0.25) 0%, rgba(255, 180, 0, 0.06) 75%);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.22);
  padding: 8px;
}

.game-page .game-over-badge svg {
  width: 100%;
  height: 100%;
}

.game-page .game-over-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(255, 226, 90, 0.12);
  border: 1px solid rgba(255, 226, 90, 0.25);
  color: #ffd83d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.game-page .game-over h2 {
  margin: 2px auto 6px;
  color: #ffffff;
  font-size: clamp(34px, 7vw, 42px);
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 16px rgba(255, 215, 0, 0.35);
}

.game-page .game-over > p {
  margin: 0 auto 16px;
  max-width: 30ch;
  color: #b8aed6;
  font-size: 13px;
  line-height: 1.45;
}

/* Oculta os cards redundantes de estatísticas no modo degustação */
.game-over.visitor-view .game-over-stats,
.game-over.visitor-view #game-over-stats {
  display: none !important;
}

.game-page .game-over-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.game-page .game-over-score,
.game-page .game-over-reward {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(201, 181, 253, 0.18);
  border-radius: 14px;
  background: rgba(8, 4, 29, 0.35);
  color: #a79bc6;
  font-size: 10px;
}

.game-page .game-over-reward {
  border-color: rgba(255, 226, 90, 0.28);
  background: rgba(255, 226, 90, 0.08);
}

.game-page .game-over-score strong,
.game-page .game-over-reward strong {
  color: #fff;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.game-page .game-over-reward strong {
  color: #ffe25a;
}

.game-page .game-over-actions {
  width: 100%;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 6px !important;
}

.game-page .game-over-actions .btn-create-account {
  order: 1 !important;
  width: 100% !important;
  min-height: 56px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
  background: linear-gradient(180deg, #fff39b, #ffd83d 22%, #eca008) !important;
  color: #1a0f3d !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  box-shadow: 0 8px 24px rgba(236, 160, 8, 0.42), 0 3px 0 #9c6508 !important;
  border: none !important;
  border-radius: 16px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: transform 0.15s ease, filter 0.15s ease !important;
}

.game-page .game-over-actions .game-over-primary {
  order: 1 !important;
  width: 100% !important;
  min-height: 54px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 16px !important;
  background: linear-gradient(180deg, #fff39b, #ffd83d 22%, #eca008) !important;
  color: #1a0f3d !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  text-transform: uppercase !important;
  border: none !important;
  border-radius: 16px !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

.game-page .game-over-actions .btn-create-account:hover,
.game-page .game-over-primary:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.05) !important;
}

.game-page .game-over-actions .btn-restart-free {
  order: 2 !important;
  width: 100% !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  color: #9d8ec2 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: color 0.15s ease !important;
}

.game-page .game-over-actions .game-over-secondary {
  order: 2 !important;
  width: 100% !important;
  min-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  color: #9d8ec2 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.game-page .game-over-actions .btn-restart-free:hover,
.game-page .game-over-secondary:hover {
  color: #ffffff !important;
  text-decoration: underline !important;
}

.game-page .game-over small,
.game-page .game-over-note {
  display: block;
  margin-top: 12px;
  color: #7b6f99;
  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 560px) {
  .game-page .game-over {
    width: min(calc(100vw - 24px), 390px);
    padding: 30px 24px 24px;
    border-radius: 26px;
  }

  .game-page .game-over-badge {
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 18px;
  }

  .game-page .game-over h2 {
    font-size: clamp(34px, 9vw, 42px);
  }

  .game-page .game-over > p {
    font-size: 13px;
    margin-bottom: 16px;
  }
}

/* Depósito permanece dentro da arena para o primeiro acesso não perder contexto. */
.game-deposit-modal {
  z-index: 60;
  background: rgba(3, 0, 20, 0.7);
}

.game-deposit-modal .modal-card {
  width: min(470px, 100%);
  padding: 24px;
  border-color: rgba(201, 181, 253, 0.3);
  background: linear-gradient(160deg, #1a1049, #0e092e);
}

.game-deposit-modal .modal-head {
  margin-bottom: 8px;
}

.game-deposit-modal .modal-head h2 {
  margin-top: 3px;
  font-size: 26px;
}

.deposit-intro {
  margin: 0 0 18px;
  color: #afa5c9;
  font-size: 12px;
  line-height: 1.5;
}

.deposit-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.deposit-values button {
  min-width: 0;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid rgba(183, 158, 247, 0.24);
  border-radius: 10px;
  background: #211754;
  box-shadow: none;
  color: #d7cdec;
  font-size: 11px;
  text-shadow: none;
}

.deposit-values button.active {
  border-color: #ffe15a;
  background: rgba(255, 225, 90, 0.13);
  color: #ffe15a;
}

.deposit-inputs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.deposit-inputs > label {
  flex: 1;
}

.deposit-input {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding: 0 14px;
  border: 1px solid rgba(183, 158, 247, 0.28);
  border-radius: 11px;
  background: #0b072b;
}

.deposit-input b {
  color: #ffe15a;
}

.deposit-input input {
  flex: 1;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 850;
}

.deposit-input input:focus {
  outline: 0;
}

.game-deposit-modal .deposit-submit {
  min-height: 54px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fff39b, #ffd83d 22%, #eca008);
  box-shadow: 0 4px 0 #9c6508;
  color: #201743;
  font-size: 13px;
}

.deposit-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(82, 227, 172, 0.1);
  color: #79ebbc;
  font-size: 11px;
  line-height: 1.4;
}

.deposit-status.is-error {
  background: rgba(255, 102, 124, 0.1);
  color: #ffb4c1;
}

.deposit-pix {
  display: grid;
  gap: 8px;
}

.deposit-pix[hidden] {
  display: none;
}

.deposit-pix textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(183, 158, 247, 0.25);
  border-radius: 10px;
  background: #090622;
  color: #eee8ff;
  font: 11px/1.45 var(--mono);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.deposit-pix textarea:hover,
.deposit-pix textarea:focus {
  border-color: #52e3ac;
  box-shadow: 0 0 0 2px rgba(82, 227, 172, 0.25);
}

.pix-tap-hint {
  font-size: 11px;
  color: #79ebbc;
  font-weight: 500;
  margin-left: 4px;
}

#deposit-copy.is-copied {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
}

.deposit-later {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #aaa0c5;
  font-size: 11px;
  text-shadow: none;
}

@media (max-width: 560px) {
  .game-deposit-modal {
    padding: 12px;
  }

  .game-deposit-modal .modal-card {
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }

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

  .deposit-inputs {
    flex-direction: column;
    gap: 8px;
  }
  
  .game-deposit-modal {
    padding: 20px;
    gap: 16px;
  }
  
  .game-deposit-modal h2 {
    font-size: 24px;
    margin-bottom: 4px;
  }
  
  .deposit-input {
    min-height: 44px;
  }
  
  .deposit-input input {
    min-height: 40px;
  }
}

.visitor-mode .stake-control,
.game-page.visitor-mode .stake-control,
.game-page .stake-control[hidden],
.game-page .stake-control.is-disabled {
  display: none !important;
}

.game-tip-close {
  background: transparent !important;
  border: none !important;
  color: #c4b5fd !important;
  font-size: 20px !important;
  line-height: 1 !important;
  padding: 4px 8px !important;
  min-height: 32px !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  opacity: 0.8 !important;
}
.game-tip-close:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Fluxo estável: arena inteira dentro do viewport e controles sempre visíveis. */
.game-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}

.game-page .game-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
}

.game-page #jogo {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.stake-input-wrapper input {
  width: 78px !important;
  text-align: center !important;
}

.stake-chips [data-stake-custom] {
  font-size: 9px;
}

.game-deposit-modal .modal-card {
  max-height: calc(100dvh - 20px);
  overflow: hidden;
  border-radius: 14px;
}

.deposit-fields {
  display: grid;
  gap: 10px;
}

.deposit-field-title {
  color: #c9c0de;
  font-size: 12px;
  font-weight: 800;
}

.deposit-fields > label {
  display: grid;
  gap: 5px;
  color: #c9c0de;
  font-size: 11px;
  font-weight: 750;
}

.deposit-fields .deposit-input {
  margin-top: 0;
}

.has-pix .deposit-fields,
.has-pix .deposit-submit {
  display: none;
}

@media (max-width: 767px) {
  .game-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 5px;
    width: 100%;
    max-width: 480px;
    padding: max(4px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }

  .game-page .game-topbar {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
    padding: 2px 2px 6px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  .game-page .game-topbar .brand-mark {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
  }

  .game-page .game-topbar .header-wallet {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 8px !important;
    background: rgba(18, 12, 48, 0.85) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 14px !important;
    margin: 0 !important;
    min-width: 0 !important;
  }

  .game-page .game-topbar .header-wallet .label {
    font-size: 9px !important;
    color: #a79ac5 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
  }

  .game-page .game-topbar .header-wallet strong {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #fff !important;
  }

  .round-summary {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    background: rgba(22, 16, 60, 0.85) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
  }

  .round-summary > div,
  .round-summary .summary-stake,
  .round-summary .summary-reward {
    padding: 0 !important;
    border: 0 !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .round-summary span {
    font-size: 10px !important;
    color: #a79ac5 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    font-weight: 700 !important;
    display: block !important;
  }

  .round-summary strong {
    font-size: 16px !important;
    font-weight: 800 !important;
    margin-top: 2px !important;
    color: #ffffff !important;
    display: block !important;
    font-variant-numeric: tabular-nums !important;
  }

  .round-summary .reward-value {
    color: #34d399 !important;
  }

  .game-page .game-stage {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
  }

  .game-page .game-controls {
    grid-column: 1;
    grid-row: 4;
    gap: 6px;
  }

  .game-page .game-nav {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  .game-page .game-nav a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    background: rgba(26, 17, 69, 0.7) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    color: #c4b5fd !important;
    white-space: nowrap !important;
    text-decoration: none !important;
  }

  .game-page.visitor-mode .game-nav #game-account-link {
    display: none !important;
  }

  .game-page.visitor-mode .game-nav #game-exit-link {
    display: inline-flex !important;
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #0b0728 !important;
    font-weight: 800 !important;
    padding: 0 10px !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35) !important;
  }

  .game-page .game-nav .deposit-link {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4) !important;
    border: none !important;
  }

  .game-page .game-sound {
    width: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    background: rgba(26, 17, 69, 0.8) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    color: #c4b5fd !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .game-page .game-sound b,
  .arena-menu {
    display: none !important;
  }

  .game-page.visitor-mode .stake-control,
  .visitor-mode .stake-control,
  .game-page .stake-control[hidden],
  .game-page .stake-control.is-disabled {
    display: none !important;
  }

  .game-page.visitor-mode .game-controls {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 4px 8px 8px !important;
    background: transparent !important;
    border: none !important;
  }

  .game-page.visitor-mode #apostar {
    width: 100% !important;
    max-width: 360px !important;
    min-height: 48px !important;
    height: 48px !important;
    font-size: 15px !important;
    margin: 0 auto !important;
  }

  .game-page .stake-control {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    background: rgba(13, 8, 38, 0.92) !important;
    border: 1px solid rgba(139, 92, 246, 0.22) !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .game-page .stake-stepper {
    width: 100% !important;
    height: 44px !important;
    display: grid !important;
    grid-template-columns: 46px 1fr 46px !important;
    align-items: center !important;
    background: #0b0728 !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  .game-page .stake-stepper button {
    min-width: 46px !important;
    width: 46px !important;
    min-height: 44px !important;
    height: 100% !important;
    background: #191044 !important;
    color: #c4b5fd !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s !important;
  }

  .game-page .stake-stepper button:active {
    background: #2b186d !important;
  }

  .game-page .stake-stepper > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 0 6px !important;
  }

  .game-page .stake-stepper span {
    display: none !important;
  }

  .game-page .stake-input-wrapper {
    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  .game-page .stake-input-wrapper b {
    font-size: 14px !important;
    color: #a78bfa !important;
    font-weight: 700 !important;
  }

  .game-page .stake-input-wrapper input {
    width: 80px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  .game-page .stake-chips {
    grid-column: auto !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px !important;
  }

  .game-page .stake-chips button {
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 2px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    background: #16103c !important;
    border: 1px solid rgba(139, 92, 246, 0.22) !important;
    color: #c4b5fd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
  }

  .game-page .stake-chips button.active {
    background: #7c3aed !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.45) !important;
  }

  .game-page .stake-chips button[data-stake-custom] {
    font-size: 10px !important;
    letter-spacing: -0.02em !important;
  }

  .game-page #apostar {
    min-height: 48px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    letter-spacing: 0.03em !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
  }

  .game-page .game-tip {
    position: relative !important;
    inset: auto !important;
    width: calc(100% - 12px) !important;
    max-width: 440px !important;
    margin: 0 auto 6px auto !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
  }

  .game-deposit-modal {
    padding: 10px;
  }

  .game-deposit-modal .modal-card {
    padding: 16px 14px;
  }

  .game-deposit-modal .modal-head {
    margin-bottom: 4px;
  }

  .game-deposit-modal .modal-head h2 {
    font-size: 22px;
  }

  .deposit-intro {
    margin-bottom: 10px;
  }

  .deposit-values {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .deposit-values button {
    min-height: 38px;
    padding: 0 3px;
    font-size: 9px;
  }

  .deposit-input {
    min-height: 44px;
  }

  .deposit-input input {
    min-height: 40px;
    font-size: 15px;
  }

  .game-deposit-modal .deposit-submit {
    min-height: 46px;
  }

  .deposit-later {
    min-height: 32px;
    margin-top: 5px;
  }
}

@media (max-width: 410px) {
  .game-topbar .header-wallet {
    min-width: 62px;
  }

  .game-page:not(.visitor-mode) .game-nav #game-account-link {
    padding-inline: 6px;
    font-size: 9px;
  }

  .game-page .game-nav #game-exit-link {
    padding-inline: 5px;
  }
}

@media (max-height: 700px) and (max-width: 767px) {
  .round-summary {
    padding-block: 4px;
  }

  .round-summary strong,
  .round-summary .reward-value,
  .round-summary .score-value {
    font-size: 13px;
  }

  .round-summary span {
    font-size: 8px;
  }

  .game-page .stake-chips button {
    min-height: 32px;
  }

  .game-page .stake-stepper {
    height: 36px;
  }

  .game-page .stake-stepper button {
    min-height: 34px;
  }

  .game-page #apostar {
    min-height: 40px;
  }
}

/* Checkout PIX: hierarquia curta e legível, inspirada em carteiras de apostas. */
.game-deposit-modal { background: rgba(4, 6, 20, .78); backdrop-filter: blur(8px); }
.game-deposit-modal .modal-card { width: min(460px, calc(100% - 24px)); padding: 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: linear-gradient(150deg,#161138,#0b1029 68%); box-shadow: 0 24px 70px rgba(0,0,0,.52); }
.deposit-head { align-items: flex-start; }
.deposit-head h2 { font-size: 25px; line-height: 1.1; }
.deposit-head p { margin: 7px 0 0; color: #aeb7d7; font-size: 13px; }
.deposit-assurance { display: flex; gap: 8px; margin: 15px 0; }
.deposit-assurance span { flex: 1; padding: 8px 7px; border-radius: 9px; background: rgba(93,211,154,.1); color: #9de7b8; font-size: 10px; font-weight: 800; text-align: center; }
.deposit-fields { gap: 12px; }
.deposit-amount-label { color: #f5f7ff; font-size: 13px; font-weight: 800; }
.deposit-values { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.deposit-values button { min-height: 44px; border-radius: 10px; background: #151d43; color: #dbe2ff; font-size: 11.5px; font-weight: 800; padding: 0 2px; white-space: nowrap; }
.deposit-values button.active { border-color: #65d8ff; background: rgba(101,216,255,.14); color: #71ddff; box-shadow: inset 0 0 0 1px rgba(101,216,255,.18); }
.deposit-main-input { min-height: 62px; margin: 0; border-color: rgba(101,216,255,.45); border-radius: 13px; background: #070c20; }
.deposit-main-input b { font-size: 19px; }
.deposit-main-input input { min-height: 58px; font-size: 26px; }
.deposit-identification { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deposit-identification label { color: #c4cbea; font-size: 11px; font-weight: 700; }
.deposit-identification .deposit-input { min-height: 48px; margin-top: 6px; padding-inline: 10px; border-radius: 10px; background: #0a0f28; }
.deposit-identification .deposit-input input { min-height: 44px; font-size: 14px; }
.game-deposit-modal .deposit-submit { min-height: 54px; border-radius: 12px; background: linear-gradient(180deg,#6be7ff,#28bbed); box-shadow: 0 4px 0 #147ba6; color: #051522; font-size: 13px; letter-spacing: .03em; }
.deposit-pix { padding: 13px; border-radius: 12px; background: rgba(72,214,143,.08); }
.deposit-pix strong { color: #c7ffd9; font-size: 12px; line-height: 1.35; }
.deposit-pix textarea { min-height: 74px; padding: 10px; }
.deposit-pix button { min-height: 44px; border-radius: 9px; background: #273a77; color: #fff; font-weight: 800; }
.deposit-legal { margin: 10px 0 0; color: #7f8aad; font-size: 10px; line-height: 1.4; text-align: center; }
.deposit-later { color: #c4cbe8; font-size: 12px; }
@media (max-width: 480px), (max-height: 760px) {
  .game-deposit-modal .modal-card { max-height: calc(100dvh - 16px); padding: 16px; overflow: hidden; }
  .deposit-head h2 { font-size: 22px; }
  .deposit-head p { font-size: 11px; }
  .deposit-assurance { margin: 9px 0; }
  .deposit-values { gap: 4px; }
  .deposit-values button { min-height: 38px; font-size: 10px; padding: 0 1px; }
  .deposit-main-input { min-height: 52px; }
  .deposit-main-input input { min-height: 48px; font-size: 22px; }
  .deposit-identification .deposit-input { min-height: 42px; }
  .deposit-identification .deposit-input input { min-height: 38px; font-size: 12px; }
  .game-deposit-modal .deposit-submit { min-height: 48px; }
  .deposit-legal { margin-top: 6px; font-size: 9px; }
}

/* Modal de Boas-Vindas e Celebração de Conta Criada */
.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 4, 25, 0.88);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.welcome-modal.open {
  opacity: 1;
  visibility: visible;
}

.welcome-card {
  width: min(400px, calc(100% - 16px));
  box-sizing: border-box;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(180deg, #161239 0%, #0d0925 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.65), 0 0 35px rgba(255, 215, 0, 0.15);
  padding: 24px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-modal.open .welcome-card {
  transform: scale(1) translateY(0);
}

.welcome-header {
  margin-bottom: 18px;
}

.welcome-badge-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
}

.welcome-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, rgba(251, 191, 36, 0.25) 50%, transparent 75%);
  filter: blur(8px);
  animation: welcome-pulse-glow 2.5s infinite ease-in-out;
}

@keyframes welcome-pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.18); opacity: 1; }
}

.welcome-icon-circle {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #191444 0%, #0b0722 100%);
  border: 2px solid rgba(251, 191, 36, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.welcome-check-svg {
  width: 58px;
  height: 58px;
  animation: welcome-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes welcome-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.welcome-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.welcome-card h2 {
  font-size: 21px;
  color: #ffffff;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.welcome-lead {
  font-size: 13px;
  color: #c9c3e6;
  margin: 0 0 16px;
  line-height: 1.45;
}

.welcome-user-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(183, 158, 247, 0.15);
  margin-bottom: 14px;
  text-align: left;
  box-sizing: border-box;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
  border: 1.5px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  font-weight: 700;
}

.user-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-label {
  display: block;
  font-size: 10px;
  color: #a49bc7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.user-email {
  display: block;
  font-size: 12px;
  color: #ffffff;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge-online {
  font-size: 10px;
  color: #34d399;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot-sm {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
}

@media (max-width: 420px) {
  .welcome-card {
    padding: 20px 14px;
    width: min(390px, calc(100% - 12px));
  }
  .welcome-user-box {
    padding: 8px 10px;
    gap: 6px;
  }
  .user-badge-online {
    padding: 2px 5px;
    font-size: 9px;
  }
}

.welcome-bonus-box {
  position: relative;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  margin-bottom: 20px;
  text-align: left;
}

.bonus-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fbbf24;
  margin-bottom: 6px;
}

.bonus-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bonus-val {
  font-size: 26px;
  font-weight: 900;
  color: #fbbf24;
  line-height: 1;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.bonus-text strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
  font-weight: 800;
  margin-bottom: 2px;
}

.bonus-text span {
  display: block;
  font-size: 11px;
  color: #d1cbe8;
  line-height: 1.35;
}

.welcome-deposit-selector {
  margin: 0 0 16px;
  text-align: left;
}

.welcome-deposit-heading {
  font-size: 11px;
  color: #a49bc7;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}

.welcome-deposit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.welcome-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(183, 158, 247, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  color: inherit;
}

.welcome-tier-card:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.welcome-tier-card.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16) 0%, rgba(16, 185, 129, 0.12) 100%);
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.28);
}

.welcome-tier-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #c9c3e6;
  margin-bottom: 4px;
}

.welcome-tier-badge.popular {
  background: rgba(251, 191, 36, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.welcome-tier-val {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.welcome-tier-sub {
  font-size: 10px;
  color: #a49bc7;
  margin-top: 3px;
  line-height: 1.25;
}

.welcome-tier-sub strong {
  color: #34d399;
}

.welcome-actions {
  display: grid;
  gap: 10px;
}

.btn-welcome-deposit {
  min-height: 52px;
  border-radius: 13px;
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.45) !important;
  cursor: pointer !important;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-welcome-deposit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(16, 185, 129, 0.65) !important;
}

.btn-welcome-skip {
  min-height: 38px;
  background: transparent !important;
  border: 0 !important;
  color: #a49bc7 !important;
  font-size: 12px !important;
  cursor: pointer !important;
}

.btn-welcome-skip:hover {
  color: #ffffff !important;
}

/* Badge no modal de depósito */
.deposit-logged-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 10px 0 6px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11px;
  color: #c7ffd9;
  max-width: 100%;
  box-sizing: border-box;
}

#deposit-user-email {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.deposit-bonus-tag {
  color: #fbbf24;
  font-weight: 800;
  white-space: nowrap;
}

/* Mobile: o tabuleiro e a acao principal recebem a maior parte da tela. */
@media (max-width: 767px) {
  /* `hidden` e `is-disabled` precisam vencer o display forçado do layout
     mobile. Sem isso, o seletor continuava ocupando espaco durante a rodada. */
  .game-page .stake-control[hidden],
  .game-page .stake-control.is-disabled {
    display: none !important;
  }

  .game-page .round-summary {
    gap: 4px 8px !important;
    padding: 4px 9px !important;
  }

  .game-page .round-summary span {
    font-size: 9px !important;
  }

  .game-page .round-summary strong {
    font-size: 14px !important;
    line-height: 1.15 !important;
  }

  .game-page .round-summary .visitor-progress {
    padding-top: 3px !important;
    margin-top: 1px !important;
  }

  .game-page .visitor-progress-info {
    margin-bottom: 2px !important;
  }

  .game-page .visitor-progress-bar {
    height: 4px !important;
  }

  /* O tutorial participa do fluxo: nunca cobre o tabuleiro. Enquanto estiver
     aberto, o resumo redundante sai para entregar mais area util ao jogo. */
  .game-page:has(.game-tip:not([hidden])) .round-summary {
    display: none !important;
  }

  .game-page .game-stage:has(.game-tip:not([hidden])) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
  }

  .game-page .game-stage:has(.game-tip:not([hidden])) #jogo {
    grid-row: 2;
    justify-self: center;
    min-height: 0;
  }

  .game-page .game-tip:not([hidden]) {
    position: relative;
    inset: auto;
    grid-row: 1;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 6px 8px;
    gap: 7px;
  }

  .game-page .game-tip p {
    min-width: 0;
  }

  .game-page .game-tip p strong {
    font-size: 12px;
  }

  .game-page .game-tip p span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-page .game-tip button {
    min-height: 40px;
    padding: 0 14px;
  }
}

@media (max-width: 410px) {
  /* Na rodada visitante, priorizar 'Criar conta' e ocultar 'Entrar' para não cortar na viewport. */
  .game-page.visitor-mode .game-nav #game-account-link {
    display: none !important;
  }
}
