@font-face {
  font-family: "PosterSans";
  src: local("Source Han Sans SC Bold"), local("Source Han Sans SC"), local("Noto Sans CJK SC Bold"), local("PingFang SC Semibold");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-void: #0e0d0c;
  --bg-main: #121110;
  --bg-panel: #151412;
  --bg-card: #181715;
  --bg-elevated: #1e1c19;
  --bg-input: #100f0e;
  --bg-modal: #141311;
  --bg-preview-pane: #0e0d0c;
  --bg-preview-stage: #0b0a09;
  --bg-toast: #1d1b18;
  --bg-hover-subtle: rgba(255, 255, 255, 0.045);
  --bg-btn-subtle: rgba(255, 255, 255, 0.015);
  --line-faint: rgba(242, 239, 233, 0.06);
  --line-hair: rgba(242, 239, 233, 0.11);
  --line-mid: rgba(242, 239, 233, 0.2);
  --line-strong: rgba(242, 239, 233, 0.34);
  --text-ivory: #f2efe9;
  --text-secondary: #a59f95;
  --text-muted: #6e685f;
  --vermilion: #d6452f;
  --vermilion-hover: #e2523c;
  --vermilion-dim: rgba(214, 69, 47, 0.16);
  --gold-light: #e2be78;
  --gold-dark: #b68d43;
  --slider-track: rgba(242, 239, 233, 0.18);
  --slider-vol-fill: rgba(242, 239, 233, 0.72);
  --slider-thumb: #f2efe9;
  --groove-stroke: rgba(242, 239, 233, 0.045);
  --hex-fill: #121110;
  --hex-stroke: #5a534a;
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Microsoft YaHei", "Malgun Gothic", "Segoe UI Historic", sans-serif;
  --font-editorial: "Source Han Sans SC", "Noto Sans SC", "Noto Serif SC", "Malgun Gothic", "Segoe UI Historic", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", "SFMono-Regular", "Segoe UI Historic", monospace;
  --sidebar-width: clamp(320px, 33vw, 520px);
}

/* Light Theme (和纸白昼画廊) */
:root[data-theme="light"] {
  --bg-void: #ebe6dc;
  --bg-main: #f4f0e8;
  --bg-panel: #f9f6f0;
  --bg-card: #ffffff;
  --bg-elevated: #ece7dd;
  --bg-input: #ffffff;
  --bg-modal: #f8f5ef;
  --bg-preview-pane: #ece7dd;
  --bg-preview-stage: #e4ded3;
  --bg-toast: #1e1c1a;
  --bg-hover-subtle: rgba(24, 22, 20, 0.055);
  --bg-btn-subtle: rgba(24, 22, 20, 0.025);
  --line-faint: rgba(24, 22, 20, 0.06);
  --line-hair: rgba(24, 22, 20, 0.12);
  --line-mid: rgba(24, 22, 20, 0.22);
  --line-strong: rgba(24, 22, 20, 0.42);
  --text-ivory: #181614;
  --text-secondary: #595249;
  --text-muted: #847c71;
  --vermilion: #c93d28;
  --vermilion-hover: #b73320;
  --vermilion-dim: rgba(201, 61, 40, 0.12);
  --slider-track: rgba(24, 22, 20, 0.16);
  --slider-vol-fill: rgba(24, 22, 20, 0.65);
  --slider-thumb: #181614;
  --groove-stroke: rgba(24, 22, 20, 0.055);
  --hex-fill: #f4f0e8;
  --hex-stroke: rgba(24, 22, 20, 0.34);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg-main);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Subtle analog paper/film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

/* Custom sleek dark scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(242, 239, 233, 0.16);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(242, 239, 233, 0.28);
}

/* ==================== App Shell ==================== */
.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.main-column {
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}

/* ==================== Topbar (Images 1/2/3) ==================== */
.topbar {
  height: 58px;
  padding: 0 24px;
  background: var(--bg-void);
  border-bottom: 1px solid var(--line-hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-icon-img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-ivory);
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 20px;
  background: var(--line-mid);
  flex-shrink: 0;
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-theme-toggle {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border-radius: 4px;
  background: var(--bg-btn-subtle);
  border: 1px solid var(--line-hair);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-theme-toggle:hover {
  color: var(--text-ivory);
  border-color: var(--line-strong);
  background: var(--bg-hover-subtle);
}

.btn-theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .btn-theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .btn-theme-toggle .icon-moon {
  display: block;
}

/* Editorial Step Switcher: 01 曲库导入 / 02 两两对决 */
.step-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  flex-shrink: 0;
}

.step-tab {
  position: relative;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.18s ease;
}

.step-code {
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.85;
}

.step-tab:hover {
  color: var(--text-ivory);
}

.step-tab.active {
  color: var(--text-ivory);
  font-weight: 600;
}

.step-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--vermilion);
}

