/* ================================================================== */
/*  CSS Variables - Day / Night theming                               */
/* ================================================================== */

:root {
  --bg-top: #d6eefb;
  --bg-bottom: #eef8ff;
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(23, 34, 44, 0.12);
  --text: #18232d;
  --text-dim: #667986;
  --accent: #5fb5ff;
  --shadow: 0 16px 40px rgba(11, 21, 31, 0.16);
  --pixel-font: 'Courier New', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ui-font: Inter, Pretendard, system-ui, sans-serif;
  --transition-speed: 0.5s;
}

/* ================================================================== */
/*  Reset & Base                                                       */
/* ================================================================== */

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  font-family: var(--ui-font);
  transition: background var(--transition-speed) ease;
}

body {
  overflow: hidden;
}

button {
  font: inherit;
}

h1, h2, h3, p {
  margin-top: 0;
}

/* ================================================================== */
/*  Preloader                                                          */
/* ================================================================== */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a2a3a, #0d1820);
  color: #eef4f8;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
  max-width: 360px;
  padding: 0 24px;
}

.preloader-content h1 {
  font-size: 36px;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.preloader-content p {
  color: #9eb1bc;
  margin-bottom: 24px;
  font-size: 15px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5fb5ff, #8fd1ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-family: var(--pixel-font);
  font-size: 11px;
  color: #667986;
  margin: 0;
}

/* ================================================================== */
/*  App shell                                                          */
/* ================================================================== */

#app {
  min-height: 100vh;
  padding: 14px;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  transition: background var(--transition-speed) ease;
}

/* ================================================================== */
/*  Night theme                                                        */
/* ================================================================== */

#app.theme-night {
  --bg-top: #0d1420;
  --bg-bottom: #182436;
  --glass: rgba(16, 24, 40, 0.92);
  --glass-border: rgba(140, 200, 255, 0.12);
  --text: #f0f4f8;
  --text-dim: #8dafc8;
  --accent: #6cc4ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ================================================================== */
/*  Glass morphism cards                                               */
/* ================================================================== */

.hud,
.ui-card,
.world-shell {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    background var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

/* ================================================================== */
/*  HUD header                                                         */
/* ================================================================== */

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  border-radius: 16px;
  margin-bottom: 6px;
}

.hud-brand {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
  font-family: var(--pixel-font);
  font-weight: 600;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(20px, 2.5vw, 28px);
  letter-spacing: -0.01em;
  font-family: var(--pixel-font);
  background: linear-gradient(135deg, var(--accent), #a8dcff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hud-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(23, 34, 44, 0.08);
  background: rgba(255, 255, 255, 0.42);
  color: var(--text);
  font-size: 10px;
  font-family: var(--pixel-font);
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.chip-secondary {
  color: var(--text-dim);
  background: rgba(15, 23, 32, 0.04);
}

.button {
  cursor: pointer;
  user-select: none;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

#clockChip {
  background: rgba(95, 181, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.button:hover {
  background: rgba(95, 181, 255, 0.15);
  border-color: var(--accent);
}

.button:active {
  background: rgba(95, 181, 255, 0.25);
}

/* ================================================================== */
/*  Main shell & world container                                       */
/* ================================================================== */

.shell {
  height: calc(100vh - 112px);
}

.world-shell {
  position: relative;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(95, 181, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(11,21,31,0.04));
}

/* ================================================================== */
/*  Timeline bar                                                       */
/* ================================================================== */

.viewport-top-chrome {
  position: absolute;
  inset: 10px 10px auto;
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.viewport-top-chrome > * {
  pointer-events: auto;
}

.timeline-bar {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: min(440px, calc(100vw - 140px));
  padding: 6px 12px;
  min-height: 38px;
  flex-shrink: 0;
  border: 1px solid rgba(95, 181, 255, 0.1);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.54));
  box-shadow: 0 8px 18px rgba(12, 21, 31, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mobile-panel-switch {
  display: none;
}

.mobile-panel-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  color: var(--text-dim);
  font: inherit;
  font-family: var(--pixel-font);
  font-size: 11px;
  cursor: pointer;
  min-height: 32px;
  padding: 0 14px;
  box-shadow: 0 8px 18px rgba(12, 21, 31, 0.1);
}

.mobile-panel-btn.is-active {
  background: rgba(95,181,255,0.16);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(95,181,255,0.2);
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.timeline-line {
  width: 28px;
  height: 2px;
  background: var(--glass-border);
  margin: 0 2px;
  align-self: center;
  flex-shrink: 0;
  /* Vertically align with dots */
  margin-top: 14px;
}

.timeline-time {
  font-family: var(--pixel-font);
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  transition: all 0.3s ease;
}

.dot--completed {
  background: var(--accent);
  border-color: var(--accent);
}

.dot--current {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 181, 255, 0.3);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.dot--future {
  background: transparent;
  border-color: var(--glass-border);
}

.timeline-label {
  font-family: var(--pixel-font);
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  line-height: 1;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(95, 181, 255, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(95, 181, 255, 0.1); }
}

/* ================================================================== */
/*  Viewport & canvas                                                  */
/* ================================================================== */

.viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.16), transparent 26%),
    linear-gradient(180deg, rgba(140, 214, 255, 0.1), rgba(24, 35, 45, 0.08));
}

.viewport::before,
.viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.viewport::before {
  background:
    linear-gradient(transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%),
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 2px,
      transparent 2px,
      transparent 6px
    );
  mix-blend-mode: screen;
}

.viewport::after {
  background: radial-gradient(circle at center, transparent 55%, rgba(8, 14, 20, 0.18) 100%);
}

#app.is-commuting .viewport::after {
  background:
    linear-gradient(180deg, rgba(8,14,20,0.2), transparent 16%, transparent 84%, rgba(8,14,20,0.2)),
    radial-gradient(circle at center, transparent 45%, rgba(8, 14, 20, 0.26) 100%);
}


