/* ============================================================
   Chef Algorithm — Design System (Tema Cerah Ramah Siswa SMP)
   Warna Hangat Ceria, Rasio 16:9 Landscape, Bebas Scroll
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Palette (Warm, Friendly, Foodie, Energetic) */
  --c-primary: #FF6B35;
  --c-primary-hover: #FF7B47;
  --c-primary-shadow: #D9531E;
  --c-primary-light: #FFF0EB;
  --c-primary-border: #FDCBAE;

  --c-secondary: #F59E0B;
  --c-secondary-hover: #FBBF24;
  --c-secondary-shadow: #D97706;
  --c-secondary-light: #FEF3C7;

  --c-accent: #EF4444;
  --c-accent-shadow: #DC2626;

  --c-success: #10B981;
  --c-success-hover: #34D399;
  --c-success-shadow: #059669;
  --c-success-light: #D1FAE5;

  --c-info: #0284C7;
  --c-info-light: #E0F2FE;

  /* Neutrals & Surfaces (Bright & Clean) */
  --c-bg-canvas: #FFFDF9;
  --c-bg-soft: #FFF7ED;
  --c-card-bg: #FFFFFF;
  --c-card-bg-trans: rgba(255, 255, 255, 0.95);
  --c-card-border: #FED7AA;
  --c-border-subtle: #F1F5F9;

  /* Typography Colors (High Contrast for Easy Reading) */
  --c-text: #1E293B;
  --c-text-heading: #0F172A;
  --c-text-muted: #64748B;
  --c-text-dim: #94A3B8;
  --c-text-white: #FFFFFF;

  /* Typography Families */
  --font-heading: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', 'Poppins', system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;
  --font-scale: 1;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(234, 88, 12, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 16px rgba(234, 88, 12, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 14px 32px rgba(234, 88, 12, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 8px 24px -4px rgba(234, 88, 12, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-normal: 0.25s ease;
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Global Reset & Box Sizing ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: calc(15px * var(--font-scale));
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--c-bg-canvas);
  color: var(--c-text);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  user-select: none;
}

/* ---------- Kitchen Background (Light Theme) ---------- */
.kitchen-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('assets/kitchen-bg-light.jpg') center center/cover no-repeat;
  filter: saturate(1.05);
}

.kitchen-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 253, 247, 0.72) 0%, rgba(255, 247, 237, 0.82) 100%);
  backdrop-filter: blur(4px);
}

/* ---------- Quick Zoom & Font Controls (Compact Header Float) ---------- */
.quick-controls {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.qc-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qc-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-right: 2px;
}

.qc-btn {
  background: #FFF7ED;
  border: 1px solid var(--c-card-border);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--c-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.qc-btn:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

.qc-val {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text);
  min-width: 36px;
  text-align: center;
  cursor: pointer;
}

.qc-divider {
  width: 1px;
  height: 18px;
  background: #E2E8F0;
  margin: 0 4px;
}

/* ---------- 16:9 Canvas App Container ---------- */
#app {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* ---------- Page Container ---------- */
.page {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  animation: pageFadeIn 0.3s ease;
}

