:root {
  --bg: #fff8ee;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-panel-strong: #ffffff;
  --text: #172033;
  --muted: #5d6a82;
  --line: rgba(23, 32, 51, 0.12);
  --primary: #ef6a3a;
  --primary-strong: #cf4f21;
  --secondary: #0f766e;
  --secondary-soft: rgba(15, 118, 110, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --shadow: 0 24px 60px rgba(85, 58, 28, 0.14);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --font-main: 'Outfit', 'Segoe UI', sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 106, 58, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.15), transparent 32%),
    linear-gradient(180deg, #fff8ee 0%, #f8efe1 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.bg-shape {
  position: fixed;
  inset: auto;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.bg-shape-left {
  top: -8rem;
  left: -8rem;
  background: rgba(239, 106, 58, 0.32);
}

.bg-shape-right {
  right: -8rem;
  bottom: -8rem;
  background: rgba(15, 118, 110, 0.22);
}

.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: block;
}

.shell {
  width: min(1100px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 1.5rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.floating-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  background: var(--bg-panel-strong);
  box-shadow: var(--shadow);
}

.onboarding-card,
.modal-card,
.section-card,
.profile-card,
.hero-card {
  padding: 1.5rem;
}

.onboarding-card {
  max-width: 760px;
  margin: 3rem auto 0;
}

.onboarding-step {
  display: none;
}

.onboarding-step.active {
  display: block;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 0.8rem;
  line-height: 1.1;
}

.lead {
  margin: 0 0 1.2rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.lead.small {
  font-size: 0.95rem;
}

.avatar-stage {
  min-height: 8rem;
  display: grid;
  place-items: center;
  margin: 1rem 0 1.25rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 245, 230, 0.8)),
    repeating-linear-gradient(90deg, rgba(239, 106, 58, 0.05) 0, rgba(239, 106, 58, 0.05) 22px, transparent 22px, transparent 44px);
  border: 1px solid rgba(23, 32, 51, 0.08);
}

.avatar-stage.large {
  min-height: 12rem;
}

.avatar-svg.avatar-bob {
  animation: avatar-bob 2.6s ease-in-out infinite;
}

