:root {
  --bg-deep: #0F0F1A;
  --bg-card: #1A1A2E;
  --bg-dark: #111827;
  --border: #2D2D4E;
  --purple: #7C3AED;
  --pink: #EC4899;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --dim: #6B7280;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0f1a, #1a0a2e);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
#app { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Token modal */
#token-modal {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.85);
  align-items: center; justify-content: center;
}
#token-modal.show { display: flex; }
.modal-box {
  background: #1A1A2E; border: 1px solid var(--border);
  border-radius: 20px; padding: 28px 24px; width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
.modal-box h3 { color: var(--text); font-size: 16px; font-weight: 800; }
.modal-box p { color: var(--muted); font-size: 13px; }
.modal-box textarea {
  background: #111827; border: 1px solid #374151; border-radius: 10px;
  color: var(--text); font-size: 12px; padding: 10px 12px;
  resize: vertical; min-height: 80px; outline: none; width: 100%;
  font-family: monospace;
}
.modal-box button {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border: none; border-radius: 12px; padding: 12px;
  font-weight: 800; font-size: 14px; cursor: pointer;
}

/* Nav pills */
#nav-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nav-pill {
  padding: 6px 14px; border-radius: 20px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 700; transition: all .2s;
  background: rgba(255,255,255,0.1); color: var(--muted);
}
.nav-pill.active { background: var(--purple); color: #fff; }

/* Phone shell */
#phone-shell {
  width: 360px;
  background: #111827;
  border-radius: 40px;
  padding: 12px 0 0;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
#notch {
  display: flex; justify-content: center; margin-bottom: 8px;
}
#notch-inner {
  width: 100px; height: 22px; background: #000; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
#notch-dot { width: 10px; height: 10px; border-radius: 50%; background: #1f2937; }
#screen-area {
  height: 680px; overflow-y: auto; background: var(--bg-deep);
  position: relative; scrollbar-width: none;
}
#screen-area::-webkit-scrollbar { display: none; }
#home-bar {
  height: 28px; background: #111827;
  display: flex; align-items: center; justify-content: center;
}
#home-bar-line { width: 100px; height: 4px; background: #374151; border-radius: 4px; }

/* Hint text */
#hint-text { color: rgba(255,255,255,0.3); font-size: 12px; text-align: center; }

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; }

