@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;800&display=swap");

:root {
  --ink: #132a33;
  --deep: #0b1f26;
  --mist: #f4fbff;
  --brand: #0f8b8d;
  --accent: #ff7f50;
  --gold: #f4b942;
  --card: rgba(255, 255, 255, 0.85);
  --shadow: 0 20px 45px rgba(9, 37, 51, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 139, 141, 0.14), transparent 30%),
    radial-gradient(circle at 80% 15%, rgba(244, 185, 66, 0.15), transparent 35%),
    linear-gradient(165deg, #e7f6ff, #f3fff5 45%, #fff7ed);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  margin: 0;
}

.ambient {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.22;
  z-index: -1;
  animation: drift 12s ease-in-out infinite alternate;
}

.ambient-left {
  left: -120px;
  top: 80px;
  background: #16b6b8;
}

.ambient-right {
  right: -120px;
  bottom: 30px;
  background: #f7ab3b;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(0.95);
  }
  to {
    transform: translate3d(20px, -20px, 0) scale(1.05);
  }
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 48px 24px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a7a7d;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.12;
}

.hero-subtitle {
  margin: 14px 0 0;
  max-width: 760px;
  color: #30505c;
}

.language-toggle {
  border: 0;
  background: var(--deep);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  height: fit-content;
  box-shadow: var(--shadow);
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head p {
  margin: 6px 0 0;
  color: #376271;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.list-card {
  border: 0;
  text-align: left;
  border-radius: 18px;
  padding: 18px 16px;
  cursor: pointer;
  background: var(--card);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.list-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 52px rgba(9, 37, 51, 0.25);
}

.theme-aurora {
  border-left: 8px solid #20a39e;
}

.theme-velocity {
  border-left: 8px solid #f18f01;
}

.theme-fortress {
  border-left: 8px solid #cf5c36;
}

.theme-legacy {
  border-left: 8px solid #5e60ce;
}

.list-card h3 {
  font-size: 1.3rem;
}

.card-desc {
  margin: 8px 0;
  color: #385f6d;
}

.card-count {
  margin: 0;
  color: #08495e;
  font-size: 0.9rem;
  font-weight: 700;
}

.card-nested {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #2f5a67;
}

.sublist-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #d6edf2;
}

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

.sublist-panel-title {
  margin: 0;
  color: #1d4b5b;
  font-weight: 700;
}

.sublist-back,
.back-list-btn {
  border: 0;
  border-radius: 999px;
  background: #1a5f74;
  color: #fff;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

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

.sublist-btn {
  border: 1px solid #cde5ec;
  border-radius: 12px;
  background: #f5fdff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.sublist-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(9, 37, 51, 0.12);
}

.sublist-btn h4 {
  margin: 0;
  font-family: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1.05rem;
}

.sublist-btn p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: #335e6d;
}

.engine-section {
  margin-top: 30px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.engine-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  position: relative;
}

.engine-top p {
  margin: 8px 0 0;
  color: #376271;
}

.active-list-subtitle {
  margin: 2px 0 0;
}

.engine-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.mode-toggle-wrap {
  display: grid;
  grid-template-columns: minmax(230px, 290px) auto minmax(230px, 290px);
  align-items: center;
  gap: 10px;
}

.mode-info {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #2f5360;
  padding: 8px 10px;
  border-radius: 12px;
  background: #eff8fb;
  border: 1px solid #d6edf2;
}

.mode-info.active {
  color: #0d3340;
  font-weight: 700;
  background: #dff3f9;
  border-color: #b5dbe5;
}

.mobile-mode-label {
  display: none;
  margin: 0;
}

.mode-switch {
  position: relative;
  width: 64px;
  height: 36px;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d2e8ef;
  border: 1px solid #b7d7e1;
  overflow: hidden;
  transition: background 180ms ease;
}

.mode-slider::after {
  content: "⚡";
  position: absolute;
  right: 9px;
  top: 7px;
  font-size: 15px;
  line-height: 1;
  opacity: 0.9;
}

.mode-slider::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(3, 40, 51, 0.2);
  transition: transform 180ms ease;
}

.mode-switch input:checked + .mode-slider {
  background: #b9dde8;
}

