/* =============================================================
   SUSUN HURUF - Game Show Style CSS
   ============================================================= */

:root {
  --primary: #ff7a18;
  --primary-dark: #e76500;
  --secondary: #0f6cbd;
  --secondary-light: #2b86d4;
  --accent: #d79a00;
  --accent-dark: #b67f00;
  --success: #16a34a;
  --success-dark: #15803d;
  --danger: #e11d48;
  --danger-dark: #be123c;
  --bg-dark: #f4f8ff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #eef5ff;
  --bg-input: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #d7e3f4;
  --vowel-color: #9a6c00;
  --vowel-bg: #fff4c7;
  --consonant-color: #0f6cbd;
  --consonant-bg: #e3f0ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 45px rgba(30, 41, 59, 0.08);
  --shadow-lg: 0 24px 60px rgba(30, 41, 59, 0.14);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    linear-gradient(180deg, #f8fbff 0%, #f4fff7 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Background Pattern ---- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 122, 24, 0.16) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 10%, rgba(15, 108, 189, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(22, 163, 74, 0.09) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ---- Navigation ---- */
.navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.navbar-brand .icon {
  font-size: 1.5rem;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-tabs li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tabs li a:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-tabs li a.active {
  color: var(--secondary);
  background: rgba(15, 108, 189, 0.12);
}

/* ---- Pages ---- */
.page {
  display: none;
  padding: 32px 0;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hero-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 40px;
  min-width: 180px;
  border-radius: 16px;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.hero-action:hover {
  transform: translateY(-3px);
}

.hero-action-host {
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
}

.hero-action-play {
  background: linear-gradient(135deg, #22c55e, #15803d);
}

.hero-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-letter {
  width: 64px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  border-radius: var(--radius-sm);
  animation: floatLetter 2s ease-in-out infinite;
  border: 2px solid;
}

.hero-letter.vowel {
  background: var(--vowel-bg);
  color: var(--vowel-color);
  border-color: rgba(247, 201, 72, 0.3);
}

.hero-letter.consonant {
  background: var(--consonant-bg);
  color: var(--consonant-color);
  border-color: rgba(88, 166, 255, 0.3);
}

.hero-letter:nth-child(1) { animation-delay: 0s; }
.hero-letter:nth-child(2) { animation-delay: 0.15s; }
.hero-letter:nth-child(3) { animation-delay: 0.3s; }
.hero-letter:nth-child(4) { animation-delay: 0.45s; }
.hero-letter:nth-child(5) { animation-delay: 0.6s; }

@keyframes floatLetter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---- Cards & Panels ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.15rem;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary-light);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #1a1a2e;
  box-shadow: 0 4px 15px rgba(247, 201, 72, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(247, 201, 72, 0.4);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 53, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.form-input-lg {
  padding: 16px 20px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---- Letter Distribution Table ---- */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.letter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  border: 2px solid;
  text-align: center;
  transition: var(--transition);
}

.letter-card.vowel {
  background: var(--vowel-bg);
  border-color: rgba(247, 201, 72, 0.3);
}

.letter-card.consonant {
  background: var(--consonant-bg);
  border-color: rgba(88, 166, 255, 0.3);
}

.letter-card .letter {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.letter-card.vowel .letter {
  color: var(--vowel-color);
}

.letter-card.consonant .letter {
  color: var(--consonant-color);
}

.letter-card .count {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
  opacity: 0.8;
}

.letter-card .count-input {
  width: 48px;
  padding: 4px;
  text-align: center;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 8px;
}

.letter-card .count-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(244,248,255,0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-box .stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-box .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-box.accent .stat-value { color: var(--accent); }
.stat-box.success .stat-value { color: var(--success); }
.stat-box.secondary .stat-value { color: var(--consonant-color); }

/* ---- Timer ---- */
.timer-container {
  text-align: center;
  padding: 40px 20px;
}

.timer-display {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
  transition: color 0.3s;
}

.timer-display.warning {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(247, 201, 72, 0.3);
}

.timer-display.danger {
  color: var(--danger);
  text-shadow: 0 0 40px rgba(255, 23, 68, 0.3);
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.timer-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 24px;
}

.timer-progress {
  width: 100%;
  max-width: 600px;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  margin: 0 auto 32px;
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--accent), var(--danger));
  border-radius: 4px;
  transition: width 0.25s linear;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- Round Info ---- */
.round-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(247, 201, 72, 0.15);
  border: 1px solid rgba(247, 201, 72, 0.3);
  border-radius: 20px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* ---- Team Panels ---- */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.team-panel {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.team-panel.active-team {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}

.team-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.team-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.team-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
}

.team-body {
  padding: 16px 20px;
}

.team-letters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.team-letter-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid;
}

.team-letter-badge.vowel {
  background: var(--vowel-bg);
  color: var(--vowel-color);
  border-color: rgba(247, 201, 72, 0.3);
}

.team-letter-badge.consonant {
  background: var(--consonant-bg);
  color: var(--consonant-color);
  border-color: rgba(88, 166, 255, 0.3);
}

.team-words {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

.team-words li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
  font-size: 0.9rem;
}

.team-words li:last-child {
  border-bottom: none;
}

.team-words .word-text {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.team-words .word-points {
  color: var(--success);
  font-weight: 700;
}

.word-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
  opacity: 0.6;
}

.word-remove:hover {
  opacity: 1;
}

/* ---- Word Input ---- */
.word-input-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.word-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.word-input-row .form-select {
  width: auto;
  min-width: 160px;
}

.word-input-row .form-input {
  flex: 1;
  min-width: 200px;
}

.validation-result {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-weight: 600;
  display: none;
}

.validation-result.valid {
  display: block;
  background: rgba(0, 200, 83, 0.15);
  border: 1px solid rgba(0, 200, 83, 0.3);
  color: var(--success);
}

.validation-result.invalid {
  display: block;
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid rgba(255, 23, 68, 0.3);
  color: var(--danger);
}

.validation-result.manual {
  display: block;
  background: rgba(247, 201, 72, 0.15);
  border: 1px solid rgba(247, 201, 72, 0.3);
  color: var(--accent);
}

/* ---- Scoreboard ---- */
.scoreboard {
  margin: 20px 0;
}

.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
}

.scoreboard-table th,
.scoreboard-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.scoreboard-table th {
  background: #eef5ff;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.scoreboard-table td {
  font-size: 1rem;
}

.scoreboard-table .team-col {
  text-align: left;
  font-weight: 700;
}

.scoreboard-table .total-col {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent);
}

.scoreboard-table tr.winner {
  background: rgba(215, 154, 0, 0.1);
}

.scoreboard-table tr.winner .team-col::after {
  content: ' \1F3C6';
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
}

.rank-1 { background: #FFD700; color: #1a1a2e; }
.rank-2 { background: #C0C0C0; color: #1a1a2e; }
.rank-3 { background: #CD7F32; color: #1a1a2e; }
.rank-other { background: var(--bg-input); color: var(--text-secondary); }

/* ---- Winner Celebration ---- */
.winner-banner {
  text-align: center;
  padding: 40px;
  margin: 20px 0;
  background: linear-gradient(135deg, rgba(247,201,72,0.1), rgba(255,107,53,0.1));
  border: 2px solid rgba(247, 201, 72, 0.3);
  border-radius: var(--radius);
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 12px;
}

.winner-name {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
}

.winner-score {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* ---- Rules Section ---- */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.rule-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.rule-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.1rem;
}

.rule-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.rule-text strong {
  color: var(--text-primary);
}

/* ---- Print Cards Page ---- */
.print-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.print-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.print-card {
  aspect-ratio: 3/4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 3px solid;
  position: relative;
  page-break-inside: avoid;
}

.print-card.vowel {
  background: linear-gradient(135deg, #FFF8E1, #FFF3C4);
  border-color: #F7C948;
}

.print-card.consonant {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border-color: #58A6FF;
}

.print-card .card-letter {
  font-size: 8rem;
  font-weight: 900;
  line-height: 1;
}

.print-card.vowel .card-letter { color: #B8860B; }
.print-card.consonant .card-letter { color: #1565C0; }

.print-card .card-type {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.print-card.vowel .card-type { color: #D4A830; }
.print-card.consonant .card-type { color: #42A5F5; }

.print-card .card-corner {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 800;
  opacity: 0.3;
}

.print-card .card-corner.tl { top: 12px; left: 16px; }
.print-card .card-corner.br { bottom: 12px; right: 16px; transform: rotate(180deg); }

/* ---- Alert / Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--accent); }

/* ---- Konfetti Effect ---- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- Print Styles ---- */
@media print {
  body {
    background: white !important;
    color: black !important;
  }

  .navbar, .no-print, .btn, .timer-controls, .word-input-section {
    display: none !important;
  }

  .page { display: block !important; }

  .print-preview {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .print-card {
    break-inside: avoid;
    min-height: 300px;
  }

  .card {
    box-shadow: none;
    border-color: #ddd;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    padding: 40px 10px;
  }

  .hero-letter {
    width: 48px;
    height: 60px;
    font-size: 1.5rem;
  }

  .timer-display {
    font-size: 5rem;
  }

  .teams-grid {
    grid-template-columns: 1fr;
  }

  .word-input-row {
    flex-direction: column;
  }

  .word-input-row .form-select,
  .word-input-row .form-input {
    width: 100%;
  }

  .kamus-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .kamus-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .kamus-group-title {
    top: 124px;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #edf3fb;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Misc ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-vowel {
  background: var(--vowel-bg);
  color: var(--vowel-color);
  border: 1px solid rgba(215, 154, 0, 0.25);
}

.badge-consonant {
  background: var(--consonant-bg);
  color: var(--consonant-color);
  border: 1px solid rgba(15, 108, 189, 0.25);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-style: italic;
}

.kamus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.kamus-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kamus-filter-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.kamus-filter-btn:hover,
.kamus-filter-btn.active {
  background: rgba(15, 108, 189, 0.12);
  border-color: rgba(15, 108, 189, 0.25);
  color: var(--secondary);
}

.kamus-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.kamus-import-help {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: rgba(15, 108, 189, 0.06);
  border: 1px solid rgba(15, 108, 189, 0.12);
  border-radius: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.kamus-help-code {
  display: block;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  white-space: pre-line;
  font-family: Consolas, monospace;
  font-size: 0.9rem;
}

.kamus-help-link {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

.kamus-help-link:hover {
  text-decoration: underline;
}

.kamus-list {
  display: grid;
  gap: 16px;
}

.kamus-group {
  display: grid;
  gap: 10px;
}

.kamus-group-title {
  position: sticky;
  top: 72px;
  z-index: 2;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.14), rgba(15, 108, 189, 0.12));
  border: 1px solid rgba(15, 108, 189, 0.15);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.kamus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(244,248,255,0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.kamus-word-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kamus-word {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.kamus-source {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kamus-source-custom {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.kamus-source-dasar {
  background: rgba(15, 108, 189, 0.1);
  color: var(--secondary);
}

.kamus-source-tambahan {
  background: rgba(255, 122, 24, 0.12);
  color: var(--primary);
}

.kamus-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kamus-action-btn {
  border: 1px solid var(--border);
  background: white;
  color: var(--secondary);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.kamus-action-btn:hover {
  border-color: rgba(15, 108, 189, 0.25);
  background: rgba(15, 108, 189, 0.08);
}

.kamus-action-btn.danger {
  color: var(--danger);
}

.kamus-action-btn.danger:hover {
  border-color: rgba(225, 29, 72, 0.25);
  background: rgba(225, 29, 72, 0.08);
}

.kamus-action-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.kamus-inline-input {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 108, 189, 0.25);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  background: white;
}

.kamus-inline-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12);
}

.kamus-empty {
  background: rgba(255,255,255,0.72);
  border: 1px dashed var(--border);
  border-radius: 14px;
}