.page.active {
  display: flex;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 16:9 Content Box (Zero-Scroll Master Frame) ---------- */
.content-box {
  width: min(1080px, 94vw);
  height: min(650px, 92vh);
  max-height: 92vh;
  background: var(--c-card-bg-trans);
  border: 3px solid var(--c-card-border);
  border-radius: var(--radius-xl);
  padding: 20px 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Zero scroll */
}

/* Mode scroll hanya untuk halaman Panduan / Profil Pengembang jika diperlukan */
.content-box.scrollable {
  overflow-y: auto;
}

.content-box.scrollable::-webkit-scrollbar {
  width: 6px;
}
.content-box.scrollable::-webkit-scrollbar-thumb {
  background: var(--c-primary-border);
  border-radius: 4px;
}

/* ---------- Buttons System (3D Tactile Game Style) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  outline: none;
}

.btn-primary {
  background: var(--c-primary);
  color: var(--c-text-white);
  box-shadow: 0 4px 0 var(--c-primary-shadow), 0 6px 12px rgba(234, 88, 12, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-primary-shadow), 0 8px 16px rgba(234, 88, 12, 0.3);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--c-primary-shadow);
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--c-text);
  border: 2px solid #CBD5E1;
  box-shadow: 0 4px 0 #94A3B8;
}
.btn-secondary:hover:not(:disabled) {
  background: #E2E8F0;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #94A3B8;
}
.btn-secondary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #94A3B8;
}

.btn-ghost {
  background: #FFF7ED;
  color: var(--c-primary);
  border: 2px solid var(--c-primary-border);
  box-shadow: 0 3px 0 var(--c-card-border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--c-primary-light);
  transform: translateY(-2px);
}
.btn-ghost:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--c-card-border);
}

.btn-success {
  background: var(--c-success);
  color: var(--c-text-white);
  box-shadow: 0 4px 0 var(--c-success-shadow), 0 6px 12px rgba(16, 185, 129, 0.25);
}
.btn-success:hover:not(:disabled) {
  background: var(--c-success-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-success-shadow);
}
.btn-success:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--c-success-shadow);
}

.btn-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  color: #78350F;
  box-shadow: 0 4px 0 var(--c-secondary-shadow), 0 6px 14px rgba(245, 158, 11, 0.3);
}
.btn-gold:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-secondary-shadow);
}
.btn-gold:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--c-secondary-shadow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
  filter: grayscale(0.6);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-md { padding: 10px 22px; font-size: 0.95rem; }
.btn-lg { padding: 14px 34px; font-size: 1.15rem; }

/* Action row */
.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
}
.action-row.compact-action {
  padding-top: 8px;
}

/* ============================================================
   PAGE 1: COVER PAGE
   ============================================================ */
.cover-page {
  text-align: center;
  padding: 16px 28px;
  justify-content: space-between;
}

.cover-logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.cover-logos img {
  height: 42px;
  object-fit: contain;
}

.cover-main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: auto 0;
}

.cover-hero-box {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cover-hero-img {
  width: 170px;
  height: 170px;
  object-fit: contain;
  border-radius: 50%;
  background: #FFFFFF;
  border: 4px solid var(--c-primary);
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.22);
  padding: 6px;
  animation: heroBounce 3s ease-in-out infinite;
}

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

.cover-info {
  text-align: left;
  max-width: 580px;
}

.cover-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.1;
  text-shadow: 2px 2px 0 var(--c-secondary-light);
}

.cover-subtitle {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-secondary-shadow);
  margin-bottom: 6px;
}

.cover-tagline {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.cover-objectives {
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
}

.cover-objectives h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--c-primary);
  margin-bottom: 4px;
}

.cover-objectives ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

.cover-objectives li {
  font-size: 0.78rem;
  color: var(--c-text);
  line-height: 1.35;
  position: relative;
  padding-left: 14px;
}

.cover-objectives li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: var(--c-success);
  font-size: 0.72rem;
  font-weight: bold;
}

.cover-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-text-muted);
  margin-bottom: 14px;
}

.btn-mulai {
  background: linear-gradient(135deg, #FF6B35 0%, #F59E0B 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 12px 42px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 0 #D9531E, 0 10px 24px rgba(234, 88, 12, 0.35);
  transition: all var(--transition-fast);
}

.btn-mulai:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #D9531E, 0 14px 28px rgba(234, 88, 12, 0.4);
}
.btn-mulai:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #D9531E;
}

/* ============================================================
   SHARED PAGE TITLE BAR
   ============================================================ */
.page-title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--c-card-border);
}

.ptb-back {
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--c-primary);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--c-card-border);
  transition: all var(--transition-fast);
}

.ptb-back:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.ptb-back:active {
  transform: translateY(2px);
}

