:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --gold: #f59e0b;
  --gold-dark: #d97706;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 32px 0 28px;
}
.hero-wheel { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.hero h1 {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--gold), #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: var(--text-muted); margin-top: 6px; font-size: 1rem; }

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}
.hidden { display: none !important; }

/* Field */
.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #64748b; }

/* Rounds toggle */
.rounds-toggle { display: flex; gap: 8px; }
.round-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #334155;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.round-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(245,158,11,0.1);
}
.round-btn:hover:not(.active) { border-color: #475569; color: var(--text); }

/* Round phrase inputs */
.round-field {
  margin-bottom: 16px;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
}
.round-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}
.round-field input {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s;
  font-family: inherit;
}
.round-field input:focus {
  outline: none;
  border-color: var(--gold);
}

/* Textarea */
textarea {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}
textarea:focus { outline: none; border-color: var(--gold); }

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  border-radius: 10px;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(245,158,11,0.15);
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(245,158,11,0.25); }

.btn-outline {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1.5px solid #334155;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-copy {
  display: block;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-copy:hover { border-color: var(--gold); color: var(--gold); }

/* Error */
.error-msg {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  border-radius: 6px;
  border-left: 3px solid var(--error);
}

/* Result screen */
.room-code-badge {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #1e293b;
}
.badge-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.room-code {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.tv-link-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #334155;
}
.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.link-box {
  display: block;
  padding: 12px 14px;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 8px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
  transition: border-color 0.15s;
}
.link-box:hover { border-color: var(--gold); }

/* QR grid */
.qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}
.qr-card {
  background: #0f172a;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.qr-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.qr-card img {
  width: 100%;
  max-width: 180px;
  border-radius: 8px;
  background: white;
  padding: 4px;
  display: block;
  margin: 0 auto 10px;
}
.qr-url {
  font-size: 0.65rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 10px;
}