.step-slash {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.55;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==================== Shared Buttons ==================== */
.btn-outline-top,
.btn-atelier {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn-outline-top:hover,
.btn-atelier:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.btn-vermilion {
  background: var(--vermilion);
  border: 1px solid var(--vermilion);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.btn-vermilion:hover {
  background: var(--vermilion-hover);
  border-color: var(--vermilion-hover);
}

.btn-vermilion:disabled,
.btn-atelier:disabled,
.btn-text-muted:disabled,
.btn-spine-pill:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-text-muted {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.btn-text-muted:hover {
  color: var(--vermilion);
}

.danger-text {
  color: #e06c5a;
  border-color: rgba(224, 108, 90, 0.3);
}

/* ==================== View Panels ==================== */
.view-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* ==================== View 01: Import Workspace (Images 2 & 3) ==================== */
.import-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
}

.drop-atelier {
  position: relative;
  border: 1px dashed var(--line-mid);
  border-radius: 6px;
  background: var(--bg-panel);
  padding: 28px 32px 22px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.drop-atelier:hover,
.drop-atelier.drag-over {
  border-color: var(--vermilion);
  background: var(--bg-card);
}

.atelier-bg-grooves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--groove-stroke);
  pointer-events: none;
}

.drop-atelier-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-vinyl-folder-icon {
  width: 96px;
  height: 76px;
  margin-bottom: 10px;
}

.drop-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-ivory);
  margin-bottom: 20px;
}

.import-btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.import-btn-row .btn-atelier {
  min-width: 164px;
  padding: 8px 18px;
}

.atelier-progress-row {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-status-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.laser-progress-track {
  flex: 1;
  height: 4px;
  background: rgba(242, 239, 233, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.laser-progress-fill {
  height: 100%;
  background: var(--vermilion);
  transition: width 0.16s ease;
}

.progress-mono-nums {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Tracklist Section */
.tracklist-section {
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-hair);
  padding-top: 14px;
}

.tracklist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-hair);
  flex-shrink: 0;
}

.tracklist-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.imported-heading {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.imported-heading span {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.track-filter-input {
  background: var(--bg-panel);
  border: 1px solid var(--line-hair);
  border-radius: 4px;
  color: var(--text-ivory);
  font-size: 12.5px;
  padding: 5px 11px;
  width: 220px;
  outline: none;
  transition: border-color 0.15s ease;
}

.track-filter-input:focus {
  border-color: var(--line-strong);
}

.tracklist-table-container {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.tracklist-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tracklist-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-hair);
}

.tracklist-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-faint);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tracklist-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.col-idx { width: 56px; font-family: var(--font-mono); font-size: 12px !important; color: var(--text-muted) !important; }
.col-cover { width: 52px; }
.col-title { width: 32%; color: var(--text-ivory) !important; font-weight: 500; }
.col-artist { width: 23%; }
.col-album { width: 25%; }
.col-year { width: 74px; font-family: var(--font-mono); }
.col-del { width: 50px; text-align: right !important; }

.track-row-cover {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
  background: #22201d;
  border: 1px solid var(--line-faint);
}

.btn-row-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-row-del:hover {
  color: var(--vermilion);
}

.tracklist-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==================== View 02: Pairwise Battle Arena (Image 1) ==================== */
#viewCompare {
  gap: 14px;
  padding: 14px 24px 20px;
}

.telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-hair);
  flex-shrink: 0;
}

.strategy-segmented {
  display: inline-flex;
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-panel);
}

.seg-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--line-hair);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  color: var(--text-ivory);
  background: rgba(255, 255, 255, 0.04);
}

.seg-btn.active {
  background: var(--vermilion);
  color: #ffffff;
  font-weight: 600;
}

.telemetry-metrics {
  display: flex;
  align-items: center;
  gap: 18px;
}

.telemetry-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
}

.tel-label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.tel-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-ivory);
  font-variant-numeric: tabular-nums;
}

.tel-sep {
  color: var(--line-mid);
  font-size: 13px;
}

