*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0A0A14; --bg2: #12121F; --purple: #9B59B6; --gold: #D9A520;
  --green: #27AE60; --red: #E74C3C; --text: #E8E8E8; --muted: #888;
  --radius: 12px;
}
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; overscroll-behavior-y: contain;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 480px; margin: 0 auto; padding: 20px; }
.container.wide { max-width: 720px; }

h1, h2 { color: var(--gold); text-align: center; }
h1 { font-size: 1.8em; margin-bottom: 8px; }

.card {
  background: var(--bg2); border-radius: var(--radius);
  padding: 24px; margin: 16px 0;
  border: 1px solid rgba(155,89,182,0.2);
}

input, select {
  width: 100%; padding: 12px 16px; border-radius: 8px;
  border: 1px solid rgba(155,89,182,0.3); background: var(--bg);
  color: var(--text); font-size: 1em; margin-bottom: 12px;
}
input:focus, select:focus { outline: none; border-color: var(--purple); }

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 8px;
  border: none; font-size: 1em; font-weight: 600; cursor: pointer;
  text-align: center; width: 100%; transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-gold { background: var(--gold); color: #000; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--purple); color: var(--purple); }

.avatar {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--purple);
}
.avatar-lg { width: 128px; height: 128px; }

.error { color: var(--red); text-align: center; margin: 8px 0; font-size: 0.9em; }
.success { color: var(--green); text-align: center; margin: 8px 0; }
.muted { color: var(--muted); text-align: center; font-size: 0.9em; }

.logo { text-align: center; padding: 30px 0 10px; }
.logo span { font-size: 2.5em; }

.form-group { margin-bottom: 4px; }
.form-group label { display: block; margin-bottom: 4px; font-size: 0.9em; color: var(--muted); }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-row input { width: auto; margin: 0; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.game-card {
  background: var(--bg); border: 2px solid rgba(155,89,182,0.3);
  border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer;
  transition: border-color 0.2s;
}
.game-card.active, .game-card:hover { border-color: var(--gold); }
.game-card .emoji { font-size: 2em; }
.game-card .name { margin-top: 8px; font-weight: 600; }

.schedule-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.schedule-table th, .schedule-table td {
  padding: 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.schedule-table th { color: var(--gold); font-size: 0.85em; }
.del-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.2em; }

.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.85em; font-weight: 600;
}
.status-badge.live { background: var(--green); color: #fff; }
.status-badge.off { background: var(--muted); color: #fff; }

/* TV page */
.tv-display {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100vh; text-align: center;
}
.tv-display h1 { font-size: 3em; }
.tv-display .room-code { font-size: 5em; color: var(--gold); font-weight: 700; letter-spacing: 8px; }

.flex-center { display: flex; flex-direction: column; align-items: center; }

@media (min-width: 768px) {
  .container { padding: 40px 20px; }
}