#game,
.viewport > canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #98d882;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: saturate(1.06) contrast(1.04);
}

.world-panels {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 58px 10px 10px;
  pointer-events: none;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.panel-stack-left {
  width: min(244px, calc(100% - 24px));
  justify-content: flex-start;
}

.panel-stack-right {
  width: min(184px, 20vw);
  justify-content: flex-end;
  align-self: stretch;
  align-items: flex-end;
}


/* ================================================================== */
/*  UI cards (overlays inside viewport)                                */
/* ================================================================== */

.ui-card {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px;
  max-width: min(300px, calc(100% - 20px));
  z-index: 10;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0.64));
  box-shadow:
    0 8px 18px rgba(12, 21, 31, 0.09),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.ui-card h2 {
  font-size: 15px;
  margin-bottom: 3px;
  line-height: 1.3;
}

.ui-card h3 {
  font-size: 14px;
  margin-bottom: 2px;
}

.ui-card p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 5px;
  line-height: 1.45;
}

.ui-card p:last-child {
  margin-bottom: 0;
}

/* Task card */
.task-card {
  width: min(208px, 100%);
  box-shadow:
    0 14px 26px rgba(12, 21, 31, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.34);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.8)),
    radial-gradient(circle at top left, rgba(95,181,255,0.16), transparent 32%);
}

.task-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.05);
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
}

#app[data-task-card-dismissed="true"] .task-card {
  display: none;
}

.task-card #taskDescription {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

#app[data-task-card-expanded="false"] .task-card {
  width: min(166px, 100%);
}

#app[data-task-card-expanded="false"] .task-card #taskDescription {
  display: none;
}

#app[data-task-card-expanded="false"] .task-card .eyebrow {
  display: none;
}

#app[data-task-card-expanded="false"] .task-card h2 {
  font-size: 15px;
  line-height: 1.25;
  margin-bottom: 3px;
}

#app[data-task-card-expanded="false"] .task-card .task-meta {
  font-size: 10px;
}

.task-card #taskDescription {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.task-card h2,
.task-card p:not(.eyebrow) {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.task-card h2 {
  -webkit-line-clamp: 2;
}

.task-card p:not(.eyebrow) {
  -webkit-line-clamp: 2;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--pixel-font);
}

.task-expand-hint {
  display: none;
}

.task-progress-track {
  height: 4px;
  background: rgba(95, 181, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 2px;
}

.task-progress-track.hidden {
  display: none;
}

.task-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #8fd1ff);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.task-route-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 2px;
}

.task-route-strip.hidden {
  display: none;
}

.task-route-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.06);
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--pixel-font);
}

.task-route-chip.is-active {
  background: rgba(95, 181, 255, 0.16);
  color: var(--accent);
}

.task-route-chip.is-traveling {
  background: rgba(255, 214, 102, 0.18);
  color: #9b6a00;
}

.task-route-chip.is-queued {
  background: rgba(132, 210, 157, 0.16);
  color: #2f7b51;
}

.task-route-chip.is-overflow {
  background: rgba(15, 23, 32, 0.08);
}

.queue-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.72)),
    radial-gradient(circle at top right, rgba(132, 210, 157, 0.16), transparent 36%);
}

.queue-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.queue-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-head h3 {
  margin: 0;
}

.queue-badge {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(95,181,255,0.12);
  border: 1px solid rgba(95,181,255,0.18);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--pixel-font);
}

.queue-collapse-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.06);
  color: var(--text-dim);
  font-family: var(--pixel-font);
  font-size: 11px;
  cursor: pointer;
}

#app[data-queue-collapsed="true"] .queue-card {
  gap: 6px;
  padding-block: 9px;
  max-width: 172px;
  padding-inline: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.62)),
    radial-gradient(circle at top right, rgba(132, 210, 157, 0.08), transparent 40%);
}

#app[data-queue-collapsed="true"] .queue-card h3 {
  font-size: 13px;
  line-height: 1.25;
}

#app[data-queue-collapsed="true"] .queue-card .task-form,
#app[data-queue-collapsed="true"] .queue-card .quick-task-chips,
#app[data-queue-collapsed="true"] .queue-card .queue-help,
#app[data-queue-collapsed="true"] .queue-card .queue-signal,
#app[data-queue-collapsed="true"] .queue-card .task-queue-list,
#app[data-queue-collapsed="true"] .queue-card .task-done-toast {
  display: none;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.task-form input {
  min-width: 0;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(23,34,44,0.1);
  padding: 10px 12px;
  font: inherit;
  background: rgba(255,255,255,0.82);
  color: var(--text);
}

