:root {
  --bg: #070b14;
  --bg-2: #0f1727;
  --surface: #121a2a;
  --surface-2: #182236;
  --surface-3: #0f1626;
  --line: #24324a;
  --line-strong: #334766;
  --text: #eaf1ff;
  --muted: #a3b2ce;
  --accent: #46b2ff;
  --accent-2: #1b78d8;
  --success: #28d07f;
  --warn: #f4b22f;
  --danger: #ef5757;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -30%, rgba(67, 127, 222, 0.22), transparent 48%),
    radial-gradient(circle at 5% 20%, rgba(21, 51, 112, 0.35), transparent 42%),
    radial-gradient(circle at 95% 15%, rgba(24, 72, 110, 0.22), transparent 40%),
    linear-gradient(180deg, #060a16 0%, #071126 48%, #081528 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
  background-image: url("public/assets/poog_outline.png");
  background-repeat: repeat;
  background-size: 170px;
  background-position: 0 0;
}

#app {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 36px 18px 40px;
}

.sheet {
  position: relative;
  isolation: isolate;
  background: linear-gradient(160deg, rgba(20, 28, 52, 0.88), rgba(12, 19, 35, 0.92));
  border: 1px solid rgba(94, 126, 176, 0.42);
  border-radius: 18px;
  padding: 0 0 18px;
  box-shadow:
    0 26px 64px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
  min-width: 0;
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 20px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(113, 148, 204, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.titlebar {
  display: block;
}

.wood-sign {
  background: linear-gradient(180deg, rgba(33, 45, 75, 0.82), rgba(19, 29, 53, 0.85));
  border-bottom: 1px solid rgba(101, 130, 177, 0.35);
  border-radius: 18px 18px 0 0;
  padding: 22px 28px 16px;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.24);
}

h1,
h2,
h3,
p,
figure,
pre {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0.3px;
  font-weight: 700;
}

h2 {
  font-size: 1.12rem;
  letter-spacing: 0.2px;
}

.subtitle,
.note {
  color: var(--muted);
  font-size: 0.92rem;
}

.app-footer {
  margin: 16px 16px 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.app-footer-project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.app-footer-link {
  display: inline-block;
  opacity: 0.75;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.app-footer-vibe-link {
  justify-self: end;
}

.app-footer-link:hover,
.app-footer-link:focus-visible,
.app-footer-link:active,
.app-footer-link:visited {
  color: inherit;
  text-decoration: none;
}

.app-footer-link:hover,
.app-footer-link:focus-visible {
  opacity: 1;
}

.how-to-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2.8vw, 26px);
  background:
    radial-gradient(circle at 50% 12%, rgba(116, 178, 255, 0.2), transparent 55%),
    rgba(8, 16, 33, 0.58);
  backdrop-filter: blur(4px);
}

.how-to-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 640px);
  display: grid;
  gap: 12px;
  padding: 24px 24px 22px;
  border-radius: 18px;
  border: 1px solid #9db6d8;
  background:
    radial-gradient(circle at 88% 6%, rgba(150, 208, 255, 0.4), transparent 42%),
    linear-gradient(170deg, #ffffff, #edf3fb);
  box-shadow:
    0 26px 70px rgba(7, 16, 31, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: #1a2434;
  animation: how-to-card-entrance 420ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.how-to-card::before {
  content: "";
  position: absolute;
  inset: auto -26% -64% 40%;
  height: 220px;
  background: radial-gradient(circle, rgba(89, 145, 220, 0.22), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.how-to-card > * {
  position: relative;
  z-index: 1;
}

.how-to-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #b7c6da;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  color: #435776;
  font-size: 0;
  line-height: 0;
  font-weight: 700;
}

.how-to-close-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.how-to-close-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.how-to-kicker {
  margin: 0;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #a9c5ea;
  background: linear-gradient(180deg, #eef6ff, #deecfe);
  color: #294f85;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.how-to-card h2 {
  font-size: clamp(1.34rem, 3vw, 1.76rem);
  padding-right: 42px;
  line-height: 1.16;
  color: #112744;
}

.how-to-intro {
  margin: 0;
  color: #40516c;
  line-height: 1.46;
  font-size: 0.98rem;
}

.how-to-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how-to-step;
  display: grid;
  gap: 8px;
}

.how-to-list li {
  position: relative;
  margin: 0;
  padding: 10px 12px 10px 46px;
  border-radius: 12px;
  border: 1px solid #cddbf0;
  background: linear-gradient(180deg, #fafdff, #edf4ff);
  color: #33455f;
  line-height: 1.43;
}

.how-to-list li::before {
  counter-increment: how-to-step;
  content: counter(how-to-step);
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #8eb0dc;
  background: linear-gradient(180deg, #d9ebff, #bdd8fa);
  color: #244a7f;
  font-size: 0.79rem;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.how-to-list strong {
  color: #1c3557;
  font-weight: 800;
}

.how-to-score-band {
  margin: 2px 0 0;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #b9cbde;
  background: linear-gradient(180deg, #f2f7ff, #e5eefb);
  color: #39506d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.how-to-score-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.how-to-score-list li {
  margin: 0;
  padding: 9px 8px;
  border-radius: 11px;
  border: 1px solid #c9d8eb;
  background: linear-gradient(180deg, #f7fbff, #edf3fb);
  color: #435470;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.how-to-score-list span {
  display: block;
  margin-bottom: 4px;
  color: #214574;
  font-size: 0.91rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.how-to-footer-note {
  margin: 0;
  color: #586b87;
  font-size: 0.85rem;
  line-height: 1.4;
}

.how-to-card .submit-btn {
  justify-self: stretch;
  min-height: 52px;
  border-radius: 12px;
  border-color: #5076a3;
  background: linear-gradient(180deg, #68aafc, #2e67c0);
  color: #f3f8ff;
  font-size: clamp(1rem, 1.9vw, 1.22rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 14px 26px rgba(37, 86, 156, 0.33);
}

.how-to-card .submit-btn:hover:not(:disabled) {
  border-color: #6392ca;
  box-shadow: 0 16px 30px rgba(37, 86, 156, 0.42);
}

.how-to-overlay.is-dismissing {
  pointer-events: none;
  animation: how-to-overlay-fade 420ms ease forwards;
}

.how-to-overlay.is-dismissing .how-to-card.is-genie-dismiss {
  animation: how-to-genie-shrink 420ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.top-right-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.how-to-help-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #c5cad4;
  background: linear-gradient(180deg, #f3f6fb, #e5eaf3);
  color: #4b5565;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: none;
}

.subtitle {
  margin-top: 7px;
  max-width: 44ch;
  justify-self: center;
  line-height: 1.45;
}

.warn-note {
  color: #ffd58a;
  font-weight: 600;
  font-size: 0.9rem;
}

button,
input,
select {
  font: inherit;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
}

button {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 14px;
  color: var(--text);
  background: linear-gradient(180deg, #1d2a42, #182338);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease;
}

button:hover:not(:disabled) {
  border-color: #7192c5;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel {
  margin: 16px 18px 0;
  background: linear-gradient(180deg, rgba(11, 20, 38, 0.95), rgba(9, 16, 31, 0.95));
  border: 1px solid rgba(73, 98, 138, 0.36);
  border-radius: 16px;
  padding: 16px 18px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.panel-head {
  display: grid;
  gap: 6px;
}

.progress-wrap {
  display: grid;
  gap: 6px;
}

.panel-record {
  gap: 12px;
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 108, 185, 0.15), transparent 42%),
    linear-gradient(160deg, rgba(12, 21, 40, 0.96), rgba(9, 16, 32, 0.96));
}

.record-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.record-step-title {
  display: grid;
  gap: 2px;
}

.step-badge {
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 700;
}

.record-top-actions {
  display: flex;
  gap: 8px;
}

.view-toggle-row {
  display: flex;
  justify-content: center;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.view-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #121d34;
  border: 1px solid #304564;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #39f0be, #60baff);
  box-shadow: 0 0 14px rgba(70, 178, 255, 0.25);
}

.record-stage {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  gap: 18px;
  border: 1px solid rgba(67, 97, 146, 0.5);
  border-radius: 14px;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(23, 66, 130, 0.22), transparent 50%),
    linear-gradient(170deg, rgba(13, 22, 43, 0.94), rgba(12, 19, 35, 0.94));
}

.record-stage-main {
  display: grid;
  gap: 12px;
  align-content: center;
}

.mob-card.single {
  display: grid;
  gap: 8px;
  align-content: center;
  position: relative;
}

.mob-card img {
  width: 100%;
  height: clamp(190px, 30vw, 300px);
  padding-block: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.4));
}

.mob-card figcaption {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.nameplate {
  font-size: clamp(1.9rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.35px;
  line-height: 1.1;
  color: var(--text);
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.nameplate-count {
  color: #d2deef;
  font-size: 0.72em;
  font-weight: 500;
}

.hint-corner-btn {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #4b6fa4;
  background: linear-gradient(180deg, #294369, #1b2f4f);
  color: #ecf3ff;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0;
  z-index: 2;
}

.hint-corner-btn.playing {
  border-color: #7eb7ff;
  background: linear-gradient(180deg, #365884, #244266);
}

.hint-corner-btn:active:not(:disabled) {
  transform: none;
}

.variant-line {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.variant-record-list {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.variant-record-row {
  border: 1px solid #385276;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(20, 33, 58, 0.95), rgba(15, 26, 46, 0.95));
}

.variant-record-row.ready {
  border-color: #3f7f47;
}

.variant-record-row.skipped {
  border-color: #7f6a3d;
}

.variant-record-row.missing {
  border-color: #385276;
}

.variant-record-row.is-recording {
  border-color: #6b9ce3;
  box-shadow: 0 0 0 1px rgba(106, 156, 227, 0.28);
}

.variant-record-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.variant-tag {
  font-size: 0.84rem;
  font-weight: 700;
  color: #dfeaff;
}

.variant-record-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.variant-record-actions .record-pill-btn {
  min-height: 50px;
  font-size: 1rem;
  flex: 1 1 auto;
}

.variant-buttons {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-btn {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.15px;
  background: linear-gradient(180deg, #213555, #172741);
  border: 1px solid #36517b;
  color: #dfeaff;
  box-shadow: none;
}

.variant-btn.ready {
  border-color: #4f9c57;
  color: #baf6c4;
}

.variant-btn.skipped {
  border-color: #8f7a42;
  color: #ffe9ae;
}

.variant-btn.missing {
  border-color: #556b8f;
  color: #cbdaee;
}

.variant-btn.is-active {
  border-color: #79b2ff;
  background: linear-gradient(180deg, #2a4a79, #1a2f4f);
  box-shadow: 0 0 0 2px rgba(112, 176, 255, 0.2);
}

.meter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meter-row-time {
  margin-top: -2px;
  font-size: 1rem;
}

.play-hint {
  color: #d7e5ff;
  font-weight: 500;
}

.level-meter {
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: #10182d;
  border: 1px solid #273957;
}

.level-meter.segmented {
  background-image: repeating-linear-gradient(to right, rgba(255, 255, 255, 0.08) 0 9px, transparent 9px 13px);
}

.level-meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e);
  transition: width 0.1s linear;
}

.record-buttons {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.record-buttons > :first-child {
  justify-self: end;
}

.record-buttons > :last-child {
  justify-self: start;
}

.hold-stack {
  position: relative;
  width: clamp(128px, 20vw, 152px);
  height: clamp(128px, 20vw, 152px);
  display: grid;
  place-items: center;
}

.countdown-ring {
  width: 100%;
  max-width: 420px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, rgba(82, 140, 235, 0.18) calc(var(--ring-pct, 100) * 1%), rgba(23, 38, 66, 0.9) 0);
  color: #c6d9ff;
  font-weight: 700;
  border: 1px solid #2f4672;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.countdown-ring span {
  display: block;
  letter-spacing: 0.25px;
}

.countdown-ring.active {
  background: linear-gradient(90deg, rgba(115, 188, 255, 0.4) calc(var(--ring-pct, 100) * 1%), rgba(27, 46, 78, 0.9) 0);
}

.record-cta-wrap {
  display: grid;
  gap: 10px;
}

.record-pill-btn {
  min-height: 82px;
  border-radius: 999px;
  border: 1px solid #b33b4e;
  background: linear-gradient(180deg, #e44d5e, #cf2b47);
  color: #fff5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 800;
  box-shadow:
    0 14px 26px rgba(95, 10, 28, 0.54),
    inset 0 1px 0 rgba(255, 227, 231, 0.45),
    inset 0 -4px 0 rgba(110, 19, 34, 0.5);
  touch-action: none;
  user-select: none;
}

.record-pill-btn:hover:not(:disabled) {
  border-color: #cb5968;
  background: linear-gradient(180deg, #ed5f70, #d53651);
}

.record-pill-btn .record-pill-icon {
  font-size: 1.25em;
  line-height: 1;
}

.record-pill-btn.recording {
  background: linear-gradient(180deg, #d84556, #bc243f);
  box-shadow:
    0 10px 26px rgba(117, 17, 36, 0.58),
    inset 0 1px 0 rgba(255, 214, 220, 0.4),
    inset 0 -4px 0 rgba(97, 17, 30, 0.48);
}

.aux-buttons {
  display: flex;
  gap: 10px;
}

.circle-btn {
  width: clamp(108px, 16vw, 126px);
  height: clamp(108px, 16vw, 126px);
  border-radius: 999px;
  border: 1px solid #a12247;
  background: radial-gradient(circle at 35% 20%, #f45a7b 0%, #de2f57 28%, #bf153f 75%);
  color: #fff1f2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 2rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  touch-action: none;
  user-select: none;
  box-shadow:
    0 12px 24px rgba(107, 14, 39, 0.48),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.circle-btn span {
  font-size: 1rem;
  font-weight: 700;
}

.circle-btn.recording {
  background: radial-gradient(circle at 35% 20%, #e54a68 0%, #ca254a 30%, #9e1537 75%);
  border-color: #7f1736;
  color: #fff1f2;
  box-shadow:
    0 14px 28px rgba(108, 8, 37, 0.58),
    inset 0 2px 0 rgba(255, 255, 255, 0.18);
}

.play-triangle-btn {
  width: 66px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid #3f5783;
  background: linear-gradient(180deg, #213458, #172743);
  color: #e8eefc;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.play-triangle-btn:hover:not(:disabled) {
  background: radial-gradient(circle at 35% 15%, #28406a, #1b2b44);
}

.play-triangle-btn.playing:not(:disabled) {
  background: #23415f;
  border-color: #5d8fbe;
  animation: playback-pulse 1s ease-in-out infinite;
}

.play-icon {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
}

.play-triangle-btn:not(.playing) .play-icon {
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 28px solid currentColor;
  transform: translateX(4px);
}

.play-triangle-btn.playing .play-icon::before,
.play-triangle-btn.playing .play-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 9px;
  background: currentColor;
  border-radius: 2px;
}

.play-triangle-btn.playing .play-icon::before {
  left: 6px;
}

.play-triangle-btn.playing .play-icon::after {
  right: 6px;
}

.skip-circle-btn {
  width: auto;
  min-width: 84px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid #3b5380;
  background: linear-gradient(180deg, #213458, #172743);
  color: #e8eefc;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.skip-circle-btn:hover:not(:disabled) {
  background: radial-gradient(circle at 35% 15%, #28406a, #1b2b44);
}

@keyframes playback-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(93, 143, 190, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(93, 143, 190, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(93, 143, 190, 0);
  }
}

.ghost-btn {
  color: var(--text);
  background: linear-gradient(180deg, #1a263d, #172236);
  border-color: #49658f;
}

.text-link-btn {
  border: 0;
  background: transparent;
  color: #9ed2ff;
  text-align: left;
  padding: 0;
  font-weight: 700;
  box-shadow: none;
}

.text-link-btn:hover:not(:disabled) {
  color: #b9deff;
  text-decoration: underline;
  border: 0;
  box-shadow: none;
}

.add-mob-form {
  display: grid;
  gap: 8px;
  border: 1px solid #304664;
  border-radius: 12px;
  padding: 10px;
  background: #101b2d;
  width: min(100%, 560px);
}

.add-mob-form label {
  font-size: 0.86rem;
  color: var(--muted);
}

.add-mob-form input {
  width: 100%;
  padding: 9px 11px;
  background: #0d1626;
  color: var(--text);
}

.mob-checklist {
  width: 100%;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #304664;
  border-radius: 10px;
  background: #0d1626;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.mob-check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}

.mob-check-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mob-check-item input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
}

.mob-check-item.is-existing {
  opacity: 0.7;
}

.mob-check-item code {
  font-size: 0.76rem;
  color: var(--muted);
}

.add-mob-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

audio {
  width: 100%;
  border-radius: 8px;
}

.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.chunky-btn {
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.big-btn {
  padding: 12px 14px;
  color: #eff6ff;
  background: linear-gradient(180deg, #2b89e5, var(--accent-2));
  border-color: #2f5e9e;
}

.danger-btn {
  background: linear-gradient(180deg, #d54337, #b82f25);
  border-color: #9d2b23;
}

.stack {
  display: grid;
  gap: 8px;
}

.panel-export {
  gap: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(86, 130, 212, 0.2), transparent 44%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 78%, white 22%), color-mix(in srgb, var(--surface) 86%, white 14%));
}

.similarity-loading-card {
  width: min(100%, 560px);
  margin-inline: auto;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  border: 1px solid #d6dce6;
  border-radius: 10px;
  background: #f7f8fb;
  padding: 18px 16px;
}

.similarity-loading-title {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: #4c5565;
}

.similarity-loading-track {
  width: min(100%, 500px);
  height: 20px;
  border-radius: 6px;
  border: 1px solid #c9d0dc;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      90deg,
      rgba(140, 156, 184, 0.16) 0 10px,
      rgba(140, 156, 184, 0.05) 10px 20px
    ),
    #edf0f5;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.similarity-loading-fill {
  display: block;
  height: 100%;
  width: calc(var(--analysis-pct, 0) * 1%);
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.2) 0 14px,
      rgba(255, 255, 255, 0.06) 14px 28px
    ),
    linear-gradient(90deg, #73b857, #9ad279);
  animation: analysis-loading-shift 1.4s linear infinite;
  transition: width 0.28s ease;
}

.similarity-calc-list {
  width: min(100%, 500px);
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.similarity-calc-list li {
  border: 1px solid #d4dbe8;
  border-radius: 6px;
  background: linear-gradient(180deg, #f9fbff, #eef3fb);
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: #5c6880;
}

.similarity-calc-list li strong {
  color: #3d5781;
}

.ready-badge {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ecffe8;
  font-size: 2.3rem;
  font-weight: 700;
  background:
    radial-gradient(circle at 30% 20%, #8de46f, #5dbb45 70%),
    linear-gradient(180deg, #84de63, #4faa3b);
  border: 1px solid rgba(168, 230, 132, 0.9);
  box-shadow:
    0 0 0 6px rgba(112, 204, 86, 0.12),
    0 14px 36px rgba(28, 86, 20, 0.45),
    inset 0 1px 0 rgba(232, 255, 218, 0.45);
}

.export-summary {
  color: #cfdcf3;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
}

.export-pack-card {
  width: min(100%, 540px);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  margin-top: 6px;
  border-radius: 14px;
  border: 1px solid rgba(73, 103, 151, 0.72);
  padding: 16px 16px 14px;
  background:
    linear-gradient(180deg, rgba(35, 53, 87, 0.48), rgba(14, 24, 43, 0.88)),
    radial-gradient(circle at 50% -40%, rgba(95, 131, 203, 0.24), transparent 58%);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gift-pack-card {
  border: 2px solid #8eb45d;
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(161, 213, 109, 0.22), transparent 42%),
    linear-gradient(180deg, #f9ffef, #edf8de);
  padding: 20px 18px;
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform-origin: 50% 12%;
  box-shadow:
    0 14px 30px rgba(92, 132, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.gift-pack-card.is-entrance {
  animation: gift-pack-pop-in 820ms cubic-bezier(0.19, 1, 0.22, 1);
}

.gift-pack-card.is-entrance::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle, rgba(245, 255, 196, 0.95) 0%, rgba(245, 255, 196, 0) 66%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  animation: gift-pack-flash 620ms ease-out;
}

.gift-pack-card.is-entrance > * {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  animation: gift-pack-content-in 460ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.gift-pack-card.is-entrance > *:nth-child(1) {
  animation-delay: 180ms;
}

.gift-pack-card.is-entrance > *:nth-child(2) {
  animation-delay: 235ms;
}

.gift-pack-card.is-entrance > *:nth-child(3) {
  animation-delay: 300ms;
}

.gift-pack-card.is-entrance > *:nth-child(4) {
  animation-delay: 365ms;
}

.gift-pack-card.is-entrance > *:nth-child(5) {
  animation-delay: 420ms;
}

@keyframes gift-pack-pop-in {
  0% {
    opacity: 0;
    transform: translateY(70px) scale(0.68) rotate(-4deg);
    filter: saturate(1.2);
  }
  62% {
    opacity: 1;
    transform: translateY(-8px) scale(1.08) rotate(1.4deg);
  }
  82% {
    transform: translateY(2px) scale(0.985) rotate(-0.7deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
    filter: saturate(1);
  }
}

@keyframes gift-pack-content-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gift-pack-flash {
  0% {
    opacity: 0;
    transform: scale(0.25);
  }
  45% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

.gift-pack-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4d6e2f;
  background: rgba(173, 218, 120, 0.35);
  border: 1px solid rgba(122, 166, 70, 0.6);
  border-radius: 999px;
  padding: 4px 10px;
}

.gift-pack-message {
  max-width: 48ch;
  font-size: clamp(1.12rem, 2.1vw, 1.52rem);
  color: #39512a;
  line-height: 1.38;
  font-weight: 850;
}

@media (prefers-reduced-motion: reduce) {
  .gift-pack-card.is-entrance,
  .gift-pack-card.is-entrance > * {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .gift-pack-card.is-entrance::after {
    animation: none;
    opacity: 0;
  }
}

.export-pack-card h3 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.export-actions {
  width: 100%;
  display: grid;
  gap: 10px;
}

.export-primary-btn {
  min-height: 62px;
  border-radius: 999px;
  border: 1px solid #4f9842;
  background: linear-gradient(180deg, #7fcd61, #4e9f3f);
  color: #f2ffe9;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  letter-spacing: 0.2px;
  font-weight: 800;
  box-shadow:
    0 14px 22px rgba(22, 70, 22, 0.48),
    inset 0 1px 0 rgba(228, 255, 215, 0.42),
    inset 0 -4px 0 rgba(40, 84, 35, 0.5);
}

.export-primary-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #8dd86f, #58ac45);
  border-color: #66b155;
}

.export-secondary-btn {
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid #3e5f92;
  background: linear-gradient(180deg, #263c63, #1a2c4a);
  font-size: 1.15rem;
}

.export-tertiary-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.export-tertiary-actions .ghost-btn {
  min-width: 170px;
}

.export-bottom-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.export-bottom-row .ghost-btn {
  min-width: 160px;
}

.advanced-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
  margin: 10px 0 8px;
}

.advanced-actions .ghost-btn {
  min-width: 190px;
}

.closeness-panel {
  border: 1px solid #d2d8e2;
  border-radius: 10px;
  background: linear-gradient(180deg, #f5f7fb, #ebeff6);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  padding: 16px;
  text-align: left;
  align-items: stretch;
}

.closeness-total {
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.closeness-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #60708a;
  text-transform: uppercase;
}

.closeness-total h3 {
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  color: #435066;
}

.closeness-total-ring {
  width: clamp(142px, 19vw, 186px);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    conic-gradient(#4a7cb7 calc(var(--total-pct, 0) * 1%), #dbe3ef 0),
    radial-gradient(circle, #f8fbff 56%, transparent 57%);
  border: 1px solid #aebdd5;
  box-shadow:
    0 12px 28px rgba(86, 110, 146, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.closeness-total-ring span {
  font-size: clamp(1.28rem, 2.6vw, 1.78rem);
  font-weight: 800;
  color: #445168;
}

.closeness-chart {
  display: grid;
  gap: 10px;
  align-content: start;
}

.closeness-results-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.closeness-chart.is-scrollable {
  --closeness-visible-rows: 10;
  --closeness-row-size: 56px;
  max-height: min(
    70vh,
    calc(
      (var(--closeness-visible-rows) * var(--closeness-row-size)) +
      ((var(--closeness-visible-rows) - 1) * 10px)
    )
  );
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.closeness-row {
  border: 1px solid #d4dbe8;
  border-radius: 8px;
  background: #f8faff;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  opacity: 1;
  transform: translateY(0);
}

.closeness-row-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.closeness-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.closeness-row-head strong {
  color: #4a5a74;
}

.closeness-row-play-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.indicator-play-btn {
  border-radius: 8px;
  border: 1px solid #5f7492;
  background: linear-gradient(180deg, #f2f6fc, #dfe8f5);
  color: #395275;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 2px 4px rgba(31, 51, 81, 0.18);
  display: grid;
  place-items: center;
}

.indicator-play-btn:hover:not(:disabled) {
  border-color: #4d6890;
  background: linear-gradient(180deg, #f8fbff, #e7eef8);
}

.indicator-play-btn:disabled {
  opacity: 0.55;
}

.indicator-play-glyph {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  transform: translateX(1px);
}

.indicator-play-btn.is-playing .indicator-play-glyph {
  width: 11px;
  height: 13px;
  border: 0;
  transform: none;
  background:
    linear-gradient(currentColor, currentColor) left center / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 4px 100% no-repeat;
}

.closeness-bar-track {
  height: 8px;
  border-radius: 999px;
  border: 1px solid #d1d8e5;
  background: #eef3fa;
  overflow: hidden;
}

.closeness-bar-fill {
  height: 100%;
  display: block;
  width: calc(var(--bar-pct, 0) * 1%);
  background: linear-gradient(90deg, #6aa1df, #4a77af);
  transform-origin: left;
  transform: scaleX(0);
  animation: closeness-bar-grow 700ms cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: var(--bar-delay, 0ms);
}

.closeness-row.is-unscored .closeness-bar-fill {
  background: linear-gradient(90deg, #b7c1d2, #9da8bb);
}

.closeness-panel.is-loading .closeness-bar-fill {
  animation: none;
  transform: scaleX(1);
}

.closeness-panel.is-entrance .closeness-total-ring {
  animation: closeness-ring-pop 760ms cubic-bezier(0.19, 1, 0.22, 1);
  animation-delay: var(--ring-delay, 0ms);
  animation-fill-mode: both;
}

.closeness-panel.is-entrance .closeness-total-ring span {
  animation: rise-in 540ms ease-out;
  animation-delay: var(--ring-delay, 0ms);
  animation-fill-mode: both;
}

.closeness-panel.is-entrance .closeness-row {
  opacity: 0;
  transform: translateY(8px);
  animation: closeness-row-reveal 360ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--row-delay, 0ms);
}

.closeness-panel.is-static .closeness-bar-fill {
  animation: none;
  transform: scaleX(1);
}

.closeness-stage-note {
  font-weight: 600;
  color: #5a6780;
}

.closeness-final-score-card {
  border: 1px solid #9bb2d0;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff5ff, #e2ecfa);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 18px rgba(67, 96, 139, 0.18);
}

.closeness-total .closeness-final-score-card {
  width: min(100%, 340px);
  justify-self: center;
  text-align: center;
  animation: rise-in 420ms ease-out both;
}

.closeness-final-score-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #4f6180;
}

.closeness-final-score-value {
  margin: 0;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.05;
}

.closeness-final-score-value strong {
  color: #2d4265;
}

.closeness-final-score-breakdown {
  margin: 0;
  font-size: 0.89rem;
  color: #536584;
}

.closeness-points-row {
  margin: 0;
}

.closeness-points-row.is-pending {
  border: 1px dashed #bcc9dc;
  border-radius: 10px;
  background: #f2f6fc;
  padding: 10px 12px;
  color: #6f7d95;
  font-style: italic;
}

.install-card {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #121f34, #0f1a2b);
  border: 1px solid #324765;
  border-radius: 12px;
  padding: 12px;
}

.install-card h3 {
  font-size: 1rem;
}

.path-line {
  font-size: 0.9rem;
}

.path-line code {
  overflow-wrap: anywhere;
}

.mob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.mob-tile {
  display: grid;
  grid-template-rows: auto auto;
  gap: 10px;
  color: var(--text);
  background: linear-gradient(180deg, #1a273e, #172236);
  border: 1px solid #334968;
  border-radius: 12px;
  padding: 10px;
  transition: border-color 0.18s ease, transform 0.08s ease;
}

.mob-tile-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
  padding: 4px;
  border-radius: 8px;
}

.mob-tile-main:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mob-tile:hover {
  border-color: #6e93c4;
  transform: translateY(-1px);
}

.mob-tile-name {
  font-weight: 700;
}

.mob-tile-status {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status-ready {
  color: #8ef3bc;
}

.status-skipped {
  color: #ffe29d;
}

.status-missing {
  color: #ffb3b3;
}

.mob-play-btn {
  width: 100%;
}

.tiny-btn {
  padding: 6px 10px;
  font-size: 0.84rem;
  min-width: 60px;
}

.advanced-recorder-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.advanced-filter-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.advanced-filter-input {
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.advanced-mob-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
  padding-bottom: 10px;
}

.advanced-mob-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 10px;
  background:
    radial-gradient(circle at 2% 50%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 40%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 40%, transparent),
    0 2px 8px rgba(0, 0, 0, 0.05);
  transition:
    border-color 0.18s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease;
}

.advanced-mob-row:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line-strong));
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 50%, transparent),
    0 6px 14px rgba(0, 0, 0, 0.08);
}

.advanced-mob-main {
  display: grid;
  gap: 4px;
}

.advanced-mob-title {
  font-weight: 700;
  color: var(--text);
}

.advanced-mob-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.advanced-mob-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.advanced-record-btn.is-recording {
  border-color: #79b2ff;
  background: linear-gradient(180deg, #2a4a79, #1a2f4f);
}

.log-box {
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #0d172a;
  border: 1px solid #2d4261;
  border-radius: 10px;
  padding: 10px;
}

.log-details {
  border: 1px solid #304664;
  border-radius: 12px;
  padding: 8px;
  background: #0f1a2d;
}

.install-details {
  border: 1px solid #304664;
  border-radius: 12px;
  padding: 8px;
  background: #0f1a2d;
}

.install-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.install-details[open] summary {
  margin-bottom: 8px;
}

.log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.log-details[open] summary {
  margin-bottom: 8px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes closeness-bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes closeness-row-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes closeness-ring-pop {
  0% {
    opacity: 0.2;
    transform: scale(0.86);
    filter: saturate(1.15);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1);
  }
}

@keyframes analysis-loading-shift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 40px 0, 0 0;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 18px 12px 24px;
  }

  .sheet {
    border-radius: 16px;
    padding: 0 0 12px;
  }

  .sheet::before {
    border-radius: 14px;
  }

  .panel {
    margin: 12px 12px 0;
    padding: 12px;
    gap: 12px;
  }

  .wood-sign {
    padding: 18px 14px 14px;
  }

  .record-head-row {
    flex-direction: column;
    align-items: stretch;
  }

  .record-stage {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mob-card img {
    height: clamp(130px, 38vw, 180px);
  }

  .variant-line {
    font-size: 1.3rem;
  }

  .variant-record-actions {
    flex-wrap: wrap;
  }

  .variant-record-actions .record-pill-btn {
    width: 100%;
  }

  .aux-buttons {
    justify-content: center;
  }

  .ready-badge {
    width: 68px;
    height: 68px;
    font-size: 1.9rem;
  }

  .export-pack-card {
    padding: 14px 12px 12px;
  }

  .closeness-panel {
    grid-template-columns: 1fr;
  }

  .closeness-total {
    justify-items: center;
  }

  .export-tertiary-actions .ghost-btn {
    min-width: 0;
    flex: 1 1 160px;
  }

  .record-buttons {
    gap: 14px;
  }

  .circle-btn span {
    font-size: 0.93rem;
  }

  .pager {
    grid-template-columns: 1fr 1fr;
  }

  .app-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.35rem;
    text-align: center;
  }

  .app-footer-project-links {
    justify-content: center;
  }

  .app-footer-vibe-link {
    justify-self: center;
  }
}

@media (max-width: 480px) {
  .record-pill-btn {
    min-height: 68px;
    font-size: 1.1rem;
    gap: 8px;
  }

  .export-bottom-row {
    flex-direction: column;
  }

  .export-bottom-row .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .advanced-actions .ghost-btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  .mob-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }

  .tiny-btn {
    min-width: 0;
  }

  .advanced-mob-row {
    grid-template-columns: 1fr;
  }

  .advanced-mob-actions {
    justify-content: flex-start;
  }

  .add-mob-actions {
    grid-template-columns: 1fr;
  }
}

/* Mock-inspired UI override */
:root {
  --bg: #efeff2;
  --surface: #f6f6f8;
  --surface-2: #ececf0;
  --line: #d7d9df;
  --line-strong: #c7ccd5;
  --text: #414a58;
  --muted: #69717f;
}

body {
  font-family: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f2f2f5 0%, #ececf0 100%);
}

#app {
  width: min(100%, 1200px);
  padding: 30px 18px 34px;
}

.sheet {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.sheet::before {
  display: none;
}

.titlebar {
  margin-bottom: 18px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.scoreboard-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #d7dbe4;
}

.scoreboard-strip p {
  font-size: 0.98rem;
  color: #4d5869;
}

.score-value {
  position: relative;
}

.score-value-positive {
  animation: score-pulse-positive 420ms ease;
}

.score-value-negative {
  animation: score-pulse-negative 420ms ease;
}

.score-fx-layer {
  position: absolute;
  top: -12px;
  right: 8px;
  display: grid;
  gap: 3px;
  pointer-events: none;
}

.score-fx {
  font-size: 0.88rem;
  font-weight: 800;
  opacity: 0;
  animation: score-fx-rise 900ms ease forwards;
}

.score-fx-positive {
  color: #3a9d58;
}

.score-fx-negative {
  color: #d56060;
}

.score-fx-bonus {
  color: #b58b1f;
  text-shadow: 0 0 8px rgba(214, 177, 70, 0.28);
}

.page-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

h1 {
  font-size: clamp(2.6rem, 5.8vw, 4rem);
  color: #424b5a;
  letter-spacing: 0.1px;
}

.subtitle {
  margin-top: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.85rem);
  color: #4f5664;
}

.theme-toggle-btn {
  position: relative;
  width: 66px;
  height: 38px;
  min-height: 38px;
  min-width: 66px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #c5cad4;
  background: linear-gradient(180deg, #f3f6fb, #e5eaf3);
  color: #4b5565;
  font-weight: 700;
  box-shadow: none;
  display: flex;
  align-items: center;
  overflow: hidden;
  transition:
    background-color 240ms ease,
    border-color 240ms ease;
}

.theme-toggle-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff7de;
  border: 1px solid rgba(204, 159, 58, 0.6);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: translateX(0);
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 240ms ease,
    border-color 240ms ease;
}

.sun-disc,
.moon-disc {
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  transition:
    transform 280ms ease,
    opacity 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.sun-disc {
  background: #f4bf43;
  box-shadow:
    0 0 0 2px rgba(244, 191, 67, 0.26),
    0 0 0 5px rgba(244, 191, 67, 0.12);
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

.moon-disc {
  background: #dbe6ff;
  transform: scale(0.3) rotate(-90deg);
  opacity: 0;
}

.moon-disc::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #294164;
}

.panel.panel-record-mock {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 14px;
}

.challenge-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  transition: gap 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.challenge-layout.has-leaderboard {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
  transition:
    grid-template-columns 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    gap 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.challenge-layout.has-leaderboard.is-leaderboard-hiding {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0fr);
  gap: 0;
}

.challenge-card,
.leaderboard-card {
  background: #f7f7f9;
  border: 1px solid #d8dae1;
  border-radius: 8px;
}

.challenge-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.challenge-card-head {
  border-bottom: 1px solid #d5d8df;
  padding-bottom: 8px;
  text-align: center;
}

.challenge-card h2,
.leaderboard-card h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  color: #434c5a;
}

.challenge-stage {
  background: #e9ebf0;
  border: 1px solid #d8dce4;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.mob-card.single {
  width: 100%;
  display: grid;
  place-items: center;
}

.mob-card img {
  height: clamp(180px, 26vw, 290px);
  filter: drop-shadow(0 12px 8px rgba(0, 0, 0, 0.1));
}

.challenge-callout {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  font-weight: 800;
  color: #46505f;
}

.challenge-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.waveform-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #65748b;
}

.original-wave-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.recorded-wave-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.waveform-action-btn {
  width: clamp(290px, 34vw, 340px);
  min-width: clamp(290px, 34vw, 340px);
  max-width: clamp(290px, 34vw, 340px);
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: clamp(0.84rem, 1.2vw, 0.96rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recorded-wave-action-wrap {
  width: clamp(290px, 34vw, 340px);
  min-width: clamp(290px, 34vw, 340px);
  max-width: clamp(290px, 34vw, 340px);
}

.recorded-wave-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.recorded-wave-controls.has-preview {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.recorded-wave-controls .waveform-action-btn {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.original-wave-play-btn {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #4c7f18;
  background: linear-gradient(180deg, #74ad32 0%, #5b9222 100%);
  color: #eff4fa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 2px 4px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
}

.recorded-wave-play-btn {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #285582;
  background: linear-gradient(180deg, #4276a9 0%, #326595 100%);
  color: #eff4fa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 2px 4px rgba(0, 0, 0, 0.15);
  display: grid;
  place-items: center;
}

.original-wave-play-btn:hover:not(:disabled),
.recorded-wave-play-btn:hover:not(:disabled) {
  border-color: #1f4a73;
  background: linear-gradient(180deg, #4d82b5 0%, #3a6ea1 100%);
}

.original-wave-play-btn:hover:not(:disabled) {
  border-color: #3f6914;
  background: linear-gradient(180deg, #80b93c 0%, #649f29 100%);
}

.original-wave-play-glyph {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
  transform: translateX(2px);
}

.recorded-wave-play-glyph {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
  transform: translateX(2px);
}

.original-wave-play-btn.is-playing .original-wave-play-glyph {
  width: 12px;
  height: 14px;
  border: 0;
  transform: none;
  background:
    linear-gradient(currentColor, currentColor) left center / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 4px 100% no-repeat;
}

.recorded-wave-play-btn.is-playing .recorded-wave-play-glyph {
  width: 12px;
  height: 14px;
  border: 0;
  transform: none;
  background:
    linear-gradient(currentColor, currentColor) left center / 4px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right center / 4px 100% no-repeat;
}

.original-sound-wave {
  --hint-progress: 0;
  position: relative;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid #d0d5df;
  background: #eff2f7;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 6px 8px;
}

.recorded-sound-wave {
  --preview-progress: 0;
  position: relative;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid #d0d5df;
  background: #eff2f7;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 6px 8px;
}

.original-sound-wave::before {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--hint-progress, 0) * 1%);
  background: linear-gradient(90deg, rgba(121, 170, 236, 0.28), rgba(143, 188, 246, 0.16));
  pointer-events: none;
}

.recorded-sound-wave::before {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--preview-progress, 0) * 1%);
  background: linear-gradient(90deg, rgba(109, 201, 165, 0.25), rgba(102, 190, 152, 0.14));
  pointer-events: none;
}

.original-wave-bars {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  align-items: center;
}

.recorded-wave-bars {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  align-items: center;
}

.original-wave-bar {
  display: block;
  width: 100%;
  min-width: 1px;
  height: var(--bar-h, 30%);
  border-radius: 999px;
  background: #7e96bb;
  align-self: center;
}

.original-wave-empty {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #667489;
  font-size: 0.82rem;
  font-weight: 600;
}

.recorded-wave-empty {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #667489;
  font-size: 0.82rem;
  font-weight: 600;
}

.original-sound-wave.is-loading .original-wave-empty {
  animation: waveform-loading-pulse 1.1s ease-in-out infinite;
}

.recorded-sound-wave.is-loading .recorded-wave-empty {
  animation: waveform-loading-pulse 1.1s ease-in-out infinite;
}

.original-wave-cursor {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: calc(var(--hint-progress, 0) * 1%);
  width: 2px;
  transform: translateX(-1px);
  background: #2d9d70;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(45, 157, 112, 0.16), 0 0 10px rgba(45, 157, 112, 0.28);
  z-index: 2;
  pointer-events: none;
}

.recorded-wave-cursor {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: calc(var(--preview-progress, 0) * 1%);
  width: 2px;
  transform: translateX(-1px);
  background: #4388d2;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(67, 136, 210, 0.16), 0 0 10px rgba(67, 136, 210, 0.28);
  z-index: 2;
  pointer-events: none;
}

@keyframes waveform-loading-pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

.record-chip-wrap {
  position: relative;
  display: grid;
}

.risk-chip {
  position: absolute;
  top: -9px;
  right: 8px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #d6b45e;
  background: linear-gradient(180deg, #fde8ad, #f8d983);
  color: #6f5316;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(210, 170, 66, 0.35);
  transition: opacity 200ms ease, transform 200ms ease;
  cursor: help;
}

.risk-chip.is-fading {
  opacity: 0;
  transform: translateY(-2px);
}

.risk-chip[data-tooltip]::before,
.risk-chip[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.risk-chip[data-tooltip]::before {
  content: attr(data-tooltip);
  right: 0;
  bottom: calc(100% + 14px);
  width: min(280px, 78vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d3d8e4;
  background: #f7f9fd;
  color: #2f3c54;
  font-size: 0.74rem;
  line-height: 1.3;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(27, 36, 54, 0.2);
  z-index: 8;
  text-transform: none;
  letter-spacing: 0;
  transform: translateY(4px);
}

.risk-chip[data-tooltip]::after {
  content: "";
  right: 14px;
  bottom: calc(100% + 9px);
  width: 9px;
  height: 9px;
  background: #f7f9fd;
  border-right: 1px solid #d3d8e4;
  border-bottom: 1px solid #d3d8e4;
  transform: translateY(4px) rotate(45deg);
  z-index: 9;
}

.risk-chip[data-tooltip]:hover::before,
.risk-chip[data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.risk-chip[data-tooltip]:hover::after,
.risk-chip[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) rotate(45deg);
}

@keyframes score-pulse-positive {
  0% {
    text-shadow: 0 0 0 rgba(67, 187, 106, 0);
  }
  50% {
    text-shadow: 0 0 10px rgba(67, 187, 106, 0.5);
  }
  100% {
    text-shadow: 0 0 0 rgba(67, 187, 106, 0);
  }
}

@keyframes score-pulse-negative {
  0% {
    text-shadow: 0 0 0 rgba(214, 91, 91, 0);
  }
  50% {
    text-shadow: 0 0 10px rgba(214, 91, 91, 0.5);
  }
  100% {
    text-shadow: 0 0 0 rgba(214, 91, 91, 0);
  }
}

@keyframes score-fx-rise {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10px);
    opacity: 0;
  }
}

.mock-btn {
  min-height: 58px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: #eff4fa;
  font-size: clamp(1.05rem, 1.9vw, 1.65rem);
  letter-spacing: 0.1px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mock-btn-green {
  background: linear-gradient(180deg, #74ad32 0%, #5b9222 100%);
  border-color: #4c7f18;
}

.mock-btn-blue {
  background: linear-gradient(180deg, #4276a9 0%, #326595 100%);
  border-color: #285582;
}

.mock-btn-blue.recording {
  background: linear-gradient(180deg, #5484b3 0%, #3f6f9f 100%);
}

.challenge-score-row {
  display: grid;
  grid-template-columns: max-content minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #d4d7df;
  padding-top: 10px;
}

.challenge-score-row p {
  font-size: clamp(1rem, 1.8vw, 1.55rem);
}

.challenge-score-row strong {
  font-size: 1.1em;
}

.countdown-ring {
  width: 100%;
  max-width: none;
  height: 10px;
  min-width: 120px;
  border-radius: 999px;
  border: 1px solid #d1d6df;
  background: linear-gradient(90deg, #a2b2c5 calc(var(--ring-pct, 0) * 1%), #ecf0f6 0);
}

.countdown-ring span {
  display: none;
}

.submit-btn {
  min-height: 46px;
  min-width: 112px;
  border-radius: 4px;
  border: 1px solid #b9bec8;
  background: linear-gradient(180deg, #f4f5f8, #e7eaf0);
  color: #49515f;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 700;
  box-shadow: none;
}

.challenge-mini-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-primary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.challenge-primary-controls .submit-btn,
.challenge-primary-controls .ghost-btn {
  border-radius: 4px;
}

.challenge-mini-controls .ghost-btn {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 5px;
  color: #51607a;
  background: #f1f4f8;
  border-color: #c9d0db;
  box-shadow: none;
}

.leaderboard-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  transform-origin: right top;
}

.challenge-layout.has-leaderboard .leaderboard-card {
  opacity: 1;
  transform: translateX(0) scale(1);
  max-height: 1500px;
  transition:
    opacity 280ms ease,
    transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    max-height 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    padding 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.challenge-layout.has-leaderboard.is-leaderboard-hiding .leaderboard-card,
.challenge-layout .leaderboard-card.is-hiding {
  opacity: 0;
  transform: translateX(14px) scale(0.98);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

.leaderboard-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.leaderboard-card li {
  background: #f7f7f9;
  border: 1px solid #d8dae1;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: clamp(0.88rem, 1.2vw, 1rem);
}

.leaderboard-card li span {
  font-weight: 650;
  color: #434c5a;
}

.leaderboard-card li strong {
  font-size: 1.05em;
  color: #434c5a;
}

.leaderboard-btn {
  min-height: 52px;
  border-radius: 4px;
  border: 1px solid #c4c9d3;
  background: linear-gradient(180deg, #eff1f5, #e4e8ef);
  color: #555e6d;
  font-size: clamp(1.02rem, 1.8vw, 1.45rem);
  box-shadow: none;
}

.mob-queue-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mob-queue-list {
  max-height: 460px;
  overflow: auto;
}

.mob-queue-list li {
  background: #eef1f6;
}

.mob-queue-list li.is-current {
  border: 1px solid #9ab0cb;
  background: #e4ebf6;
}

.mob-queue-list li strong {
  font-size: 0.88em;
  color: #55657b;
}

.mob-queue-list li.is-current strong {
  color: #2d5c8f;
}

.panel-export {
  background: linear-gradient(180deg, #f7f9fd, #eef2f8);
  border: 1px solid #d2d9e5;
  border-radius: 8px;
}

.export-summary {
  color: #57657d;
}

.export-pack-card {
  border-color: #cbd5e4;
  background: linear-gradient(180deg, #f6f9ff, #edf2fa);
  box-shadow: none;
}

.export-pack-card h3 {
  color: #435066;
}

.export-secondary-btn {
  border-color: #b8c6dc;
  background: linear-gradient(180deg, #eef2f8, #e4eaf3);
  color: #4a586f;
}

.similarity-loading-card,
.gift-pack-card {
  border-color: #d2dae8;
}

.gift-pack-card {
  border-color: #91ba61;
  background:
    radial-gradient(circle at 8% 0%, rgba(161, 213, 109, 0.2), transparent 42%),
    linear-gradient(180deg, #f8ffed, #eef8df);
}

.similarity-loading-title,
.gift-pack-message {
  color: #475773;
}

.gift-pack-kicker {
  color: #4f6f31;
  background: rgba(168, 212, 118, 0.34);
  border-color: rgba(123, 166, 74, 0.55);
}

.gift-pack-message {
  color: #3d572d;
}

.similarity-loading-track {
  border-color: #c9d2e1;
  background: #edf2f9;
}

.challenge-primary-controls .ghost-btn,
.export-tertiary-actions .ghost-btn,
.export-bottom-row .ghost-btn,
.stack .ghost-btn {
  background: linear-gradient(180deg, #f1f4f9, #e7ecf4);
  border-color: #c8d0dd;
  color: #4d5d75;
  box-shadow: none;
}

.add-mob-form,
.mob-checklist,
.log-box,
.log-details,
.install-details,
.install-card {
  border-color: #c8d2e0;
  background: #eef2f8;
}

.add-mob-form input {
  border-color: #c8d2e0;
  background: #ffffff;
  color: #3f4c61;
}

.mob-check-item:hover {
  background: rgba(67, 89, 122, 0.08);
}

:root[data-theme="dark"] body {
  color: #dcdfe6;
  background: linear-gradient(180deg, #17181c 0%, #1d1f24 100%);
}

:root[data-theme="dark"] h1 {
  color: #eceff5;
}

:root[data-theme="dark"] .subtitle {
  color: #b4bac6;
}

:root[data-theme="dark"] .scoreboard-strip {
  background: transparent;
  border-color: #3d4350;
}

:root[data-theme="dark"] .scoreboard-strip p {
  color: #d0d6e1;
}

:root[data-theme="dark"] .score-fx-bonus {
  color: #ebcb73;
}

:root[data-theme="dark"] .theme-toggle-btn {
  border-color: #505661;
  background: linear-gradient(180deg, #383c44, #2e3239);
  color: #f0f2f7;
}

:root[data-theme="dark"] .how-to-help-btn {
  border-color: #505661;
  background: linear-gradient(180deg, #383c44, #2e3239);
  color: #f0f2f7;
}

:root[data-theme="dark"] .theme-toggle-icon {
  transform: translateX(28px);
  background: #20242b;
  border-color: rgba(141, 149, 163, 0.72);
}

:root[data-theme="dark"] .sun-disc {
  transform: scale(0.3) rotate(90deg);
  opacity: 0;
}

:root[data-theme="dark"] .moon-disc {
  transform: scale(1) rotate(0deg);
  opacity: 1;
}

:root[data-theme="dark"] .challenge-card,
:root[data-theme="dark"] .leaderboard-card {
  background: #262930;
  border-color: #3d424d;
}

:root[data-theme="dark"] .leaderboard-card li {
  background: #262930;
  border-color: #3d424d;
}

:root[data-theme="dark"] .leaderboard-card li span {
  color: #eaedf4;
}

:root[data-theme="dark"] .leaderboard-card li strong {
  color: #eaedf4;
}

:root[data-theme="dark"] .how-to-overlay {
  background:
    radial-gradient(circle at 50% 12%, rgba(84, 140, 220, 0.24), transparent 56%),
    rgba(0, 0, 0, 0.78);
}

:root[data-theme="dark"] .how-to-card {
  border-color: #4a5f7e;
  background:
    radial-gradient(circle at 85% 8%, rgba(99, 148, 221, 0.2), transparent 45%),
    linear-gradient(170deg, #27303b, #1f252f);
  color: #ecf1f8;
}

:root[data-theme="dark"] .how-to-list {
  color: #d6dde9;
}

:root[data-theme="dark"] .how-to-card h2 {
  color: #f2f7ff;
}

:root[data-theme="dark"] .how-to-kicker {
  border-color: #4f6890;
  background: linear-gradient(180deg, #304157, #27364a);
  color: #d9e8ff;
}

:root[data-theme="dark"] .how-to-intro {
  color: #c1cbda;
}

:root[data-theme="dark"] .how-to-list li {
  border-color: #4b5f7c;
  background: linear-gradient(180deg, #2a3545, #222c3b);
  color: #d8e0ee;
}

:root[data-theme="dark"] .how-to-list li::before {
  border-color: #6184b4;
  background: linear-gradient(180deg, #385987, #2a466f);
  color: #e4efff;
}

:root[data-theme="dark"] .how-to-list strong {
  color: #eef5ff;
}

:root[data-theme="dark"] .how-to-score-band {
  border-color: #516786;
  background: linear-gradient(180deg, #313f53, #273347);
  color: #d2def0;
}

:root[data-theme="dark"] .how-to-score-list li {
  border-color: #4d607b;
  background: linear-gradient(180deg, #2b3645, #222d3b);
  color: #cfd8e7;
}

:root[data-theme="dark"] .how-to-score-list span {
  color: #ebf3ff;
}

:root[data-theme="dark"] .how-to-footer-note {
  color: #bdc9da;
}

:root[data-theme="dark"] .how-to-close-btn {
  border-color: #607594;
  background: linear-gradient(180deg, #36465e, #2a3749);
  color: #e4edfb;
}

:root[data-theme="dark"] .how-to-card .submit-btn {
  border-color: #70a2d8;
  background: linear-gradient(180deg, #4d81cb, #315f9f);
  color: #f3f8ff;
}

:root[data-theme="dark"] .challenge-card-head {
  border-bottom-color: #444955;
}

:root[data-theme="dark"] .challenge-card h2,
:root[data-theme="dark"] .leaderboard-card h2 {
  color: #eaedf4;
}

:root[data-theme="dark"] .challenge-stage {
  background: #1f2229;
  border-color: #454a55;
}

:root[data-theme="dark"] .challenge-callout {
  color: #e5e9f1;
}

:root[data-theme="dark"] .original-wave-play-btn {
  background: linear-gradient(180deg, #74ad32 0%, #5b9222 100%);
  border-color: #4c7f18;
  color: #eff4fa;
}

:root[data-theme="dark"] .recorded-wave-play-btn {
  background: linear-gradient(180deg, #4276a9 0%, #326595 100%);
  border-color: #285582;
  color: #eff4fa;
}

:root[data-theme="dark"] .original-sound-wave {
  border-color: #464b57;
  background: #1f232b;
}

:root[data-theme="dark"] .recorded-sound-wave {
  border-color: #464b57;
  background: #1f232b;
}

:root[data-theme="dark"] .original-sound-wave::before {
  background: linear-gradient(90deg, rgba(82, 128, 202, 0.34), rgba(93, 148, 218, 0.2));
}

:root[data-theme="dark"] .recorded-sound-wave::before {
  background: linear-gradient(90deg, rgba(78, 180, 140, 0.32), rgba(96, 196, 156, 0.2));
}

:root[data-theme="dark"] .original-wave-bar {
  background: #9db1d1;
}

:root[data-theme="dark"] .original-wave-empty {
  color: #bdc7d8;
}

:root[data-theme="dark"] .recorded-wave-empty {
  color: #bdc7d8;
}

:root[data-theme="dark"] .waveform-label {
  color: #aab6c9;
}

:root[data-theme="dark"] .original-wave-cursor {
  background: #4fd69b;
  box-shadow: 0 0 0 1px rgba(79, 214, 155, 0.18), 0 0 10px rgba(79, 214, 155, 0.32);
}

:root[data-theme="dark"] .recorded-wave-cursor {
  background: #76b5ff;
  box-shadow: 0 0 0 1px rgba(118, 181, 255, 0.2), 0 0 10px rgba(118, 181, 255, 0.35);
}

:root[data-theme="dark"] .submit-btn {
  border-color: #575d69;
  background: linear-gradient(180deg, #3e434d, #343941);
  color: #eceff6;
}

:root[data-theme="dark"] .challenge-mini-controls .ghost-btn,
:root[data-theme="dark"] .ghost-btn {
  background: linear-gradient(180deg, #3a3f49, #31363e);
  border-color: #585f6b;
  color: #dde1ea;
}

:root[data-theme="dark"] .risk-chip {
  border-color: #9d7b2c;
  background: linear-gradient(180deg, #6c5525, #4e3f20);
  color: #f2da98;
  box-shadow: 0 0 10px rgba(158, 123, 44, 0.32);
}

:root[data-theme="dark"] .risk-chip[data-tooltip]::before {
  border-color: #4f5a71;
  background: #212833;
  color: #e3ebfa;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .risk-chip[data-tooltip]::after {
  background: #212833;
  border-right-color: #4f5a71;
  border-bottom-color: #4f5a71;
}

:root[data-theme="dark"] .panel-export {
  border-color: #464c56;
  background:
    radial-gradient(circle at 50% 0%, rgba(148, 154, 166, 0.14), transparent 44%),
    linear-gradient(180deg, #2a2f37, #22262d);
}

:root[data-theme="dark"] .export-summary {
  color: #c6cfdf;
}

:root[data-theme="dark"] .export-pack-card {
  border-color: rgba(73, 103, 151, 0.72);
  background:
    linear-gradient(180deg, rgba(35, 53, 87, 0.48), rgba(14, 24, 43, 0.88)),
    radial-gradient(circle at 50% -40%, rgba(95, 131, 203, 0.24), transparent 58%);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .export-pack-card h3 {
  color: #eaf0fb;
}

:root[data-theme="dark"] .export-secondary-btn {
  border-color: #4c6688;
  background: linear-gradient(180deg, #324a68, #243955);
  color: #e3ebf8;
}

:root[data-theme="dark"] .closeness-panel {
  border-color: #404652;
  background: linear-gradient(180deg, #252930, #1f2228);
}

:root[data-theme="dark"] .similarity-loading-card,
:root[data-theme="dark"] .gift-pack-card {
  border-color: #72925d;
  background:
    radial-gradient(circle at 10% 0%, rgba(135, 179, 95, 0.18), transparent 46%),
    linear-gradient(180deg, #293223, #232d1e);
}

:root[data-theme="dark"] .similarity-loading-title,
:root[data-theme="dark"] .gift-pack-message {
  color: #d1d8e5;
}

:root[data-theme="dark"] .similarity-calc-list li {
  border-color: #46515f;
  background: linear-gradient(180deg, #2a2f3a, #252a34);
  color: #b8c3d8;
}

:root[data-theme="dark"] .similarity-calc-list li strong {
  color: #dce9ff;
}

:root[data-theme="dark"] .gift-pack-kicker {
  color: #d7f1b8;
  background: rgba(116, 149, 76, 0.32);
  border-color: rgba(167, 202, 124, 0.52);
}

:root[data-theme="dark"] .gift-pack-message {
  color: #e2f1d2;
}

:root[data-theme="dark"] .advanced-mob-row {
  border-color: #50545d;
  background: linear-gradient(180deg, #2b2d33, #25272d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .advanced-mob-row:hover {
  border-color: #686d77;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .similarity-loading-track {
  border-color: #464f5d;
  background: #1f242d;
}

:root[data-theme="dark"] .closeness-kicker,
:root[data-theme="dark"] .closeness-total h3,
:root[data-theme="dark"] .closeness-total-ring span,
:root[data-theme="dark"] .closeness-final-score-label,
:root[data-theme="dark"] .closeness-final-score-breakdown,
:root[data-theme="dark"] .closeness-row-head strong {
  color: #d8dde8;
}

:root[data-theme="dark"] .closeness-stage-note,
:root[data-theme="dark"] .closeness-points-row.is-pending {
  color: #b8c4d7;
}

:root[data-theme="dark"] .closeness-final-score-card {
  border-color: #4d5f79;
  background: linear-gradient(180deg, #2a3342, #222a37);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .closeness-final-score-value strong {
  color: #f3f6fe;
}

:root[data-theme="dark"] .closeness-points-row.is-pending {
  border-color: #4f5b6f;
  background: #232a35;
}

:root[data-theme="dark"] .closeness-total-ring {
  background:
    conic-gradient(#53d6ff calc(var(--total-pct, 0) * 1%), #2d3440 0),
    radial-gradient(circle, #1c2129 58%, transparent 59%);
  border-color: #4f6f8f;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.46),
    0 0 30px rgba(83, 214, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .closeness-row {
  border-color: #434a56;
  background: #2a2e36;
}

:root[data-theme="dark"] .indicator-play-btn {
  border-color: #5d6879;
  background: linear-gradient(180deg, #444d5d, #363d4b);
  color: #dbe7fb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 4px 10px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .closeness-bar-track {
  border-color: #444b57;
  background: #1c2027;
}

:root[data-theme="dark"] .log-box,
:root[data-theme="dark"] .log-details,
:root[data-theme="dark"] .install-details,
:root[data-theme="dark"] .install-card,
:root[data-theme="dark"] .add-mob-form,
:root[data-theme="dark"] .mob-checklist {
  background: #1f232b;
  border-color: #434955;
}

:root[data-theme="dark"] .add-mob-form input {
  background: #171b22;
  border-color: #495263;
  color: #dde3ef;
}

:root[data-theme="dark"] .mob-check-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  .challenge-layout,
  .challenge-layout.has-leaderboard {
    grid-template-columns: 1fr;
  }

  .challenge-layout.has-leaderboard.is-leaderboard-hiding {
    gap: 0;
  }

  .challenge-layout.has-leaderboard.is-leaderboard-hiding .leaderboard-card,
  .challenge-layout .leaderboard-card.is-hiding {
    transform: translateY(-8px) scale(0.99);
  }
}

@media (max-width: 760px) {
  .challenge-actions {
    grid-template-columns: 1fr;
  }

  .original-wave-row {
    grid-template-columns: 1fr;
  }

  .waveform-action-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .recorded-wave-action-wrap {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .recorded-wave-controls.has-preview {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recorded-wave-row {
    grid-template-columns: 1fr;
  }

  .recorded-wave-play-btn {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    height: 58px;
    min-height: 58px;
    max-height: 58px;
  }

  .challenge-score-row {
    grid-template-columns: 1fr;
  }

  .top-right-tools {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .theme-toggle-btn {
    width: 60px;
    height: 34px;
    min-height: 34px;
    min-width: 60px;
    padding: 2px;
  }

  .how-to-help-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 0.98rem;
  }

  .how-to-card {
    gap: 10px;
    padding: 20px 16px 16px;
    border-radius: 15px;
  }

  .how-to-card h2 {
    padding-right: 36px;
  }

  .how-to-list li {
    padding: 9px 10px 9px 42px;
    font-size: 0.92rem;
  }

  .how-to-list li::before {
    left: 10px;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    line-height: 22px;
  }

  .how-to-score-list {
    grid-template-columns: 1fr;
  }

  .how-to-card .submit-btn {
    min-height: 48px;
  }

  .theme-toggle-icon {
    width: 28px;
    height: 28px;
  }

  :root[data-theme="dark"] .theme-toggle-icon {
    transform: translateX(24px);
  }

}

@keyframes how-to-card-entrance {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes how-to-genie-shrink {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0.15;
    transform: translate3d(var(--genie-tx, 0px), var(--genie-ty, 0px), 0) scale(var(--genie-scale, 0.08));
    filter: blur(1px);
  }
}

@keyframes how-to-overlay-fade {
  0% {
    background: rgba(4, 8, 18, 0.72);
    backdrop-filter: blur(3px);
    opacity: 1;
  }
  100% {
    background: rgba(4, 8, 18, 0);
    backdrop-filter: blur(0);
    opacity: 0;
  }
}

/* Advanced page theme refresh */
@keyframes advanced-reveal-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.advanced-page {
  --adv-surface: #eceff4;
  --adv-surface-strong: #f5f7fb;
  --adv-line: #c8ced8;
  --adv-line-strong: #b5becb;
  --adv-text: #3f4958;
  --adv-muted: #667182;
  --adv-panel-bg: #e7ebf2;
  --adv-score-bg: #e5e9f0;
  --adv-btn-border: #b8c0cd;
  --adv-btn-bg: #e8ecf3;
  --adv-btn-text: #4e5c72;
  --adv-input-border: #bac3d1;
  --adv-input-bg: #ffffff;
  --adv-input-text: #3f4b5f;
  --adv-row-border: #c0c8d6;
  --adv-row-bg: #eef2f8;
  --adv-row-hover-border: #aeb7c6;
  --adv-recording-border: #9099a8;
  --adv-recording-bg: #dfe4ec;
  --adv-log-border: #c3cad8;
  --adv-log-bg: #eef2f8;
  color: var(--adv-text);
  background: #ececf0;
}

:root[data-theme="dark"] body.advanced-page {
  --adv-surface: #262930;
  --adv-surface-strong: #2a2e36;
  --adv-line: #464b55;
  --adv-line-strong: #555b66;
  --adv-text: #eceff5;
  --adv-muted: #babfca;
  --adv-panel-bg: #262930;
  --adv-score-bg: #272c35;
  --adv-btn-border: #585f6b;
  --adv-btn-bg: #3a3f49;
  --adv-btn-text: #dde1ea;
  --adv-input-border: #495263;
  --adv-input-bg: #171b22;
  --adv-input-text: #dde3ef;
  --adv-row-border: #50545d;
  --adv-row-bg: #2a2c31;
  --adv-row-hover-border: #686d77;
  --adv-recording-border: #7f8692;
  --adv-recording-bg: #4a505b;
  --adv-log-border: #434955;
  --adv-log-bg: #1f232b;
  background: #1d1f24;
}

body.advanced-page .titlebar {
  margin-bottom: 20px;
  gap: 12px;
}

body.advanced-page .page-hero h1 {
  color: var(--adv-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
}

body.advanced-page .subtitle {
  color: var(--adv-muted);
  font-size: clamp(1.04rem, 2.3vw, 1.7rem);
}

body.advanced-page .scoreboard-strip {
  border-radius: 14px;
  border: 1px solid var(--adv-line);
  background: transparent;
}

body.advanced-page .scoreboard-strip p {
  color: var(--adv-muted);
}

body.advanced-page .scoreboard-strip strong {
  color: var(--adv-text);
}

body.advanced-page .panel-export {
  border: 1px solid var(--adv-line-strong);
  border-radius: 18px;
  padding: 18px;
  background: var(--adv-panel-bg);
  box-shadow:
    0 20px 36px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: advanced-reveal-up 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.advanced-page .export-tertiary-actions {
  width: min(100%, 980px);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  display: grid;
  gap: 10px;
}

body.advanced-page .export-tertiary-actions .ghost-btn,
body.advanced-page .export-tertiary-actions .export-primary-btn {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border-radius: 14px;
  font-size: 1rem;
}

body.advanced-page .export-primary-btn {
  border-color: var(--adv-btn-border);
  background: var(--adv-btn-bg);
  color: var(--adv-btn-text);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.advanced-page .ghost-btn {
  border-color: var(--adv-btn-border);
  color: var(--adv-btn-text);
  background: var(--adv-btn-bg);
}

body.advanced-page .advanced-recorder-panel,
body.advanced-page .advanced-panel {
  border-radius: 16px;
  border-color: var(--adv-line-strong);
  background: var(--adv-log-bg);
  padding: 12px;
}

body.advanced-page .advanced-filter-label {
  color: var(--adv-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

body.advanced-page .advanced-filter-input {
  max-width: 420px;
  min-height: 44px;
  border-radius: 12px;
  border-color: var(--adv-input-border);
  background: var(--adv-input-bg);
  color: var(--adv-input-text);
}

body.advanced-page .advanced-filter-input::placeholder {
  color: color-mix(in srgb, var(--adv-muted) 84%, white 16%);
}

body.advanced-page .advanced-mob-list {
  max-height: 560px;
  padding-right: 6px;
  padding-bottom: 14px;
  gap: 10px;
}

body.advanced-page .advanced-mob-row {
  border-radius: 14px;
  border: 1px solid var(--adv-row-border);
  padding: 11px 12px;
  background: var(--adv-row-bg);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: advanced-reveal-up 300ms ease both;
}

body.advanced-page .advanced-mob-row:nth-child(even) {
  animation-delay: 40ms;
}

body.advanced-page .advanced-mob-row:hover {
  border-color: var(--adv-row-hover-border);
  box-shadow:
    0 12px 20px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.advanced-page .advanced-mob-title {
  color: var(--adv-text);
  font-size: 1.05rem;
}

body.advanced-page .advanced-mob-sub {
  color: var(--adv-muted);
  font-size: 0.84rem;
}

body.advanced-page .advanced-mob-actions .tiny-btn {
  min-height: 34px;
  border-radius: 999px;
  border-color: var(--adv-btn-border);
  color: var(--adv-btn-text);
  background: var(--adv-btn-bg);
}

body.advanced-page .advanced-record-btn.is-recording {
  border-color: var(--adv-recording-border);
  background: var(--adv-recording-bg);
  color: var(--adv-btn-text);
}

body.advanced-page .advanced-panel summary,
body.advanced-page .advanced-recorder-panel .note,
body.advanced-page .log-box {
  color: var(--adv-muted);
}

body.advanced-page .log-box {
  border-color: var(--adv-log-border);
  background: var(--adv-log-bg);
}

/* Extend how-to modal palette to the full site */
:root[data-theme="light"] {
  --howto-theme-page-bg:
    radial-gradient(circle at 50% -22%, rgba(150, 208, 255, 0.42), transparent 52%),
    radial-gradient(circle at 8% 12%, rgba(117, 169, 235, 0.18), transparent 42%),
    linear-gradient(180deg, #f4f8ff 0%, #e8f0fb 100%);
  --howto-theme-surface-bg:
    radial-gradient(circle at 88% 6%, rgba(150, 208, 255, 0.28), transparent 42%),
    linear-gradient(170deg, #ffffff, #edf3fb);
  --howto-theme-surface-border: #9db6d8;
  --howto-theme-surface-shadow:
    0 16px 34px rgba(31, 52, 81, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --howto-theme-subtle-bg: linear-gradient(180deg, #fafdff, #edf4ff);
  --howto-theme-subtle-border: #cddbf0;
  --howto-theme-button-bg: linear-gradient(180deg, #ffffff, #eef4fb);
  --howto-theme-button-border: #b7c6da;
  --howto-theme-button-text: #435776;
  --howto-theme-primary-bg: linear-gradient(180deg, #68aafc, #2e67c0);
  --howto-theme-primary-border: #5076a3;
  --howto-theme-primary-text: #f3f8ff;
  --howto-theme-text: #1a2434;
  --howto-theme-muted: #40516c;
}

:root[data-theme="dark"] {
  --howto-theme-page-bg:
    radial-gradient(circle at 50% -18%, rgba(98, 147, 221, 0.24), transparent 56%),
    radial-gradient(circle at 6% 10%, rgba(70, 113, 176, 0.18), transparent 42%),
    linear-gradient(180deg, #121a27 0%, #0c1420 100%);
  --howto-theme-surface-bg:
    radial-gradient(circle at 85% 8%, rgba(99, 148, 221, 0.2), transparent 45%),
    linear-gradient(170deg, #27303b, #1f252f);
  --howto-theme-surface-border: #4a5f7e;
  --howto-theme-surface-shadow:
    0 22px 42px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --howto-theme-subtle-bg: linear-gradient(180deg, #2b3645, #222d3b);
  --howto-theme-subtle-border: #4d607b;
  --howto-theme-button-bg: linear-gradient(180deg, #36465e, #2a3749);
  --howto-theme-button-border: #607594;
  --howto-theme-button-text: #e4edfb;
  --howto-theme-primary-bg: linear-gradient(180deg, #4d81cb, #315f9f);
  --howto-theme-primary-border: #70a2d8;
  --howto-theme-primary-text: #f3f8ff;
  --howto-theme-text: #ecf1f8;
  --howto-theme-muted: #c1cbda;
}

:root[data-theme] body,
:root[data-theme] body.advanced-page {
  color: var(--howto-theme-text);
  background: var(--howto-theme-page-bg);
}

:root[data-theme] h1,
:root[data-theme] .challenge-card h2,
:root[data-theme] .leaderboard-card h2,
:root[data-theme] .challenge-callout,
:root[data-theme] .scoreboard-strip strong,
:root[data-theme] .leaderboard-card li span,
:root[data-theme] .leaderboard-card li strong,
:root[data-theme] .closeness-total h3,
:root[data-theme] .closeness-total-ring span,
:root[data-theme] .closeness-final-score-value strong,
:root[data-theme] .closeness-row-head strong,
:root[data-theme] body.advanced-page .advanced-mob-title {
  color: var(--howto-theme-text);
}

:root[data-theme] .subtitle,
:root[data-theme] .scoreboard-strip p,
:root[data-theme] .waveform-label,
:root[data-theme] .export-summary,
:root[data-theme] .closeness-kicker,
:root[data-theme] .closeness-final-score-label,
:root[data-theme] .closeness-final-score-breakdown,
:root[data-theme] .closeness-stage-note,
:root[data-theme] .closeness-points-row.is-pending,
:root[data-theme] .advanced-filter-label,
:root[data-theme] .advanced-mob-sub,
:root[data-theme] body.advanced-page .advanced-panel summary,
:root[data-theme] body.advanced-page .advanced-recorder-panel .note,
:root[data-theme] body.advanced-page .log-box {
  color: var(--howto-theme-muted);
}

:root[data-theme] .challenge-card,
:root[data-theme] .leaderboard-card,
:root[data-theme] .panel-export,
:root[data-theme] .export-pack-card,
:root[data-theme] .closeness-panel,
:root[data-theme] .closeness-final-score-card,
:root[data-theme] .similarity-loading-card,
:root[data-theme] body.advanced-page .panel-export {
  border-color: var(--howto-theme-surface-border);
  background: var(--howto-theme-surface-bg);
  box-shadow: var(--howto-theme-surface-shadow);
}

:root[data-theme] .add-mob-form,
:root[data-theme] .mob-checklist,
:root[data-theme] .log-box,
:root[data-theme] .log-details,
:root[data-theme] .install-details,
:root[data-theme] .install-card,
:root[data-theme] body.advanced-page .advanced-recorder-panel,
:root[data-theme] body.advanced-page .advanced-panel {
  border-color: var(--howto-theme-surface-border);
  background: var(--howto-theme-subtle-bg);
}

:root[data-theme] .scoreboard-strip,
:root[data-theme] .challenge-stage,
:root[data-theme] .leaderboard-card li,
:root[data-theme] .similarity-calc-list li,
:root[data-theme] .closeness-points-row.is-pending,
:root[data-theme] .closeness-row,
:root[data-theme] .original-sound-wave,
:root[data-theme] .recorded-sound-wave,
:root[data-theme] .add-mob-form input,
:root[data-theme] body.advanced-page .advanced-filter-input,
:root[data-theme] body.advanced-page .advanced-mob-row {
  border-color: var(--howto-theme-subtle-border);
  background: var(--howto-theme-subtle-bg);
}

:root[data-theme] body.advanced-page .advanced-mob-row:hover {
  border-color: var(--howto-theme-surface-border);
}

:root[data-theme] .theme-toggle-btn,
:root[data-theme] .how-to-help-btn,
:root[data-theme] .challenge-mini-controls .ghost-btn,
:root[data-theme] .ghost-btn,
:root[data-theme] .leaderboard-btn,
:root[data-theme] .export-secondary-btn,
:root[data-theme] body.advanced-page .advanced-mob-actions .tiny-btn {
  border-color: var(--howto-theme-button-border);
  background: var(--howto-theme-button-bg);
  color: var(--howto-theme-button-text);
  box-shadow: none;
}

:root[data-theme] .submit-btn,
:root[data-theme] body.advanced-page .export-primary-btn {
  border-color: var(--howto-theme-primary-border);
  background: var(--howto-theme-primary-bg);
  color: var(--howto-theme-primary-text);
  box-shadow: 0 14px 26px rgba(37, 86, 156, 0.33);
}

:root[data-theme] .submit-btn:hover:not(:disabled),
:root[data-theme] body.advanced-page .export-primary-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

@media (max-width: 760px) {
  body.advanced-page #app {
    padding: 24px 12px 28px;
  }

  body.advanced-page .panel-export {
    border-radius: 14px;
    padding: 12px;
  }

  body.advanced-page .export-tertiary-actions {
    grid-template-columns: 1fr;
  }

  body.advanced-page .advanced-mob-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.advanced-page .advanced-mob-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
