:root {
  /* PALET LIGHT MODE BERDASARKAN KARTU B-TRANS INDUSTRY */
  --bg-main: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;

  --border-color: rgba(9, 55, 96, 0.12);
  --border-focus: #093760;

  --text-main: #093760; /* Deep BTI Navy dari tipografi kartu */
  --text-body: #1e293b; /* Charcoal untuk teks isi yang sangat terbaca */
  --text-muted: #526b84; /* Muted slate navy */
  --text-dim: #7890a8;

  /* Kartu Hijau: Soft Sage / Matcha Green (#99c884) */
  --color-green: #99c884;
  --color-green-glow: rgba(153, 200, 132, 0.45);
  --color-green-dark: #6e9f58;

  /* Kartu Kuning: Warm Pastel Buttery Yellow (#fee47a) */
  --color-yellow: #fee47a;
  --color-yellow-glow: rgba(254, 228, 122, 0.45);
  --color-yellow-dark: #d6b83f;

  /* Kartu Merah: Dusty Coral Rose / Salmon (#e78b8b) */
  --color-red: #e78b8b;
  --color-red-glow: rgba(231, 139, 139, 0.45);
  --color-red-dark: #c26565;

  /* Warna Identitas & Tipografi Kartu */
  --color-bti-navy: #093760;
  --color-bti-coral: #ff5757;
  --color-primary: #093760;
  --color-primary-hover: #124a78;
  --color-accent: #fee47a;
  --color-gold: #f59e0b;
  --color-purple: #8b5cf6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(9, 55, 96, 0.08);
  --shadow-md: 0 4px 16px rgba(9, 55, 96, 0.08);
  --shadow-lg: 0 12px 32px rgba(9, 55, 96, 0.12);

  --font-sans: 'Nunito', 'Fredoka', system-ui, -apple-system, sans-serif;
  --font-heading: 'Fredoka', 'Nunito', cursive, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(254, 228, 122, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(153, 200, 132, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(231, 139, 139, 0.16) 0%, transparent 45%);
}

/* ==================== HEADER (LIGHT MODE) ==================== */
.app-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 10px rgba(9, 55, 96, 0.05);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  background: #093760;
  color: #ff5757;
  border: 2px solid #fee47a;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(9, 55, 96, 0.2);
}

.brand-info h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-bti-navy);
}

.brand-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Nav Tabs */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(9, 55, 96, 0.06);
}

.nav-btn.active {
  color: #fff;
  background: var(--color-bti-navy);
  box-shadow: 0 4px 14px rgba(9, 55, 96, 0.25);
}

.active-player-pill {
  font-size: 0.7rem;
  background: var(--color-yellow);
  color: #093760;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==================== BUTTONS & INPUTS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
}

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

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.65rem 1.35rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--color-bti-navy);
  color: #fff;
  border-color: rgba(9, 55, 96, 0.2);
}
.btn-primary:hover {
  background: #124a78;
  box-shadow: 0 4px 16px rgba(9, 55, 96, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-accent {
  background: var(--color-yellow);
  color: #093760;
  font-weight: 800;
  border: 1px solid #e5c448;
}
.btn-accent:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 14px rgba(254, 228, 122, 0.5);
}

.btn-success {
  background: var(--color-green);
  color: #093760;
  font-weight: 800;
  border: 1px solid #7cb166;
}
.btn-success:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 14px rgba(153, 200, 132, 0.5);
}

.btn-danger {
  background: var(--color-red);
  color: #ffffff;
  font-weight: 800;
  border: 1px solid #d16f6f;
}
.btn-danger:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 14px rgba(231, 139, 139, 0.5);
}

.btn-outline-danger {
  background: transparent;
  color: #c24141;
  border-color: #e78b8b;
}
.btn-outline-danger:hover {
  background: rgba(231, 139, 139, 0.15);
}

.btn-warning {
  background: var(--color-yellow);
  color: #093760;
  font-weight: 800;
  border: 1px solid #e5c448;
}
.btn-warning:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 14px rgba(254, 228, 122, 0.5);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border-color: #cbd5e1;
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--color-bti-navy);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(9, 55, 96, 0.06);
}

.icon-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #f8fafc;
  border-color: var(--color-bti-navy);
}

.text-danger {
  color: #c24141 !important;
}