.task-form button,
.quick-task-chips button,
.task-queue-remove {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(95,181,255,0.2), rgba(95,181,255,0.1));
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.task-form button {
  min-height: 40px;
  padding: 0 12px;
  font-weight: 600;
}

.quick-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-task-chips button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  flex: 0 0 auto;
}

.quick-task-chips button[data-task-bundle] {
  background: linear-gradient(180deg, rgba(255, 214, 102, 0.24), rgba(255, 214, 102, 0.12));
}

.queue-help {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
  display: none;
}

.queue-signal {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 32, 0.04);
  border: 1px solid rgba(15, 23, 32, 0.05);
}

.queue-signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-signal-head strong,
.queue-signal-head span {
  font-size: 11px;
  font-family: var(--pixel-font);
}

.queue-signal-head span {
  color: var(--text-dim);
  text-align: right;
}

.queue-signal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.queue-signal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(15, 23, 32, 0.06);
  color: var(--text);
  font-size: 11px;
  font-family: var(--pixel-font);
  white-space: nowrap;
  flex: 0 0 auto;
}

.queue-signal-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(24, 35, 45, 0.28);
  box-shadow: 0 0 0 3px rgba(24, 35, 45, 0.05);
  flex-shrink: 0;
}

.queue-signal-chip-dot.is-queued {
  background: rgba(95, 181, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(95, 181, 255, 0.12);
}

.queue-signal-chip-dot.is-traveling {
  background: rgba(255, 181, 64, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 181, 64, 0.14);
}

.queue-signal-chip-dot.is-live {
  background: rgba(104, 224, 168, 0.95);
  box-shadow: 0 0 0 3px rgba(104, 224, 168, 0.16);
}

.queue-signal-chip-dot.is-done {
  background: rgba(91, 194, 138, 0.9);
  box-shadow: 0 0 0 3px rgba(91, 194, 138, 0.14);
}

.queue-signal-chip-dot.is-muted {
  background: rgba(24, 35, 45, 0.34);
}

.queue-signal-chip.is-active {
  background: rgba(95, 181, 255, 0.16);
  border-color: rgba(95, 181, 255, 0.24);
  color: var(--accent);
}

.queue-signal-chip.is-traveling {
  background: rgba(255, 214, 102, 0.18);
  border-color: rgba(255, 214, 102, 0.26);
  color: #9b6a00;
}

.queue-signal-chip.is-done {
  background: rgba(91, 194, 138, 0.16);
  border-color: rgba(91, 194, 138, 0.24);
  color: #246b42;
}

.queue-signal-chip.is-overflow {
  background: rgba(15, 23, 32, 0.06);
  color: var(--text-dim);
}

.queue-signal-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.08);
  font-size: 10px;
}

.task-queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 32, 0.05);
  border: 1px solid rgba(15, 23, 32, 0.06);
}

.task-queue-item.is-active {
  background: rgba(95,181,255,0.12);
  border-color: rgba(95,181,255,0.22);
}

.task-queue-item.is-traveling {
  background: rgba(255, 214, 102, 0.12);
  border-color: rgba(255, 214, 102, 0.24);
}

.task-queue-item.is-completed {
  background: rgba(91, 194, 138, 0.12);
  border-color: rgba(91, 194, 138, 0.2);
}

.task-queue-item.is-empty {
  background: rgba(15, 23, 32, 0.04);
}

.task-queue-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.08);
  font-size: 11px;
  font-family: var(--pixel-font);
  flex-shrink: 0;
}

.task-queue-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-queue-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-queue-copy strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-queue-stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(24, 35, 45, 0.08);
  color: var(--text-dim);
  font-size: 9px;
  font-family: var(--pixel-font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.task-queue-stage.is-queued {
  background: rgba(95, 181, 255, 0.12);
  color: var(--accent);
}

.task-queue-stage.is-traveling {
  background: rgba(255, 214, 102, 0.2);
  color: #9b6a00;
}

.task-queue-stage.is-live {
  background: rgba(104, 224, 168, 0.18);
  color: #1e7f56;
}

.task-queue-stage.is-done {
  background: rgba(91, 194, 138, 0.18);
  color: #246b42;
}

.task-queue-stage.is-muted {
  background: rgba(24, 35, 45, 0.08);
  color: var(--text-dim);
}

.task-queue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.task-queue-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15, 23, 32, 0.05);
  color: var(--text);
  font-size: 10px;
  font-family: var(--pixel-font);
}

.task-queue-meta-copy {
  display: block;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-dim);
}

.task-queue-remove {
  width: 30px;
  height: 30px;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.task-queue-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: center;
}

.task-queue-actions.is-static {
  min-width: 0;
}

.task-queue-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-queue-reorder button {
  border: 0;
  border-radius: 6px;
  background: rgba(15, 23, 32, 0.06);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 8px;
  line-height: 1;
  padding: 4px 6px;
}