.ptb-text h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--c-text-heading);
  line-height: 1.1;
}

.ptb-text p {
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* ============================================================
   PAGE 2: PANDUAN BERMAIN
   ============================================================ */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: auto 0;
}

.tutorial-card {
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition-normal);
}

.tutorial-card:hover {
  transform: translateY(-4px);
  background: #FFF;
}

.tc-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.tc-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-primary);
}

.tc-desc {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}

/* ============================================================
   PAGE 3: MENU LEVEL
   ============================================================ */
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: auto 0;
}

.level-card {
  background: #FFFFFF;
  border: 3px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 230px;
}

.level-card:hover:not(.locked) {
  transform: translateY(-6px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-lg);
}

.level-card.locked {
  opacity: 0.55;
  filter: grayscale(0.85);
  cursor: not-allowed;
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.level-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.2rem;
}

.level-card.completed {
  border-color: var(--c-success);
  background: var(--c-success-light);
}

.level-card .lc-icon {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.level-card .lc-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text-heading);
  line-height: 1.2;
  margin-bottom: 2px;
}

.level-card .lc-subtitle {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--c-primary);
}

.level-card .lc-stars {
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.lc-stars .star-earned { color: #F59E0B; }
.lc-stars .star-empty { color: #CBD5E1; }

.progress-section {
  margin-top: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.progress-bar-outer {
  width: 480px;
  max-width: 90%;
  height: 12px;
  background: #E2E8F0;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid #CBD5E1;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

.progress-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-text-muted);
}

.badge-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-secondary-light);
  border: 2px solid var(--c-secondary);
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400E;
}

/* ============================================================
   SHARED GAME HEADER & BRIEFING
   ============================================================ */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.gh-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-level-badge {
  background: var(--c-primary-light);
  border: 2px solid var(--c-primary-border);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-primary);
}

.gh-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text-heading);
}

.gh-attempts {
  font-size: 0.82rem;
  font-weight: 700;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  color: var(--c-text-muted);
}

.game-briefing {
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-secondary);
  padding: 8px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--c-text);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* ============================================================
   LEVEL 1: SPLIT 2-COLUMN (ZERO SCROLL FIT-TO-SCREEN)
   ============================================================ */
.l1-workspace {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr;
  gap: 12px;
  align-items: stretch;
  height: 385px; /* Fixed height to guarantee zero scroll */
  margin-bottom: 4px;
}

.l1-pool-col, .l1-board-col {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--c-card-border);
}

.col-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-primary);
}

.col-hint {
  font-size: 0.72rem;
  color: var(--c-text-dim);
}

.l1-flow-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--c-primary);
  font-weight: 900;
}

/* Left Pool: 7 cards compact */
.drag-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}

.drag-zone::-webkit-scrollbar {
  width: 4px;
}
.drag-zone::-webkit-scrollbar-thumb {
  background: var(--c-primary-border);
  border-radius: 4px;
}

/* Right Drop Zone: 7 Slots compact */
.drop-zone {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  justify-content: space-between;
}

/* Step Card (Available) */
.step-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFDF9;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: grab;
  touch-action: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.step-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  transform: translateX(3px);
}

.step-card:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.step-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}

.sc-emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sc-text {
  flex: 1;
  line-height: 1.25;
}

.sc-action-hint {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--c-primary);
  background: #FFF;
  border: 1px solid var(--c-primary-border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}

/* Drop Slot */
.drop-slot {
  height: 44px;
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.78rem;
  color: var(--c-text-dim);
  font-weight: 700;
  transition: all var(--transition-fast);
  position: relative;
}

.drop-slot.drag-over {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  border-style: solid;
}

.drop-slot.filled {
  border-style: solid;
  border-color: var(--c-card-border);
  background: #FFFFFF;
  padding: 0;
}

.slot-filled-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.slot-num-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slot-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.slot-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--c-text-muted);
  cursor: pointer;
}

