* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, #1e1b4b, #0f172a);
  color: #f8fafc;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 48px;
}

header h1 {
  text-align: center;
  font-size: 2rem;
  margin: 8px 0 20px;
}

.view {
  display: block;
}

.hidden {
  display: none !important;
}

.card-panel {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-panel.center {
  align-items: center;
  text-align: center;
}

label {
  font-size: 0.85rem;
  color: #cbd5e1;
}

input {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.room-code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-weight: bold;
}

.btn {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 6px;
  -webkit-tap-highlight-color: transparent;
}

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #facc15;
  color: #1e1b4b;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.divider {
  text-align: center;
  color: #94a3b8;
  margin: 6px 0;
}

.room-code-display {
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 8px;
  text-align: center;
  color: #facc15;
}

.hint {
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
}

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

.player-list li {
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
}

.player-list .host-tag {
  color: #facc15;
  font-size: 0.75rem;
}

.turn-banner {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  font-weight: 600;
}

.turn-banner.my-turn {
  background: #16a34a;
}

.last-ball {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #facc15;
}

.bingo-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.bingo-headers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  text-align: center;
  font-weight: bold;
  font-size: 1.3rem;
  color: #facc15;
  margin-bottom: 6px;
}

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

.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1rem;
  font-weight: 600;
}

.bingo-cell.marked {
  background: #16a34a;
  color: #fff;
}

.bingo-cell.free {
  background: #facc15;
  color: #1e1b4b;
}

.called-history {
  margin-top: 16px;
}

.called-history h3 {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.called-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.called-ball {
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 100;
  font-size: 0.9rem;
  max-width: 90%;
  text-align: center;
}