.task-queue-reorder button:hover:not(:disabled) {
  background: rgba(95, 181, 255, 0.15);
  color: var(--accent);
}

.task-queue-reorder button:disabled {
  opacity: 0.25;
  cursor: default;
}

#app[data-queue-pressure="high"] .queue-badge {
  background: rgba(255, 140, 80, 0.18);
  border-color: rgba(255, 140, 80, 0.3);
  color: #e87040;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 80, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 140, 80, 0.15); }
}

.task-done-toast {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(91, 194, 138, 0.16);
  border: 1px solid rgba(91, 194, 138, 0.24);
  color: #246b42;
  font-size: 12px;
  font-family: var(--pixel-font);
}

/* Zone card */
.zone-card {
  width: 100%;
  transition: opacity 0.3s ease;
  background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(255,255,255,0.64));
}

/* Dialog card */
.dialog-card {
  position: absolute;
  top: 62px;
  right: 10px;
  left: auto;
  transform: none;
  width: min(256px, calc(100% - 20px));
  z-index: 30;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.68));
}

.dialog-topline,
.dialog-buttons {
  display: flex;
  align-items: center;
}

.dialog-topline {
  justify-content: space-between;
  gap: 12px;
}

.dialog-buttons {
  gap: 8px;
}

.dialog-card .eyebrow,
.dialog-card h2,
.dialog-card p {
  margin: 0;
}

.dialog-card h2 {
  padding-right: 20px;
}

#dialogDescription {
  line-height: 1.45;
}

.dialog-expand {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(95,181,255,0.22);
  background: rgba(95,181,255,0.08);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--pixel-font);
  cursor: pointer;
}

.zone-pill {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 18;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--pixel-font);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #eef4f8;
  background: rgba(11, 19, 29, 0.72);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.commute-overlay {
  position: absolute;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 0;
  max-width: min(280px, calc(100% - 160px));
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(11, 19, 29, 0.72);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  color: #eef4f8;
}

.commute-overlay strong,
.commute-overlay span,
.commute-overlay .eyebrow {
  display: block;
  margin: 0;
}

.commute-overlay strong {
  font-size: 12px;
}

.commute-overlay span {
  margin-top: 2px;
  font-size: 9px;
  color: rgba(238,244,248,0.8);
}

#app.is-commuting .commute-overlay {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 22px 44px rgba(0,0,0,0.28);
}

.dialog-link {
  display: inline-block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}

.dialog-link:hover {
  text-decoration: underline;
}

.dialog-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--text);
}


.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 14, 22, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.intro-card {
  width: min(420px, 100%);
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
  border: 1px solid rgba(95,181,255,0.18);
  box-shadow: 0 24px 56px rgba(0,0,0,0.2);
}

.intro-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.intro-card p,
.intro-card li {
  color: var(--text-dim);
  line-height: 1.55;
}

.intro-card ul {
  margin: 12px 0 16px 18px;
  padding: 0;
}

.intro-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(95,181,255,0.3);
  background: linear-gradient(180deg, rgba(95,181,255,0.18), rgba(95,181,255,0.08));
  color: var(--accent);
  font-family: var(--pixel-font);
  cursor: pointer;
}


/* NPC card */
.npc-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.72));
  max-width: 220px;
}

.npc-card h3 {
  color: var(--text);
}

/* ================================================================== */
/*  Minimap                                                            */
/* ================================================================== */

.minimap {
  width: 100%;
  z-index: 10;
  padding: 9px 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.66)),
    radial-gradient(circle at top right, rgba(95,181,255,0.1), transparent 34%);
}

.minimap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 11px;
  gap: 10px;
}

.minimap-hint {
  font-family: var(--pixel-font);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

#minimap {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid rgba(95, 181, 255, 0.18);
  border-radius: 6px;
  background: #91cf7e;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 6px 14px rgba(11, 21, 31, 0.12);
}

/* ================================================================== */
/*  Utility                                                            */
/* ================================================================== */

.hidden {
  display: none !important;
}

/* ================================================================== */
/*  Responsive - Tablet                                                */
/* ================================================================== */

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
  }

  .world-shell {
    min-height: 78vh;
  }

  .timeline-bar {
    width: min(420px, calc(100vw - 72px));
  }

  .timeline-line {
    width: 18px;
  }

  .panel-stack-left {
    width: min(228px, 31vw);
  }

  .panel-stack-right {
    width: min(176px, 22vw);
  }

  .queue-help {
    display: none;
  }
}

/* ================================================================== */
/*  Responsive - Mobile                                                */
/* ================================================================== */