.permission-banner {
  background: rgba(214, 69, 47, 0.1);
  border: 1px solid rgba(214, 69, 47, 0.35);
  border-radius: 4px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-ivory);
  flex-shrink: 0;
}

.compare-empty-state {
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
}

/* Battle Arena Grid: Left Deck | Spine | Right Deck */
.battle-arena {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.deck-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line-hair);
  border-radius: 6px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.2s ease;
}

.deck-card.is-playing {
  border-color: rgba(214, 69, 47, 0.45);
}

.deck-ambient-glow {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 140, 110, 0.12) 0%, transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.deck-card > *:not(.deck-ambient-glow) {
  position: relative;
  z-index: 1;
}

.deck-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
}

.deck-side-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-ivory);
}

.deck-slash {
  color: var(--text-muted);
}

.deck-rank-code {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* Square Jacket + Peeking Vinyl Record */
.jacket-stage {
  position: relative;
  width: min(255px, 28vh);
  height: min(255px, 28vh);
  min-width: 156px;
  min-height: 156px;
  margin: 2px auto;
  cursor: pointer;
  flex-shrink: 0;
}

.jacket-box {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  overflow: hidden;
  background: #121110;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.jacket-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Realistic peeking vinyl disc on the right side of the jacket */
.vinyl-peek {
  position: absolute;
  z-index: 1;
  top: 4%;
  right: -10px;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  background:
    conic-gradient(
      from 30deg,
      #141414 0deg,
      #2c2b29 38deg,
      #121212 78deg,
      #121212 180deg,
      #2d2b29 218deg,
      #141414 260deg,
      #141414 360deg
    );
  box-shadow: 4px 8px 22px rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.vinyl-peek-grooves {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 2px,
    transparent 5px
  );
}

.jacket-stage:hover .vinyl-peek {
  transform: translateX(14px);
}

.deck-card.is-playing .vinyl-peek {
  transform: translateX(26px);
  animation: spinVinylPeek 8s linear infinite;
}

@keyframes spinVinylPeek {
  from { transform: translateX(26px) rotate(0deg); }
  to { transform: translateX(26px) rotate(360deg); }
}

/* Song Title & 3-Row Hairline Obi Metadata List */
.deck-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.deck-song-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-ivory);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.35em;
  user-select: text;
}

.obi-meta-list {
  border-top: 1px solid var(--line-hair);
  border-bottom: 1px solid var(--line-hair);
}

.obi-meta-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-faint);
  font-size: 12.5px;
}

.obi-meta-row:last-child {
  border-bottom: none;
}

.obi-meta-row dt {
  color: var(--text-muted);
  font-weight: 400;
}

.obi-meta-row dd {
  color: var(--text-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
}

.mono-val {
  font-family: var(--font-mono);
}

/* Hi-Fi Audio Player (Exact layout of Image 1) */
.hifi-player {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

.hifi-transport-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hifi-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  border: 1.4px solid var(--line-strong);
  color: var(--text-ivory);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hifi-play-btn:hover {
  border-color: var(--text-ivory);
  background: rgba(255, 255, 255, 0.06);
}

.hifi-play-btn svg {
  width: 17px;
  height: 17px;
}

.hifi-play-btn .icon-pause {
  display: none;
}

.deck-card.is-playing .hifi-play-btn {
  border-color: var(--vermilion);
}

.deck-card.is-playing .hifi-play-btn .icon-play {
  display: none;
}

.deck-card.is-playing .hifi-play-btn .icon-pause {
  display: block;
}

.hifi-progress-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hifi-timecode {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-ivory);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.time-sep {
  color: var(--text-muted);
  margin: 0 3px;
}

.hifi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.seek-bar {
  background: linear-gradient(
    to right,
    var(--vermilion) 0%,
    var(--vermilion) var(--pct, 0%),
    var(--slider-track) var(--pct, 0%),
    var(--slider-track) 100%
  );
}

.vol-bar {
  background: linear-gradient(
    to right,
    var(--slider-vol-fill) 0%,
    var(--slider-vol-fill) var(--pct, 80%),
    var(--slider-track) var(--pct, 80%),
    var(--slider-track) 100%
  );
}

.hifi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--slider-thumb);
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.hifi-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.hifi-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 4px;
}

.hifi-mute-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.hifi-mute-btn:hover {
  color: var(--text-ivory);
}

