/* ==========================================================================
   SISTEM KOMPUTER - STYLESHEET v2.0
   Adventure Game Map, Immersive UI, Touch & Whiteboard Friendly
   ========================================================================== */

:root {
  --bg-main: #0d1117;
  --bg-surface: #161b22;
  --bg-card: #1c2433;
  --bg-subtle: #21262d;
  --border-subtle: #30363d;
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-inverse: #0d1117;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: 0 0 20px rgba(99, 102, 241, 0.4);

  --team-a: #f97316;
  --team-a-light: rgba(249, 115, 22, 0.15);
  --team-a-border: rgba(249, 115, 22, 0.4);
  --team-a-glow: 0 0 16px rgba(249, 115, 22, 0.35);

  --team-b: #06b6d4;
  --team-b-light: rgba(6, 182, 212, 0.15);
  --team-b-border: rgba(6, 182, 212, 0.4);
  --team-b-glow: 0 0 16px rgba(6, 182, 212, 0.35);

  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);

  --gold: #fbbf24;
  --gold-glow: 0 0 20px rgba(251, 191, 36, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 40px rgba(0,0,0,0.6);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  user-select: none;
}

/* =============================================================================
   TOP NAVIGATION
   ============================================================================= */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--primary-glow);
}

.brand-text h1 {
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text-primary); line-height: 1.1;
}

.badge-bab {
  font-size: 0.68rem; font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px; border-radius: var(--radius-full);
  display: inline-block;
}

.team-score-bar {
  display: flex; align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 4px; border-radius: var(--radius-full); gap: 6px;
}

.team-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: var(--radius-full);
  transition: var(--transition); cursor: pointer;
}

.team-a-pill { background: var(--team-a-light); border: 1px solid var(--team-a-border); }
.team-b-pill { background: var(--team-b-light); border: 1px solid var(--team-b-border); }
.team-avatar { font-size: 1.2rem; line-height: 1; }
.team-info { display: flex; flex-direction: column; }
.team-info.right-align { text-align: right; }
.team-name { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); line-height: 1.1; }
.team-score-num { font-size: 0.9rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.vs-divider { font-size: 0.65rem; font-weight: 800; color: var(--text-muted); }

.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.icon-btn {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--primary); }

.hidden { display: none !important; }

/* =============================================================================
   APP MAIN & VIEW SWITCHER
   ============================================================================= */
.app-main { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }

.view-section { display: none; width: 100%; flex: 1; flex-direction: column; animation: fadeIn 0.3s ease-out; }
.view-section.active { display: flex; }

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

/* =============================================================================
   VIEW 1: ADVENTURE MAP
   ============================================================================= */
.map-stats-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px 14px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
  gap: 20px;
  position: relative;
  z-index: 5;
}

.map-world-tag {
  font-size: 0.72rem; font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 10px; border-radius: var(--radius-full);
  display: inline-block; margin-bottom: 4px;
}
.map-world-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.map-world-desc { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }

.map-progress-card {
  min-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: 12px 16px; border-radius: var(--radius-md);
}
.progress-label-row {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px;
}
.progress-label-row strong { color: var(--primary); font-weight: 800; }
.progress-track { height: 8px; background: var(--bg-subtle); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #10b981); border-radius: var(--radius-full); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-active-hint { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* --- Adventure Map Canvas (Game-Style) --- */
.adventure-map-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 640px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(249, 115, 22, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #0d1117 0%, #0a1628 50%, #0d1117 100%);
}

/* Decorative Background Elements */
.map-bg-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.deco-cloud, .deco-star, .deco-tree, .deco-mountain, .deco-flag {
  position: absolute; font-size: 2rem; opacity: 0.25; animation: floatDeco 6s ease-in-out infinite;
}
.deco-cloud-1 { top: 8%; left: 5%; font-size: 2.5rem; animation-delay: 0s; }
.deco-cloud-2 { top: 15%; right: 8%; font-size: 1.8rem; animation-delay: -2s; }
.deco-cloud-3 { top: 5%; left: 40%; animation-delay: -4s; }
.deco-star-1 { top: 25%; left: 8%; font-size: 1.2rem; animation-delay: -1s; }
.deco-star-2 { top: 55%; right: 5%; font-size: 1rem; animation-delay: -3s; }
.deco-star-3 { bottom: 30%; left: 12%; font-size: 1.4rem; animation-delay: -5s; }
.deco-tree-1 { bottom: 10%; left: 3%; font-size: 2.5rem; opacity: 0.3; animation: none; }
.deco-tree-2 { bottom: 8%; right: 4%; font-size: 2rem; opacity: 0.3; animation: none; }
.deco-tree-3 { bottom: 5%; left: 45%; font-size: 1.8rem; opacity: 0.2; animation: none; }
.deco-mountain { top: 40%; right: 2%; font-size: 3rem; opacity: 0.15; animation: none; }
.deco-flag { top: 12%; right: 15%; font-size: 2rem; opacity: 0.2; animation-delay: -2.5s; }

@keyframes floatDeco {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* SVG Path Connector */
.map-path-svg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; overflow: visible;
}

/* Adventure Nodes Layer */
.adventure-nodes-layer {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 3;
}

/* --- Individual Adventure Node (Game Waypoint Style) --- */
.adv-node {
  position: absolute;
  width: 130px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.22s var(--bounce);
}

.adv-node:hover .adv-node-orb { transform: scale(1.1); }
.adv-node:hover .adv-node-label { opacity: 1; transform: translateY(0); }

/* Orb (the clickable dot) */
.adv-node-orb {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
  transition: transform 0.22s var(--bounce), box-shadow 0.22s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.adv-node-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
}
.adv-node.quiz-node .adv-node-icon-wrap svg { stroke: var(--gold); }
.adv-node.final-node .adv-node-icon-wrap svg { stroke: var(--danger); }

.adv-node.locked .adv-node-orb {
  background: linear-gradient(135deg, #1e2430, #161c27);
  border: 3px solid #2a3040;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  filter: grayscale(0.6);
  opacity: 0.6;
  cursor: not-allowed;
}

.adv-node.unlocked .adv-node-orb {
  background: linear-gradient(135deg, #1e2a4a, #263552);
  border: 3px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25), 0 0 0 6px rgba(99, 102, 241, 0.08);
  animation: orbPulse 2.5s ease-in-out infinite;
}

.adv-node.completed .adv-node-orb {
  background: linear-gradient(135deg, #1a3a2a, #22c55e22);
  border: 3px solid rgba(34, 197, 94, 0.6);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.2);
  animation: none;
}

.adv-node.quiz-node.unlocked .adv-node-orb {
  background: linear-gradient(135deg, #3a2a0a, #fbbf2422);
  border: 3px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3), 0 0 0 6px rgba(251, 191, 36, 0.08);
  animation: orbGold 2.5s ease-in-out infinite;
}

.adv-node.final-node .adv-node-orb {
  width: 90px; height: 90px; font-size: 2rem;
  background: linear-gradient(135deg, #3a1a3a, #ef444422);
  border: 3px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3), 0 0 0 8px rgba(239, 68, 68, 0.08);
  animation: orbFire 1.8s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25), 0 0 0 6px rgba(99, 102, 241, 0.08); }
  50% { box-shadow: 0 4px 28px rgba(99, 102, 241, 0.45), 0 0 0 10px rgba(99, 102, 241, 0.15); }
}
@keyframes orbGold {
  0%, 100% { box-shadow: 0 4px 20px rgba(251, 191, 36, 0.3), 0 0 0 6px rgba(251, 191, 36, 0.08); }
  50% { box-shadow: 0 4px 28px rgba(251, 191, 36, 0.5), 0 0 0 12px rgba(251, 191, 36, 0.12); }
}
@keyframes orbFire {
  0%, 100% { box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3), 0 0 0 8px rgba(239, 68, 68, 0.08); }
  50% { box-shadow: 0 6px 36px rgba(239, 68, 68, 0.55), 0 0 0 14px rgba(239, 68, 68, 0.15); }
}

/* Step Number Badge on Orb */
.adv-node-step {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-main);
}
.adv-node.locked .adv-node-step { background: #2a3040; color: var(--text-muted); }
.adv-node.unlocked .adv-node-step { background: var(--primary); color: white; }
.adv-node.completed .adv-node-step { background: var(--success); color: white; }
.adv-node.quiz-node .adv-node-step { background: var(--gold); color: #1a0a00; }
.adv-node.final-node .adv-node-step { background: var(--danger); color: white; width: 26px; height: 26px; font-size: 0.7rem; }

/* Node Label Tag */
.adv-node-label {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  width: 150px;
  text-align: center;
  box-shadow: var(--shadow-md);
  opacity: 0.85;
  transform: translateY(2px);
  transition: var(--transition);
  pointer-events: none;
}
.adv-node:hover .adv-node-label, .adv-node.active-focus .adv-node-label { opacity: 1; transform: translateY(0); }
.adv-node.unlocked .adv-node-label { border-color: rgba(99, 102, 241, 0.3); }
.adv-node.completed .adv-node-label { border-color: rgba(34, 197, 94, 0.3); }
.adv-node.quiz-node.unlocked .adv-node-label { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.06); }

.adv-node-label-title {
  font-size: 0.75rem; font-weight: 800;
  color: var(--text-primary); line-height: 1.2;
  display: block;
}
.adv-node-label-status {
  display: inline-block; margin-top: 4px;
  font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full);
}
.status-locked { background: #2a3040; color: var(--text-muted); }
.status-open { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.3); }
.status-done { background: var(--success-light); color: var(--success); }
.status-gold { background: var(--warning-light); color: var(--warning); }
.status-fire { background: var(--danger-light); color: var(--danger); }

/* =============================================================================
   FAMILY 100 ARENA
   ============================================================================= */
.game-arena-container {
  max-width: 1040px; margin: 16px auto 30px;
  width: 94%; display: flex; flex-direction: column; gap: 14px;
}

.f100-header { display: flex; align-items: center; justify-content: space-between; }
.f100-title-pill { display: flex; align-items: center; gap: 12px; }
.f100-icon { font-size: 1.8rem; }
.f100-title-text h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.f100-title-text span { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.f100-question-counter {
  font-size: 0.8rem; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: 6px 14px; border-radius: var(--radius-full); color: var(--text-secondary);
}

.f100-team-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }

.f100-team-card {
  background: var(--bg-card); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 14px;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.f100-team-card.active-turn { box-shadow: var(--shadow-md); }
#f100CardTeamA.active-turn { border-color: var(--team-a); box-shadow: var(--team-a-glow); }
#f100CardTeamB.active-turn { border-color: var(--team-b); box-shadow: var(--team-b-glow); }

.team-card-header { display: flex; align-items: center; gap: 10px; }
.team-card-header.right-order { justify-content: flex-end; }
.team-avatar-lg { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--bg-subtle); }
.team-meta h3 { font-size: 1rem; font-weight: 800; }
.f100-score-badge { font-size: 0.9rem; font-weight: 800; color: var(--primary); }