/* Dashboard */
#screen-dashboard { padding: 0; }
.dashboard-inner { padding: 16px 16px 80px; }
.player-card {
  background: linear-gradient(135deg, #4C1D95, #1E3A5F);
  border-radius: 20px; padding: 20px 20px 16px; margin-bottom: 16px;
}
.player-row { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  flex-shrink: 0;
}
.player-name { color: #fff; font-weight: 800; font-size: 16px; }
.player-badges { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.badge-lv {
  background: var(--purple); color: #fff; font-size: 11px;
  font-weight: 700; padding: 2px 8px; border-radius: 6px;
}
.badge-title {
  background: rgba(245,158,11,.2); color: #FCD34D; font-size: 11px;
  font-weight: 700; padding: 2px 8px; border-radius: 6px;
}
.exp-right { text-align: right; margin-left: auto; }
.exp-label { color: var(--muted); font-size: 10px; }
.exp-val { color: #fff; font-weight: 800; font-size: 15px; }
.exp-sub { color: var(--dim); font-size: 11px; }
.exp-bar-wrap {
  margin-top: 12px; background: rgba(0,0,0,0.3);
  border-radius: 8px; height: 6px; overflow: hidden;
}
.exp-bar {
  height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 8px; transition: width 1s ease;
}
.daily-quest {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.quest-icon { font-size: 20px; }
.quest-title { color: #FCD34D; font-weight: 700; font-size: 13px; }
.quest-sub { color: var(--muted); font-size: 12px; }
.quest-count { margin-left: auto; color: #F59E0B; font-size: 12px; font-weight: 700; }
.section-label {
  color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .06em;
}
.level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-card {
  border-radius: 16px; padding: 16px 14px; position: relative;
  transition: all .2s; cursor: pointer;
}
.level-card.unlocked {
  background: var(--bg-card); border: 1px solid var(--border);
}
.level-card.locked {
  background: #111827; border: 1px solid #1f2937;
  opacity: 0.45; cursor: default;
}
.level-lock { position: absolute; top: 8px; right: 10px; font-size: 14px; }
.level-icon { font-size: 28px; margin-bottom: 6px; }
.level-name { color: var(--text); font-weight: 700; font-size: 14px; }
.level-sub { color: var(--dim); font-size: 11px; margin-top: 2px; }
.level-stars { margin-top: 6px; }
.level-new { margin-top: 6px; color: var(--purple); font-size: 11px; font-weight: 700; }
.level-goal { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.4; }
.level-resume { margin-top: 6px; color: #34D399; font-size: 11px; font-weight: 700; }
.level-card.in-progress {
  border-color: #34D399 !important;
  box-shadow: 0 0 0 1px rgba(52,211,153,0.25);
}
.daily-quest.quest-done { opacity: 0.6; }
.daily-quest.quest-done .quest-icon::after { content: ' ✅'; }
.star { font-size: 11px; }
.star.lit { color: #F59E0B; }
.star.dim { color: #374151; }
.fab-wrap { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 20px; }
.fab-btn {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; border: none; border-radius: 24px; padding: 12px 20px;
  font-weight: 800; font-size: 14px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,0.5);
}

/* Setup */
#screen-setup { padding: 0 0 80px; }
.setup-header {
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #1F2937;
}
.back-btn {
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 0;
}
.setup-title { color: #fff; font-weight: 800; font-size: 15px; }
.setup-sub { color: var(--dim); font-size: 11px; }
.persona-preview {
  margin: 16px 16px 0;
  border-radius: 18px; padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all .3s;
  background: linear-gradient(135deg, #1E1B4B, #1A1A2E);
  border: 1px solid var(--border);
}
.persona-preview.selected { border-color: var(--purple); }
.persona-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4C1D95, #BE185D);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.persona-name { color: var(--text); font-weight: 700; font-size: 14px; }
.persona-desc { color: var(--muted); font-size: 12px; margin-top: 3px; }
.persona-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.persona-tag {
  background: rgba(124,58,237,.2); color: #A78BFA;
  font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.setup-section { padding: 14px 16px 0; }
.mbti-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mbti-btn {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 8px 4px; cursor: pointer; text-align: center;
  transition: all .15s;
}
.mbti-btn.selected {
  background: rgba(124,58,237,.25); border-color: var(--purple);
}
.mbti-code { color: var(--text); font-weight: 700; font-size: 12px; }
.mbti-trait { color: var(--dim); font-size: 9px; margin-top: 2px; }
.diff-row {
  display: flex; background: var(--bg-card); border-radius: 12px;
  padding: 4px; gap: 4px;
}
.diff-btn {
  flex: 1; padding: 8px 0; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 700; font-size: 13px; transition: all .2s;
  background: transparent; color: var(--dim);
}
.diff-btn.active-easy { background: #10B981; color: #fff; }
.diff-btn.active-normal { background: var(--purple); color: #fff; }
.diff-btn.active-hard { background: #EF4444; color: #fff; }
.hard-warning {
  color: #FCA5A5; font-size: 11px; margin-top: 8px; text-align: center;
}
.start-btn {
  width: 100%; padding: 14px; border-radius: 16px; border: none;
  font-weight: 800; font-size: 16px; transition: all .3s; cursor: pointer;
  background: #1F2937; color: #4B5563;
}
.start-btn.ready {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; cursor: pointer;
  box-shadow: 0 8px 24px rgba(124,58,237,0.4);
}
.start-btn.ready-hard {
  background: linear-gradient(135deg, #B91C1C, #EF4444);
  color: #fff; cursor: pointer;
}

/* Chat */
#screen-chat { display: none; flex-direction: column; height: 680px; }
#screen-chat.active { display: flex; }
.chat-hud {
  background: #111827; padding: 12px 16px 10px;
  border-bottom: 1px solid #1F2937; flex-shrink: 0;
}
.hud-row { display: flex; align-items: center; gap: 10px; }
.hud-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4C1D95, #BE185D);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  flex-shrink: 0;
}
.hud-name { color: var(--text); font-weight: 700; font-size: 14px; }
.hud-sub { color: var(--dim); font-size: 11px; }
.hud-goal { color: #A78BFA; font-size: 10px; margin-top: 2px; }
.hp-wrap { margin-left: auto; text-align: right; }
.hp-label { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.hp-bar-track {
  width: 80px; height: 6px; background: #1F2937;
  border-radius: 4px; overflow: hidden;
}
.hp-bar {
  height: 100%; border-radius: 4px; transition: width .7s ease, box-shadow .3s;
}
.hp-bar.high { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.hp-bar.mid { background: linear-gradient(90deg, #D97706, #F59E0B); }
.hp-bar.low { background: linear-gradient(90deg, #B91C1C, #EF4444); }
.danger-banner {
  margin-top: 8px;
  background: rgba(234,88,12,0.2); border: 1px solid rgba(234,88,12,0.4);
  border-radius: 8px; padding: 6px 12px;
  color: #FB923C; font-size: 11px; font-weight: 700; text-align: center;
}
/* Quest HUD */
#quest-hud {
  background: #12122a; border-bottom: 1px solid #2D2D4E;
  flex-shrink: 0;
}
.qhud-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; user-select: none;
}
.qhud-badge {
  background: rgba(124,58,237,.25); color: #A78BFA;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  flex-shrink: 0;
}
.qhud-mbti {
  color: #34D399; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.qhud-title-text {
  color: var(--muted); font-size: 11px; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qhud-rounds {
  color: var(--dim); font-size: 10px; flex-shrink: 0;
}
.qhud-chevron {
  color: var(--dim); font-size: 10px; flex-shrink: 0;
  transition: transform .2s;
}
#quest-hud.expanded .qhud-chevron { transform: rotate(180deg); }
.qhud-body {
  display: none; padding: 0 14px 12px;
}
#quest-hud.expanded .qhud-body { display: block; }
.qhud-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 10px;
}
.qhud-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; text-align: center;
}
.qhud-stat-label { color: var(--dim); font-size: 9px; margin-bottom: 3px; }
.qhud-stat-val { color: var(--text); font-weight: 700; font-size: 14px; }
.qhud-desc {
  color: var(--muted); font-size: 12px; line-height: 1.5;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}

#msg-list {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: none;
}
#msg-list::-webkit-scrollbar { display: none; }
.msg-row { display: flex; flex-direction: column; }
.msg-bubble-row {
  display: flex; align-items: flex-end; gap: 8px;
}
.msg-bubble-row.user { justify-content: flex-end; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4C1D95, #BE185D);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.bubble {
  max-width: 70%; padding: 10px 14px; color: var(--text);
  font-size: 14px; line-height: 1.5;
}
.bubble.ai { background: #1F2937; border-radius: 18px 18px 18px 4px; }
.bubble.user {
  background: linear-gradient(135deg, var(--purple), #9333EA);
  border-radius: 18px 18px 4px 18px;
}
.feedback-chip {
  display: flex; justify-content: flex-end; margin-top: 6px;
}
.chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.chip.positive {
  background: rgba(16,185,129,.2); color: #34D399;
  border: 1px solid rgba(16,185,129,.4);
}
.chip.negative {
  background: rgba(239,68,68,.2); color: #FCA5A5;
  border: 1px solid rgba(239,68,68,.4);
}
.chip.neutral {
  background: rgba(107,114,128,.2); color: #9CA3AF;
  border: 1px solid rgba(107,114,128,.3);
}
.typing-bubble {
  display: none; align-items: flex-end; gap: 8px;
}
.typing-bubble.show { display: flex; }
.typing-dots {
  padding: 10px 16px; border-radius: 18px 18px 18px 4px;
  background: #1F2937; display: flex; gap: 5px; align-items: center;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--dim);
  animation: bounce 1s infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
#hint-panel {
  display: none;
  background: #1E1B4B; border-top: 1px solid #3730A3; padding: 12px 16px;
}
#hint-panel.show { display: block; }
.hint-title { color: #A78BFA; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
#hint-text-content { color: #C4B5FD; font-size: 13px; }
.hint-close {
  margin-top: 8px; color: var(--dim); background: none; border: none;
  cursor: pointer; font-size: 12px;
}
.chat-input-row {
  background: #111827; border-top: 1px solid #1F2937;
  padding: 10px 14px; display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
#hint-btn {
  flex-shrink: 0; padding: 8px 10px; border-radius: 12px;
  border: 1.5px solid var(--purple);
  background: rgba(124,58,237,.15); color: #A78BFA;
  cursor: pointer; font-size: 12px; font-weight: 700; transition: all .2s;
}
#hint-btn.disabled {
  border-color: #374151; background: #1F2937; color: #4B5563; cursor: not-allowed;
}
#msg-input {
  flex: 1; background: #1F2937; border: 1px solid #374151;
  border-radius: 20px; padding: 10px 14px; color: var(--text);
  font-size: 14px; outline: none; font-family: inherit;
}
#msg-input::placeholder { color: #4B5563; }
#send-btn {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; font-size: 16px; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
#send-btn.disabled { background: #1F2937; cursor: not-allowed; }

/* Result */
#screen-result { padding: 24px 16px 80px; text-align: center; }
.result-emoji { font-size: 42px; margin-bottom: 6px; }
.result-title {
  font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, #34D399, #60A5FA);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 4px;
}
.result-title.fail {
  background: linear-gradient(135deg, #EF4444, #F97316);
  -webkit-background-clip: text; background-clip: text;
}
.result-sub { color: var(--dim); font-size: 13px; margin-bottom: 20px; }
.title-badge {
  background: linear-gradient(135deg, #4C1D95, #BE185D, #D97706);
  border-radius: 20px; padding: 20px 20px 16px; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.badge-new {
  position: absolute; top: 8px; right: 10px;
  background: #FCD34D; color: #78350F;
  font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 8px;
}
.badge-icon { font-size: 40px; margin-bottom: 8px; }
.badge-name { color: #fff; font-weight: 900; font-size: 20px; margin-bottom: 4px; }
.badge-desc { color: rgba(255,255,255,0.7); font-size: 12px; }
.score-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.score-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 8px; }
.score-label { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.score-val { color: var(--text); font-weight: 800; font-size: 18px; }
.radar-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.radar-title {
  color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 12px;
  text-align: left; text-transform: uppercase; letter-spacing: .06em;
}
.exp-result-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
}
.exp-result-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.exp-result-label { color: var(--muted); font-size: 12px; }
.exp-result-val { color: #A78BFA; font-weight: 800; font-size: 14px; }
.exp-result-track { background: #111827; border-radius: 8px; height: 8px; overflow: hidden; }
.exp-result-bar {
  height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 8px; transition: width 1s ease; width: 0%;
}
.debrief-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 20px; text-align: left;
}
.debrief-toggle {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; background: none; border: none; cursor: pointer; padding: 0;
}
.debrief-toggle-label { color: var(--text); font-weight: 700; font-size: 14px; }
.debrief-arrow { color: var(--purple); font-size: 16px; transition: transform .3s; }
.debrief-arrow.open { transform: rotate(180deg); }
.debrief-preview { color: var(--muted); font-size: 13px; margin-top: 8px; }
.debrief-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.debrief-item { display: flex; gap: 10px; align-items: flex-start; }
.debrief-item span:first-child { font-size: 12px; margin-top: 1px; }
.debrief-positive { color: #34D399; font-size: 13px; }
.debrief-improve { color: #FCD34D; font-size: 13px; }
.result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.retry-btn {
  padding: 13px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 20px rgba(124,58,237,.4);
}
.home-btn {
  padding: 13px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--muted); font-weight: 700; font-size: 14px;
}

/* ===== CHAT SIDEBAR (desktop only) ===== */
#chat-sidebar { display: none; }
.sidebar-label {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
#sidebar-hp-label { color: var(--text); font-size: 13px; margin-bottom: 6px; }
#sidebar-hint-text { color: #C4B5FD; font-size: 13px; line-height: 1.5; }
#sidebar-round-info { color: var(--text); font-size: 13px; }

/* ===== RESPONSIVE: TABLET (≥768px) ===== */
@media (min-width: 768px) {
  body { align-items: flex-start; padding: 0; }
  #app { width: 100%; flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
  #nav-pills {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15,15,26,0.95); backdrop-filter: blur(8px);
    justify-content: flex-start; padding: 12px 24px; gap: 12px; flex-wrap: nowrap;
  }
  .nav-pill { font-size: 14px; padding: 8px 18px; }
  .nav-pill[data-screen="chat"],
  .nav-pill[data-screen="result"] { display: none; }
  #phone-shell { width: 100%; border-radius: 0; box-shadow: none; padding: 0; background: transparent; }
  #notch, #home-bar { display: none; }
  #screen-area { height: auto; min-height: calc(100vh - 56px); overflow-y: visible; }
  #screen-chat { height: calc(100vh - 56px); }
  .dashboard-inner,
  #screen-setup,
  #screen-result { max-width: 800px; margin: 0 auto; padding: 24px 20px 60px; }
  #hint-text { display: none; }
}

/* ===== RESPONSIVE: DESKTOP (≥1200px) ===== */
@media (min-width: 1200px) {
  /* Dashboard – two-column grid */
  .dashboard-inner {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-rows: auto auto 1fr;
    column-gap: 28px;
  }
  .dashboard-inner .player-card { grid-column: 1 / -1; }
  .dashboard-inner .daily-quest { grid-column: 1; grid-row: 2; }
  .dashboard-inner .section-label { grid-column: 2; grid-row: 2; }
  .dashboard-inner .level-grid {
    grid-column: 2; grid-row: 3;
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-inner .fab-wrap { grid-column: 1; grid-row: 3; align-self: end; }

  /* Setup – two-column */
  #screen-setup { max-width: 1100px; padding: 0 0 60px; }
  .setup-body-desktop {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    padding: 20px 24px;
  }

  /* Chat – sidebar layout */
  #screen-chat { flex-direction: row; flex-wrap: wrap; }
  .chat-hud { width: 100%; flex: 0 0 100%; }
  #msg-list { flex: 1; }
  #chat-sidebar {
    display: flex; flex-direction: column; gap: 16px;
    width: 280px; flex-shrink: 0;
    background: var(--bg-card); border-left: 1px solid var(--border);
    padding: 20px 16px; overflow-y: auto;
  }
  .chat-input-row { width: 100%; flex: 0 0 100%; }
  #hint-panel { display: none !important; }

  /* Result – modal overlay (結算頁不是導航目的地，改為彈出式) */
  #screen-result.active {
    display: flex !important;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.82); backdrop-filter: blur(8px);
    align-items: center; justify-content: center;
    padding: 32px;
  }

  .result-inner {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 24px;
    max-width: 920px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    scrollbar-width: none;
    padding: 36px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    text-align: left;
  }
  .result-inner::-webkit-scrollbar { display: none; }

  .result-inner .result-emoji,
  .result-inner .result-title,
  .result-inner .result-sub { grid-column: 1 / -1; text-align: center; }
  .result-inner .result-right { grid-column: 2; grid-row: 2; }
  .result-inner .result-left  { grid-column: 1; grid-row: 2; }
  .result-inner .result-btns  { grid-column: 1 / -1; }
}