.hifi-vol-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Vote Buttons (Symmetric borders, large far-left / far-right arrows) */
.btn-choose {
  position: relative;
  width: 100%;
  height: 48px;
  padding: 0 56px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-choose:hover {
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: #ffffff;
}

.choose-arrow-svg {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  transition: transform 0.18s ease;
}

.choose-arrow-svg.arrow-left {
  left: 20px;
}

.choose-arrow-svg.arrow-right {
  right: 20px;
}

.btn-choose:hover .choose-arrow-svg.arrow-left {
  transform: translate(-4px, -50%);
}

.btn-choose:hover .choose-arrow-svg.arrow-right {
  transform: translate(4px, -50%);
}

/* Center VS Spine (Image 1) */
.vs-spine {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

/* Continuous 1px vertical hairline */
.vs-spine::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line-hair);
  z-index: 0;
}

.vs-hex {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-hex-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vs-text {
  position: relative;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-ivory);
}

.spine-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 66px;
}

.btn-spine-pill {
  background: var(--bg-main);
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 0;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-spine-pill:hover {
  border-color: var(--line-strong);
  color: var(--text-ivory);
  background: var(--bg-elevated);
}

/* ==================== Right Persistent 5-Column Sidebar (Images 1/2/3) ==================== */
.sidebar-archive {
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: 100vh;
  background: var(--bg-void);
  border-left: 1px solid var(--line-hair);
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--line-hair);
  flex-shrink: 0;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mobile-grid-toggle {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.poster-preview-img {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

.sidebar-heading {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-ivory);
}

.sidebar-heading span {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.btn-export-top {
  padding: 7px 14px;
  font-size: 13px;
}

.sidebar-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  color: var(--text-ivory);
  font-size: 12.5px;
  padding: 7px 12px 7px 34px;
  outline: none;
  transition: border-color 0.15s ease;
}

.sidebar-search-input:focus {
  border-color: var(--line-strong);
}

.sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px 28px;
}

.sidebar-empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* Strictly 5 songs per row, frameless gallery style matching Images 1/2/3 */
.five-col-wall {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 14px;
}

.wall-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: 90px 132px;
}

.wall-cover-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  overflow: hidden;
  background: #1b1917;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 5px;
}

.wall-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.24s ease;
}

.wall-tile:hover .wall-cover-img {
  transform: scale(1.05);
}

/* Corner Rank Tag (01/02/03 diagonal gold ribbon, 04+ dark charcoal square) */
.wall-rank-tag {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 5px;
  background: rgba(16, 15, 14, 0.88);
  color: var(--text-ivory);
  border-bottom-right-radius: 2px;
}

.wall-rank-tag.podium-1,
.wall-rank-tag.podium-2,
.wall-rank-tag.podium-3 {
  padding: 4px 7px 9px 5px;
  color: #16120b;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 0 100%);
  border-radius: 0;
}

.wall-rank-tag.podium-1 {
  background: linear-gradient(135deg, #ecc97e, #c39644);
}

.wall-rank-tag.podium-2 {
  background: linear-gradient(135deg, #e0d2b8, #a9987b);
}

.wall-rank-tag.podium-3 {
  background: linear-gradient(135deg, #d7a66e, #9c6a37);
}

.wall-song-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.wall-song-artist {
  font-size: 10.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ==================== Export Poster Studio Modal (Image 4) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(8, 8, 7, 0.82);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: var(--bg-modal);
  border: 1px solid var(--line-mid);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
}

.poster-modal {
  max-width: 1220px;
  height: min(820px, 90vh);
}

.backup-dialog {
  max-width: 480px;
}

.modal-topbar {
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modal-divider {
  width: 1px;
  height: 16px;
  background: var(--line-mid);
}

.modal-en {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-ivory);
}

.poster-studio-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.poster-controls-pane {
  padding: 22px 24px;
  border-right: 1px solid var(--line-hair);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-ivory);
  letter-spacing: 0.03em;
}

.studio-single-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

.studio-single-input:focus {
  border-color: var(--line-strong);
}

.custom-top-dialog {
  max-width: 320px;
}

.custom-top-body {
  padding: 20px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.custom-top-body .number-stepper {
  width: 100%;
}

.custom-top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.control-divider {
  height: 1px;
  background: var(--line-hair);
}

/* Custom Numeric Stepper (Image 4) */
.number-stepper {
  display: inline-flex;
  align-items: stretch;
  width: 124px;
  height: 40px;
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  background: var(--bg-input);
  overflow: hidden;
}

.stepper-input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-ivory);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 0 12px;
  outline: none;
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btns {
  width: 28px;
  border-left: 1px solid var(--line-hair);
  display: flex;
  flex-direction: column;
}

.step-arrow {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-arrow:first-child {
  border-bottom: 1px solid var(--line-hair);
}

.step-arrow:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-ivory);
}

/* Visual Theme Swatch Cards (Image 4) */
.theme-swatch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-card {
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
}

.swatch-preview {
  position: relative;
  height: 76px;
  border-radius: 5px;
  border: 1.5px solid var(--line-mid);
  overflow: hidden;
  transition: border-color 0.16s ease;
}

.theme-card.active .swatch-preview {
  border-color: var(--vermilion);
}

.swatch-obsidian {
  background: linear-gradient(135deg, #1b1917 0%, #0f0e0d 100%);
}

.swatch-vinyl-disc {
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    #252321 0px,
    #252321 2px,
    #141312 3px,
    #141312 6px
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.swatch-vinyl-disc::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--vermilion);
}

.swatch-washi {
  background: linear-gradient(135deg, #f3efe6 0%, #e5ded0 100%);
}

.swatch-obi-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 22px;
  background: #b84230;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.swatch-radio-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}

.theme-card.active .swatch-radio-row {
  color: var(--text-ivory);
}

.radio-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  position: relative;
  flex-shrink: 0;
}

.theme-card.active .radio-dot {
  border-color: var(--vermilion);
}

.theme-card.active .radio-dot::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--vermilion);
}