/* ==================== MAIN CONTENT & VIEW PANELS ==================== */
.app-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-panel.active {
  display: block;
}

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.view-header h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Grid Layouts */
.grid-2-col {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .grid-2-col {
    grid-template-columns: 1fr;
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.input-inline {
  display: flex;
  gap: 0.5rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(9, 55, 96, 0.15);
  background: #ffffff;
}

.setup-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.quick-info-box {
  background: #fffdf2;
  border: 1px solid #fee47a;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #634b08;
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #e2e8f0;
}

.badge-accent {
  background: rgba(254, 228, 122, 0.3);
  color: #093760;
  border-color: #fee47a;
}

.badge-rank {
  background: rgba(254, 228, 122, 0.3);
  color: #093760;
  border-color: #fee47a;
}

.badge-clevel { background: rgba(254, 228, 122, 0.4); color: #7a5a08; border-color: #fee47a; }
.badge-vplevel { background: rgba(196, 167, 231, 0.35); color: #5b21b6; border-color: #c4a7e7; }
.badge-director { background: rgba(96, 165, 250, 0.25); color: #1e40af; border-color: #93c5fd; }
.badge-manager { background: rgba(106, 196, 248, 0.25); color: #0369a1; border-color: #7dd3fc; }
.badge-supervisor { background: rgba(45, 212, 191, 0.25); color: #0f766e; border-color: #5eead4; }
.badge-senior { background: rgba(153, 200, 132, 0.35); color: #2e621d; border-color: #99c884; }
.badge-specialist { background: rgba(231, 139, 139, 0.35); color: #9f2a2a; border-color: #e78b8b; }
.badge-junior { background: rgba(203, 213, 225, 0.5); color: #334155; border-color: #cbd5e1; }

.text-gold { color: #854d0e; }
.text-purple { color: #5b21b6; }
.text-blue { color: #1e40af; }
.text-cyan { color: #0369a1; }
.text-teal { color: #0f766e; }
.text-green { color: #2e621d; }
.text-orange { color: #9f2a2a; }
.text-muted { color: #526b84; }

/* Tables (Light Mode) */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.data-table, .level-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.data-table th, .level-table th {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  color: var(--text-main);
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.775rem;
  letter-spacing: 0.05em;
}

.data-table td, .level-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  color: var(--text-body);
}

.data-table tr:hover, .level-table tr:hover {
  background: #f8fafc;
}

.active-turn-row {
  background: #edf6ff !important;
  border-left: 4px solid var(--color-bti-navy);
}

.finished-player-row {
  opacity: 0.65;
  background: #f8fafc;
}

.score-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
}

/* Log Panel */
.game-log-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.game-log-panel h4 {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.log-list {
  list-style: none;
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.log-list li {
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--color-primary);
  background: #ffffff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
  color: #334155;
}

/* ==================== VIEW 2: GAMEPLAY (START) ==================== */
.turn-banner {
  background: linear-gradient(135deg, #093760, #144974);
  border: 1px solid rgba(254, 228, 122, 0.4);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(9, 55, 96, 0.16);
}

.turn-label {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--color-yellow);
  text-transform: uppercase;
}

.active-player-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin: 0.1rem 0;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.turn-next-info {
  text-align: right;
  background: rgba(255, 255, 255, 0.14);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.turn-next-info strong {
  display: block;
  font-size: 1.05rem;
  color: var(--color-yellow);
}

/* Game Arena Grid */
.game-arena {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1060px) {
  .game-arena {
    grid-template-columns: 1fr;
  }
}

/* Dice Section */
.dice-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
}

.dice-container {
  margin: 0.85rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.dice-box {
  width: 96px;
  height: 96px;
  background: #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(9, 55, 96, 0.12), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  border: 2px solid #cbd5e1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* Dice Colors: Murni Blok Warna diambil dari kartu */
.dice-box.dice-hijau {
  background: #99c884;
  border-color: #7ab863;
  box-shadow: 0 14px 30px rgba(153, 200, 132, 0.5), inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

.dice-box.dice-kuning {
  background: #fee47a;
  border-color: #e5c448;
  box-shadow: 0 14px 30px rgba(254, 228, 122, 0.5), inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

.dice-box.dice-merah {
  background: #e78b8b;
  border-color: #d46c6c;
  box-shadow: 0 14px 30px rgba(231, 139, 139, 0.5), inset 0 2px 8px rgba(255, 255, 255, 0.5);
}

/* Rolling Animation */
.dice-box.rolling {
  animation: diceRoll 0.8s ease-in-out infinite;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(0.95); }
  25% { transform: rotate(90deg) scale(1.1) translateY(-8px); }
  50% { transform: rotate(180deg) scale(0.95); }
  75% { transform: rotate(270deg) scale(1.1) translateY(-4px); }
  100% { transform: rotate(360deg) scale(1); }
}

.dice-result-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 2px solid var(--border-color);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}

.dice-points-tag {
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-main);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

/* Mini Leaderboard di Kolom Kiri */
.mini-leaderboard-box {
  margin-top: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  width: 100%;
  text-align: left;
}

.mini-lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
}

.mini-lb-header h4 {
  font-size: 0.875rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

.mini-lb-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}

.mini-lb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  transition: all 0.2s ease;
}

.mini-lb-item.active-mini-player {
  background: #edf6ff;
  border-color: #93c5fd;
  border-left: 3px solid var(--color-bti-navy);
  font-weight: 700;
}

.mini-lb-item.finished-mini-player {
  opacity: 0.6;
}

.mini-lb-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
}

.mini-lb-rank {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.775rem;
}

.mini-lb-name {
  color: var(--text-main);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.mini-badge-turn {
  font-size: 0.65rem;
  background: var(--color-yellow);
  color: #093760;
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.mini-badge-finish {
  font-size: 0.65rem;
  background: var(--color-green);
  color: #093760;
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.mini-lb-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-lb-points {
  font-weight: 800;
  color: var(--text-main);
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
}

.mini-lb-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.empty-mini-lb {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem;
}

/* ==================== CARD DISPLAY & ARENA BODY (SIDE-BY-SIDE) ==================== */
.card-display-section {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Layout Side-by-Side: Kartu Portrait di Kiri, Aksi di Kanan */
.card-arena-body {
  display: grid;
  grid-template-columns: minmax(380px, 420px) 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .card-arena-body {
    grid-template-columns: 1fr;
  }
}

.card-viewport {
  width: 100%;
  max-width: 420px;
  height: 570px;
  min-height: 570px;
  margin-bottom: 0;
  perspective: 1200px;
  margin: 0 auto;
}

/* Placeholder */
.card-placeholder {
  width: 100%;
  max-width: 420px;
  height: 570px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  color: var(--text-body);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.card-placeholder h4 {
  font-size: 1.3rem;
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 3D Flip Card Container - Format Portrait */
.flip-card-wrapper {
  width: 100%;
  max-width: 420px;
  height: 570px;
  perspective: 1200px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(9, 55, 96, 0.15);
  border: 3px solid #cbd5e1;
  background: #ffffff;
}

.card-front {
  background: #ffffff;
  border-color: #cbd5e1;
}

.card-back {
  background: #ffffff;
  transform: rotateY(180deg);
  border-color: #99c884;
}

.card-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  padding: 0 0.25rem;
}

.card-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-badge.badge-hijau {
  background: var(--color-green);
  color: #093760;
  border: 1px solid #7cb166;
}
.card-badge.badge-kuning {
  background: var(--color-yellow);
  color: #093760;
  border: 1px solid #e5c448;
}
.card-badge.badge-merah {
  background: var(--color-red);
  color: #ffffff;
  border: 1px solid #d16f6f;
}
.card-badge.badge-answer {
  background: var(--color-yellow);
  color: #093760;
  border: 1px solid #e5c448;
}

.card-number-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.card-media-box {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: transparent;
  position: relative;
  border: none;
  padding: 0;
}

.card-image {
  width: 100%;
  height: 100%;
  max-height: 490px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(9, 55, 96, 0.1);
}

.card-fallback-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
  gap: 0.75rem;
  height: 100%;
}

.fallback-icon {
  font-size: 2.75rem;
}

.card-fallback-content h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-main);
}

.card-fallback-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 320px;
}

.card-points-pill {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.825rem;
  border: 1px solid #cbd5e1;
}

.card-points-pill.bg-success {
  background: rgba(153, 200, 132, 0.25);
  color: #2e621d;
  border: 1px solid #99c884;
}

.card-points-pill.bg-gold {
  background: rgba(254, 228, 122, 0.35);
  color: #7a5a08;
  border: 1px solid #fee47a;
}

.card-footer-caption {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Challenge Card */
.challenge-card-wrapper {
  width: 100%;
  max-width: 420px;
  height: 570px;
}

.challenge-card {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.18);
  border: 3px solid #f59e0b;
  background: #fffdf5;
}

/* ==================== CARD CONTROLS (PANEL AKSI DI SAMPING KARTU) ==================== */
.card-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  min-height: 570px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.action-guide-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  text-align: left;
}

.guide-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guide-icon {
  font-size: 2.75rem;
}

.guide-text h4 {
  font-size: 1.25rem;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.guide-text p {
  font-size: 0.925rem;
  color: var(--text-muted);
}

.guide-rule-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.25rem;
}

.rule-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rule-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(9, 55, 96, 0.06);
}

.rule-card.rule-hijau { border-left: 4px solid var(--color-green); }
.rule-card.rule-kuning { border-left: 4px solid var(--color-yellow); }
.rule-card.rule-merah { border-left: 4px solid var(--color-red); }
.rule-card.rule-challenge { border-left: 4px solid #f59e0b; }

.rule-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.rule-pts {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-bti-navy);
}

.rule-desc {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.action-step-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.action-step-header h4 {
  font-size: 1.2rem;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.step-badge {
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--color-bti-navy);
  color: #fff;
}

.step-badge.badge-warning {
  background: #f59e0b;
  color: #000;
}

.action-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.post-answer-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(9, 55, 96, 0.05);
}

.post-answer-status {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.post-answer-status.status-correct {
  border-left: 5px solid var(--color-green);
  background: #f4faf2;
}

.post-answer-status.status-correct .status-icon {
  color: #2e621d;
}

.post-answer-status.status-wrong {
  border-left: 5px solid var(--color-red);
  background: #fdf5f5;
}

.post-answer-status.status-wrong .status-icon {
  color: #c24141;
}

.status-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.status-text h4 {
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.status-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-group-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.picker-instruction {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
}

.challenge-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-category {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-category:hover {
  background: #fffdf5;
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.btn-category-random {
  grid-column: span 2;
  text-align: center;
}

.picker-instruction {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}

.challenge-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-category {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-category:hover {
  background: #fffdf5;
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.btn-category-random {
  grid-column: span 2;
  text-align: center;
}

/* Countdown Panel */
.countdown-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.countdown-circle {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 3px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: #d97706;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  animation: pulse 1s infinite;
}

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

.countdown-text {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 700;
}

/* ==================== VIEW 3: LEVEL TABLE & CRITERIA ==================== */
.level-table-container {
  overflow-x: auto;
}

.criteria-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.btn-get-idcard {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ==================== MODALS & DIALOGS (LIGHT MODE) ==================== */
dialog.modal-dialog {
  background: transparent;
  border: none;
  padding: 0;
  margin: auto;
  max-width: 520px;
  width: calc(100% - 2rem);
  color: var(--text-body);
  outline: none;
}

dialog.modal-dialog::backdrop {
  background-color: rgba(9, 55, 96, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(9, 55, 96, 0.2);
  text-align: center;
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-body);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon-header {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.modal-content h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.modal-body-text {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.question-highlight {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #edf6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 800;
  color: #093760;
}

.congrats-quote {
  margin: 1.25rem 0;
  padding: 1.25rem;
  background: #fffdf2;
  border: 1px solid #fee47a;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 800;
  color: #854d0e;
}

.modal-btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-btn-group .btn-block {
  grid-column: span 2;
}

/* ID Card Modal Specific */
dialog.idcard-modal {
  max-width: 960px;
}

.idcard-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.idcard-tab-bar {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-tab {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tab.active {
  background: var(--color-bti-navy);
  color: #ffffff;
  border-color: var(--color-bti-navy);
  box-shadow: 0 4px 12px rgba(9, 55, 96, 0.15);
}

.official-card-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 400px;
}

.official-idcard-img {
  max-height: 520px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.official-idcard-fallback {
  color: #94a3b8;
  font-size: 0.95rem;
  padding: 2rem;
  text-align: center;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}
.btn-close:hover {
  color: var(--text-main);
}

.idcard-personalize-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.idcard-personalize-bar label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.idcard-personalize-bar select {
  max-width: 280px;
}

.idcard-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #091e32;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid #093760;
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.idcard-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.idcard-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    padding: 0.5rem 1rem;
  }
  .header-container {
    flex-wrap: wrap;
  }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }
  .nav-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
  .turn-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .turn-next-info {
    text-align: left;
    width: 100%;
  }
  .btn-group-2 {
    grid-template-columns: 1fr;
  }
  .challenge-category-grid {
    grid-template-columns: 1fr;
  }
  .btn-category-random {
    grid-column: span 1;
  }
  .modal-btn-group {
    grid-template-columns: 1fr;
  }
}
