/* ============================================================
   RESET / BASE
   ============================================================ */
* {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* ============================================================
   INPUTS / BOTÕES
   ============================================================ */
.inp {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: #f1f5f9;
  outline: none;
  transition: border-color .15s;
}
.inp:focus { border-color: #f59e0b; }

.lbl {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.btn-primary, .btn-secondary, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  font-weight: 800;
  transition: all .15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #f59e0b;
  color: #0f172a;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px -6px rgba(245,158,11,.5);
}
.btn-primary:hover { background: #fbbf24; }
.btn-primary:disabled { opacity: .5; cursor: wait; }

.btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  border: 1px solid #334155;
}
.btn-secondary:hover { background: #334155; }

.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: #334155;
  color: #f1f5f9;
  font-size: 0.9rem;
  border-radius: 0.6rem;
  flex-shrink: 0;
}
.btn-icon:hover { background: #475569; }

/* ============================================================
   TELA DE AUTH
   ============================================================ */
.auth-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
  margin: auto;
  padding: 0 1rem;
}
.auth-brand { text-align: center; }

@media (min-width: 768px) and (orientation: landscape) {
  .auth-wrapper {
    flex-direction: row;
    max-width: 60rem;
    align-items: center;
    gap: 3rem;
    padding: 0 2rem;
  }
  .auth-brand { flex: 0 0 40%; text-align: center; }
  .auth-forms { flex: 1; }
}

/* ============================================================
   CÉLULAS DA CARTELA
   ============================================================ */
.bingo-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 0.6rem;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.bingo-cell:hover { background: #334155; }

.bingo-cell.marcada {
  background: #f59e0b !important;
  color: #0f172a !important;
  border-color: #d97706 !important;
  transform: scale(.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.3);
}

.bingo-cell.win-highlight {
  animation: pulse-win 0.9s ease-in-out infinite alternate;
  border-color: aquamarine !important;
}
@keyframes pulse-win {
  from { box-shadow: 0 0 0 2px #f59e0b, 0 0 10px rgba(245,158,11,.45); }
  to   { box-shadow: 0 0 0 4px #fbbf24, 0 0 26px rgba(251,191,36,.85); }
}

/* ---------- Casa FREE (formato de estrela) ---------- */
.bingo-cell.free {
  background: black !important;
  color: whitesmoke !important;
  cursor: default;
  padding: 0;
  clip-path: polygon(
    50% 4%,
    62% 38%, 98% 38%,
    68% 59%, 78% 94%,
    50% 73%, 22% 94%,
    32% 59%, 2% 38%, 38% 38%
  );
  border-radius: 0 !important;
  border: none !important;
}

.bingo-cell.free.free-win {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: black !important;
}

.bingo-cell.free.free-win-super {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: whitesmoke !important;
}

.free-content {
  font-weight: 900;
  line-height: 1;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ---------- Brinde na casa FREE ---------- */
.free-content.free-number {
  font-size: 1.35rem;
  color: aqua;
}

.free-content.free-super {
  font-size: 1.5rem;
}

.free-content.free-empty {
  width: 60%;
  height: 60%;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.28), transparent 70%);
  border-radius: 50%;
}

.bingo-cell.free.free-lost {
  filter: grayscale(1);
  opacity: 0.55;
}
/* ============================================================
   BOLINHAS DO HISTÓRICO
   ============================================================ */
.mini-bola {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .72rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

/* ============================================================
   LAYOUT DA SALA
   ============================================================ */
.room-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

@media (min-width: 768px) {
  .room-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .room-grid.host-mode {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
}

/* ============================================================
   SCROLLBARS DISCRETAS
   ============================================================ */
#admin-board::-webkit-scrollbar,
#monitor-list::-webkit-scrollbar,
#history::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}
#admin-board::-webkit-scrollbar-thumb,
#monitor-list::-webkit-scrollbar-thumb,
#history::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}