.slot-btn:hover {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

.slot-btn.remove:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

/* Correct / Wrong Highlight */
.drop-slot.correct-answer {
  border-color: var(--c-success) !important;
  background: var(--c-success-light) !important;
}

.drop-slot.wrong-answer {
  border-color: var(--c-accent) !important;
  background: #FEE2E2 !important;
  animation: cardShake 0.4s ease;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============================================================
   LEVEL 2: RESTAURANT COUNTER (IF-ELSE)
   ============================================================ */
.l2-counter-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: 380px;
  align-items: stretch;
}

.l2-guest-card {
  background: #FFFFFF;
  border: 3px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.l2-guest-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 2px solid var(--c-card-border);
}

.l2-guest-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-primary);
}

.l2-guest-bubble {
  background: var(--c-bg-soft);
  border: 2px solid var(--c-secondary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--c-text);
  line-height: 1.35;
  margin-top: 8px;
  position: relative;
}

.l2-decision-card {
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.l2-flow-box {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
}

.l2-condition-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c-primary);
  letter-spacing: 1px;
}

.l2-condition-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text-heading);
  margin-top: 2px;
}

.l2-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.flow-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFDF9;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  text-align: left;
}

.flow-option-btn:hover:not(.disabled) {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  transform: translateX(4px);
}

.flow-option-btn.selected-correct {
  border-color: var(--c-success);
  background: var(--c-success-light);
  color: #065F46;
}

.flow-option-btn.selected-wrong {
  border-color: var(--c-accent);
  background: #FEE2E2;
  color: #991B1B;
}

.flow-option-btn.disabled {
  pointer-events: none;
}

.scenario-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
}

.scenario-feedback.show {
  display: block;
}

.scenario-feedback.correct {
  background: var(--c-success-light);
  border: 1px solid var(--c-success);
  color: #065F46;
}

.scenario-feedback.wrong {
  background: #FEE2E2;
  border: 1px solid var(--c-accent);
  color: #991B1B;
}

/* ============================================================
   LEVEL 3: LOOP BUILDER
   ============================================================ */
.loop-container {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
  height: 380px;
}

.loop-manual-side, .loop-smart-side {
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}

.loop-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loop-recipe-list {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--c-text-muted);
  flex: 1;
  overflow-y: auto;
}

.loop-count-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.loop-count-btn {
  flex: 1;
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 6px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--c-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.loop-count-btn.active {
  background: var(--c-success-light);
  border-color: var(--c-success);
  color: #065F46;
}

.loop-code-preview {
  background: #1E293B;
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  padding: 10px;
  line-height: 1.5;
  white-space: pre;
  margin-bottom: 10px;
}

.loop-counter-display {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-primary);
  text-align: center;
  margin: 4px 0;
}

.loop-progress-bar {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 5px;
  overflow: hidden;
}

.loop-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-success));
  border-radius: 5px;
  transition: width 0.25s ease;
}

.loop-savings {
  display: flex;
  justify-content: space-around;
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 8px;
}

.ls-number {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}
.ls-number.bad { color: var(--c-accent); }
.ls-number.good { color: var(--c-success); }
.ls-label { font-size: 0.7rem; color: var(--c-text-muted); text-align: center; }

/* ============================================================
   LEVEL 4: DECOMPOSITION (HORIZONTAL WORKSTATIONS)
   ============================================================ */
.l4-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 380px;
}

/* 3 Assistant Workstations Side-by-Side */
.l4-assistants-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 1;
}

.assistant-card {
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.assistant-card.drag-over {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}

.ac-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #E2E8F0;
}

.ac-avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid var(--c-card-border);
}

.ac-info h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
}

.ac-station {
  font-size: 0.7rem;
  color: var(--c-text-muted);
  font-weight: 600;
}

.ac-drop-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
  background: #F8FAFC;
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 6px;
}

