.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: none;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.tutorial-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: none;
}
.tutorial-overlay.active { display: block; }
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}
.tutorial-card {
  position: absolute;
  max-width: 340px;
  border: 2px solid rgba(251, 191, 36, 0.9);
  border-radius: 12px;
  padding: 12px;
  background: rgba(17, 24, 39, 0.96);
  color: #fef9c3;
  font-size: 15px;
  line-height: 1.2;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.tutorial-card strong {
  display: block;
  color: #fbbf24;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  margin-bottom: 8px;
}
.tutorial-arrow {
  position: absolute;
  color: #facc15;
  font-family: 'Press Start 2P', monospace;
  font-size: 46px;
  line-height: 1;
  text-shadow:
    0 0 18px rgba(251, 191, 36, 0.95),
    0 0 36px rgba(251, 191, 36, 0.55);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55));
  pointer-events: none;
  transform-origin: center;
}
.tutorial-arrow.dir-down  { animation: tutArrowDown  0.65s ease-in-out infinite; }
.tutorial-arrow.dir-up    { animation: tutArrowUp    0.65s ease-in-out infinite; }
.tutorial-arrow.dir-left  { animation: tutArrowLeft  0.65s ease-in-out infinite; }
.tutorial-arrow.dir-right { animation: tutArrowRight 0.65s ease-in-out infinite; }
.tutorial-target-highlight {
  position: absolute;
  border: 3px solid #fbbf24;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(6, 8, 15, 0.6),
    0 0 0 3px rgba(251, 191, 36, 0.28),
    0 0 24px rgba(251, 191, 36, 0.35);
  pointer-events: none;
  animation: tutorialHighlightPulse 1.2s ease-in-out infinite;
}
.tutorial-focus {
  position: relative;
  z-index: 31 !important;
  filter: none !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 0 16px rgba(251, 191, 36, 0.3);
}
@keyframes tutArrowDown {
  0%, 100% { transform: translateY(0)   scale(1);    }
  50%      { transform: translateY(12px) scale(1.18); }
}
@keyframes tutArrowUp {
  0%, 100% { transform: translateY(0)    scale(1);    }
  50%      { transform: translateY(-12px) scale(1.18); }
}
@keyframes tutArrowLeft {
  0%, 100% { transform: translateX(0)    scale(1);    }
  50%      { transform: translateX(-12px) scale(1.18); }
}
@keyframes tutArrowRight {
  0%, 100% { transform: translateX(0)   scale(1);    }
  50%      { transform: translateX(12px) scale(1.18); }
}
@keyframes tutorialHighlightPulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.6; }
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 25;
  padding: 24px;
  overflow-y: auto;
}

.overlay.show {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}

.summary-card {
  width: min(680px, 100%);
  max-height: 100%;
  margin: auto 0;
  background: rgba(15, 12, 22, 0.97);
  border: 1px solid rgba(251, 191, 36, 0.2);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(251, 191, 36, 0.08);
  border-radius: 20px;
  padding: 24px;
  color: #f0e6d6;
  display: grid;
  gap: 16px;
  overflow-y: auto;
  animation: summarySlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-card h2 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  line-height: 1.5;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 24px;
}

.summary-stat,
.summary-goal {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px;
  transition: background 0.2s ease;
}

.summary-stat:hover,
.summary-goal:hover {
  background: rgba(255,255,255,0.06);
}

.summary-stat b,
.summary-goal b {
  display: block;
  margin-top: 6px;
  color: var(--lime);
}

.summary-goals {
  display: grid;
  gap: 10px;
}

.summary-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-lane {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(191, 219, 254, 0.12);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.2;
}

.summary-lane b {
  display: block;
  color: #67e8f9;
  margin-top: 3px;
}

.summary-goal.fail b {
  color: #fca5a5;
}

.summary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: rgba(18, 15, 24, 0.96);
  padding-top: 6px;
}

.summary-button {
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.summary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.5);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ---------- Coaching card (pre-day & end-of-day extras) ---------- */
.summary-coaching {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(251, 191, 36, 0.06));
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
}
.summary-coaching strong { color: #fbbf24; font-size: 13px; letter-spacing: 0.5px; font-family: 'Press Start 2P', monospace; }
.summary-coaching .coaching-line { color: #e2e8f0; }
.summary-coaching .coaching-line b { color: #67e8f9; }

/* ---------- One-shot hint overlay (just-in-time teaching) ---------- */
.hint-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.7);
  backdrop-filter: blur(6px);
  z-index: 45;
  padding: 24px;
}
.hint-overlay.show { display: flex; animation: overlayFadeIn 0.25s ease; }
.hint-card {
  max-width: 460px;
  background: linear-gradient(135deg, rgba(30, 27, 46, 0.97), rgba(20, 18, 30, 0.97));
  border: 2px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(251, 191, 36, 0.1);
  border-radius: 18px;
  padding: 22px 24px;
  color: #f0e6d6;
  display: grid;
  gap: 10px;
  animation: summarySlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.hint-card strong {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  color: #fbbf24;
  line-height: 1.6;
}
.hint-card .hint-body { font-size: 17px; line-height: 1.5; color: #e2e8f0; }
.hint-card .hint-footer { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* ---------- Help menu ---------- */
.help-fab {
  position: absolute;
  top: 72px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(15, 12, 22, 0.9);
  color: #fbbf24;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  cursor: pointer;
  z-index: 22;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.help-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.25);
}
.help-overlay {
  position: absolute;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: flex-start;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 40;
  padding: 32px 20px;
  overflow-y: auto;
}
.help-overlay.show { display: flex; }
.help-card {
  width: min(720px, 100%);
  background: rgba(15, 12, 22, 0.97);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 18px;
  padding: 22px 24px;
  display: grid;
  gap: 12px;
  color: #e2e8f0;
}
.help-card h2 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #fbbf24;
}
.help-section { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.help-section summary {
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #fbbf24;
  user-select: none;
}
.help-section summary:hover { background: rgba(255,255,255,0.06); }
.help-section .help-body { padding: 12px 14px; font-size: 15px; line-height: 1.55; }
.help-section .help-body .item { padding: 6px 0; border-top: 1px dashed rgba(255,255,255,0.06); }
.help-section .help-body .item:first-child { border-top: none; }
.help-section .help-body b { color: #67e8f9; }
.help-section .help-body .locked { color: #94a3b8; font-style: italic; }
.help-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.help-actions button {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(30, 41, 59, 0.5);
  color: #e2e8f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.help-actions button.primary { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: #fff; }
.help-actions button:hover { filter: brightness(1.15); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 5px;
  font-size: 12px;
  line-height: 1;
  margin-top: auto;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.3);
  color: #94a3b8;
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