@media (max-width: 760px) {
  #app {
    padding: 8px;
  }

  .hud {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 14px;
    margin-bottom: 6px;
  }

  .hud-brand .eyebrow {
    display: none;
  }

  .hud h1 {
    font-size: 18px;
  }

  .hud-actions {
    justify-content: flex-end;
    gap: 5px;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  #modeChip {
    display: none;
  }

  #zoomInBtn,
  #zoomOutBtn {
    display: none;
  }

  .chip {
    padding: 6px 9px;
    font-size: 10px;
  }

  .shell {
    height: calc(100svh - 72px);
  }

  .world-shell {
    height: 100%;
    min-height: 0;
    border-radius: 16px;
  }

  .viewport-top-chrome {
    inset: calc(6px + env(safe-area-inset-top)) 8px auto;
    align-items: stretch;
    gap: 0;
  }

  .timeline-bar {
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    min-height: 26px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    background: rgba(255,255,255,0.42);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 6px 12px rgba(12, 21, 31, 0.08);
  }

  .mobile-panel-switch {
    z-index: 13;
    display: inline-flex;
    align-self: auto;
    gap: 4px;
    margin: 0;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255,255,255,0.52);
    border: 1px solid rgba(95,181,255,0.14);
    box-shadow: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .mobile-panel-btn {
    min-height: 28px;
    padding: 0 11px;
    box-shadow: none;
  }

  .timeline-bar::-webkit-scrollbar {
    display: none;
  }

  .timeline-line {
    width: 8px;
    margin-top: 4px;
    opacity: 0.55;
  }

  .timeline-step {
    gap: 2px;
  }

  .timeline-time {
    display: none;
    font-size: 9px;
  }

  .timeline-step:has(.dot--current) .timeline-time {
    display: block;
  }

  .timeline-dot {
    width: 8px;
    height: 8px;
    border-width: 2px;
  }

  .timeline-label {
    display: none !important;
  }

  .viewport {
    display: block;
    position: relative;
    height: 100%;
    min-height: 100%;
  }

  .world-panels {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 12;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    padding: 0 8px 8px;
    pointer-events: none;
    background: none;
    border-top: 0;
  }

  .panel-stack,
  .panel-stack-left,
  .panel-stack-right {
    gap: 10px;
    pointer-events: none;
  }

  .panel-stack-left {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    margin-left: 0;
    min-width: 0;
  }

  .panel-stack-right {
    flex: 0 0 132px;
    width: 132px !important;
    align-self: flex-end;
    align-items: stretch;
    margin-left: 0;
    margin-bottom: 0;
  }

  .zone-card {
    display: none !important;
  }

  .zone-pill {
    display: inline-flex !important;
    top: calc(40px + env(safe-area-inset-top));
    left: 8px;
    max-width: calc(100% - 120px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #game,
  .viewport > canvas {
    min-height: 100%;
    max-height: 100%;
    flex-shrink: 0;
  }

  .task-card,
  .queue-card,
  .zone-card,
  .npc-card,
  .minimap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    pointer-events: auto;
  }

  #app[data-mobile-panel="summary"] .queue-card {
    display: none;
  }

  #app[data-mobile-panel="summary"] .panel-stack-left {
    flex: 1 1 auto;
  }

  #app[data-mobile-panel="queue"] .panel-stack-left {
    flex: 1 1 auto;
    width: 100%;
  }

  #app[data-mobile-panel="queue"] .panel-stack-right,
  #app[data-mobile-panel="queue"] .minimap,
  #app[data-mobile-panel="queue"] .npc-card,
  #app[data-mobile-panel="queue"] .task-card {
    display: none !important;
  }

  #app[data-mobile-panel="queue"] .queue-card {
    display: flex;
    max-height: min(40svh, 360px);
  }

  .dialog-card {
    top: calc(42px + env(safe-area-inset-top));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(320px, calc(100% - 22px));
    max-height: min(20svh, 166px);
    padding: 8px 10px;
    border-radius: 16px;
    overflow: hidden;
    gap: 4px;
    background: linear-gradient(180deg, rgba(248,252,255,0.96), rgba(235,242,247,0.9));
    border: 1px solid rgba(24, 35, 45, 0.07);
    box-shadow: 0 10px 24px rgba(12, 21, 31, 0.16);
  }

  .commute-overlay {
    top: calc(78px + env(safe-area-inset-top));
    min-width: 0;
    max-width: calc(100% - 20px);
    padding: 6px 10px;
  }

  .commute-overlay strong {
    font-size: 12px;
  }

  .dialog-card.is-compact {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .dialog-card.is-compact h2 {
    font-size: 13px;
    line-height: 1.35;
    padding-right: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .dialog-card.is-compact #dialogDescription {
    font-size: 11px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .dialog-card.is-compact.is-expanded {
    max-height: min(36vh, 280px);
    overflow: auto;
  }

  .dialog-card.is-compact.is-expanded #dialogDescription {
    display: block;
    max-height: none;
    -webkit-line-clamp: unset;
  }

  .dialog-topline {
    align-items: flex-start;
  }

  .dialog-buttons {
    flex-shrink: 0;
  }

  .dialog-expand {
    display: inline-flex;
    align-items: center;
  }

  .dialog-close {
    font-size: 18px;
    padding: 2px 4px;
  }

  .dialog-card.is-compact .dialog-close {
    align-self: flex-start;
  }

  .dialog-card.is-compact:not(.is-expanded) .dialog-expand {
    min-width: 48px;
  }

  .dialog-card.is-compact.is-expanded .dialog-expand {
    background: rgba(95,181,255,0.16);
  }

  .dialog-card.is-compact .eyebrow {
    font-size: 9px;
  }

  .dialog-card.is-compact p:last-of-type {
    margin-bottom: 0;
  }

  .dialog-card.is-compact .dialog-link {
    font-size: 12px;
  }

  .queue-card {
    order: 1;
    max-height: 40svh;
    overflow: auto;
    border-radius: 22px 22px 16px 16px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.8)),
      radial-gradient(circle at top right, rgba(132, 210, 157, 0.18), transparent 36%);
    box-shadow:
      0 18px 34px rgba(12, 21, 31, 0.18),
      inset 0 1px 0 rgba(255,255,255,0.4);
  }

  .task-card {
    order: 0;
    margin-bottom: 0;
    min-height: 0;
    max-height: 148px;
    width: 100%;
    max-width: none;
    padding: 10px 12px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.88), rgba(255,255,255,0.72)),
      radial-gradient(circle at top left, rgba(95,181,255,0.18), transparent 36%);
    box-shadow:
      0 14px 28px rgba(12, 21, 31, 0.16),
      inset 0 1px 0 rgba(255,255,255,0.34);
  }

  .task-card-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    background: rgba(24, 35, 45, 0.08);
    font-size: 14px;
  }

  #app[data-task-card-expanded="true"] .task-card {
    max-height: 180px;
    width: 100%;
  }

  #app[data-task-card-expanded="false"] .task-card {
    max-height: 74px;
  }

  .task-card .eyebrow {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
  }

  #app:not([data-task-card-expanded="true"]) .task-card #taskDescription {
    display: -webkit-box;
  }

  .task-card h2 {
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    font-size: 15px;
    line-height: 1.28;
    margin-bottom: 4px;
    padding-right: 20px;
    -webkit-line-clamp: 2;
  }

  .task-card p:not(.eyebrow) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
  }

  #app[data-task-card-expanded="true"] .task-card p:not(.eyebrow) {
    -webkit-line-clamp: 3;
  }

  #app[data-task-card-expanded="false"] .task-card p:not(.eyebrow) {
    -webkit-line-clamp: 1;
  }

  .task-card .task-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 10px;
  }

  .task-route-strip {
    margin: 6px 0 4px;
    gap: 5px;
  }

  .task-route-chip {
    min-height: 22px;
    padding: 0 8px;
    font-size: 9px;
  }

  .task-expand-hint {
    display: inline-flex;
    margin-left: auto;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(95,181,255,0.12);
    color: var(--accent);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #app[data-task-card-expanded="true"] .task-expand-hint {
    display: none;
  }

  .npc-card {
    display: none !important;
  }

  .minimap {
    order: 10;
    width: 132px;
    margin-left: auto;
    padding: 8px 9px;
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 14px 24px rgba(12, 21, 31, 0.14);
  }

  #minimap {
    max-height: 116px;
  }

  .intro-card {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .queue-help {
    display: block;
    font-size: 11px;
    line-height: 1.35;
  }

  .queue-signal {
    gap: 7px;
    padding: 8px 10px;
  }

  .queue-signal-head {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .queue-signal-head span {
    text-align: right;
  }

  .queue-signal-strip,
  .quick-task-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .queue-signal-strip::-webkit-scrollbar,
  .quick-task-chips::-webkit-scrollbar {
    display: none;
  }

  .queue-signal-chip {
    min-height: 26px;
    font-size: 10px;
    padding: 0 8px;
  }

  .task-form {
    grid-template-columns: minmax(0, 1fr) auto;
    position: sticky;
    top: 0;
    z-index: 1;
    padding-bottom: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.74));
  }

  .task-form input {
    min-height: 38px;
    border-radius: 14px;
    padding: 9px 12px;
  }

  .task-form button {
    width: auto;
    min-width: 60px;
    padding-inline: 14px;
    border-radius: 14px;
  }

  .quick-task-chips {
    gap: 6px;
    padding-bottom: 4px;
  }

  .task-queue-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .task-queue-title-row {
    align-items: flex-start;
  }

  .task-queue-meta {
    gap: 5px 7px;
  }

  .queue-signal-chip-count {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .task-queue-remove {
    justify-self: end;
    width: 28px;
    height: 28px;
  }
}

