/* ============================================================
   A DAY IN CLAUDE'S BRAIN — game.css
   ============================================================ */

/* === VARIABLES === */
:root {
  --bg:      #0a0a14;
  --bg2:     #0f0f1e;
  --bg3:     #13131f;
  --bg4:     #1a1a2e;
  --orange:  #f97316;
  --orange2: #ea6c0a;
  --orange-glow: rgba(249,115,22,0.4);
  --orange-dim:  rgba(249,115,22,0.12);
  --orange-border: rgba(249,115,22,0.28);
  --purple:  #a78bfa;
  --green:   #22c55e;
  --red:     #ef4444;
  --yellow:  #fbbf24;
  --text:    #e2e8f0;
  --dim:     #94a3b8;
  --muted:   #64748b;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --radius:  10px;
}

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100dvh;
  height: 100vh; /* fallback */
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font-family: inherit; }

/* === SCREEN SYSTEM === */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.screen.active { display: flex; opacity: 1; }

/* === TOP BAR === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 48px;
}
.topbar-title {
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
}
.chapter-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(249,115,22,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65em;
  font-weight: 700;
  color: rgba(249,115,22,0.25);
}
.dot.active {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
  box-shadow: 0 0 12px var(--orange-glow);
}
.dot.done {
  background: var(--orange-dim);
  border-color: rgba(249,115,22,0.4);
  color: var(--orange);
}
.dot-sep {
  color: rgba(255,255,255,0.15);
  font-size: 0.65em;
}
.score-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--orange-dim);
  border: 1px solid var(--orange-border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--orange);
}

/* === GAME LAYOUT (desktop: 2-col) === */
.game-area {
  display: grid;
  grid-template-columns: 250px 1fr;
  flex: 1;
  overflow: hidden;
}