.poster-download-footer {
  margin-top: auto;
  padding-top: 8px;
}

.btn-download-lg {
  height: 44px;
  font-size: 14px;
}

/* Right Preview Pane */
.poster-preview-pane {
  padding: 18px 24px 22px;
  background: var(--bg-preview-pane);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.preview-pane-header {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.poster-canvas-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line-hair);
  border-radius: 4px;
  background: var(--bg-preview-stage);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.poster-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

/* Backup Dialog & Overlay */
.backup-content {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.global-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(14, 13, 12, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay-box {
  border: 1.5px dashed var(--vermilion);
  border-radius: 8px;
  padding: 44px 64px;
  text-align: center;
  background: var(--bg-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.overlay-vinyl-svg {
  width: 56px;
  height: 56px;
  color: var(--vermilion);
}

.toast-container {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-toast);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--vermilion);
  color: #f2efe9;
  padding: 9px 18px;
  border-radius: 3px;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* Responsive support: ALWAYS keep right sidebar on the right for desktop windows (including 125%-175% Windows DPI scaling!) */
@media (max-width: 1360px) {
  .topbar {
    padding: 0 16px;
    gap: 10px;
  }
  .brand-divider,
  .brand-en {
    display: none;
  }
  .brand-title {
    font-size: 16px;
  }
  .step-tabs {
    gap: 8px;
  }
  .step-tab {
    font-size: 13px;
    padding: 0 4px;
  }
  .btn-outline-top {
    padding: 6px 10px;
    font-size: 12.5px;
    gap: 6px;
  }
  .view-panel {
    padding: 14px 16px;
  }
  .deck-card {
    padding: 14px 16px;
  }
  .battle-arena {
    grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  }
  .five-col-wall {
    column-gap: 7px;
    row-gap: 11px;
  }
  .sidebar-scroll {
    padding: 12px 12px 24px;
  }
}

@media (max-width: 768px) {
  :root {
    --mob-nav-h: 56px;
  }

  html,
  body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  .app-shell {
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: calc(var(--mob-nav-h) + env(safe-area-inset-bottom, 0px));
  }

  .main-column {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    width: 100%;
  }

  .app-shell[data-mobile-view="import"] .sidebar-archive,
  .app-shell[data-mobile-view="compare"] .sidebar-archive {
    display: none;
  }

  .app-shell[data-mobile-view="ranking"] .main-column {
    flex: 0 0 auto;
    height: auto;
  }

  .app-shell[data-mobile-view="ranking"] .view-panel {
    display: none !important;
  }

  .app-shell[data-mobile-view="ranking"] .sidebar-archive {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: none;
  }

  /* Compact Mobile Topbar */
  .topbar {
    height: 50px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 5px;
  }

  .brand-title {
    font-size: 15.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-divider,
  .brand-en,
  .step-tabs {
    display: none;
  }

  .btn-theme-toggle {
    width: 30px;
    height: 30px;
    margin-left: 2px;
    flex-shrink: 0;
  }

  .btn-outline-top {
    padding: 6px 10px;
    font-size: 12px;
    gap: 5px;
  }

  /* Mobile Bottom Tab Bar */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 400;
    height: calc(var(--mob-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-void);
    border-top: 1px solid var(--line-hair);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }

  .mob-nav-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: color 0.15s ease;
  }

  .mob-nav-btn.active {
    color: var(--vermilion);
  }

  .mob-nav-btn.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--vermilion);
  }

  .mob-nav-badge {
    position: absolute;
    top: 6px;
    left: calc(50% + 10px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--vermilion);
    color: #ffffff;
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }

  /* View Panels on Mobile */
  .view-panel {
    padding: 10px 12px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 01 Import View (Mobile Portrait) */
  .import-workspace {
    gap: 12px;
    height: auto;
    min-height: 100%;
  }

  .drop-atelier {
    padding: 18px 14px 14px;
    min-height: auto;
  }

  .hero-vinyl-folder-icon {
    width: 68px;
    height: 54px;
    margin-bottom: 6px;
  }

  .drop-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .import-btn-row {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .import-btn-row .btn-atelier {
    flex: 1 1 130px;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
  }

  .atelier-progress-row {
    gap: 8px;
    font-size: 11px;
  }

  .tracklist-section {
    flex: 1 1 auto;
    min-height: 220px;
  }

  .tracklist-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 8px;
  }

  .tracklist-bar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .imported-heading {
    font-size: 14px;
  }

  .track-filter-input {
    flex: 1 1 140px;
    min-width: 120px;
    width: auto;
    font-size: 13px;
    padding: 7px 10px;
  }

  #btnStartSorting {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
  }

  .tracklist-table .col-album,
  .tracklist-table .col-year,
  .tracklist-table td:nth-child(5),
  .tracklist-table td:nth-child(6) {
    display: none;
  }

  .tracklist-table th,
  .tracklist-table td {
    padding: 8px 6px;
    font-size: 12.5px;
  }

  .tracklist-table .col-idx {
    width: 30px;
  }

  .tracklist-table .col-cover {
    width: 40px;
  }

  /* 02 Compare View (Mobile Portrait Single-Screen Vertical 1v1 Duel) */
  #viewCompare {
    padding: 8px 10px 10px;
    gap: 8px;
  }

  .telemetry-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-bottom: 6px;
  }

  .strategy-segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .seg-btn {
    padding: 6px 4px;
    font-size: 11.5px;
    text-align: center;
    white-space: nowrap;
  }

  .telemetry-metrics {
    justify-content: space-between;
    padding: 0 2px;
    gap: 6px;
  }

  .telemetry-item {
    gap: 4px;
  }

  .tel-label {
    font-size: 9.5px;
    letter-spacing: 0.05em;
  }

  .tel-val {
    font-size: 12.5px;
  }

  .permission-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .battle-arena {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Compact Horizontal-Inside-Vertical Deck Card so SIDE A & SIDE B fit on 1 screen */
  .deck-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "jacket meta"
      "player player"
      "vote vote";
    column-gap: 12px;
    row-gap: 8px;
    padding: 10px 12px;
    align-content: start;
    flex: 0 0 auto;
  }

  .deck-ambient-glow {
    width: 180px;
    height: 180px;
    top: 0;
    left: 20%;
    transform: none;
  }

  .deck-header {
    grid-area: header;
    gap: 6px;
  }

  .deck-side-name {
    font-size: 12px;
  }

  .deck-rank-code {
    font-size: 11.5px;
  }

  .jacket-stage {
    grid-area: jacket;
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    margin: 0;
    align-self: center;
  }

  .vinyl-peek {
    right: -6px;
  }

  .deck-card.is-playing .vinyl-peek {
    transform: translateX(10px);
    animation: spinVinylPeekMobile 8s linear infinite;
  }

  @keyframes spinVinylPeekMobile {
    from { transform: translateX(10px) rotate(0deg); }
    to { transform: translateX(10px) rotate(360deg); }
  }

  .deck-meta {
    grid-area: meta;
    gap: 4px;
    justify-content: center;
  }

  .deck-song-title {
    font-size: 14.5px;
    line-height: 1.28;
    -webkit-line-clamp: 2;
    min-height: auto;
  }

  .obi-meta-list {
    border-top: 1px solid var(--line-faint);
    border-bottom: none;
  }

  .obi-meta-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 2.5px 0;
    font-size: 11.5px;
    gap: 6px;
  }

  .obi-meta-row .meta-en {
    display: none;
  }

  .hifi-player {
    grid-area: player;
    gap: 0;
    padding-top: 2px;
  }

  .hifi-transport-row {
    gap: 10px;
  }

  .hifi-play-btn {
    width: 36px;
    height: 36px;
  }

  .hifi-play-btn svg {
    width: 15px;
    height: 15px;
  }

  .hifi-progress-col {
    gap: 4px;
  }

  .hifi-timecode {
    font-size: 11px;
  }

  .hifi-slider {
    height: 5px;
  }

  .hifi-slider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }

  /* Mobile devices use hardware volume buttons (and iOS Safari makes audio.volume read-only) */
  .hifi-volume-row {
    display: none;
  }

  .btn-choose {
    grid-area: vote;
    height: 40px;
    padding: 0 42px;
    font-size: 14px;
  }

  .choose-arrow-svg {
    width: 20px;
    height: 20px;
  }

  .choose-arrow-svg.arrow-left {
    left: 14px;
    transform: translateY(-50%) rotate(90deg);
  }

  .choose-arrow-svg.arrow-right {
    right: 14px;
    transform: translateY(-50%) rotate(90deg);
  }

  .btn-choose:hover .choose-arrow-svg.arrow-left,
  .btn-choose:active .choose-arrow-svg.arrow-left {
    transform: translateY(calc(-50% - 2px)) rotate(90deg);
  }

  .btn-choose:hover .choose-arrow-svg.arrow-right,
  .btn-choose:active .choose-arrow-svg.arrow-right {
    transform: translateY(calc(-50% + 2px)) rotate(90deg);
  }

  /* Horizontal Compact VS Spine between Card A and Card B */
  .vs-spine {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    min-height: 34px;
  }

  .vs-spine::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
  }

  .vs-hex {
    width: 34px;
    height: 36px;
    flex-shrink: 0;
  }

  .vs-text {
    font-size: 11px;
  }

  .spine-actions {
    flex-direction: row;
    width: auto;
    gap: 8px;
  }

  .btn-spine-pill {
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* 03 Sidebar Ranking View (Full-Screen Mobile Tab) */
  .sidebar-top {
    padding: 10px 12px;
    gap: 8px;
  }

  .sidebar-heading {
    font-size: 15.5px;
  }

  .btn-mobile-grid-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    background: var(--bg-panel);
    border: 1px solid var(--line-mid);
    border-radius: 4px;
    color: var(--text-ivory);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
  }

  .btn-export-top {
    padding: 6px 11px;
    font-size: 12px;
  }

  .sidebar-scroll {
    padding: 10px 12px 20px;
    -webkit-overflow-scrolling: touch;
  }

  .five-col-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 14px;
  }

  .five-col-wall.mobile-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 10px;
  }

  .five-col-wall.mobile-cols-5 .wall-song-title {
    font-size: 10px;
  }

  .five-col-wall.mobile-cols-5 .wall-song-artist {
    font-size: 9px;
  }

  /* Modals on Mobile Portrait */
  .modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-dialog {
    max-height: 92dvh;
    border-radius: 10px;
  }

  .poster-modal {
    height: 92dvh;
    max-width: 100%;
  }

  .modal-topbar {
    height: 48px;
    padding: 0 14px;
  }

  .modal-title-group h2 {
    font-size: 15.5px;
  }

  .modal-divider,
  .modal-en {
    display: none;
  }

  .poster-studio-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .poster-controls-pane {
    padding: 12px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line-hair);
    gap: 12px;
    overflow: visible;
    flex-shrink: 0;
  }

  .control-divider {
    display: none;
  }

  .swatch-preview {
    height: 46px;
  }

  .poster-download-footer {
    margin-top: 2px;
    padding-top: 0;
  }

  .poster-preview-pane {
    padding: 12px 14px 16px;
    flex: 1 0 auto;
    min-height: 260px;
  }

  .poster-canvas-stage {
    padding: 10px;
    min-height: 220px;
  }

  .toast-container {
    bottom: calc(var(--mob-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    width: calc(100% - 24px);
    align-items: center;
  }

  .toast-msg {
    max-width: 100%;
    text-align: center;
    font-size: 12.5px;
  }
}