/* ================================================================== */
/*  Responsive - Small mobile                                          */
/* ================================================================== */

@media (max-width: 480px) {
  #app {
    padding: 6px;
  }

  .hud {
    padding: 7px 8px;
    border-radius: 14px;
    margin-bottom: 5px;
  }

  .hud h1 {
    font-size: 16px;
  }

  .ui-card {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .ui-card h2 {
    font-size: 14px;
  }

  .ui-card p {
    font-size: 12px;
  }

  .task-card h2 {
    font-size: 15px;
  }

  .task-card p:not(.eyebrow) {
    font-size: 13px;
  }

  .task-card .task-meta {
    font-size: 12px;
  }

  .world-panels {
    padding: 0 8px 8px;
    gap: 8px;
  }

  .timeline-bar {
    padding: 4px 7px;
    min-height: 24px;
  }

  .timeline-time {
    font-size: 8px;
  }

  .timeline-dot {
    width: 7px;
    height: 7px;
  }

  .minimap-hint {
    font-size: 9px;
  }

  #minimap {
    max-height: 160px;
  }

  #zoomInBtn,
  #zoomOutBtn {
    display: none;
  }

  #clockChip {
    padding-inline: 8px;
  }

  .intro-card h2 {
    font-size: 20px;
  }
}

/* ================================================================== */
/*  Exercise-active state — accent glow on task card                   */
/* ================================================================== */