.mode-switch input:checked + .mode-slider::before {
  transform: translateX(28px);
}

.mode-switch input:checked + .mode-slider::after {
  content: "🎯";
  right: auto;
  left: 8px;
}

.restart-btn {
  border: 0;
  border-radius: 999px;
  background: #102f3b;
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.engine-top-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-panel {
  margin-top: 16px;
}

.progress-panel p {
  margin: 0 0 8px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #daedf1;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f8b8d, #f4b942);
  transition: width 200ms ease;
}

.final-nine-banner {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fff3cc, #ffe9a8);
  border: 1px solid #f2d37a;
  color: #6a4c00;
  font-weight: 700;
}

.engine-section.final-nine-active .progress-track {
  display: none;
}

.comparison-board {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(237, 252, 255, 0.92));
  border: 1px solid #d6eef2;
  opacity: 1;
  transition: opacity 240ms ease, transform 240ms ease;
  animation: board-enter 220ms ease;
}

.undo-choice-btn {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 24;
  width: 58px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  line-height: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.undo-choice-btn:hover {
  transform: translateY(-1px);
}

.undo-choice-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.undo-choice-icon {
  display: inline-block;
  height: 30px;
  line-height: 30px;
  font-size: 1.12rem;
  font-weight: 900;
  transform: none;
  filter: drop-shadow(0 1px 5px rgba(4, 18, 29, 0.24));
}

.undo-choice-text {
  display: inline-block;
  height: 30px;
  line-height: 30px;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  transform: none;
  text-shadow: 0 1px 6px rgba(4, 18, 29, 0.28);
  letter-spacing: 0.01em;
}

.comparison-board.accuracy-phase {
  background: linear-gradient(155deg, rgba(255, 247, 214, 0.96), rgba(255, 235, 168, 0.92));
  border: 1px solid #f1d17a;
}

.comparison-board.fading-out {
  opacity: 0;
  transform: translateY(8px);
}

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

.compare-prompt {
  margin: 0 0 10px;
  text-align: center;
  font-weight: 700;
}

.matchup {
  position: relative;
  height: 320px;
  border-radius: 12px;
  border: 0;
  overflow: hidden;
  background: linear-gradient(100deg, var(--duel-left) 0%, var(--duel-left) 47%, var(--duel-right) 53%, var(--duel-right) 100%);
}

.comparison-board {
  --duel-left: #9a2f43;
  --duel-right: #1f4f8f;
}

.comparison-board.accuracy-phase {
  --duel-left: #b89335;
  --duel-right: #8b95a4;
}

.choice-card {
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 14px;
  cursor: pointer;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  color: #ffffff;
  text-align: left;
  box-shadow: none;
  transition: transform 140ms ease, filter 140ms ease;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.choice-card:hover {
  transform: scale(1.01);
  filter: brightness(1.06);
}

.choice-card.winner {
  animation: pulse 260ms ease;
}

.choice-card.left-pane {
  left: 0;
  background: transparent;
  justify-content: flex-start;
  padding-top: 56px;
}

.choice-card.right-pane {
  right: 0;
  background: transparent;
  align-items: flex-end;
  text-align: right;
  justify-content: flex-end;
  padding-bottom: 56px;
}

.duel-divider {
  display: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.choice-rank {
  display: none;
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}

.choice-name {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.08;
  max-width: 78%;
}

.choice-meta {
  display: none;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

.versus {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.06em;
  font-size: 3rem;
  text-shadow: none;
  z-index: 3;
}

.corner-mode-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(12, 34, 48, 0.45);
  background: rgba(255, 255, 255, 0.88);
  color: #0f2735;
  font-size: 14px;
  display: none;
  place-items: center;
  font-weight: 800;
}

.duel-mini-track {
  display: none;
}

.duel-mini-progress {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transition: width 180ms ease;
}

.result-section {
  margin-top: 24px;
}

.result-detail {
  min-height: 0;
  border: 0;
}

.result-head p {
  margin: 8px 0 0;
  color: #365864;
}

.ranking-list {
  margin-top: 10px;
  columns: 2;
  gap: 20px;
  padding-left: 0;
  list-style: none;
}

.ranking-list li {
  margin: 4px 0;
}

.top9-card {
  margin-top: 22px;
  background: #fff;
  border: 0;
  border-radius: 18px;
  padding: 14px;
  box-shadow: none;
}

.top9-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.download-btn {
  text-decoration: none;
  background: #0f8b8d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

#top9Canvas {
  display: none;
}

#top9Preview {
  margin-top: 10px;
  width: 100%;
  border-radius: 14px;
  border: 0;
}

@media (min-width: 861px) {
  .result-scroll-hint,
  .result-scroll-arrow {
    display: none;
  }
}

.result-transition-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(0.6px);
  z-index: 15;
  pointer-events: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 24, 33, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #d8edf3;
  box-shadow: 0 20px 45px rgba(8, 28, 39, 0.28);
  padding: 18px;
  animation: board-enter 180ms ease;
}

.modal-card h3 {
  font-size: 1.35rem;
}

.modal-card p {
  margin: 10px 0 0;
  color: #2a4b58;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.modal-btn.secondary {
  background: #e8f2f6;
  color: #143545;
}

.modal-btn.primary {
  background: #0f8b8d;
  color: #fff;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .hero {
    flex-direction: column;
    padding-top: 28px;
  }

  .language-toggle {
    align-self: flex-start;
  }

  .engine-top {
    flex-direction: column;
  }

  .engine-controls {
    align-items: flex-start;
  }

  .engine-top-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .mode-toggle-wrap {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .mode-switch {
    justify-self: center;
  }

  .ranking-list {
    columns: 1;
  }

  body.mobile-layout #selectionSection,
  body.mobile-layout #engineSection {
    min-height: calc(100vh - 130px);
    min-height: calc(100dvh - 130px);
    margin-top: 10px;
  }

  body.mobile-layout #selectionSection.stage-root {
    display: flex;
    flex-direction: column;
  }

  body.mobile-layout.stage-compare #selectionSection,
  body.mobile-layout.stage-result #selectionSection {
    display: none !important;
  }

  body.mobile-layout.stage-compare #engineSection,
  body.mobile-layout.stage-result #engineSection {
    display: flex !important;
  }

  body.mobile-layout .sublist-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  body.mobile-layout .sublist-panel.hidden {
    display: none;
  }

  body.mobile-layout .sublist-panel-head {
    margin-bottom: 8px;
  }

  body.mobile-layout .sublist-grid {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
    padding-bottom: 8px;
  }

  body.mobile-layout #engineSection {
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    min-height: calc(100dvh - 120px);
  }

  body.mobile-layout:not(.stage-compare):not(.stage-result) #engineSection {
    display: none !important;
  }

  body.mobile-layout:not(.stage-compare):not(.stage-result) #comparisonBoard {
    display: none !important;
  }

  body.mobile-layout.stage-compare {
    overflow: hidden;
    background: #ffffff;
  }

  body.mobile-layout.stage-compare .mode-switch,
  body.mobile-layout.stage-compare .back-list-btn,
  body.mobile-layout.stage-compare .restart-btn,
  body.mobile-layout.stage-compare .undo-choice-btn,
  body.mobile-layout.stage-compare #comparisonBoard .choice-card {
    touch-action: manipulation;
  }

  body.mobile-layout.stage-compare .hero,
  body.mobile-layout.stage-compare .ambient {
    display: none;
  }

  body.mobile-layout.stage-compare .layout {
    max-width: none;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.mobile-layout.stage-compare #engineSection {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    background: linear-gradient(102deg, #8f273b 0%, #8f273b 48%, #214f89 52%, #214f89 100%);
    padding: 10px 10px 12px;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    position: relative;
    overflow: hidden;
  }

  body.mobile-layout.stage-compare .engine-top {
    display: block;
    min-height: 90px;
    text-align: center;
    position: relative;
    z-index: 12;
  }

  body.mobile-layout.stage-compare .active-list-head {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 144px), 560px);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    pointer-events: none;
  }

  body.mobile-layout.stage-compare .engine-top > .active-list-head h2 {
    font-size: 1.68rem;
    line-height: 1.05;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(5, 21, 34, 0.35);
    white-space: normal;
    word-break: break-word;
  }

  body.mobile-layout.stage-compare #activeListSubTitle {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
    line-height: 1.1;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(5, 21, 34, 0.32);
    white-space: normal;
    word-break: break-word;
  }

  body.mobile-layout.stage-compare #activeListSubTitle.hidden {
    display: none;
  }

  body.mobile-layout.stage-compare #activeListDescription {
    display: none;
  }

  body.mobile-layout.stage-compare .engine-controls {
    position: static;
    align-items: flex-end;
    gap: 0;
  }

  body.mobile-layout.stage-compare .mode-toggle-wrap {
    position: absolute;
    top: 8px;
    right: 10px;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-width: none;
  }

  body.mobile-layout.stage-compare .mode-info {
    display: none;
  }

  body.mobile-layout.stage-compare .mobile-mode-label {
    display: block;
    order: 2;
    width: 58px;
    font-size: 0.62rem;
    line-height: 1;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(4, 18, 29, 0.4);
  }

  body.mobile-layout.stage-compare .mode-switch {
    order: 1;
    width: 58px;
    height: 30px;
  }

  body.mobile-layout.stage-compare .mode-slider::before {
    width: 24px;
    height: 24px;
    left: 3px;
    top: 2px;
  }

  body.mobile-layout.stage-compare .mode-switch input:checked + .mode-slider::before {
    transform: translateX(28px);
  }

  body.mobile-layout.stage-compare .mode-switch input:checked + .mode-slider::after {
    left: 6px;
    right: auto;
  }

  body.mobile-layout.stage-compare .mode-slider::after {
    top: 5px;
    right: 8px;
    font-size: 14px;
  }

  body.mobile-layout.stage-compare .mode-slider {
    background: #d2e8ef;
    border: 1px solid #b7d7e1;
  }

  body.mobile-layout.stage-compare .progress-panel {
    margin: 0;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(44px + env(safe-area-inset-bottom, 0px));
    z-index: 13;
  }

  body.mobile-layout.stage-compare .progress-panel p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(5, 21, 34, 0.35);
    text-align: left;
  }

  body.mobile-layout.stage-compare .progress-panel .progress-track {
    display: block;
    margin-top: 6px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    border: 0;
  }

  body.mobile-layout.stage-compare #engineSection.final-nine-active .progress-panel .progress-track {
    display: none;
  }

  body.mobile-layout.stage-compare .progress-panel .progress-bar {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(238, 245, 255, 0.95));
  }

  body.mobile-layout.stage-compare .progress-panel .final-nine-banner {
    margin: 6px 0 0;
    padding: 5px 8px;
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: center;
    background: rgba(255, 236, 184, 0.9);
    border: 0;
    color: #5e4300;
  }

  body.mobile-layout.stage-compare .engine-top-buttons {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 14;
    width: auto;
    pointer-events: none;
  }

  body.mobile-layout.stage-compare .back-list-btn,
  body.mobile-layout.stage-compare .restart-btn {
    pointer-events: auto;
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #ffffff;
    text-shadow: 0 1px 8px rgba(5, 21, 34, 0.38);
  }

  body.mobile-layout.stage-compare #comparisonBoard {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: 0;
    height: 100%;
    display: block;
    z-index: 1;
  }

  body.mobile-layout.stage-compare #comparisonBoard .compare-prompt {
    display: none;
  }

  body.mobile-layout.stage-compare #comparisonBoard .matchup {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
    background: linear-gradient(102deg, var(--duel-left) 0%, var(--duel-left) 48%, var(--duel-right) 52%, var(--duel-right) 100%);
  }

  body.mobile-layout.stage-compare .engine-top .undo-choice-btn {
    top: 8px;
    left: 10px;
    width: 58px;
    height: 30px;
    gap: 2px;
  }

  body.mobile-layout.stage-compare .engine-top .undo-choice-icon {
    height: 30px;
    line-height: 30px;
    font-size: 1.12rem;
  }

  body.mobile-layout.stage-compare .engine-top .undo-choice-text {
    height: 30px;
    line-height: 30px;
    font-size: 0.8rem;
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-card {
    width: 50%;
    height: 50%;
    min-height: 0;
    padding: 36px 14px;
    box-shadow: none;
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-card.left-pane {
    left: 6%;
    top: 8%;
    bottom: auto;
    background: transparent;
    justify-content: flex-start;
    padding-top: 40px;
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-card.right-pane {
    right: 6%;
    top: auto;
    bottom: 8%;
    background: transparent;
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
    padding-bottom: 72px;
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-rank {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-name {
    margin-top: 8px;
    font-size: clamp(2rem, 10vw, 2.7rem);
    line-height: 0.98;
    max-width: 100%;
  }

  body.mobile-layout.stage-compare #comparisonBoard .choice-meta {
    margin-top: 10px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
  }

  body.mobile-layout.stage-compare #comparisonBoard .duel-divider {
    display: none;
  }

  body.mobile-layout.stage-compare #comparisonBoard .versus {
    font-size: 3.1rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #ffffff;
    text-shadow: 0 3px 16px rgba(4, 18, 29, 0.38);
  }

  body.mobile-layout.stage-compare #comparisonBoard .duel-mini-track {
    display: none;
  }

  body.mobile-layout.stage-result {
    overflow: hidden;
    background: #ffffff;
    overscroll-behavior: none;
    touch-action: auto;
  }

  body.mobile-layout.stage-result .hero,
  body.mobile-layout.stage-result .ambient {
    display: none;
  }

  body.mobile-layout.stage-result .layout {
    max-width: none;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.mobile-layout.stage-result #engineSection {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 10px 10px 72px;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }

  body.mobile-layout.stage-result .engine-top {
    display: block;
    min-height: 0;
    text-align: center;
  }

  body.mobile-layout.stage-result .engine-top > div:first-child {
    display: none;
  }

  body.mobile-layout.stage-result .engine-controls {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 16;
  }

  body.mobile-layout.stage-result .mode-toggle-wrap {
    display: none;
  }

  body.mobile-layout.stage-result .engine-top-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  body.mobile-layout.stage-result .back-list-btn,
  body.mobile-layout.stage-result .restart-btn {
    pointer-events: auto;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  body.mobile-layout.stage-result .progress-panel,
  body.mobile-layout.stage-result .final-nine-banner,
  body.mobile-layout.stage-result #comparisonBoard {
    display: none !important;
  }

  body.mobile-layout.stage-result #resultSection {
    margin-top: 0;
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding-bottom: 0;
  }

  body.mobile-layout.stage-result #resultSection .result-pager-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
  }

  body.mobile-layout.stage-result #resultSection .result-pager-track {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translate3d(0, 0, 0);
    transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
  }

  body.mobile-layout.stage-result #resultSection .result-page {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.mobile-layout.stage-result #resultSection .result-page-full {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px calc(74px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  body.mobile-layout.stage-result #resultSection .top9-card {
    margin-top: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 0 10px;
  }

  body.mobile-layout.stage-result #resultSection .top9-head {
    width: 100%;
    margin-bottom: 6px;
  }

  body.mobile-layout.stage-result #resultSection #top9Preview {
    width: min(100%, 480px);
    max-height: calc(100% - 118px);
    height: auto;
    object-fit: contain;
    background: #ffffff;
    border: 0;
    justify-self: center;
    align-self: center;
  }

  body.mobile-layout.stage-result #resultSection .result-scroll-hint {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: #335e6f;
    font-weight: 600;
  }

  body.mobile-layout.stage-result #resultSection .result-scroll-arrow {
    margin: 2px 0 0;
    text-align: center;
    font-size: 1.4rem;
    line-height: 1;
    color: #1c5063;
    font-weight: 800;
  }

  body.mobile-layout.stage-result #resultSection .result-detail {
    margin-top: 0;
    min-height: 0;
    height: auto;
    max-height: 100%;
    width: min(92%, 520px);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    overflow: hidden;
  }

  body.mobile-layout.stage-result #resultSection .result-head {
    flex: 0 0 auto;
  }

  body.mobile-layout.stage-result #resultSection .result-head h3 {
    font-size: 1.7rem;
    line-height: 1.05;
  }

  body.mobile-layout.stage-result #resultSection .result-head p {
    margin-top: 4px;
    font-size: 0.85rem;
  }

  body.mobile-layout.stage-result #resultSection .ranking-list {
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
    columns: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