.ac-placeholder {
  margin: auto;
  font-size: 0.74rem;
  color: var(--c-text-dim);
  text-align: center;
}

/* Bottom Tray for Tasks */
.l4-tasks-tray {
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.tray-header {
  margin-bottom: 6px;
}

.tray-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-primary);
}

.task-pool {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  min-height: 52px;
}

.task-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFDF9;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: grab;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.task-chip:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  transform: translateY(-2px);
}

.task-chip:active {
  cursor: grabbing;
}

.task-chip.assigned {
  background: #FFFFFF;
  border-color: var(--c-success);
}

.task-chip .tc-remove {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--c-accent);
  cursor: pointer;
  padding: 0 4px;
}

/* Timer Section */
.timer-section {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  margin-bottom: 8px;
}

.timer-display {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--c-accent);
}

.timer-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  background: var(--c-accent);
  transition: width 0.5s linear;
}

/* ============================================================
   RECAP PAGES (1, 2, 3, 4)
   ============================================================ */
.recap-header {
  text-align: center;
  margin-bottom: 12px;
}

.recap-result-icon {
  font-size: 2.5rem;
}

.recap-result-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-text-heading);
}

.recap-stars {
  font-size: 1.5rem;
  letter-spacing: 4px;
  margin: 2px 0;
}

.recap-score {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--c-primary);
}

.pseudocode-box {
  background: #1E293B;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 8px;
  color: #F8FAFC;
}

.pseudocode-box .pb-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38BDF8;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.pseudocode-box pre {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  color: #E2E8F0;
  white-space: pre-wrap;
}

.funfact-box {
  background: var(--c-bg-soft);
  border-left: 4px solid var(--c-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 14px;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-bottom: 8px;
}

.ff-label {
  font-weight: 800;
  color: var(--c-secondary-shadow);
  margin-bottom: 2px;
}

.cptp-box {
  font-size: 0.74rem;
  color: var(--c-text-muted);
  line-height: 1.35;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-bottom: 8px;
}

.cptp-label {
  font-weight: 700;
  color: var(--c-primary);
}

/* ============================================================
   HASIL AKHIR & PENGEMBANG
   ============================================================ */
.results-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.results-chef-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 4px;
}

.results-badge-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
}

.results-total-score {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--c-secondary-shadow);
  line-height: 1;
}

.results-total-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-muted);
}

.results-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.rl-card {
  background: #FFFFFF;
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 8px;
  text-align: center;
}

.rl-title { font-size: 0.75rem; font-weight: 700; }
.rl-stars { font-size: 0.9rem; }
.rl-score { font-size: 0.75rem; font-weight: 800; color: var(--c-primary); }

.results-concepts {
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
}

.results-concepts h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--c-primary);
  margin-bottom: 6px;
}

.results-concept-tag {
  display: inline-block;
  background: #FFFFFF;
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 2px;
}

/* Pengembang */
.dev-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--c-bg-soft);
  border: 2px solid var(--c-card-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: auto 0;
}

.dev-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-primary);
}

.dev-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text-heading);
}

.dev-role {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-primary);
}

.dev-school {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

.dev-description {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--c-text);
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}

.footer-logos img {
  height: 38px;
  object-fit: contain;
}

/* ============================================================
   MOBILE ROTATE OVERLAY (16:9 LANDSCAPE PROMPT)
   ============================================================ */
.rotate-device-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #FFFDF9;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.rotate-card {
  background: #FFFFFF;
  border: 3px solid var(--c-card-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rotate-icon {
  font-size: 3.5rem;
  animation: phoneRotate 2s ease-in-out infinite;
}

@keyframes phoneRotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

.rotate-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--c-primary);
}

.rotate-card p {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  line-height: 1.4;
}

/* Muncul hanya di layar kecil / mobile saat orientasi portrait */
@media screen and (orientation: portrait) and (max-width: 768px) {
  .rotate-device-overlay {
    display: flex;
  }
}