#app[data-exercise-active="true"] .task-card {
  border-color: rgba(95, 181, 255, 0.32);
  box-shadow:
    0 14px 26px rgba(12, 21, 31, 0.18),
    0 0 0 2px rgba(95, 181, 255, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.34);
}

#app[data-exercise-active="true"] .task-card .eyebrow {
  display: block !important;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
}

#app[data-exercise-active="true"] .task-progress-bar {
  background: linear-gradient(90deg, #5fb5ff, #68e0a8);
}

/* ================================================================== */
/*  Queue signal — world entity feel                                   */
/* ================================================================== */

.queue-signal {
  position: relative;
  overflow: hidden;
}

.queue-signal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(95,181,255,0.06), transparent 60%);
  pointer-events: none;
}

#app[data-queue-pressure="high"] .queue-signal {
  border-color: rgba(255, 150, 80, 0.18);
  background: rgba(255, 200, 120, 0.06);
}

#app[data-queue-pressure="high"] .queue-signal::before {
  background: radial-gradient(circle at top right, rgba(255,180,80,0.1), transparent 60%);
}

#app[data-queue-pressure="medium"] .queue-signal {
  border-color: rgba(95, 181, 255, 0.14);
}

/* ================================================================== */
/*  Mobile command center — bottom dock                                */
/* ================================================================== */