.strikes-container { display: flex; gap: 6px; margin-top: 10px; }
.strikes-container.right-align { justify-content: flex-end; }

.strike-slot {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition);
}
.strike-slot svg { stroke: var(--text-muted); transition: var(--transition); }
.strike-slot.active {
  background: rgba(239, 68, 68, 0.22); border-color: var(--danger);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); transform: scale(1.12);
  animation: strikeShake 0.35s ease-in-out;
}
.strike-slot.active svg { stroke: #ef4444; filter: drop-shadow(0 0 4px #ef4444); }

@keyframes strikeShake {
  0%, 100% { transform: translateX(0) scale(1.12); }
  25% { transform: translateX(-4px) scale(1.12); }
  75% { transform: translateX(4px) scale(1.12); }
}

.turn-status-indicator { margin-top: 8px; font-size: 0.73rem; font-weight: 700; color: var(--text-muted); }
.f100-team-card.active-turn .turn-status-indicator { color: var(--success); }
.f100-team-card.team-eliminated {
  opacity: 0.7; border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.04);
}
.f100-team-card.team-eliminated .turn-status-indicator {
  color: var(--danger); font-weight: 800;
}

.f100-center-info { display: flex; flex-direction: column; align-items: center; }
.round-points-circle {
  width: 88px; height: 88px; border-radius: 50%;
  background: linear-gradient(135deg, #1a1060, #2d1b8a);
  border: 3px solid rgba(99, 102, 241, 0.5);
  box-shadow: var(--primary-glow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.points-label { font-size: 0.55rem; font-weight: 800; letter-spacing: 0.05em; color: rgba(199, 210, 254, 0.8); }
.points-val { font-size: 1.6rem; font-weight: 800; color: var(--gold); line-height: 1; }

.f100-question-box {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 14px 18px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.q-label { font-size: 0.68rem; font-weight: 800; color: var(--primary); letter-spacing: 0.08em; }
.f100-question-box h3 { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); margin-top: 4px; }

/* Flip Card Answers */
.f100-answers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; perspective: 1200px; }

.f100-card {
  height: 70px; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}
.f100-card.flipped { transform: rotateX(180deg); }

.f100-card-face {
  position: absolute; inset: 0;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  display: flex; align-items: center;
  padding: 0 14px;
  box-shadow: var(--shadow-sm);
}

.f100-card-front {
  background: linear-gradient(135deg, #0d1220, #0a0e1a);
  border: 2px solid #1e2535;
  color: white;
  justify-content: space-between;
}
.f100-slot-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: #1e2535; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.f100-hidden-dots { color: #2d3748; letter-spacing: 4px; font-weight: 700; font-size: 1.1rem; }

.f100-card-back {
  background: linear-gradient(135deg, #0e3a5a, #1260a0);
  border: 2px solid rgba(6, 182, 212, 0.4);
  color: white;
  transform: rotateX(180deg);
  justify-content: space-between;
}
.f100-card-back.revealed-missed {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border-color: #444;
  opacity: 0.8;
}
.f100-ans-text { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.f100-ans-pts {
  background: var(--gold); color: #1a0a00;
  font-weight: 800; font-size: 1.05rem;
  padding: 4px 10px; border-radius: var(--radius-full);
  min-width: 40px; text-align: center;
}

/* Action Bar */
.f100-action-bar {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.f100-input-form { display: flex; gap: 10px; }
.f100-input {
  flex: 1; font-family: inherit;
  font-size: 1.05rem; font-weight: 600;
  padding: 12px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none; transition: var(--transition);
}
.f100-input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px var(--primary-light); }
.f100-input::placeholder { color: var(--text-muted); }

.f100-control-buttons {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px;
  padding-top: 8px; border-top: 1px solid var(--border-subtle);
}

/* Buttons */
.btn {
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  padding: 10px 16px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border-subtle); }
.btn-secondary:hover { background: var(--bg-card); border-color: var(--primary); }
.btn-outline { background: transparent; border-color: var(--border-subtle); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-success { background: var(--success); color: white; box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3); }
.btn-success:hover { background: #16a34a; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================================================
   TARIK TAMBANG ARENA
   ============================================================================= */
.tug-arena-container {
  max-width: 1080px; margin: 14px auto 28px;
  width: 94%; display: flex; flex-direction: column; gap: 14px;
}

.tug-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 14px 20px;
}
.tug-badge {
  font-size: 0.7rem; font-weight: 800;
  color: var(--danger); background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 10px; border-radius: var(--radius-full);
}
.tug-title-wrap h2 { font-size: 1.3rem; font-weight: 800; margin-top: 4px; }
.tug-title-wrap p { font-size: 0.82rem; color: var(--text-secondary); }
.tug-metrics { display: flex; gap: 10px; }
.tug-metric-box {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 8px 16px; text-align: center;
}
.timer-box { border-color: var(--danger); }
.m-title { display: block; font-size: 0.6rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.06em; }
.m-val { font-size: 1.35rem; font-weight: 800; color: var(--primary); }
.timer-box .m-val { color: var(--danger); }

/* Tug Stage */
.tug-stage {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(34, 197, 94, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #0a1628, #0d1117);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid; grid-template-columns: 200px 1fr 200px;
  align-items: center; gap: 10px;
  min-height: 200px; overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.tug-team-zone { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 5; }

.finish-line {
  position: absolute; top: -20px; bottom: -20px;
  width: 3px;
  background: repeating-linear-gradient(0deg, var(--danger), var(--danger) 8px, transparent 8px, transparent 16px);
  opacity: 0.6;
}
.finish-line.left-line { left: 16px; }
.finish-line.right-line { right: 16px; }
.finish-flag {
  position: absolute; top: 8px;
  font-size: 0.6rem; font-weight: 800; background: var(--bg-card);
  color: var(--danger); padding: 2px 5px; border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.4); white-space: nowrap;
}
.finish-line.left-line .finish-flag { left: 6px; }
.finish-line.right-line .finish-flag { right: 6px; }

.tug-character { display: flex; flex-direction: column; align-items: center; transition: transform 0.4s var(--bounce); }
.char-bubble {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700; margin-bottom: 4px;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.char-sprite { font-size: 3.2rem; filter: drop-shadow(0 8px 12px rgba(0,0,0,0.4)); transition: var(--transition); }
.char-team-name { font-size: 0.85rem; font-weight: 800; margin-top: 4px; }
.char-team-score { font-size: 0.78rem; font-weight: 700; color: var(--primary); }

.char-pulling-left { animation: pullLeft 0.5s ease-in-out; }
.char-pulling-right { animation: pullRight 0.5s ease-in-out; }
@keyframes pullLeft { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-18px) rotate(-10deg); } }
@keyframes pullRight { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(18px) rotate(10deg); } }

.tug-rope-track {
  position: relative; height: 60px;
  display: flex; align-items: center; justify-content: center;
}
.rope-center-goal {
  position: absolute; top: 0; bottom: 0; width: 2px;
  border-left: 2px dashed rgba(99, 102, 241, 0.4);
}
.tug-rope-body {
  position: relative; width: 100%; height: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.45s var(--bounce);
}
.rope-line {
  position: absolute; width: 120%; height: 14px;
  background: repeating-linear-gradient(45deg, #d97706, #d97706 10px, #b45309 10px, #b45309 20px);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
.rope-ribbon {
  position: absolute; width: 30px; height: 30px;
  background: var(--danger); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); border: 2px solid rgba(255,255,255,0.2);
  z-index: 10;
}
.ribbon-flag { font-size: 0.9rem; }

/* Battle Card */
.tug-battle-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.tug-q-badge {
  align-self: center; font-size: 0.7rem; font-weight: 800;
  color: var(--primary); background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 3px 12px; border-radius: var(--radius-full);
}
.tug-question-text { font-size: 1.2rem; font-weight: 800; text-align: center; color: var(--text-primary); }

.tug-options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tug-opt-btn {
  background: var(--bg-subtle); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; gap: 10px; text-align: left;
  transition: var(--transition);
}
.tug-opt-btn:hover { background: var(--bg-card); border-color: var(--primary); transform: translateY(-2px); }
.tug-opt-btn.correct-ans { background: var(--success-light); border-color: var(--success); }
.tug-opt-btn.wrong-ans { background: var(--danger-light); border-color: var(--danger); }
.opt-letter {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--primary); font-size: 0.85rem; flex-shrink: 0;
}

/* Dual Buzzers */
.dual-buzzer-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border-subtle);
}
.team-buzzer-btn {
  border: none; border-radius: var(--radius-lg); padding: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px;
  position: relative; overflow: hidden; transition: var(--transition); box-shadow: var(--shadow-md);
}
.team-buzzer-btn:active { transform: scale(0.95); }
.buzzer-a { background: linear-gradient(135deg, var(--team-a), #c2410c); color: white; box-shadow: var(--team-a-glow); }
.buzzer-b { background: linear-gradient(135deg, var(--team-b), #0e7490); color: white; box-shadow: var(--team-b-glow); }
.buzzer-icon { font-size: 1.8rem; }
.buzzer-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.buzzer-text strong { font-size: 1.05rem; }
.buzzer-text small { font-size: 0.7rem; opacity: 0.85; }
.buzzer-status-pill {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full); padding: 8px 12px;
  font-size: 0.72rem; font-weight: 700; color: var(--text-secondary);
  text-align: center;
}

/* =============================================================================
   MODALS & DIALOGS
   ============================================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  animation: backdropIn 0.2s ease-out;
}
.modal-backdrop.active { display: flex; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 840px;
  max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn 0.3s var(--bounce);
}
@keyframes modalIn { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header.center-header {
  flex-direction: column; text-align: center; justify-content: center; gap: 4px;
}
.modal-title-group { display: flex; flex-direction: column; gap: 2px; }
.modal-step-badge {
  font-size: 0.7rem; font-weight: 800;
  color: var(--primary); background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px; border-radius: var(--radius-full); display: inline-block;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 800; margin-top: 2px; }
.modal-close-btn {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  width: 32px; height: 32px; border-radius: var(--radius-md);
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: var(--transition);
}
.modal-close-btn:hover { background: var(--danger-light); color: var(--danger); border-color: rgba(239,68,68,0.4); }

.modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.modal-body.center-body { align-items: center; text-align: center; }

.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-subtle);
}
.modal-footer.center-footer { justify-content: center; }
.dialog-subtitle { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }

/* Lesson Modal Specifics */
.lesson-summary-box {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px 18px;
}
.lesson-summary-box h4 { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.lesson-summary-box p, .lesson-summary-box ul { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
.lesson-summary-box ul { padding-left: 18px; margin-top: 6px; }
.lesson-summary-box li { margin-bottom: 4px; }

.lesson-interactive-area {
  background: var(--bg-card); border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}

.interaction-status { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.status-dot.done { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }

/* =============================================================================
   INTERACTIVE FLIPCARD SYSTEM (3D Perspective & Hidden Default Points)
   ============================================================================= */
.flipcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  perspective: 1200px;
  width: 100%;
}

.flipcard-wrapper {
  min-height: 220px;
  position: relative;
  cursor: pointer;
  perspective: 1200px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.flipcard-wrapper:active {
  transform: scale(0.98);
}

.flipcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1);
  border-radius: var(--radius-lg);
}

.flipcard-wrapper.flipped .flipcard-inner {
  transform: rotateY(180deg);
}

.flipcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Front Face: Points STRICTLY HIDDEN */
.flipcard-front {
  background: linear-gradient(145deg, #10192a, #0b121e);
  border: 2px solid #1e2c44;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  gap: 12px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.flipcard-wrapper:hover .flipcard-front {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.flipcard-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #38bdf8;
  flex-shrink: 0;
}

.flipcard-front-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
}

.flipcard-badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.flipcard-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px dashed rgba(56, 189, 248, 0.45);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  animation: pulseHint 2s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.04); opacity: 1; }
}

.flipcard-hint-icon {
  font-size: 1rem;
  display: inline-block;
}

/* Back Face: Points REVEALED when flipped */
.flipcard-back {
  background: linear-gradient(145deg, #0d2238, #091726);
  border: 2px solid #0284c7;
  transform: rotateY(180deg);
  padding: 18px 16px;
  overflow-y: auto;
  justify-content: flex-start;
  text-align: left;
  box-shadow: 0 0 24px rgba(2, 132, 199, 0.28);
}

.flipcard-back-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.flipcard-back-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #38bdf8;
}

.flipcard-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

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

.flipcard-points-list li {
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.5;
  position: relative;
  padding-left: 18px;
}

.flipcard-points-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: bold;
}

.flipcard-sub-info {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flipcard-pill {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.flipcard-flipback-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  align-self: center;
  transition: var(--transition);
}
.flipcard-flipback-btn:hover {
  color: white;
  border-color: white;
}

/* Pipeline (Input → Process → Output) */
.pipeline-flow-interactive {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  justify-content: center;
}
.pipeline-step-btn {
  flex: 1; min-width: 0; padding: 14px 8px;
  background: var(--bg-subtle); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md); text-align: center; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.pipeline-step-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pipeline-step-btn.active-step { border-color: var(--primary); background: var(--primary-light); animation: btnGlow 1.5s infinite; }
.pipeline-step-btn.done-step { border-color: var(--success); background: var(--success-light); }
.pipeline-step-btn strong { display: block; font-size: 0.85rem; color: var(--text-primary); }
.pipeline-step-btn span { display: block; font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }
@keyframes btnGlow { 0%, 100% { box-shadow: 0 0 0 0 var(--primary-light); } 50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15); } }
.flow-arrow-icon { font-size: 1.4rem; color: var(--text-muted); flex-shrink: 0; }