/* === CLAUDE PANEL (left sidebar) === */
.claude-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  gap: 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.claude-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(249,115,22,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249,115,22,0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* === CLAUDE CHARACTER === */
.claude-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}
.claude-wrap svg { width: 100%; height: 100%; }

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  background: var(--orange);
  pointer-events: none;
}
.p1 { width: 6px; height: 6px;  top: -6px;  right: 20px; animation: pop 2.4s 0.2s infinite; }
.p2 { width: 4px; height: 4px;  top: -16px; right: 10px; animation: pop 2.4s 0.8s infinite; }
.p3 { width: 8px; height: 8px;  top: -10px; right: 0px;  animation: pop 2.4s 1.3s infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}
@keyframes pop {
  0%   { opacity: 0;  transform: translateY(0) scale(0); }
  30%  { opacity: .8; }
  100% { opacity: 0;  transform: translateY(-26px) scale(.3); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.6); }
  70%  { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fill-bar {
  from { width: 0%; }
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.shake { animation: shake 0.4s ease-in-out !important; }

/* === SPEECH BUBBLE === */
.speech-bubble {
  background: var(--bg4);
  border: 1px solid var(--orange-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.8em;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  width: 100%;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: var(--orange-border);
  border-top: none;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: var(--bg4);
  border-top: none;
}
.speech-name {
  font-size: 0.66em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--orange);
  margin-bottom: 4px;
}

/* === CONTENT AREA === */
.content-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chapter-header {
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chapter-tag {
  font-size: 0.66em;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 4px;
}
.chapter-title {
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.3;
}
.chapter-desc {
  font-size: 0.78em;
  color: var(--muted);
  margin-top: 3px;
}
.chapter-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 22px;
}
.chapter-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* === BUTTONS === */
.btn-primary {
  padding: 12px 28px;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 0.9em;
  font-weight: 700;
  transition: all .2s;
  box-shadow: 0 0 20px var(--orange-glow);
}
.btn-primary:hover  { background: var(--orange2); transform: translateY(-1px); box-shadow: 0 0 30px rgba(249,115,22,.6); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: #2a2a3a;
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* === PANEL CARD === */
.panel-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-card-header {
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.panel-card-body { padding: 12px; }
.wdc { width: 7px; height: 7px; border-radius: 50%; }
.wdc-r { background: var(--red); }
.wdc-y { background: #eab308; }
.wdc-g { background: var(--green); }

/* ============================================================
   INTRO SCREEN
   ============================================================ */
#intro {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at 50% 35%, #1e0d00 0%, var(--bg) 65%);
  padding: 20px;
}
.intro-blob {
  width: 170px;
  height: 170px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 36px rgba(249,115,22,.5));
}
.intro-title {
  font-size: 2.4em;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.15;
}
.intro-title span { color: var(--orange); }
.intro-sub {
  font-size: 0.95em;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.75;
  margin-bottom: 32px;
}
.intro-badges {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.intro-badge {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.75em;
  color: var(--dim);
}
.intro-badge span { color: var(--orange); font-weight: 700; }

/* ============================================================
   CHAPTER 1 — VS CODE SETUP PUZZLE
   ============================================================ */
.ch1-step { display: none; }
.ch1-step.active { display: flex; flex-direction: column; gap: 12px; }

.step-progress {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.step-dot.s-active { border-color: var(--orange); color: var(--orange); background: var(--orange-dim); }
.step-dot.s-done   { background: var(--orange); border-color: var(--orange); color: white; }
.step-label {
  font-size: 0.75em;
  color: var(--muted);
}
.step-label span { color: var(--text); font-weight: 600; }

/* Browser mock */
.browser-mock {
  background: #1a1b26;
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
}
.browser-chrome {
  background: #2a2b3d;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.browser-dots { display: flex; gap: 5px; }
.browser-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}
.browser-dots span:nth-child(1) { background: var(--red); }
.browser-dots span:nth-child(2) { background: #eab308; }
.browser-dots span:nth-child(3) { background: var(--green); }
.browser-url {
  background: rgba(255,255,255,0.07);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72em;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  flex: 1;
}
.browser-body {
  padding: 24px;
  display: flex;
  justify-content: center;
}
.vscode-download-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.vscode-icon-big {
  font-size: 3em;
  margin-bottom: 8px;
  display: block;
}
.vscode-card-title {
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 4px;
}
.vscode-card-sub {
  font-size: 0.78em;
  color: var(--muted);
  margin-bottom: 16px;
}
.btn-download {
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 7px;
  padding: 10px 20px;
  font-size: 0.85em;
  font-weight: 700;
  width: 100%;
  transition: all .2s;
}
.btn-download:hover { background: #006abc; transform: translateY(-1px); }
.dl-progress-wrap {
  margin-top: 12px;
  display: none;
}
.dl-progress-track {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.dl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0078d4, #00bcf2);
  border-radius: 999px;
  width: 0%;
  transition: width 0.1s linear;
}
.dl-progress-label {
  font-size: 0.72em;
  color: var(--muted);
  text-align: center;
}
.dock-area {
  margin-top: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.dock-label {
  font-size: 0.68em;
  color: var(--muted);
  flex-shrink: 0;
}
.dock-item {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  animation: pop-in 0.4s ease;
}
.dock-item.visible { display: flex; }
.dock-icon {
  width: 36px;
  height: 36px;
  background: #1e6dc0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  transition: transform .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.dock-item:hover .dock-icon { transform: translateY(-4px) scale(1.1); }
.dock-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }

/* VS Code mock */
.vscode-mock {
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vscode-titlebar {
  background: #3c3c3c;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.3);
}
.vscode-titlebar .browser-dots span:nth-child(1) { background: #ff5f57; }
.vscode-titlebar .browser-dots span:nth-child(2) { background: #febc2e; }
.vscode-titlebar .browser-dots span:nth-child(3) { background: #28c840; }
.vscode-title-text {
  font-size: 0.72em;
  color: #cccccc;
  margin: 0 auto;
}
.vscode-body {
  display: flex;
  flex: 1;
}
.vscode-activity {
  width: 44px;
  background: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 2px;
  border-right: 1px solid rgba(0,0,0,0.3);
}
.activity-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  color: #888;
  transition: all .15s;
  position: relative;
}
.activity-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.activity-btn.target { color: var(--orange); }
.activity-btn.target::after {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 20px;
  background: var(--orange);
  border-radius: 0 2px 2px 0;
}
.activity-btn.wrong-click { animation: shake 0.35s ease; color: var(--red) !important; }
.activity-sep { flex: 1; }
.activity-hint {
  animation: pulse-border 1s ease-in-out infinite;
  border-radius: 6px;
}
.vscode-content {
  flex: 1;
  background: #1e1e1e;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.vscode-welcome {
  text-align: center;
  color: #555;
  font-size: 0.8em;
}
.vscode-status-bar {
  background: #007acc;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.65em;
  color: white;
  gap: 12px;
}

/* Extensions panel */
.ext-panel {
  display: flex;
  flex-direction: column;
  background: #252526;
  width: 100%;
  height: 100%;
  min-height: 180px;
}
.ext-header {
  padding: 8px 10px;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #bbb;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ext-search-wrap {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ext-search {
  width: 100%;
  background: #3c3c3c;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 0.78em;
  color: white;
  outline: none;
}
.ext-search:focus { border-color: var(--orange); }
.ext-suggestion {
  margin: 4px 8px 0;
  display: none;
}
.ext-suggestion.visible { display: block; }
.ext-suggest-chip {
  background: rgba(249,115,22,0.15);
  border: 1px solid var(--orange-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72em;
  color: var(--orange);
  cursor: pointer;
  display: inline-block;
}
.ext-card {
  margin: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 10px;
  display: none;
}
.ext-card.visible { display: block; animation: slide-up 0.3s ease; }
.ext-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ext-card-icon {
  width: 32px; height: 32px;
  background: var(--orange);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1em;
  flex-shrink: 0;
}
.ext-card-info { flex: 1; }
.ext-card-name { font-size: 0.82em; font-weight: 700; }
.ext-card-author { font-size: 0.68em; color: var(--muted); }
.btn-install {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.72em;
  font-weight: 700;
  transition: all .2s;
}
.btn-install:hover { background: var(--orange2); }
.install-success {
  font-size: 0.72em;
  color: var(--green);
  display: none;
  align-items: center;
  gap: 4px;
}
.install-success.visible { display: flex; }

/* Auth modal */
.auth-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.auth-card {
  background: var(--bg3);
  border: 1px solid var(--orange-border);
  border-radius: 12px;
  padding: 28px 32px;
  text-align: center;
  max-width: 280px;
  width: 90%;
  animation: pop-in 0.3s ease;
}
.auth-icon { font-size: 2.2em; margin-bottom: 8px; display: block; }
.auth-title { font-size: 1em; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 0.78em; color: var(--muted); margin-bottom: 18px; }
.btn-authorize {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.85em;
  font-weight: 700;
  width: 100%;
  transition: all .2s;
}
.btn-authorize:hover { background: var(--orange2); transform: translateY(-1px); }
.auth-success { display: none; flex-direction: column; align-items: center; gap: 6px; }
.auth-success.visible { display: flex; animation: pop-in 0.4s ease; }
.auth-check { font-size: 2em; }

/* ============================================================
   CHAPTER 2 — TAP-TO-ASSIGN FILE SORTER
   ============================================================ */
.ch2-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}
.ch2-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.timer-badge {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.75em;
  font-weight: 700;
  color: var(--text);
  font-family: 'SF Mono', monospace;
}
.stress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stress-label {
  font-size: 0.7em;
  color: var(--muted);
  white-space: nowrap;
}
.stress-track {
  flex: 1;
  height: 6px;
  background: rgba(239,68,68,0.15);
  border-radius: 999px;
  overflow: hidden;
}
.stress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  background-size: 200% 100%;
  background-position: right center;
  border-radius: 999px;
  width: 100%;
  transition: width 0.5s ease, background-position 0.5s ease;
}

.file-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}
.file-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.72em;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.file-card:hover { border-color: rgba(249,115,22,0.4); background: rgba(249,115,22,0.05); }
.file-card.selected {
  border-color: var(--orange);
  background: rgba(249,115,22,0.12);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.25);
  transform: scale(1.03);
}
.file-card.sorted-correct {
  opacity: 0.35;
  border-color: var(--green);
  background: rgba(34,197,94,0.05);
  cursor: default;
  transform: none;
  pointer-events: none;
}
.file-card.sorted-correct::after {
  content: '✓';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9em;
  color: var(--green);
}
.file-card-icon { font-size: 1.1em; flex-shrink: 0; }
.file-card-name {
  color: var(--dim);
  font-family: 'SF Mono', 'Fira Code', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex-shrink: 0;
}
.folder-zone {
  background: var(--bg3);
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.folder-zone:hover,
.folder-zone.ready {
  border-color: var(--orange);
  background: rgba(249,115,22,0.07);
}
.folder-zone.accepted {
  border-color: var(--green);
  background: rgba(34,197,94,0.07);
  animation: pulse-border 0.4s ease;
}
.folder-zone.rejected {
  border-color: var(--red);
  background: rgba(239,68,68,0.07);
  animation: shake 0.35s ease;
}
.folder-zone-name {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--orange);
  font-family: 'SF Mono', monospace;
}
.folder-zone-hint { font-size: 0.68em; color: var(--muted); }
.folder-zone-count {
  font-size: 0.68em;
  color: var(--green);
  font-weight: 700;
}

/* ============================================================
   CHAPTER 3 — CLAUDE.MD MEMORY TOGGLE
   ============================================================ */
.ch3-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  height: 100%;
}

/* Editor column */
.ch3-editor-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
}

/* CLAUDE.md editor widget */
.claudemd-editor {
  background: #0d1117;
  border: 1px solid rgba(249,115,22,0.25);
  border-radius: 9px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cme-titlebar {
  background: #161b22;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.cme-dots { display: flex; gap: 5px; }
.cme-dots span { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cme-dots span:nth-child(1) { background: #ff5f57; }
.cme-dots span:nth-child(2) { background: #febc2e; }
.cme-dots span:nth-child(3) { background: #28c840; }
.cme-filename {
  font-size: 0.68em;
  color: #8b949e;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin: 0 auto;
}
.cme-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Section toggle rows */
.cme-section { border-radius: 6px; overflow: hidden; }
.cme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  user-select: none;
}
.cme-toggle:hover { background: rgba(249,115,22,0.07); }
.cme-section.active .cme-toggle { background: rgba(249,115,22,0.1); }
.cme-tog-icon {
  font-size: 0.6em;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
  width: 10px;
}
.cme-section.active .cme-tog-icon { transform: rotate(90deg); color: var(--orange); }
.cme-heading {
  font-size: 0.8em;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--muted);
  flex: 1;
  transition: color 0.2s;
}
.cme-section.active .cme-heading { color: var(--orange); }
.cme-badge {
  font-size: 0.62em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}
.cme-section.active .cme-badge {
  background: rgba(34,197,94,0.12);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.2);
}
.cme-lines {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 10px 8px 26px;
}
.cme-section.active .cme-lines { display: flex; animation: slide-up 0.2s ease; }
.cme-line {
  font-size: 0.7em;
  color: #8b949e;
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.6;
}
.cme-line::before { content: '> '; color: rgba(139,148,158,0.35); }
.cme-hint {
  font-size: 0.66em;
  color: var(--muted);
  text-align: center;
  padding-top: 2px;
  flex-shrink: 0;
}

/* Response bubbles column */
.ch3-bubbles-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}
.ch3-bubble-pair {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
}
.ch3-bubble-label {
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.ch3-bubble-label.bad  { color: var(--red);   background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2); }
.ch3-bubble-label.good { color: var(--green);  background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.2); }
.ch3-bubble {
  background: var(--bg3);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 0.78em;
  line-height: 1.7;
  color: var(--dim);
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: color 0.3s ease;
}
.ch3-bubble.bad  { border-left: 3px solid var(--red); }
.ch3-bubble.good { border-left: 3px solid var(--green); }
.ch3-placeholder { color: var(--muted); font-style: italic; }
.ch3-bubble-sub  { display: block; margin-top: 8px; font-size: 0.85em; color: var(--muted); font-style: italic; }
.ch3-brain-pulse {
  background: rgba(249,115,22,.08);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.78em;
  color: var(--orange);
  text-align: center;
  display: none;
  flex-shrink: 0;
  animation: slide-up 0.4s ease;
}

/* ============================================================
   CHAPTER 4 — SUBFOLDER CONTEXT CARDS
   ============================================================ */
.ch4-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

/* Context card grid */
.ch4-cards-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  flex-shrink: 0;
}
.ctx-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.72em;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.4;
  color: var(--dim);
  position: relative;
  overflow: hidden;
}
.ctx-card:hover { border-color: rgba(249,115,22,0.4); background: rgba(249,115,22,0.05); }
.ctx-card.selected {
  border-color: var(--orange);
  background: rgba(249,115,22,0.12);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.25);
}
.ctx-card.sorted-correct {
  opacity: 0.3;
  border-color: var(--green);
  background: rgba(34,197,94,0.05);
  cursor: default;
  pointer-events: none;
}
.ctx-card.sorted-correct::after {
  content: '✓';
  position: absolute;
  right: 6px; top: 6px;
  font-size: 0.85em;
  color: var(--green);
}

/* Folder columns */
.ch4-folders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}
.ch4-folder-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
  min-height: 0;
}
.ch4-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ch4-folder-name {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--orange);
  font-family: 'SF Mono', monospace;
}
.ch4-folder-count {
  font-size: 0.65em;
  color: var(--green);
  font-weight: 700;
}
.ch4-folder-zone {
  background: var(--bg3);
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 9px;
  padding: 10px;
  cursor: pointer;
  transition: all .2s;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ch4-folder-zone:hover,
.ch4-folder-zone.ready  { border-color: var(--orange); background: rgba(249,115,22,0.07); }
.ch4-folder-zone.accepted { border-color: var(--green); background: rgba(34,197,94,0.07); animation: pulse-border 0.4s ease; }
.ch4-folder-zone.rejected { border-color: var(--red);   background: rgba(239,68,68,0.07); animation: shake 0.35s ease; }
.ch4-fz-hint { font-size: 0.62em; color: var(--muted); text-align: center; font-family: 'SF Mono', monospace; line-height: 1.5; }
.ch4-folder-bubble {
  background: var(--bg3);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.7em;
  line-height: 1.55;
  color: var(--muted);
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-style: italic;
  border-left: 2px solid rgba(255,255,255,0.07);
  transition: all 0.35s ease;
}
.ch4-folder-bubble.complete {
  color: var(--dim);
  border-left-color: var(--green);
  font-style: normal;
  animation: slide-up 0.3s ease;
}

/* ============================================================
   REVEAL SCREENS
   ============================================================ */
.reveal-screen { flex-direction: column; }
.reveal-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.reveal-tag {
  font-size: 0.66em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--green);
  margin-bottom: 3px;
}
.reveal-title { font-size: 1.2em; font-weight: 700; }
.reveal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.reveal-side {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 14px;
}
.reveal-side-bad  { border-right: 1px solid var(--border); background: rgba(239,68,68,.025); }
.reveal-side-good { background: rgba(34,197,94,.025); }
.side-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .68em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 4px 10px;
  border-radius: 999px;
}
.side-label.bad  { color: var(--red);   background: rgba(239,68,68,.1);   border: 1px solid rgba(239,68,68,.2); }
.side-label.good { color: var(--green); background: rgba(34,197,94,.1);   border: 1px solid rgba(34,197,94,.2); }
.reveal-claude-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}
.reveal-claude-wrap svg { width: 100%; height: 100%; }
.reveal-bubble {
  background: var(--bg3);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: .8em;
  line-height: 1.75;
  color: var(--dim);
}
.reveal-bubble.bad  { border-left: 3px solid var(--red); }
.reveal-bubble.good { border-left: 3px solid var(--green); }
.reveal-lesson {
  background: rgba(249,115,22,.07);
  border: 1px solid rgba(249,115,22,.2);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: .78em;
  color: var(--orange);
}
.reveal-lesson strong {
  display: block;
  margin-bottom: 2px;
  font-size: .68em;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.reveal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
#results {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  background: radial-gradient(ellipse at 50% 30%, #1e0800 0%, var(--bg) 70%);
  overflow-y: auto;
  padding: 24px 16px;
}
.results-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  max-width: 520px;
  width: 100%;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 48px rgba(249,115,22,.5); }
  50%       { box-shadow: 0 0 80px rgba(249,115,22,.8); }
}
.badge-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #c2410c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2em;
  margin: 0 auto 14px;
  animation: pulse-glow 2s ease-in-out infinite;
}
.badge-title {
  font-size: 2em;
  font-weight: 800;
  margin-bottom: 5px;
}
.badge-sub {
  color: var(--dim);
  font-size: .9em;
  margin-bottom: 24px;
  line-height: 1.6;
}
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat {
  text-align: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 100px;
}
.stat-num   { font-size: 1.8em; font-weight: 800; color: var(--orange); }
.stat-label { font-size: .68em; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.share-box {
  background: var(--bg3);
  border: 1px solid var(--orange-border);
  border-radius: 10px;
  padding: 16px 18px;
  width: 100%;
  margin-bottom: 16px;
  text-align: left;
}
.share-box-label {
  font-size: .66em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--orange);
  margin-bottom: 7px;
}
.share-text {
  font-size: .8em;
  color: var(--dim);
  line-height: 1.75;
}
.btn-share {
  padding: 12px 28px;
  background: #0a66c2;
  color: white;
  border: none;
  border-radius: 9px;
  font-size: .88em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
}
.btn-share:hover { background: #0958ab; transform: translateY(-1px); }
.copy-confirm {
  font-size: .72em;
  color: var(--green);
  margin-top: 6px;
  opacity: 0;
  transition: opacity .3s;
  min-height: 18px;
}
.copy-confirm.show { opacity: 1; }

/* ============================================================
   FLOATING CLAUDE (mobile companion)
   ============================================================ */
.claude-floating {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 200;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.float-bubble {
  background: var(--bg4);
  border: 1px solid var(--orange-border);
  border-radius: 10px 10px 0 10px;
  padding: 9px 12px;
  font-size: 0.75em;
  line-height: 1.55;
  max-width: 200px;
  opacity: 0;
  transform: translateY(6px);
  transition: all .25s ease;
  pointer-events: none;
}
.float-bubble.show { opacity: 1; transform: translateY(0); }
.float-char {
  width: 64px;
  height: 64px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(249,115,22,0.3));
}
.float-char svg { width: 100%; height: 100%; }


/* ============================================================
   MOBILE — ≤ 767px
   ============================================================ */
@media (max-width: 767px) {
  body { height: 100dvh; }

  /* Show floating claude, hide panel */
  .claude-panel   { display: none !important; }
  .claude-floating { display: flex; }

  /* Single column game layout */
  .game-area { grid-template-columns: 1fr; }

  /* Chapter headers smaller */
  .chapter-title { font-size: 1.05em; }
  .chapter-body  { padding: 12px 14px; }
  .chapter-footer { padding: 10px 14px; }

  /* Chapter 1 */
  .browser-body { padding: 14px; }
  .vscode-download-card { padding: 16px 18px; }

  /* Chapter 2 — stack vertically */
  .ch2-layout { gap: 10px; }
  .file-cards-grid  { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .file-card { font-size: 0.65em; padding: 6px 7px; }
  .folder-zones { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .folder-zone { min-height: 72px; padding: 8px 6px; }
  .folder-zone-name { font-size: 0.72em; }

  /* Chapter 3 — single column */
  .ch3-layout { grid-template-columns: 1fr; }
  .ch3-bubbles-col { display: none; }

  /* Chapter 4 — compact on mobile */
  .ch4-cards-area { grid-template-columns: repeat(2, 1fr); gap: 5px; }
  .ctx-card { font-size: 0.66em; padding: 7px 8px; }
  .ch4-folders { gap: 7px; }
  .ch4-folder-col { gap: 5px; }
  .ch4-folder-bubble { font-size: 0.64em; padding: 7px 9px; }

  /* Reveal screens — stack */
  .reveal-body { grid-template-columns: 1fr; }
  .reveal-side-bad { border-right: none; border-bottom: 1px solid var(--border); }

  /* Topbar */
  .topbar-title { display: none; }
  .topbar { padding: 8px 14px; }

  /* Intro */
  .intro-title { font-size: 1.85em; }
  .intro-blob  { width: 130px; height: 130px; }
  .intro-sub   { font-size: 0.87em; }

  /* Results */
  .badge-circle { width: 100px; height: 100px; font-size: 2.4em; }
  .badge-title  { font-size: 1.6em; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.mono { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; }
code {
  background: rgba(167,139,250,0.12);
  color: var(--purple);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', monospace;
}