@media (max-width: 760px) {
  .world-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    align-items: end;
    gap: 8px;
    max-height: 54svh;
    padding: 0 8px calc(6px + env(safe-area-inset-bottom));
  }

  .world-panels::before {
    content: "";
    position: absolute;
    inset: auto 12px 4px;
    height: clamp(72px, 11svh, 92px);
    border-radius: 24px 24px 18px 18px;
    background: linear-gradient(180deg, rgba(248, 252, 255, 0), rgba(240, 246, 251, 0.2) 24%, rgba(236, 242, 247, 0.46) 68%, rgba(236, 242, 247, 0.54));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 -2px 12px rgba(12, 21, 31, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
  }

  #app[data-mobile-panel="summary"] .world-panels::before {
    opacity: 1;
    transform: translateY(0);
  }

  .panel-stack-left,
  .panel-stack-right {
    position: relative;
    z-index: 1;
  }

  #app[data-mobile-panel="summary"] .panel-stack-left {
    display: flex;
    min-width: 0;
    justify-content: flex-end;
    align-items: flex-end;
  }

  #app[data-mobile-panel="summary"] .panel-stack-right {
    flex: 0 0 84px;
    width: 84px !important;
    margin: 0;
    align-self: end;
    padding-bottom: 2px;
  }

  #app[data-mobile-panel="summary"] .task-card {
    position: relative;
    align-self: flex-end;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,251,255,0.78)),
      radial-gradient(circle at top left, rgba(95,181,255,0.12), transparent 36%);
    border: 1px solid rgba(95,181,255,0.13);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: min(100%, calc(100vw - 128px));
    min-height: 0;
    margin: 0;
    padding: 11px 12px 10px;
    border-radius: 22px;
    box-shadow:
      0 10px 22px rgba(12, 21, 31, 0.12),
      inset 0 1px 0 rgba(255,255,255,0.34);
  }

  #app[data-mobile-panel="summary"] .task-card::after {
    display: none;
  }

  #app[data-mobile-panel="summary"] .task-card .task-progress-track {
    display: block !important;
    margin: 5px 0 0;
    height: 3px;
  }

  #app[data-mobile-panel="summary"] .task-card .task-progress-track.hidden {
    display: block !important;
    opacity: 0.4;
  }

  #app[data-mobile-panel="summary"][data-task-card-expanded="true"] .task-card {
    max-height: 150px;
  }

  #app[data-mobile-panel="summary"][data-task-card-expanded="false"] .task-card {
    max-height: 102px;
  }

  #app[data-mobile-panel="summary"] .task-card h2 {
    margin-bottom: 3px;
    padding-right: 18px;
  }

  #app[data-mobile-panel="summary"] .task-card p:not(.eyebrow) {
    font-size: 11px;
    line-height: 1.38;
  }

  #app[data-mobile-panel="summary"] .task-card .task-meta {
    gap: 6px 8px;
    font-size: 9px;
  }

  #app[data-mobile-panel="summary"] .task-route-strip {
    gap: 4px;
    margin: 5px 0 3px;
  }

  #app[data-mobile-panel="summary"] .task-route-chip {
    min-height: 20px;
    padding: 0 7px;
    font-size: 8px;
  }

  #app[data-mobile-panel="summary"] .minimap {
    position: relative;
    width: 84px;
    margin: 0;
    padding: 8px 8px 9px;
    border-radius: 22px;
    border: 1px solid rgba(95, 181, 255, 0.14);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.88), rgba(245,249,253,0.76)),
      radial-gradient(circle at top right, rgba(95,181,255,0.12), transparent 40%);
    box-shadow:
      0 10px 22px rgba(12, 21, 31, 0.12),
      inset 0 1px 0 rgba(255,255,255,0.28);
  }

  #app[data-mobile-panel="summary"] .minimap-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
  }

  #app[data-mobile-panel="summary"] .minimap-head strong {
    font-size: 12px;
    line-height: 1.1;
  }

  #app[data-mobile-panel="summary"] .minimap-hint {
    font-size: 7px;
    letter-spacing: 0.06em;
    opacity: 0.78;
  }

  #app[data-mobile-panel="summary"] #minimap {
    max-height: 88px;
    border-radius: 10px;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.2),
      0 4px 10px rgba(11, 21, 31, 0.08);
  }

  #app[data-exercise-active="true"] .task-card {
    max-height: 88px;
    border-color: rgba(95, 181, 255, 0.28);
  }

  #app[data-exercise-active="true"] .task-card .eyebrow {
    font-size: 10px;
    margin-bottom: 1px;
  }

  .queue-card {
    border: 1px solid rgba(132, 210, 157, 0.16);
    border-radius: 20px;
  }

  #app[data-mobile-panel="queue"] .world-panels {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 0;
    max-height: min(60svh, 520px);
    padding: 0 8px calc(6px + env(safe-area-inset-bottom));
  }

  #app[data-mobile-panel="queue"] .world-panels::before,
  #app[data-mobile-panel="queue"] .task-card {
    display: none;
  }

  #app[data-mobile-panel="queue"] .panel-stack-left {
    display: flex;
    justify-content: center;
    max-width: none;
  }

  #app[data-mobile-panel="queue"] .queue-card {
    position: relative;
    width: 100%;
    max-height: min(60svh, 520px);
    min-height: min(40svh, 340px);
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
    border: 1px solid rgba(132, 210, 157, 0.22);
    border-radius: 28px 28px 18px 18px;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    background:
      linear-gradient(180deg, rgba(252,255,253,0.97), rgba(244,250,246,0.93)),
      radial-gradient(circle at top right, rgba(132, 210, 157, 0.14), transparent 42%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
      0 18px 32px rgba(12, 21, 31, 0.16),
      inset 0 1px 0 rgba(255,255,255,0.44);
  }

  #app[data-mobile-panel="queue"] .queue-card::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(24, 35, 45, 0.16);
  }

  #app[data-mobile-panel="queue"] .queue-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    margin: -1px -1px 0;
    padding: 3px 1px 12px;
    background: linear-gradient(180deg, rgba(252,255,252,0.99), rgba(252,255,252,0.9), rgba(252,255,252,0));
  }

  #app[data-mobile-panel="queue"] .queue-head h3 {
    font-size: 16px;
    line-height: 1.25;
  }

  #app[data-mobile-panel="queue"] .queue-head-actions {
    gap: 8px;
    align-items: center;
  }

  #app[data-mobile-panel="queue"] .queue-badge {
    min-height: 30px;
    padding: 0 12px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
  }

  #app[data-mobile-panel="queue"] .queue-collapse-btn {
    display: none;
  }

  #app[data-mobile-panel="queue"] .task-form {
    top: 74px;
    z-index: 3;
    padding-top: 4px;
    padding-bottom: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(255,255,255,0.88), rgba(255,255,255,0.62));
  }

  #app[data-mobile-panel="queue"] .task-form input {
    min-height: 46px;
    font-size: 16px;
  }

  #app[data-mobile-panel="queue"] .task-form button {
    min-width: 74px;
    border-radius: 14px;
  }

  #app[data-mobile-panel="queue"] .quick-task-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -2px;
    padding: 0 2px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  #app[data-mobile-panel="queue"] .quick-task-chips::-webkit-scrollbar {
    display: none;
  }

  .queue-signal {
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    border-color: rgba(15, 23, 32, 0.06);
  }

  .queue-signal-chip {
    font-size: 10px;
    min-height: 26px;
  }

  .quick-task-chips button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
    border-radius: 10px;
  }

  .quick-task-chips button[data-task-bundle] {
    font-weight: 600;
    border: 1px solid rgba(255, 214, 102, 0.22);
  }

  #app[data-mobile-panel="queue"] .queue-help {
    display: block;
    margin-top: -1px;
    font-size: 11px;
    line-height: 1.45;
  }

  #app[data-mobile-panel="queue"] .task-queue-list {
    gap: 9px;
    padding-bottom: 4px;
  }

  #app[data-mobile-panel="queue"] .task-queue-item {
    padding: 11px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
  }

  .task-done-toast {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(91, 194, 138, 0.92);
    color: #fff;
    font-family: var(--pixel-font);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(12, 21, 31, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    animation: toast-in 0.3s ease;
  }

  .task-done-toast.hidden {
    display: none;
  }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