/* Processor Board */
.proc-board {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: #060c18; padding: 16px; border-radius: var(--radius-md);
  border: 1px solid #1a2535;
}
.proc-chip-card {
  background: #0e1a2a; border: 2px solid #1e2e45;
  border-radius: var(--radius-md); padding: 14px;
  cursor: pointer; transition: var(--transition); text-align: center;
}
.proc-chip-card:hover { border-color: #38bdf8; background: #0f2744; }
.proc-chip-card.active { border-color: #06b6d4; background: rgba(6, 182, 212, 0.1); }
.proc-chip-card h4 { color: #38bdf8; font-weight: 800; font-size: 1rem; margin-bottom: 4px; }
.proc-chip-card .chip-role { font-size: 0.7rem; color: #64748b; margin-bottom: 6px; }
.proc-chip-card .chip-desc { font-size: 0.78rem; color: #8b949e; line-height: 1.4; }

/* Software Match Grid */
.sw-match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.sw-match-card {
  background: var(--bg-subtle); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 12px; text-align: center;
  cursor: pointer; transition: var(--transition);
}
.sw-match-card:hover { border-color: var(--primary); background: var(--primary-light); }
.sw-match-card.matched { border-color: var(--success); background: var(--success-light); }
.sw-match-card .sw-icon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.sw-match-card .sw-name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.sw-match-card .sw-cat { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

/* Computer Scale (sequential ordering) */
.scale-seq-list { display: flex; flex-direction: column; gap: 8px; }
.scale-seq-item {
  background: var(--bg-subtle); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 12px 16px;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 12px;
}
.scale-seq-item:hover { border-color: var(--primary); background: var(--primary-light); transform: translateX(4px); }
.scale-seq-item.activated { border-color: var(--success); background: var(--success-light); transform: translateX(4px); }
.scale-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.scale-item-text { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.scale-item-sub { font-size: 0.7rem; color: var(--text-secondary); }

/* Team Edit */
.team-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.team-edit-box {
  background: var(--bg-subtle); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.team-edit-box.a-theme { border-color: var(--team-a-border); }
.team-edit-box.b-theme { border-color: var(--team-b-border); }
.team-edit-box label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.team-name-input {
  font-family: inherit; font-size: 1rem; font-weight: 700;
  padding: 10px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card); color: var(--text-primary);
}
.avatar-select-row { display: flex; gap: 8px; }
.avatar-opt {
  font-size: 1.4rem; width: 42px; height: 42px;
  border-radius: var(--radius-md); border: 2px solid var(--border-subtle);
  background: var(--bg-card); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: var(--transition);
}
.avatar-opt.active { border-color: var(--primary); background: var(--primary-light); transform: scale(1.1); }

/* Family 100 Dialog */
.f100-dialog { max-width: 580px; }
.trophy-bounce { font-size: 3rem; animation: bounceTrophy 1.5s infinite ease-in-out; }
@keyframes bounceTrophy { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-10px) rotate(5deg); } }

/* Grand Finale */
.finale-dialog { max-width: 640px; text-align: center; position: relative; }
.confetti-canvas-wrap { position: absolute; inset: 0; pointer-events: none; z-index: 1; border-radius: var(--radius-xl); overflow: hidden; }
.crown-icon { font-size: 3rem; animation: bounceCrown 1.5s infinite ease-in-out; }
@keyframes bounceCrown { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.05); } }
.champion-announcement { width: 100%; padding: 16px; background: linear-gradient(135deg, #2a1800, #3a2200); border-radius: var(--radius-lg); border: 2px solid var(--gold); box-shadow: var(--gold-glow); }
.champion-announcement h3 { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.final-scores-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 14px; }
.final-team-res-card { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); background: var(--bg-subtle); }
.final-team-res-card.winner { border-color: var(--gold); background: rgba(251, 191, 36, 0.08); }

/* Strike / Correct Overlays */
.strike-huge-overlay, .correct-overlay {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none; z-index: 3000;
  opacity: 0; transition: all 0.25s var(--bounce);
}
.strike-huge-overlay.active, .correct-overlay.active {
  transform: translate(-50%, -50%) scale(1.2); opacity: 1;
}
.huge-x { font-size: 8rem; font-weight: 900; color: var(--danger); text-shadow: 0 0 40px rgba(239, 68, 68, 0.6); }
.correct-check { font-size: 8rem; font-weight: 900; color: var(--success); text-shadow: 0 0 40px rgba(34, 197, 94, 0.6); }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-subtle); color: var(--text-primary);
  padding: 10px 18px; border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 600;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.3s ease-out;
}
.toast.toast-success { border-color: rgba(34, 197, 94, 0.4); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Info box in lesson */
.info-block {
  background: var(--primary-light); border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-primary); line-height: 1.5;
}
.info-block.success-block { background: var(--success-light); border-color: rgba(34, 197, 94, 0.3); }

/* Completed Node Checkmark */
.adv-node-check {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--success);
}

/* Helper utilities used inside lesson summaries */
.mt-3 { margin-top: 10px; }

/* =============================================================================
   FAMILY 100 DISCUSSION MODAL
   ============================================================================= */
.f100-discussion-dialog { max-width: 720px; }
.disc-header-reason {
  font-size: 0.8rem; font-weight: 700;
  padding: 4px 12px; border-radius: var(--radius-full);
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.disc-header-reason.both-eliminated {
  background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}
.disc-header-reason.all-cleared {
  background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.4);
  color: var(--success);
}

.disc-answers-list { display: flex; flex-direction: column; gap: 8px; }
.disc-ans-item {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: var(--transition);
}
.disc-ans-item.revealed { border-color: rgba(6, 182, 212, 0.4); background: rgba(6, 182, 212, 0.08); }
.disc-ans-item.missed { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }

.disc-ans-left { display: flex; align-items: center; gap: 10px; }
.disc-ans-rank {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; color: var(--primary);
}
.disc-ans-name { font-size: 0.95rem; font-weight: 800; color: var(--text-primary); }
.disc-ans-role { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }

.disc-ans-right { display: flex; align-items: center; gap: 10px; }
.disc-status-tag {
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full);
}
.disc-status-tag.tag-a { background: var(--team-a-light); color: var(--team-a); border: 1px solid var(--team-a-border); }
.disc-status-tag.tag-b { background: var(--team-b-light); color: var(--team-b); border: 1px solid var(--team-b-border); }
.disc-status-tag.tag-missed { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

.disc-ans-pts {
  background: var(--gold); color: #1a0a00;
  font-weight: 800; font-size: 0.9rem;
  padding: 3px 8px; border-radius: var(--radius-full);
}

.disc-footer-score { font-size: 0.85rem; color: var(--text-secondary); font-weight: 700; }

/* =============================================================================
   HARDWARE PHYSICAL COMPONENT VISUALIZER (Titik 3)
   ============================================================================= */
.hw-visualizer-container { display: flex; flex-direction: column; gap: 14px; }
.hw-category-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-subtle);
}
.hw-tab-btn {
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); padding: 6px 14px; border-radius: var(--radius-full);
  font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.hw-tab-btn:hover { color: var(--text-primary); border-color: var(--primary); }