@keyframes avatar-bob {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.field,
.checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field span,
.checkbox-row span {
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(23, 32, 51, 0.16);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.pill-row,
.color-row,
.task-meta-row,
.hero-meta,
.task-actions,
.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.pill-btn,
.category-pill {
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 999px;
  background: #fff;
  padding: 0.78rem 1rem;
  min-height: 2.8rem;
}

.pill-btn.active,
.category-pill.active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.color-btn {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.1);
}

.color-btn.active {
  box-shadow: 0 0 0 3px var(--text);
}

.creator-layout,
.app-layout,
.modal-grid {
  display: grid;
  gap: 1rem;
}

.btn {
  min-height: 3rem;
  border-radius: 16px;
  border: none;
  padding: 0.85rem 1.15rem;
  font-weight: 800;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(239, 106, 58, 0.24);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.app-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.header-player {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hud-avatar {
  width: 5rem;
}

.hud-stats {
  min-width: 11rem;
}

.stat-badge,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  background: rgba(23, 32, 51, 0.06);
}

.tag-soft {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.tag-alert {
  background: var(--warning-soft);
  color: #a16207;
}

.xp-bar {
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.08);
  overflow: hidden;
  margin: 0.45rem 0;
}

.xp-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #f97316);
}

.nav-rail {
  padding: 0.9rem;
  display: none;
  gap: 0.5rem;
}

.nav-item {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  text-align: left;
  color: var(--muted);
  min-height: 3rem;
}

.nav-item.active {
  background: rgba(23, 32, 51, 0.08);
  color: var(--text);
  font-weight: 800;
}

.tab-content,
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-card,
.path-card,
.skill-task-card,
.medal-card,
.history-row,
.metric-card {
  background: var(--bg-panel-strong);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(23, 32, 51, 0.08);
  padding: 1rem;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.task-summary,
.path-summary,
.lock-reason,
.path-progress,
.medal-line {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.grid-two {
  display: grid;
  gap: 1rem;
}

.compact {
  gap: 0.75rem;
}

.path-card-muted {
  opacity: 0.72;
}

.skill-task-card.locked {
  border-style: dashed;
}

.empty-state {
  color: var(--muted);
  padding: 1rem 0.25rem;
}

.facts-list,
.detail-list {
  margin: 0;
  padding-left: 1.2rem;
}

.facts-list li,
.detail-list li {
  margin-bottom: 0.55rem;
}

.warning-box {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: var(--warning-soft);
  color: #8a5500;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(23, 32, 51, 0.46);
  padding: 1rem;
  overflow: auto;
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal.active {
  display: block;
}

.modal-card {
  max-width: 960px;
  margin: 2rem auto;
  padding: 1.25rem;
}

.modal-header,
.result-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.detail-list.numbered {
  list-style: decimal;
}

.field-grid {
  display: grid;
  gap: 0.85rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  margin: 0;
}

.checkbox-row input {
  width: auto;
}

.result-form {
  margin-top: 1rem;
  border-top: 1px solid rgba(23, 32, 51, 0.08);
  padding-top: 1rem;
}

.result-status {
  margin: 0;
  color: var(--muted);
}

.mobile-nav {
  position: sticky;
  bottom: 0.75rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  padding: 0.45rem;
  margin-top: 1rem;
}

.mobile-nav .nav-item {
  min-height: 3.2rem;
  text-align: center;
  padding: 0.75rem 0.5rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(239, 106, 58, 0.34);
  outline-offset: 2px;
}

@media (min-width: 860px) {
  .creator-layout {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }

  .app-layout {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }

  .nav-rail {
    display: grid;
  }

  .mobile-nav {
    display: none;
  }

  .grid-two,
  .field-grid,
  .modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 859px) {
  .shell {
    width: min(720px, calc(100vw - 1rem));
    padding-bottom: 5.5rem;
  }

  .app-header,
  .modal-header,
  .result-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* --- High-Aesthetics & Gamification Additions --- */

.cta-card {
  background: linear-gradient(135deg, rgba(239, 106, 58, 0.16) 0%, rgba(15, 118, 110, 0.12) 100%), var(--bg-panel-strong);
  border: 2px solid var(--primary);
  box-shadow: 0 20px 45px rgba(239, 106, 58, 0.15);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(239, 106, 58, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.cta-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(239, 106, 58, 0.22);
}

.cta-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cta-text-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cta-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(239, 106, 58, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  align-self: flex-start;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.cta-meta-row {
  display: flex;
  gap: 0.5rem;
}

.btn-cta-start {
  font-size: 1.1rem;
  padding: 1rem 2rem;
  min-height: 3.5rem;
  animation: pulse-button 2s infinite;
}

@keyframes pulse-button {
  0% { box-shadow: 0 0 0 0 rgba(239, 106, 58, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(239, 106, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 106, 58, 0); }
}

.today-plan-header {
  margin: 1.5rem 0 0.5rem;
}

/* Completed Card styling */
.task-card-completed {
  border-color: rgba(15, 118, 110, 0.3) !important;
  background: rgba(255, 255, 255, 0.5) !important;
  opacity: 0.85;
}

.task-card-completed .task-emoji {
  text-decoration: line-through;
  color: var(--muted);
}

/* Timer Section styling */
.timer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(15, 118, 110, 0.08);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 118, 110, 0.2);
  margin-bottom: 1.5rem;
  text-align: center;
}

.timer-display-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#timer-display {
  font-size: 4rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 10px rgba(15, 118, 110, 0.15);
}

.timer-unit {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.25rem;
}

.timer-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-timer {
  min-height: 2.8rem;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
}

/* Success Overlay */
.success-overlay {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  position: relative;
  overflow: hidden;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 450px;
  width: 100%;
  animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scale-up {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-celebration {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.2em;
}

.success-medal {
  font-size: 5.5rem;
  line-height: 1;
  filter: drop-shadow(0 12px 24px rgba(239, 106, 58, 0.3));
  animation: pulse-medal 2s ease-in-out infinite;
}

@keyframes pulse-medal {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.08) rotate(3deg); }
}

.success-stats {
  display: flex;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

.success-stat-box {
  background: var(--bg-panel-strong);
  border: 1px solid var(--line);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 4px 10px rgba(23, 32, 51, 0.04);
}

.stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.unlock-box {
  background: linear-gradient(135deg, rgba(239, 106, 58, 0.08), rgba(15, 118, 110, 0.08));
  border: 2px dashed rgba(239, 106, 58, 0.5);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.unlock-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.12em;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

.w-full {
  width: 100%;
}

/* Confetti styling */
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 100;
  animation: confetti-fall 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(350px) rotate(720deg);
    opacity: 0;
  }
}

/* Result input pulse glow */
.pulse-highlight {
  animation: glow-pulse 1.5s ease-out;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: none; border-color: rgba(23, 32, 51, 0.16); }
  50% { box-shadow: 0 0 15px rgba(15, 118, 110, 0.6); border-color: var(--secondary); }
}

@media (max-width: 859px) {
  .cta-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .btn-cta-start {
    width: 100%;
  }
}

/* Accordion Collapse System */
.details-accordion {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(23, 32, 51, 0.02);
  overflow: hidden;
}

.accordion-summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--secondary);
  user-select: none;
  outline: none;
}

.accordion-summary:focus-visible {
  background: var(--secondary-soft);
}

.accordion-content {
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.accordion-content h4 {
  margin: 0 0 0.50rem 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.font-danger {
  color: #b91c1c;
}

/* Danger Button Styling */
.btn-danger-soft {
  background: rgba(185, 28, 28, 0.12) !important;
  color: #b91c1c !important;
}

.btn-danger-soft:hover {
  background: rgba(185, 28, 28, 0.22) !important;
}

/* --- Pitch polish: sporty, focused, touch-first --- */
:root {
  --navy: #101b35;
  --court: #fff4e3;
  --lime: #c7f23a;
  --shadow-soft: 0 12px 32px rgba(31, 37, 56, 0.09);
}

body {
  background:
    linear-gradient(115deg, transparent 0 49.8%, rgba(239, 106, 58, 0.035) 50% 50.2%, transparent 50.4%),
    radial-gradient(circle at 10% 0%, rgba(239, 106, 58, 0.18), transparent 34rem),
    linear-gradient(180deg, #fffaf2 0%, #f7eddf 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: repeating-linear-gradient(90deg, transparent 0 79px, rgba(16, 27, 53, 0.08) 80px);
}

.card {
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.75rem;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-ball {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--primary);
  box-shadow: inset -6px -4px 0 rgba(16, 27, 53, 0.18);
}

.onboarding-card {
  position: relative;
  overflow: hidden;
  max-width: 900px;
  padding: clamp(1.5rem, 5vw, 4.25rem);
  border: 0;
  background: rgba(255, 255, 255, 0.94);
}

.onboarding-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 24rem;
  height: 24rem;
  right: -8rem;
  top: -10rem;
  border: 5rem solid rgba(239, 106, 58, 0.09);
  border-radius: 50%;
}

#onboarding-step-1 h1 {
  max-width: 650px;
  font-size: clamp(3rem, 9vw, 6.4rem);
  letter-spacing: -0.065em;
  line-height: 0.87;
}

#onboarding-step-1 h1 span,
.hero-card h2 span {
  color: var(--primary);
}

#onboarding-step-1 .lead {
  max-width: 36rem;
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
}

#mascot-preview {
  min-height: 12rem;
  border: 0;
  background: linear-gradient(180deg, transparent 76%, rgba(15, 118, 110, 0.1) 76%);
}

.btn {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:active {
  transform: translateY(2px) scale(0.985);
}

.btn-primary {
  background: var(--navy);
  box-shadow: 0 8px 0 #080f20, 0 14px 30px rgba(16, 27, 53, 0.18);
}

.btn-primary:hover {
  background: #1b2d55;
}

.btn-hero-start {
  display: flex;
  width: min(100%, 25rem);
  min-height: 4.1rem;
  align-items: center;
  justify-content: space-between;
  padding-inline: 1.4rem;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.btn-hero-start span {
  color: var(--lime);
  font-size: 1.5rem;
}

.trust-line {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.app-header {
  border: 0;
  background: rgba(255, 255, 255, 0.78);
}

.hero-card {
  min-height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  overflow: hidden;
  position: relative;
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 88% 15%, rgba(199, 242, 58, 0.18) 0 4rem, transparent 4.1rem),
    linear-gradient(125deg, var(--navy), #183866);
}

.hero-card::before,
.hero-card::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.hero-card::before { width: 25rem; height: 25rem; right: -12rem; top: -12rem; }
.hero-card::after { width: 12rem; height: 12rem; right: -5rem; top: -5rem; }
.hero-card .eyebrow { color: var(--lime); }
.hero-card h2 { font-size: clamp(2.1rem, 5vw, 4rem); letter-spacing: -0.045em; }
.hero-card .tag { color: #fff; background: rgba(255,255,255,0.12); }
.hero-copy { position: relative; z-index: 1; }

.daily-ring {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 8.5rem;
  height: 8.5rem;
  display: grid;
  place-content: center;
  text-align: center;
  border: 0.65rem solid rgba(255,255,255,0.16);
  border-top-color: var(--lime);
  border-right-color: var(--lime);
  border-radius: 50%;
  transform: rotate(8deg);
}
.daily-ring span, .daily-ring small { transform: rotate(-8deg); }
.daily-ring span { font-size: 2rem; font-weight: 800; }
.daily-ring small { color: var(--lime); font-weight: 800; letter-spacing: 0.12em; }

.cta-card {
  border: 0;
  border-left: 7px solid var(--primary);
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.cta-card:hover { transform: none; }
.cta-badge { color: var(--secondary); background: var(--secondary-soft); }
.btn-cta-start { animation: none; background: var(--primary); box-shadow: 0 7px 0 #b94018, 0 13px 24px rgba(239,106,58,0.2); }
.btn-cta-start:hover { background: #f2784c; }

.today-plan-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 1.75rem;
}
.today-plan-header h3 { font-size: clamp(1.35rem, 3vw, 1.8rem); }

.task-card {
  box-shadow: 0 5px 18px rgba(31, 37, 56, 0.05);
  transition: transform 160ms ease, border-color 160ms ease;
}
.task-card:hover { transform: translateY(-2px); border-color: rgba(239,106,58,0.35); }
.task-card-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.task-number {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 14px;
  color: var(--primary);
  background: rgba(239,106,58,0.1);
  font-weight: 800;
}
.task-emoji { font-size: 1.05rem; font-weight: 800; }

.mobile-nav { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 859px) {
  .shell { width: min(720px, calc(100vw - 1rem)); padding-top: 0.5rem; }
  .app-header { margin-top: 0.2rem; padding: 0.8rem; }
  .hud-avatar { width: 3.5rem; }
  .hud-stats { width: 100%; }
  .hero-card { min-height: 280px; align-items: flex-start; flex-direction: column; }
  .hero-card h2 { font-size: clamp(2.3rem, 12vw, 3.6rem); }
  .daily-ring { position: absolute; right: 1.1rem; bottom: 1.1rem; width: 6.5rem; height: 6.5rem; }
  .daily-ring span { font-size: 1.5rem; }
  .hero-meta { max-width: calc(100% - 7rem); }
  .cta-card { padding: 1.25rem; }
  .task-card-top { grid-template-columns: auto 1fr; }
  .task-card-top .tag { grid-column: 2; justify-self: start; }
  .task-actions .btn { flex: 1; }
  .mobile-nav { position: fixed; z-index: 4; left: 0.5rem; right: 0.5rem; bottom: max(0.5rem, env(safe-area-inset-bottom)); margin: 0; }
  #onboarding-step-1 h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .brand-lockup { margin-bottom: 2rem; }
}

@media (max-width: 440px) {
  .onboarding-card { margin-top: 0.5rem; padding: 1.3rem; border-radius: 22px; }
  #mascot-preview { min-height: 9rem; margin-block: 0.5rem 1rem; }
  .trust-line { line-height: 1.6; }
  .hero-card { border-radius: 22px; }
  .task-card { padding: 0.85rem; }
  .task-meta-row .tag { font-size: 0.75rem; }
}
/* --- Training focus pass: one challenge, three targets --- */
.modal {
  background: rgba(8, 15, 32, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  max-width: 760px;
  overflow: hidden;
  border: 0;
  background: #fffdf8;
}

.modal-header {
  margin: -1.25rem -1.25rem 0;
  padding: 1.4rem 1.5rem 1.2rem;
  color: #fff;
  background: var(--navy);
}

.modal-header .eyebrow { color: var(--lime); }
.modal-header h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); }

.modal-close {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,0.1);
  font-size: 1.8rem;
  line-height: 1;
}

.modal-main-content { padding-top: 1.35rem; }

.exercise-goal {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 700;
  line-height: 1.35;
}

.medal-targets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
}

.medal-target {
  min-width: 0;
  padding: 1rem 0.6rem 0.85rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(16,27,53,0.06);
}

.medal-target-icon { font-size: 1.55rem; }
.medal-target strong { margin-top: 0.15rem; font-size: clamp(1.6rem, 5vw, 2.25rem); line-height: 1; }
.medal-target small { margin-top: 0.35rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.medal-target-gold { border-color: rgba(245,158,11,0.45); background: #fffaf0; }

.instructions-block {
  padding: 1.25rem;
  border-radius: 20px;
  background: rgba(15,118,110,0.07);
}

.instructions-block .detail-list {
  padding: 0;
  list-style: none;
  counter-reset: training-step;
}

.instructions-block .detail-list li {
  position: relative;
  min-height: 2.4rem;
  margin: 0.75rem 0 0;
  padding-left: 3rem;
  display: flex;
  align-items: center;
  font-size: 1rem;
  line-height: 1.35;
  counter-increment: training-step;
}

.instructions-block .detail-list li::before {
  content: counter(training-step);
  position: absolute;
  left: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--secondary);
  font-weight: 800;
}

.details-accordion { margin: 1rem 0; background: transparent; }
.accordion-summary { color: var(--muted); font-size: 0.9rem; }

.result-form {
  margin: 1rem -1.25rem -1.25rem;
  padding: 1.25rem;
  border-top: 0;
  background: var(--navy);
}

.result-form .field span,
.result-form .checkbox-row span { color: #fff; }
.result-form input { min-height: 3.6rem; border: 2px solid transparent; font-size: 1.2rem; font-weight: 800; }
.result-form input:focus { border-color: var(--lime); }
.result-form .result-status { color: rgba(255,255,255,0.7); }
.result-form .btn-primary { color: var(--navy); background: var(--lime); box-shadow: 0 7px 0 #8eaF1d; }

@media (max-width: 859px) {
  .modal { padding: 0; }
  .modal-card { min-height: 100dvh; margin: 0; border-radius: 0; }
  .modal-header { flex-direction: row; align-items: center; position: sticky; top: 0; z-index: 2; }
  .result-actions { align-items: stretch; }
  .result-actions .btn { width: 100%; }
}

@media (max-width: 440px) {
  .modal-card { padding: 1rem; }
  .modal-header { margin: -1rem -1rem 0; padding: 1rem; }
  .modal-header h2 { font-size: 1.65rem; }
  .modal-main-content { padding-top: 1rem; }
  .medal-target { padding: 0.75rem 0.25rem; border-radius: 14px; }
  .medal-target-icon { font-size: 1.25rem; }
  .medal-target strong { font-size: 1.6rem; }
  .medal-target small { font-size: 0.65rem; }
  .instructions-block { padding: 1rem; }
  .instructions-block .detail-list li { font-size: 0.93rem; }
  .result-form { margin: 1rem -1rem -1rem; padding: 1rem; }
}
/* --- Academy vertical slice --- */
.academy-arena {
  min-height: 390px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  grid-template-rows: 1fr auto;
  gap: 1.5rem;
  overflow: hidden;
  padding: clamp(1.4rem, 4vw, 2.5rem);
  color: #fff;
  border: 0;
  background:
    radial-gradient(circle at 78% 22%, rgba(80,107,154,0.22), transparent 22rem),
    linear-gradient(145deg, #10192e 0%, #07101f 100%);
  box-shadow: 0 24px 60px rgba(8,15,32,0.28);
  isolation: isolate;
}

.academy-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  background: repeating-linear-gradient(100deg, transparent 0 79px, rgba(255,255,255,0.025) 80px);
}

.academy-story { z-index: 2; align-self: center; }
.academy-story .eyebrow { color: #7484a7; }
.academy-story h2 { margin-bottom: 1rem; font-size: clamp(2.4rem, 5.8vw, 4.7rem); letter-spacing: -0.055em; line-height: 0.9; }
.academy-story h2 span { color: #65728e; transition: color 700ms ease, text-shadow 700ms ease; }
.academy-arena .hero-meta .tag { color: #aeb8cc; background: rgba(255,255,255,0.07); }

.kiki-message {
  max-width: 34rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin: 1.3rem 0;
  padding: 0.8rem 1rem 0.8rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  color: #dfe5f0;
  background: rgba(255,255,255,0.055);
}
.kiki-message p { margin: 0; line-height: 1.4; }

.kiki-orb {
  flex: 0 0 3.15rem;
  width: 3.15rem;
  height: 3.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border-radius: 48% 52% 45% 55%;
  color: #091122;
  background: #6f7c97;
  box-shadow: inset -8px -7px 0 rgba(0,0,0,0.18);
  transform: rotate(-8deg);
  transition: background 500ms ease, box-shadow 500ms ease;
}
.kiki-orb span { font-size: 1.35rem; line-height: 0; transform: translateY(-2px); }

.arena-sky { position: absolute; inset: 0; pointer-events: none; }
.arena-star { position: absolute; color: #fff; opacity: 0.12; animation: arena-twinkle 2.4s ease-in-out infinite; }
.star-one { left: 46%; top: 12%; }
.star-two { left: 58%; top: 27%; animation-delay: 0.7s; }
.star-three { right: 8%; top: 8%; animation-delay: 1.4s; }
@keyframes arena-twinkle { 50% { opacity: 0.4; transform: scale(1.3); } }

.arena-world {
  min-height: 250px;
  position: relative;
  align-self: end;
  perspective: 500px;
}

.arena-stands {
  position: absolute;
  left: 4%; right: 4%; bottom: 45%; height: 34%;
  border-radius: 55% 55% 10px 10px;
  border: 10px solid #151f35;
  background:
    radial-gradient(circle, #202b45 0 2px, transparent 2.5px) 0 0 / 13px 11px,
    #0b1427;
  box-shadow: inset 0 -20px 30px rgba(0,0,0,0.65);
}

.arena-court {
  position: absolute;
  left: 7%; right: 7%; bottom: 0; height: 52%;
  overflow: hidden;
  border-radius: 8px 8px 40% 40%;
  border: 2px solid rgba(255,255,255,0.12);
  background: linear-gradient(90deg, #172037, #202b43 50%, #172037);
  transform: rotateX(56deg);
  transform-origin: bottom;
  transition: background 700ms ease, box-shadow 700ms ease;
}
.arena-court::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid rgba(255,255,255,0.2); }
.arena-court::after { content: ''; position: absolute; width: 34%; aspect-ratio: 1; left: 33%; top: 20%; border: 2px solid rgba(255,255,255,0.2); border-radius: 50%; }
.arena-court i { position: absolute; inset: 10% 6%; border: 2px solid rgba(255,255,255,0.18); border-radius: 6px 6px 35% 35%; }

.arena-scoreboard {
  position: absolute;
  z-index: 3;
  left: 50%; top: 17%;
  width: 5.5rem;
  padding: 0.5rem;
  display: grid;
  text-align: center;
  color: #68738c;
  border: 3px solid #2b354b;
  background: #070d18;
  transform: translateX(-50%);
}
.arena-scoreboard span { font-size: 1.2rem; font-weight: 800; }
.arena-scoreboard small { font-size: 0.55rem; letter-spacing: 0.1em; }

.arena-lights { position: absolute; z-index: 4; inset: 7% 0 auto; display: flex; justify-content: space-between; }
.arena-lights i { width: 2.8rem; height: 0.7rem; border-radius: 3px; background: #263047; transform: rotate(-9deg); transition: all 700ms ease; }
.arena-lights i:nth-child(2) { transform: rotate(0); }
.arena-lights i:nth-child(3) { transform: rotate(9deg); }

.academy-progress {
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.09);
}
.academy-progress-copy { display: grid; min-width: 6.5rem; }
.academy-progress-copy span { color: #fff; font-size: 1.4rem; font-weight: 800; }
.academy-progress-copy small { color: #76819b; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; }
.academy-progress-track { height: 0.75rem; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.09); }
#academy-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #ffc14d); transition: width 900ms cubic-bezier(.2,.9,.25,1); }

.academy-arena.arena-awake { background: radial-gradient(circle at 74% 15%, rgba(255,190,64,0.25), transparent 25rem), linear-gradient(145deg, #142344, #081426); }
.academy-arena.arena-awake .academy-story h2 span { color: #ffb13b; text-shadow: 0 0 28px rgba(255,177,59,0.35); }
.academy-arena.arena-awake .kiki-orb { background: var(--primary); box-shadow: 0 0 25px rgba(239,106,58,0.45), inset -8px -7px 0 rgba(0,0,0,0.18); animation: kiki-awake 2s ease-in-out infinite; }
.academy-arena.arena-awake .arena-lights i { background: #ffe7a2; box-shadow: 0 8px 35px 12px rgba(255,211,91,0.28); }
.academy-arena.arena-awake .arena-scoreboard { color: var(--lime); text-shadow: 0 0 12px rgba(199,242,58,0.5); }
.academy-arena.arena-awake .arena-court { background: linear-gradient(90deg, #d66036, #ee8051 50%, #d66036); box-shadow: 0 0 45px rgba(239,106,58,0.22); }
@keyframes kiki-awake { 50% { transform: translateY(-5px) rotate(6deg); } }

.academy-arena.arena-silver .arena-stands { background: radial-gradient(circle, #f1a642 0 2px, transparent 2.5px) 0 0 / 13px 11px, #18233b; }
.academy-arena.arena-gold .arena-lights i { background: #fff; box-shadow: 0 12px 45px 18px rgba(255,241,174,0.42); }
.academy-arena[data-reward="lights"] .arena-lights i { width: 4rem; background: #fff8c7; }
.academy-arena[data-reward="crowd"] .arena-stands { background: radial-gradient(circle, #ffbe4f 0 3px, transparent 3.5px) 0 0 / 13px 11px, #27324b; }
.academy-arena[data-reward="court"] .arena-court { background: linear-gradient(90deg, #007e73, #13a294 50%, #007e73); box-shadow: 0 0 55px rgba(30,224,197,0.35); }

.academy-reward { width: 100%; padding: 1.1rem; border: 1px solid rgba(239,106,58,0.22); border-radius: 20px; background: #fff8ef; }
.reward-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.8rem; }
.reward-option { min-height: 5rem; display: grid; place-items: center; gap: 0.25rem; padding: 0.7rem 0.35rem; border: 2px solid transparent; border-radius: 15px; color: var(--text); background: #fff; box-shadow: 0 5px 14px rgba(16,27,53,0.08); }
.reward-option span { font-size: 1.55rem; }
.reward-option strong { font-size: 0.78rem; }
.reward-option.selected { border-color: var(--primary); background: #fff1e9; transform: translateY(-2px); }

@media (max-width: 859px) {
  .academy-arena { min-height: 570px; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .academy-story h2 { font-size: clamp(2.8rem, 13vw, 4.5rem); }
  .arena-world { min-height: 210px; }
  .academy-progress { grid-column: 1; }
}

@media (max-width: 440px) {
  .academy-arena { min-height: 535px; padding: 1.1rem; border-radius: 22px; }
  .kiki-message { font-size: 0.88rem; }
  .kiki-orb { flex-basis: 2.7rem; width: 2.7rem; height: 2.7rem; }
  .arena-world { min-height: 180px; }
  .reward-options { gap: 0.35rem; }
  .reward-option { min-height: 4.5rem; }
}
/* --- Handball identity and audio-first play --- */
.brand-ball,
.kiki-orb {
  overflow: hidden;
  background:
    linear-gradient(35deg, transparent 43%, #172033 44% 49%, transparent 50%),
    linear-gradient(145deg, transparent 43%, #172033 44% 49%, transparent 50%),
    linear-gradient(90deg, #f6c945 0 48%, #f8f0da 49% 66%, #ef6a3a 67%);
}

.brand-ball::after,
.kiki-orb::after {
  content: '';
  position: absolute;
  width: 46%;
  height: 120%;
  left: 27%;
  top: -10%;
  border-left: 3px solid #172033;
  border-right: 3px solid #172033;
  border-radius: 50%;
  transform: rotate(28deg);
  pointer-events: none;
}

.brand-ball { position: relative; color: transparent; }
.kiki-orb { position: relative; }
.kiki-orb span { position: relative; z-index: 2; width: 0.42rem; height: 0.52rem; border-radius: 50%; color: transparent; background: #08101f; box-shadow: 0 1px 0 #fff; }

.handball-goal {
  position: absolute;
  z-index: 5;
  width: 3.8rem;
  height: 2.6rem;
  bottom: 30%;
  border: 5px solid #fff;
  border-image: repeating-linear-gradient(45deg, #fff 0 7px, #e33232 7px 14px) 5;
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,0.14) 7px 8px);
  transform: perspective(120px) rotateX(-5deg);
}
.goal-left { left: 4%; }
.goal-right { right: 4%; }

.arena-court::after {
  width: 20%;
  height: 72%;
  left: -8%;
  top: 14%;
  border-radius: 50%;
  box-shadow: calc(100% + 14rem) 0 0 -2px transparent;
}

.audio-mission {
  margin-bottom: 1rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  border: 2px solid rgba(23,32,51,0.08);
  border-radius: 20px;
  background: #fff;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.audio-mission.active { border-color: var(--secondary); background: #eefaf7; transform: scale(1.01); }
.audio-mission-copy { min-width: 0; display: flex; align-items: center; gap: 0.85rem; }
.audio-mission-copy > div { display: grid; }
.audio-mission-copy small { margin-top: 0.2rem; color: var(--muted); }
.audio-mission .btn { min-width: 12rem; }

.audio-wave { width: 2.7rem; height: 2.7rem; flex: 0 0 2.7rem; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; color: #fff; background: var(--secondary); }
.audio-wave i { width: 3px; height: 8px; border-radius: 3px; background: #fff; }
.audio-wave i:nth-child(2) { height: 17px; }
.audio-wave i:nth-child(3) { height: 12px; }
.audio-mission.active .audio-wave i { animation: audio-wave 650ms ease-in-out infinite alternate; }
.audio-mission.active .audio-wave i:nth-child(2) { animation-delay: 120ms; }
.audio-mission.active .audio-wave i:nth-child(3) { animation-delay: 240ms; }
.audio-mission.active .audio-wave i:nth-child(4) { animation-delay: 360ms; }
@keyframes audio-wave { to { height: 22px; } }

.mastery-constellation {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, #101b35, #182d51);
}
.mastery-constellation h3 { margin-bottom: 0.3rem; }
.constellation-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; margin-top: 1rem; }
.constellation-star { padding: 0.75rem 0.4rem; display: grid; place-items: center; gap: 0.25rem; border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; color: #71809f; background: rgba(255,255,255,0.05); text-align: center; }
.constellation-star::before { content: '✦'; font-size: 1.5rem; }
.constellation-star.active { color: var(--lime); border-color: rgba(199,242,58,0.38); box-shadow: inset 0 0 20px rgba(199,242,58,0.08); }
.constellation-star small { color: inherit; font-weight: 700; }

@media (max-width: 600px) {
  .audio-mission { grid-template-columns: 1fr; }
  .audio-mission .btn { width: 100%; min-width: 0; }
  .audio-mission-copy small { font-size: 0.78rem; }
  .handball-goal { width: 3rem; height: 2.1rem; }
}
/* --- Blickfänger boss vertical slice --- */
.arena-boss {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 3%;
  width: 5.8rem;
  height: 3.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 52% 48% 44% 56%;
  background: #4b2b70;
  box-shadow: 0 0 28px rgba(160,84,255,0.42), inset 0 -10px 16px rgba(0,0,0,0.3);
  transform: translateX(-50%);
  animation: boss-hover 2.3s ease-in-out infinite;
}
.arena-boss i { width: 1.15rem; height: 1.35rem; display: block; border-radius: 50%; border: 4px solid #fff; background: #151023; box-shadow: inset 2px 0 0 #e058ff; }
.arena-boss span { position: absolute; top: calc(100% + 0.3rem); color: #c9a4ff; font-size: 0.52rem; font-weight: 800; letter-spacing: 0.12em; }
.arena-boss.boss-damaged { filter: saturate(0.65); opacity: 0.8; }
@keyframes boss-hover { 50% { transform: translate(-50%, -7px) rotate(2deg); } }

.next-area-teaser {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  color: #fff;
  border: 1px solid rgba(199,242,58,0.35);
  background: linear-gradient(120deg, #10243f, #0d4c49);
}
.next-area-teaser h3, .next-area-teaser p { margin-bottom: 0.2rem; }
.next-area-teaser .eyebrow { color: var(--lime); }
.next-area-teaser > span { color: var(--lime); font-size: 2.2rem; }

.boss-modal { background: radial-gradient(circle at 50% 20%, rgba(112,46,161,0.38), transparent 35rem), rgba(5,9,20,0.94); }
.boss-card { max-width: 720px; min-height: min(760px, calc(100dvh - 2rem)); margin: 1rem auto; overflow: hidden; padding: 0; color: #fff; border: 1px solid rgba(200,164,255,0.2); background: linear-gradient(180deg, #16102b, #080e1c); }
.boss-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.boss-header .eyebrow { color: #ce9cff; }
.boss-header h2 { margin: 0; font-size: clamp(1.8rem, 6vw, 2.7rem); }
.boss-battle-view, .boss-result-form, .boss-outcome { padding: clamp(1.1rem, 4vw, 2rem); }

.boss-health-row { display: flex; justify-content: space-between; color: #cabbdc; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; }
.boss-health-track { height: 0.85rem; margin-top: 0.55rem; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.08); }
#boss-health-fill { width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ed4a65, #ae4fe5); transition: width 800ms ease; }

.boss-creature {
  width: min(82%, 390px);
  aspect-ratio: 1.55;
  position: relative;
  margin: 2rem auto 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 7vw, 3rem);
  border-radius: 48% 52% 44% 56%;
  background: radial-gradient(circle at 50% 35%, #713ca4, #321b58 65%, #160f2c);
  box-shadow: 0 0 70px rgba(168,73,239,0.3), inset 0 -35px 45px rgba(0,0,0,0.35);
  animation: boss-breathe 2.2s ease-in-out infinite;
}
.boss-creature::before, .boss-creature::after { content: ''; position: absolute; width: 3rem; height: 5rem; top: 42%; border-radius: 50%; background: #281643; }
.boss-creature::before { left: -1.2rem; transform: rotate(34deg); }
.boss-creature::after { right: -1.2rem; transform: rotate(-34deg); }
.boss-eye { width: clamp(3.3rem, 12vw, 5.5rem); aspect-ratio: 0.82; display: grid; place-items: center; border-radius: 50%; background: #f8f2ff; box-shadow: 0 0 24px rgba(255,255,255,0.3); }
.boss-eye i { width: 46%; aspect-ratio: 1; border-radius: 50%; background: #0d0a18; box-shadow: inset 0 0 0 8px #bd53ec; animation: eye-look 2.5s ease-in-out infinite; }
.boss-creature > span { position: absolute; left: 1rem; right: 1rem; bottom: 1.2rem; text-align: center; color: #d7c5e9; font-size: 0.76rem; font-weight: 700; }
.boss-creature.record-strike { animation: boss-hit 650ms ease both; }
@keyframes boss-breathe { 50% { transform: scale(1.025) translateY(-4px); } }
@keyframes eye-look { 35% { transform: translateX(-7px); } 70% { transform: translateX(7px); } }
@keyframes boss-hit { 20%, 60% { transform: translateX(-14px) rotate(-3deg); filter: brightness(2); } 40%, 80% { transform: translateX(14px) rotate(3deg); } }

.boss-command-stage { min-height: 7rem; display: grid; place-content: center; text-align: center; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; background: rgba(255,255,255,0.05); }
.boss-command-stage .eyebrow { color: var(--lime); }
.boss-command-stage strong { font-size: clamp(1.8rem, 7vw, 3rem); letter-spacing: -0.03em; }
.boss-command-stage small { margin-top: 0.3rem; color: #9ea9bd; }
.boss-main-action { width: 100%; min-height: 4rem; margin-top: 1rem; color: #101b35; background: var(--lime); box-shadow: 0 7px 0 #8fac20; }
.boss-main-action:hover { color: #101b35; background: #d6ff4e; }

.boss-result-form h3 { font-size: clamp(1.8rem, 6vw, 2.7rem); }
.boss-result-form .field span { color: #fff; }
.boss-result-form input[type="number"] { min-height: 4.2rem; font-size: 1.5rem; font-weight: 800; }
.gaze-field { margin: 1.2rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; border: 0; }
.gaze-field legend { width: 100%; margin-bottom: 0.7rem; font-weight: 800; }
.gaze-field label { cursor: pointer; }
.gaze-field input { position: absolute; opacity: 0; pointer-events: none; }
.gaze-field span { min-height: 4rem; display: grid; place-items: center; padding: 0.6rem; border: 2px solid rgba(255,255,255,0.12); border-radius: 15px; color: #c6ccda; background: rgba(255,255,255,0.05); text-align: center; font-weight: 700; }
.gaze-field input:checked + span { color: #fff; border-color: var(--lime); background: rgba(199,242,58,0.13); box-shadow: 0 0 22px rgba(199,242,58,0.12); }

.boss-outcome { text-align: center; }
.boss-outcome .eyebrow { color: var(--lime); }
.boss-outcome h2 { margin-top: 1.3rem; font-size: clamp(2rem, 8vw, 3.5rem); }
.boss-outcome > p:not(.eyebrow) { color: #b4bdd0; }
.dual-result { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; margin: 1.5rem 0; }
.dual-result > div { padding: 1.3rem 0.7rem; display: grid; border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; background: rgba(255,255,255,0.05); }
.dual-result span { color: var(--lime); font-size: 2.2rem; font-weight: 800; }
.dual-result small { color: #9ca8bd; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; }
.cosmetic-unlock { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; padding: 1rem; border: 1px solid rgba(199,242,58,0.4); border-radius: 18px; color: #fff; background: rgba(199,242,58,0.1); text-align: left; }
.cosmetic-unlock > div { display: grid; }
.cosmetic-unlock small { color: var(--lime); font-weight: 800; }
.visor-icon { width: 3.3rem; height: 2rem; display: grid; place-items: center; border-radius: 50% 50% 40% 40%; color: var(--lime); border: 3px solid var(--lime); background: rgba(199,242,58,0.15); }
.cosmetic-visor .hud-avatar { position: relative; }
.cosmetic-visor .hud-avatar::after { content: ''; position: absolute; width: 2.1rem; height: 0.65rem; left: 50%; top: 1.15rem; border: 2px solid var(--lime); border-radius: 50%; background: rgba(199,242,58,0.35); transform: translateX(-50%) rotate(-3deg); box-shadow: 0 0 10px rgba(199,242,58,0.6); }

.constellation-line { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 600px) {
  .boss-card { min-height: 100dvh; margin: 0; border-radius: 0; }
  .boss-creature { width: 92%; }
  .gaze-field { grid-template-columns: 1fr; }
  .gaze-field span { min-height: 3.2rem; }
  .constellation-line { grid-template-columns: repeat(2, 1fr); }
}
.boss-special-attack { width: 7rem; height: 7rem; position: relative; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 50%; color: #7b8498; background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 68%); }
.boss-special-attack i { width: 3.4rem; height: 3.4rem; display: block; border-radius: 50%; background: #4b5570; box-shadow: inset -8px -7px 0 rgba(0,0,0,0.2); }
.boss-special-attack span { position: absolute; bottom: -0.2rem; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.12em; }
.boss-special-attack.record { color: var(--lime); animation: special-impact 850ms cubic-bezier(.2,.9,.2,1) both; }
.boss-special-attack.record i { background: var(--lime); box-shadow: 0 0 18px var(--lime), 0 0 55px rgba(199,242,58,0.55), inset -8px -7px 0 rgba(0,0,0,0.18); }
@keyframes special-impact { 0% { opacity: 0; transform: scale(0.2) rotate(-120deg); } 65% { transform: scale(1.35) rotate(8deg); } 100% { opacity: 1; transform: scale(1); } }
/* --- Kiki Magic Counter --- */
.magic-counter {
  position: relative;
  margin-bottom: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  overflow: hidden;
  border: 2px solid rgba(15,118,110,0.18);
  border-radius: 24px;
  background: linear-gradient(145deg, #f5fffc, #eaf8f4);
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.magic-counter::after { content: ''; position: absolute; width: 11rem; height: 11rem; right: -6rem; top: -7rem; border: 2rem solid rgba(15,118,110,0.05); border-radius: 50%; pointer-events: none; }
.magic-counter.requesting { border-color: #f2b33d; background: #fffaf0; }
.magic-counter.active { color: #fff; border-color: var(--lime); background: linear-gradient(145deg, #102540, #0c3e3b); box-shadow: 0 16px 35px rgba(9,46,58,0.22); }
.magic-counter.complete { border-color: var(--secondary); background: linear-gradient(145deg, #f3fff9, #e2f8ef); }
.magic-counter.bounce-hit .live-counter span { animation: counter-hit 180ms ease-out; }
@keyframes counter-hit { 50% { color: var(--lime); transform: scale(1.16); text-shadow: 0 0 24px rgba(199,242,58,0.7); } }

.magic-counter-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 0.9rem; }
.magic-counter-head > div { min-width: 0; display: grid; }
.magic-counter-head .eyebrow { margin: 0 0 0.2rem; }
.magic-counter-head small { margin-top: 0.2rem; color: var(--muted); }
.magic-counter.active .magic-counter-head small { color: #b7c8d1; }
.magic-counter.active .eyebrow { color: var(--lime); }

.live-counter { position: relative; z-index: 1; display: grid; place-items: center; min-height: 9rem; padding: 0.7rem; text-align: center; }
.live-counter span { display: block; color: var(--navy); font-size: clamp(4.5rem, 18vw, 8rem); font-weight: 800; letter-spacing: -0.08em; line-height: 0.85; transition: color 120ms ease, transform 120ms ease; }
.live-counter small { margin-top: 0.65rem; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; }
.magic-counter.active .live-counter span { color: #fff; }
.magic-counter.active .live-counter small { color: var(--lime); }

.tracking-signal { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; align-items: center; margin-bottom: 1rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.tracking-signal > div { height: 0.45rem; overflow: hidden; border-radius: 99px; background: rgba(23,32,51,0.1); }
.tracking-signal i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--secondary), var(--lime)); transition: width 80ms linear; }
.magic-counter.active .tracking-signal { color: #b7c8d1; }
.magic-counter.active .tracking-signal > div { background: rgba(255,255,255,0.12); }

.magic-counter-action { position: relative; z-index: 1; width: 100%; min-height: 4rem; }
.counter-finish-controls { position: relative; z-index: 1; display: grid; grid-template-columns: 3.4rem 1fr 3.4rem; gap: 0.6rem; }
.counter-finish-controls > button:first-child,
.counter-finish-controls > button:last-child { min-height: 3.7rem; border: 1px solid rgba(255,255,255,0.2); border-radius: 16px; color: #fff; background: rgba(255,255,255,0.1); font-size: 1.6rem; font-weight: 700; }
.counter-finish-controls .btn { min-height: 3.7rem; color: var(--navy); background: var(--lime); box-shadow: 0 6px 0 #8ead1e; }
.manual-count-link { position: relative; z-index: 1; width: 100%; margin-top: 0.8rem; padding: 0.4rem; border: 0; color: var(--secondary); background: transparent; font-size: 0.85rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.magic-counter.active .manual-count-link { color: #c7d5dd; }
.privacy-note { position: relative; z-index: 1; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.4; text-align: center; }
.magic-counter.active .privacy-note { color: #9eb0ba; }
.magic-counter.manual .live-counter,
.magic-counter.manual .tracking-signal { display: none; }
.magic-counter.manual { padding-bottom: 1rem; }

@media (max-width: 440px) {
  .magic-counter { padding: 1rem; border-radius: 20px; }
  .magic-counter-head { align-items: flex-start; }
  .magic-counter-head .audio-wave { width: 2.35rem; height: 2.35rem; flex-basis: 2.35rem; }
  .live-counter { min-height: 7.5rem; }
  .counter-finish-controls { grid-template-columns: 3rem 1fr 3rem; gap: 0.35rem; }
  .counter-finish-controls .btn { padding-inline: 0.55rem; font-size: 0.82rem; }
}