.hw-tab-btn.active {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary); box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.hw-main-inspector {
  display: grid; grid-template-columns: 240px 1fr; gap: 14px;
  background: #090d16; border: 1px solid #1a2538;
  border-radius: var(--radius-lg); padding: 14px;
}

.hw-components-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 420px; overflow-y: auto; padding-right: 4px;
}
.hw-item-btn {
  background: #111a28; border: 1px solid #1e2c42;
  border-radius: var(--radius-md); padding: 8px 12px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  text-align: left; transition: var(--transition);
  color: var(--text-primary); font-family: inherit;
}
.hw-item-btn:hover { background: #162438; border-color: #38bdf8; }
.hw-item-btn.active {
  background: rgba(56, 189, 248, 0.12); border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.hw-btn-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); background: #0c1420; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hw-btn-info { display: flex; flex-direction: column; overflow: hidden; }
.hw-btn-name { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-btn-cat { font-size: 0.65rem; color: #64748b; }
.hw-btn-check { font-size: 0.75rem; color: var(--success); margin-left: auto; }

.hw-showcase-view {
  background: transparent;
  padding: 0;
  border: none;
  width: 100%;
}

.hw-component-detail {
  width: 100%;
  min-height: 400px;
  background: #0d1524;
  border: 1px solid #203048;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.hw-role-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(8, 18, 31, 0.72);
  border: 1px solid #203048;
  border-radius: var(--radius-md);
}
.hw-point-title { color: #7dd3fc; font-size: 0.9rem; font-weight: 800; }
.hw-animation-canvas { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 190px; }
.hw-animation-canvas svg { display: block; max-width: 100%; height: auto; }
.hw-role-desc { width: 100%; margin: 0; font-size: 0.85rem; line-height: 1.55; color: #cbd5e1; }
.hw-die-toggle-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.hw-die-btn {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #2b3c55;
  border-radius: var(--radius-full);
  background: #111a28;
  color: #94a3b8;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.hw-die-btn:hover { border-color: #38bdf8; color: #e2e8f0; }
.hw-die-btn.active { background: rgba(56, 189, 248, 0.15); border-color: #38bdf8; color: #7dd3fc; }

.hw-info-card { text-align: left; width: 100%; }
.hw-info-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; width: 100%; }
.hw-info-title { font-size: 1.15rem; font-weight: 800; color: #38bdf8; }
.hw-badge-cat {
  font-size: 0.7rem; font-weight: 800; padding: 2px 10px; border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3);
}

/* =============================================================================
   SOFTWARE DASHBOARD (Titik 4)
   ============================================================================= */
.sw-dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sw-dash-card {
  background: #0e1626; border: 2px solid #1e2c44;
  border-radius: var(--radius-md); padding: 14px;
  cursor: pointer; transition: var(--transition); text-align: left;
}
.sw-dash-card:hover { border-color: #38bdf8; transform: translateY(-2px); }
.sw-dash-card.active { border-color: var(--success); background: rgba(34, 197, 94, 0.08); }
.sw-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sw-card-head h4 { font-size: 0.95rem; font-weight: 800; color: #f1f5f9; }
.sw-cat-badge { font-size: 0.65rem; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 6px; border-radius: 4px; }
.sw-examples-pill { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sw-pill { font-size: 0.7rem; font-weight: 600; background: #162438; color: #94a3b8; padding: 2px 8px; border-radius: var(--radius-full); }

/* =============================================================================
   TARIK TAMBANG BALANCED ANIMATIONS
   ============================================================================= */
.char-sprite-wrap { display: flex; align-items: center; justify-content: center; }
.tug-vector-char { transition: transform 0.4s var(--bounce); }
.char-stumble-left { animation: stumbleLeft 0.55s ease-in-out; }
.char-stumble-right { animation: stumbleRight 0.55s ease-in-out; }
@keyframes stumbleLeft { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(20px) rotate(8deg); } }
@keyframes stumbleRight { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-20px) rotate(-8deg); } }

/* Vector Avatars */
.team-vector-avatar { display: inline-block; vertical-align: middle; }

/* =============================================================================
   RESPONSIVE DESIGN & MOBILE-FRIENDLY OPTIMIZATIONS
   ============================================================================= */
/* Global touch optimization */
button, input, .adv-node, .flipcard-wrapper, .hw-item-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
  .f100-team-board { grid-template-columns: 1fr; }
  .f100-center-info { order: -1; }
  .tug-stage { grid-template-columns: 1fr; gap: 14px; }
  .team-edit-grid { grid-template-columns: 1fr; }
  .pipeline-flow-interactive { flex-wrap: wrap; }
  .hw-main-inspector { grid-template-columns: 1fr; }
  .hw-components-list { max-height: 220px; }
}

@media (max-width: 640px) {
  /* Header & Navigation */
  .top-nav {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand-group { gap: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-logo svg { width: 20px; height: 20px; }
  .brand-text h1 { font-size: 0.95rem; }
  .badge-bab { font-size: 0.62rem; padding: 1px 6px; }
  .top-actions { gap: 6px; margin-left: auto; }
  .icon-btn { width: 38px; height: 38px; }

  /* Compact Mobile Team Score Bar */
  .team-score-bar {
    display: flex;
    width: 100%;
    order: 3;
    justify-content: space-between;
    padding: 4px 10px;
    margin-top: 4px;
    background: rgba(10, 15, 26, 0.95);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
  }
  .team-badge { padding: 4px 8px; gap: 6px; }
  .team-name { font-size: 0.72rem; }
  .team-score-num { font-size: 0.75rem; }
  .vs-divider { font-size: 0.65rem; }

  /* Map View */
  .map-stats-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }
  .map-world-title { font-size: 1.15rem; }
  .map-world-desc { font-size: 0.8rem; }
  .map-progress-card { width: 100%; }

  /* Modals on Mobile */
  .modal-dialog {
    width: 96%;
    max-height: 92vh;
    border-radius: var(--radius-md);
  }
  .modal-header { padding: 12px 16px; }
  .modal-header h2 { font-size: 1.05rem; }
  .modal-close-btn { width: 36px; height: 36px; font-size: 1.1rem; }
  .modal-body { padding: 14px 14px; gap: 14px; }
  .modal-footer {
    padding: 12px 14px;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .modal-footer .btn { width: 100%; justify-content: center; min-height: 46px; }
  .interaction-status { font-size: 0.75rem; text-align: center; justify-content: center; }

  /* Hardware inspector: keep the component picker compact and swipeable */
  .hw-category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hw-category-tabs::-webkit-scrollbar,
  .hw-components-list::-webkit-scrollbar { display: none; }
  .hw-tab-btn { flex: 0 0 auto; white-space: nowrap; }
  .hw-main-inspector { padding: 10px; gap: 10px; }
  .hw-components-list {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hw-item-btn { flex: 0 0 86%; max-width: 220px; min-height: 58px; scroll-snap-align: start; }
  .hw-component-detail { min-height: 0; padding: 12px; overflow: visible; }
  .hw-info-header { align-items: flex-start; gap: 8px; flex-wrap: wrap; }
  .hw-info-title { overflow-wrap: anywhere; }
  .hw-badge-cat { white-space: normal; }
  .hw-role-panel { padding: 12px; gap: 10px; }
  .hw-animation-canvas { min-height: 150px; }
  .hw-die-toggle-wrap { flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
  .hw-die-btn { flex: 1 1 140px; min-width: 0; white-space: normal; }

  /* Flipcard Grid on Mobile: Clean single-column for easy touch & readability */
  .flipcard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .flipcard-wrapper {
    min-height: 200px;
  }
  .flipcard-inner {
    min-height: 200px;
  }
  .flipcard-front {
    padding: 18px 14px;
    gap: 10px;
  }
  .flipcard-front-title { font-size: 1rem; }
  .flipcard-hint-pill { font-size: 0.74rem; padding: 6px 12px; }
  .flipcard-back { padding: 16px 14px; }
  .flipcard-points-list li { font-size: 0.8rem; line-height: 1.45; }

  /* Tarik Tambang Arena on Mobile */
  .tug-arena-container { padding: 10px 8px; gap: 12px; }
  .tug-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .tug-title-wrap h2 { font-size: 1.25rem; }
  .tug-title-wrap p { font-size: 0.8rem; }
  .tug-metrics { width: 100%; justify-content: flex-start; }
  .tug-metric-box { padding: 6px 14px; min-width: 90px; }
  .tug-metric-box .m-title { font-size: 0.65rem; }
  .tug-metric-box .m-val { font-size: 1.15rem; }

  /* Tarik Tambang Stage */
  .tug-stage {
    padding: 12px 6px;
    overflow-x: hidden;
  }
  .tug-team-zone { gap: 6px; }
  .tug-character { gap: 4px; }
  .char-bubble { font-size: 0.7rem; padding: 2px 8px; }
  .tug-vector-char { width: 56px; height: 64px; }
  .char-team-name { font-size: 0.78rem; }
  .char-team-score { font-size: 0.72rem; }
  .finish-flag span { display: none; }
  .finish-flag { padding: 4px; }

  /* Tarik Tambang Battle Card & Options */
  .tug-battle-card { padding: 14px 12px; gap: 12px; }
  .tug-question-text { font-size: 0.95rem; line-height: 1.45; }
  .tug-options-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tug-opt-btn {
    min-height: 48px;
    padding: 10px 14px;
    font-size: 0.85rem;
    gap: 10px;
  }
  .opt-letter { width: 26px; height: 26px; font-size: 0.8rem; }

  /* Buzzers on Mobile: Large, prominent, easily touched */
  .dual-buzzer-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .buzzer-status-pill {
    grid-column: span 2;
    order: -1;
    font-size: 0.75rem;
    padding: 6px 10px;
  }
  .team-buzzer-btn {
    padding: 12px 8px;
    min-height: 56px;
  }
  .buzzer-text strong { font-size: 0.82rem; }
  .buzzer-text small { display: none; }
  .buzzer-icon { font-size: 1.3rem; }

  /* Family 100 Arena on Mobile */
  .game-arena-container { padding: 10px 8px; gap: 12px; }
  .f100-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .f100-answers-grid { grid-template-columns: 1fr; gap: 8px; }
  .f100-card { min-height: 50px; }
  .f100-input { font-size: 16px; /* prevent iOS zoom */ }
  .f100-action-bar { gap: 10px; }
  .f100-input-form { flex-direction: column; width: 100%; gap: 8px; }
  .f100-input-form .btn { width: 100%; justify-content: center; min-height: 46px; }
  .f100-control-buttons { flex-direction: column; width: 100%; gap: 6px; }
  .f100-control-buttons .btn { width: 100%; justify-content: center; min-height: 44px; }
}

@media (max-width: 380px) {
  .brand-text h1 { font-size: 0.85rem; }
  .team-buzzer-btn { padding: 10px 6px; }
  .buzzer-text strong { font-size: 0.75rem; }
  .tug-opt-btn { font-size: 0.8rem; }
}

