/* ============================================================
   NEO SKYLINE — 商用プレミアムモバイルゲーム UI スタイル
   テーマ：深淵オブシディアン × ティファニーシアン × アークゴールド
   ============================================================ */
:root {
  color-scheme: dark;
  --black: #03050a;
  --surface: rgba(8, 16, 32, 0.24);
  --surface-strong: rgba(7, 14, 28, 0.38);
  --tiffany: #78f7e8;
  --tiffany-strong: #00d9c8;
  --gold: #ffc83d;
  --gold-light: #ffe27a;
  --violet: #b788ff;
  --danger: #ff4593;
  --text: #f5f7fa;
  --text-dim: #c7d4e2;
  --border-subtle: rgba(120, 247, 232, 0.34);
  --font-heading: "Chakra Petch", "Noto Sans JP", sans-serif;
  --font-body: "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --target-size: 32px;
  --in-oklab: ;
  --in-oklch: ;
}

@supports (linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
    --in-oklch: in oklch;
  }
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

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

[hidden] {
  display: none !important;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

html, body {
  inline-size: 100%;
  block-size: 100dvh;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.app-stage {
  position: relative;
  inline-size: 100%;
  block-size: 100dvh;
  overflow: hidden;
  overflow: clip;
}

.app-stage::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(120, 247, 232, 0.022) 0px,
      rgba(120, 247, 232, 0.022) 1px,
      transparent 1px,
      transparent 4px
    );
}

#game {
  position: fixed;
  inset: 0;
  display: block;
  inline-size: 100%;
  block-size: 100dvh;
  contain: layout style paint;
  touch-action: none; /* ゲーム用キャンバスでのスワイプ時に画面スクロールを防止 */
  cursor: crosshair;
}

/* キーボードフォーカス可視化 */
:where(button, a[href], [tabindex]):focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

/* ---------- 共通ボタンスタイル ---------- */
button, a.btn-ghost, a.btn-cta {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
  touch-action: manipulation;
}

button {
  font: inherit;
  transition: transform 140ms ease-out, box-shadow 180ms ease-out, border-color 180ms ease-out, filter 180ms ease-out;
}
button:active {
  transform: scale(0.97);
}

/* ---------- 右上のシステムボタン ---------- */
.corner-buttons {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: max(36px, var(--target-size));
  padding: 0 12px;
  border: 1px solid rgba(120, 247, 232, 0.48);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(16, 32, 58, 0.3), rgba(6, 12, 26, 0.2));
  color: var(--tiffany);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.9);
}

.icon-btn:hover {
  border-color: var(--tiffany);
  box-shadow: 0 0 18px rgba(120, 247, 232, 0.45);
}

.icon-btn[aria-pressed="false"] {
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ---------- プレイ中コックピット HUD ---------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  font-family: var(--font-heading);
}

.hud-panel {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  contain: layout style paint;
}

.hud-left {
  left: max(14px, env(safe-area-inset-left, 0px));
  padding: 8px 14px 10px;
  min-inline-size: clamp(132px, 24dvw, 210px);
  max-inline-size: calc(100dvw - 210px);
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(135deg var(--in-oklab), rgba(10, 22, 42, 0.42), rgba(5, 11, 22, 0.24));
  border: 1px solid rgba(120, 247, 232, 0.42);
  border-left: 3px solid var(--tiffany);
  border-radius: 8px;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(120, 247, 232, 0.14), inset 0 1px 0 rgba(188, 252, 255, 0.36), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
  transition: border-color 220ms ease, box-shadow 260ms ease;
}

.hud[data-hyper="1"] .hud-left {
  border-color: rgba(120, 247, 232, 0.78);
  border-left-color: var(--gold);
  box-shadow: 0 8px 28px rgba(0, 217, 200, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.hud[data-hyper="2"] .hud-left {
  border-color: rgba(255, 200, 61, 0.85);
  border-left-color: var(--gold-light);
  box-shadow: 0 8px 34px rgba(255, 200, 61, 0.34), inset 0 1px 0 rgba(255, 244, 190, 0.36);
}

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

.hud-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.hud-mult {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 200, 61, 0.16);
  border: 1px solid rgba(255, 200, 61, 0.5);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 700;
}

.hud-score {
  font-size: clamp(1.35rem, 3.2vw, 2.05rem);
  font-weight: 700;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 14px rgba(120, 247, 232, 0.55);
  margin-block-start: 2px;
}

.hud-combo-row {
  margin-block-start: 2px;
}

.hud-combo:empty {
  display: none;
}

.hud-combo {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 200, 61, 0.65);
}

.hud-hyper-wrap {
  margin-block-start: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-hyper-bar {
  inline-size: 100%;
  block-size: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.hud-hyper-fill {
  display: block;
  inline-size: 0%;
  block-size: 100%;
  background: linear-gradient(90deg var(--in-oklab), var(--tiffany), var(--gold));
  box-shadow: 0 0 8px var(--tiffany);
  transition: inline-size 160ms ease-out;
}

.hud-hyper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 2px 8px;
  background: rgba(255, 200, 61, 0.22);
  border: 1px solid var(--gold);
  border-radius: 4px;
  color: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  box-shadow: 0 0 14px rgba(255, 200, 61, 0.5);
}

.hyper-dot {
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .hud-hyper {
    animation: hyper-pulse 1.1s ease-in-out infinite alternate;
  }
}

@keyframes hyper-pulse {
  from { filter: drop-shadow(0 0 4px rgba(255, 200, 61, 0.7)); transform: scale(1); }
  to { filter: drop-shadow(0 0 10px rgba(120, 247, 232, 0.9)); transform: scale(1.03); }
}

.hud-center {
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 6px 16px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.025) 0 1px, transparent 1px 4px),
    rgba(6, 12, 24, 0.32);
  border: 1px solid rgba(120, 247, 232, 0.38);
  border-radius: 99px;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28), 0 0 18px rgba(120, 247, 232, 0.14), inset 0 1px 0 rgba(188, 252, 255, 0.36), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
  transition: border-color 220ms ease, box-shadow 260ms ease;
}

.hud[data-hyper="1"] .hud-center {
  border-color: rgba(120, 247, 232, 0.72);
  box-shadow: 0 6px 26px rgba(0, 217, 200, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.hud[data-hyper="2"] .hud-center {
  border-color: rgba(255, 200, 61, 0.84);
  box-shadow: 0 6px 32px rgba(255, 200, 61, 0.34), inset 0 1px 0 rgba(255, 244, 190, 0.36);
}

.hud-sector {
  font-size: clamp(0.65rem, 1.5vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--tiffany);
  margin-block-end: 8px;
  white-space: nowrap;
}

.hud-progress {
  position: relative;
  inline-size: min(32vw, 280px);
  block-size: 5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
}

.hud-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg var(--in-oklab), var(--tiffany), var(--gold));
  box-shadow: 0 0 12px var(--tiffany);
}

.hud-progress i {
  position: absolute;
  top: -2px;
  inline-size: 1px;
  block-size: 9px;
  background: rgba(255, 255, 255, 0.35);
}

.hud-progress-goal {
  position: absolute;
  right: -12px;
  top: -4px;
  font-size: 9px;
  color: var(--gold);
}

.hud-right {
  top: max(54px, calc(12px + env(safe-area-inset-top, 0px) + 42px));
  right: max(14px, env(safe-area-inset-right, 0px));
  padding: 7px 11px 9px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(225deg var(--in-oklab), rgba(10, 22, 42, 0.42), rgba(5, 11, 22, 0.24));
  border: 1px solid rgba(120, 247, 232, 0.42);
  border-right: 3px solid var(--tiffany);
  border-radius: 8px;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(120, 247, 232, 0.14), inset 0 1px 0 rgba(188, 252, 255, 0.36), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
  transition: border-color 220ms ease, box-shadow 260ms ease;
}

.hud[data-hyper="1"] .hud-right {
  border-color: rgba(120, 247, 232, 0.78);
  border-right-color: var(--gold);
  box-shadow: 0 8px 28px rgba(0, 217, 200, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.hud[data-hyper="2"] .hud-right {
  border-color: rgba(255, 200, 61, 0.85);
  border-right-color: var(--gold-light);
  box-shadow: 0 8px 34px rgba(255, 200, 61, 0.34), inset 0 1px 0 rgba(255, 244, 190, 0.36);
}

.hud-shields {
  display: flex;
  gap: 5px;
}

html[data-craft="solaris"] .hud-left {
  border-left-color: var(--gold);
}

html[data-craft="solaris"] .hud-right {
  border-right-color: var(--gold);
}

html[data-craft="solaris"] .btn-start {
  border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 0 26px rgba(255, 200, 61, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

html[data-craft="solaris"] .roll-fab {
  border-color: rgba(255, 200, 61, 0.56);
  color: var(--gold-light);
}

html[data-craft="solaris"] .roll-ring-progress {
  stroke: var(--gold);
}

html[data-craft="phantom"] .hud-left {
  border-left-color: var(--violet);
}

html[data-craft="phantom"] .hud-right {
  border-right-color: var(--violet);
}

html[data-craft="phantom"] .btn-start {
  border-color: var(--violet);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), 0 0 26px rgba(183, 136, 255, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

html[data-craft="phantom"] .roll-fab {
  border-color: rgba(183, 136, 255, 0.58);
  color: #dcc2ff;
}

html[data-craft="phantom"] .roll-ring-progress {
  stroke: var(--violet);
}

@media (prefers-reduced-motion: no-preference) {
  .hud:not([hidden]) .hud-left {
    animation: hud-in-left 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hud:not([hidden]) .hud-right {
    animation: hud-in-right 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hud:not([hidden]) .hud-center {
    animation: hud-in-center 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hud:not([hidden]) .roll-fab {
    animation: hud-in-right 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes hud-in-left {
  from { opacity: 0; transform: translate3d(-16px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes hud-in-right {
  from { opacity: 0; transform: translate3d(16px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes hud-in-center {
  from { opacity: 0; transform: translate3d(-50%, -10px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

@keyframes hud-in-bottom {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (max-width: 600px) {
  .hud:not([hidden]) .hud-center {
    animation-name: hud-in-bottom;
  }
}

.shield-cell {
  inline-size: 18px;
  block-size: 8px;
  transform: skewX(-18deg);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.shield-cell.on {
  background: linear-gradient(135deg var(--in-oklab), var(--tiffany), #fff);
  border-color: var(--tiffany);
  box-shadow: 0 0 10px var(--tiffany);
}

/* モバイル＆タクティカル「ROLL」ボタン（画面右下） */
.roll-fab {
  pointer-events: auto;
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  inline-size: 78px;
  block-size: 78px;
  border-radius: 50%;
  border: 1px solid rgba(120, 247, 232, 0.5);
  background: radial-gradient(circle at center, rgba(20, 48, 72, 0.34), rgba(6, 12, 26, 0.24));
  color: var(--tiffany);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.34), 0 0 22px rgba(120, 247, 232, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.roll-fab:hover {
  border-color: var(--gold);
  box-shadow: 0 0 28px rgba(120, 247, 232, 0.5);
}

.roll-fab:active {
  transform: scale(0.92);
}

.roll-fab.cooling {
  opacity: 0.72;
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.2);
}

.roll-ring {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  transform: rotate(-90deg);
}

.roll-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 3;
}

.roll-ring-progress {
  fill: none;
  stroke: var(--tiffany);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 175.93;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 50ms linear;
}

.roll-fab-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.roll-icon {
  font-size: 1.35rem;
}

.roll-text {
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

/* ---------- 地区バナー・通知トースト ---------- */
.banner {
  position: fixed;
  left: 50%;
  top: max(188px, 26dvh);
  transform: translate(-50%, -50%) scale(0.96);
  text-align: center;
  pointer-events: none;
  font-family: var(--font-heading);
  opacity: 0;
  z-index: 25;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.banner small {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.42em;
  color: rgba(226, 240, 255, 0.92);
  text-shadow: 0 2px 12px rgba(2, 5, 14, 0.96);
}

.banner strong {
  display: block;
  font-size: clamp(1.75rem, 6vw, 3.6rem);
  letter-spacing: 0.12em;
  color: var(--banner-color, var(--tiffany));
  text-shadow: 0 4px 24px rgba(2, 4, 12, 0.94), 0 0 28px var(--banner-color, var(--tiffany));
}

.banner span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(246, 250, 255, 0.96);
  text-shadow: 0 2px 14px rgba(2, 5, 14, 0.98), 0 0 10px rgba(2, 5, 14, 0.9);
  margin-block-start: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(56px, calc(38px + env(safe-area-inset-bottom, 0px)));
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border: 1px solid rgba(255, 200, 61, 0.7);
  border-radius: 99px;
  background: rgba(7, 13, 26, 0.86);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  max-inline-size: min(92vw, 480px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 200, 61, 0.25);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: translate(-50%, 0);
  }
}

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

/* ---------- オーバーレイスクリーン共通 ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 0.95dvh, 12px);
  padding: max(clamp(8px, 1.4dvh, 14px), env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(clamp(8px, 1.4dvh, 14px), env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  text-align: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(4, 10, 22, 0.02) 0%, rgba(3, 7, 16, 0.22) 70%, rgba(2, 5, 12, 0.36) 100%);
  z-index: 15;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
}

.screen-title {
  background: linear-gradient(180deg, rgba(2, 5, 14, 0.34) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 72%, rgba(2, 5, 14, 0.42) 100%);
}

.title-top-cluster {
  inline-size: 100%;
  max-inline-size: 1040px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.title-bottom-dock {
  inline-size: 100%;
  max-inline-size: 1040px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.8dvh, 8px);
  margin-block-start: auto;
}

.title-selectors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  inline-size: 100%;
}

.title-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
}

.kicker {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--tiffany);
}

.screen-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 700;
  text-wrap: balance;
}

/* ---------- タイトル画面（近未来ハンガーUI） ---------- */
.title-topbar {
  inline-size: 100%;
  max-inline-size: 1040px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-inline-end: 86px; /* 右上サウンドボタンと重ならない余白 */
}

.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  backdrop-filter: blur(7px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(188, 252, 255, 0.34), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--tiffany);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.9);
}

.sys-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--tiffany);
  box-shadow: 0 0 10px var(--tiffany), 0 0 16px rgba(120, 247, 232, 0.7);
}

@media (prefers-reduced-motion: no-preference) {
  .sys-dot {
    animation: sys-pulse 1.8s ease-in-out infinite alternate;
  }
}

@keyframes sys-pulse {
  from { opacity: 0.72; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.16); }
}

.best-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 200, 61, 0.14);
  border: 1px solid rgba(255, 200, 61, 0.46);
  border-radius: 8px;
  backdrop-filter: blur(7px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 238, 175, 0.36), inset 0 -1px 0 rgba(255, 200, 61, 0.16);
  font-family: var(--font-heading);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.9);
}

.best-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.best-val {
  font-size: 0.95rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.title-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-block: 0;
  padding: 2px 12px;
  background: none;
}

.title-hero::after {
  content: "";
  display: block;
  inline-size: min(260px, 66vw);
  block-size: 1px;
  margin-block-start: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(120, 247, 232, 0.72) 28%, rgba(255, 212, 118, 0.92) 50%, rgba(120, 247, 232, 0.72) 72%, transparent 100%);
  box-shadow: 0 0 12px rgba(120, 247, 232, 0.65);
}

.title-emblem {
  display: none;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.24em;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 0.94;
  font-size: clamp(1.55rem, min(4.8vw, 5.2dvh), 2.85rem);
  letter-spacing: 0.06em;
  text-wrap: balance;
}

.logo span {
  display: inline;
}

.title-hero .kicker {
  font-size: clamp(0.58rem, 1.2dvh, 0.68rem);
  letter-spacing: 0.34em;
  text-shadow: 0 2px 12px rgba(2, 6, 16, 0.98), 0 0 20px rgba(2, 6, 16, 0.88);
}

.logo-neo {
  color: var(--gold);
  text-shadow: 0 4px 20px rgba(2, 6, 16, 0.85), 0 0 34px rgba(255, 200, 61, 0.58);
}

.logo-sky {
  background: linear-gradient(180deg var(--in-oklab), #ffffff 12%, var(--tiffany) 60%, var(--tiffany-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 16px rgba(2, 6, 16, 0.88)) drop-shadow(0 0 24px rgba(120, 247, 232, 0.52));
}

.tagline {
  max-inline-size: 46ch;
  font-size: clamp(0.7rem, 1.45dvh, 0.88rem);
  line-height: 1.3;
  color: var(--text);
  text-wrap: pretty;
  text-shadow: 0 2px 12px rgba(2, 6, 16, 0.98), 0 0 20px rgba(2, 6, 16, 0.9);
}

.tagline em {
  font-style: normal;
  font-weight: 700;
  color: var(--gold-light);
}

/* 3機種セレクトカード */
.craft-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  inline-size: min(640px, 100%);
}

.craft-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(180, 245, 255, 0.3);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.025) 0 1px, transparent 1px 4px),
    rgba(7, 15, 30, 0.44);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(188, 252, 255, 0.38), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease-out, box-shadow 220ms ease-out, background 220ms ease-out;
}

.craft-card:hover {
  border-color: rgba(120, 247, 232, 0.62);
  transform: translateY(-2px);
}

.craft-card.active {
  border-color: var(--tiffany);
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.04) 0 1px, transparent 1px 4px),
    linear-gradient(135deg var(--in-oklab), rgba(120, 247, 232, 0.24), rgba(8, 18, 34, 0.26));
  box-shadow: 0 0 22px rgba(120, 247, 232, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(120, 247, 232, 0.2), inset 0 0 14px rgba(120, 247, 232, 0.14);
}

.craft-card[data-craft="solaris"].active {
  border-color: var(--gold);
  background:
    repeating-linear-gradient(0deg, rgba(255, 200, 61, 0.04) 0 1px, transparent 1px 4px),
    linear-gradient(135deg var(--in-oklab), rgba(255, 200, 61, 0.24), rgba(8, 18, 34, 0.26));
  box-shadow: 0 0 22px rgba(255, 200, 61, 0.28), inset 0 1px 0 rgba(255, 240, 180, 0.34), inset 0 -1px 0 rgba(255, 200, 61, 0.2);
}

.craft-card[data-craft="phantom"].active {
  border-color: var(--violet);
  background:
    repeating-linear-gradient(0deg, rgba(183, 136, 255, 0.04) 0 1px, transparent 1px 4px),
    linear-gradient(135deg var(--in-oklab), rgba(183, 136, 255, 0.26), rgba(8, 18, 34, 0.26));
  box-shadow: 0 0 22px rgba(183, 136, 255, 0.3), inset 0 1px 0 rgba(235, 215, 255, 0.34), inset 0 -1px 0 rgba(183, 136, 255, 0.22);
}

.craft-swatch {
  flex-shrink: 0;
  inline-size: 8px;
  block-size: 24px;
  border-radius: 3px;
  background: var(--swatch);
  box-shadow: 0 0 10px var(--swatch);
}

.craft-meta {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.craft-meta strong {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
}

.craft-meta small {
  font-size: 0.68rem;
  color: #d2deec;
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.92);
}

/* BGM・サウンドスタイル選択ピル（タイトル画面） */
.bgm-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  inline-size: min(640px, 100%);
  padding: 6px 10px;
  border: 1px solid rgba(120, 247, 232, 0.36);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(120, 247, 232, 0.025) 0 1px, transparent 1px 4px),
    rgba(7, 15, 30, 0.44);
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(188, 252, 255, 0.36), inset 0 -1px 0 rgba(120, 247, 232, 0.14);
}

.bgm-heading {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
}

.bgm-pills,
.remix-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.bgm-pill,
.remix-pill {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  background: rgba(12, 24, 44, 0.2);
  color: #dae4ef;
  font-family: var(--font-heading);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.92);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.2s ease;
}

.bgm-pill:hover,
.remix-pill:hover {
  border-color: rgba(120, 247, 232, 0.62);
  color: #ffffff;
  transform: translateY(-1px);
}

.bgm-pill.active,
.remix-pill.active {
  border-color: var(--gold);
  background: rgba(255, 200, 61, 0.24);
  color: var(--gold-light);
  box-shadow: 0 0 14px rgba(255, 200, 61, 0.32), inset 0 1px 0 rgba(255, 242, 185, 0.3);
}

/* 出撃メインボタン */
.title-launch {
  display: flex;
  justify-content: center;
  inline-size: 100%;
}

.title-launch .btn-start {
  padding: clamp(6px, 1.1dvh, 10px) clamp(22px, 5vw, 34px);
}

.btn-start {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-inline-size: min(290px, 84vw);
  padding: clamp(8px, 1.45dvh, 13px) clamp(22px, 5vw, 36px);
  border: 1px solid var(--tiffany);
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(135deg var(--in-oklab), rgba(0, 217, 200, 0.36), rgba(255, 200, 61, 0.24));
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2.1dvh, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(1.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36), 0 0 28px rgba(120, 247, 232, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.48), inset 0 0 18px rgba(120, 247, 232, 0.18);
  text-shadow: 0 1px 10px rgba(2, 6, 14, 0.88);
}

.btn-start-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-start small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--tiffany);
}

.btn-start:hover {
  transform: translateY(-2px);
  border-color: var(--gold-light);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 32px rgba(120, 247, 232, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.28) 50%, transparent 75%);
    transform: translateX(-120%);
    animation: btn-sweep 3.6s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes btn-sweep {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 170px;
  padding: 11px 20px;
  border: 1px solid rgba(180, 235, 255, 0.34);
  border-radius: 6px;
  background: rgba(10, 20, 38, 0.24);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(7px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.9);
}

.btn-ghost:hover {
  border-color: var(--tiffany);
  color: var(--tiffany);
  background: rgba(120, 247, 232, 0.12);
}

.howto {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(3px, 0.7dvh, 6px) clamp(8px, 1.8vw, 14px);
  padding: clamp(4px, 0.75dvh, 6px) clamp(8px, 1.6vw, 12px);
  border-radius: 8px;
  background: rgba(6, 13, 26, 0.36);
  border: 1px solid rgba(120, 247, 232, 0.24);
  backdrop-filter: blur(6px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
  font-size: clamp(0.66rem, 1.35dvh, 0.74rem);
}

.howto li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.howto-key {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(120, 247, 232, 0.14);
  border: 1px solid rgba(120, 247, 232, 0.35);
  color: var(--tiffany);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.howto-desc {
  color: #d3dfec;
}

.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .pc-only { display: none; }
  .touch-only { display: inline; }
}

.credit {
  margin-block: 0;
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(4, 10, 22, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  font-family: var(--font-heading);
  font-size: clamp(0.66rem, 1.4dvh, 0.74rem);
  letter-spacing: 0.1em;
  color: #dce6f2;
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.95);
}

.credit a {
  color: var(--gold);
  text-decoration: none;
  margin-inline-start: 4px;
}

.credit a:hover {
  text-decoration: underline;
}

/* ---------- 一時停止モーダル ---------- */
.screen-pause {
  justify-content: center;
  background: rgba(3, 7, 16, 0.28);
  backdrop-filter: blur(3px) saturate(1.15);
}

.dialog-frame {
  inline-size: min(440px, 100%);
  max-block-size: calc(100dvh - 16px);
  padding: clamp(14px, 2.8dvh, 28px) clamp(16px, 4vw, 24px);
  background: linear-gradient(165deg, rgba(16, 32, 58, 0.4), rgba(7, 14, 28, 0.34));
  border: 1px solid rgba(120, 247, 232, 0.42);
  border-radius: 12px;
  backdrop-filter: blur(10px) saturate(1.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.46), 0 0 30px rgba(120, 247, 232, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 8px rgba(2, 6, 14, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6dvh, 14px);
  overflow: hidden;
  overflow: clip;
}

.pause-hint {
  font-size: 0.86rem;
  color: var(--text-dim);
  text-wrap: pretty;
}

.pause-bgm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  inline-size: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(120, 247, 232, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pause-bgm-label {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.pause-bgm-label strong {
  color: var(--gold-light);
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: 100%;
  align-items: center;
}

.pause-actions .btn-start,
.pause-actions .btn-ghost {
  inline-size: 100%;
}

/* ---------- 結果画面（ゼロスクロール・エキシビションショーケース） ---------- */
.screen-result {
  justify-content: flex-start;
  gap: 0;
  padding: max(clamp(6px, 1.1dvh, 10px), env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(clamp(6px, 1.1dvh, 10px), env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: radial-gradient(ellipse at 50% 24%, rgba(6, 16, 34, 0.14) 0%, rgba(3, 8, 18, 0.24) 68%, rgba(2, 4, 10, 0.36) 100%);
  backdrop-filter: blur(2.5px) saturate(1.22);
}

.result-container {
  container: result / inline-size;
  inline-size: min(980px, 100%);
  flex: 1 1 0;
  min-block-size: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.85dvh, 10px);
}

.result-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.7dvh, 6px);
  inline-size: 100%;
}

.result-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
  padding-inline-end: 74px; /* 右上サウンドボタンと衝突しない余白を確保 */
}

.rank-badge {
  position: relative;
  flex: 0 0 auto;
  inline-size: clamp(42px, 5.8dvh, 58px);
  block-size: clamp(42px, 5.8dvh, 58px);
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 16px rgba(255, 200, 61, 0.45));
}

@media (prefers-reduced-motion: no-preference) {
  .rank-badge {
    animation: rank-aura 2.8s ease-in-out infinite alternate;
  }
  @keyframes rank-aura {
    from { filter: drop-shadow(0 0 14px rgba(255, 200, 61, 0.42)); transform: scale(1); }
    to { filter: drop-shadow(0 0 24px rgba(120, 247, 232, 0.62)); transform: scale(1.035); }
  }
}

.rank-hex {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

.result-rank {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.5dvh, 1.85rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 14px var(--gold);
}

.result-score-block {
  min-inline-size: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.result-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-inline-size: 0;
}

.result-top-bar .kicker {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  line-height: 1.2;
  text-shadow: 0 1px 10px rgba(2, 6, 16, 0.92);
}

.result-craft-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(6, 16, 30, 0.72);
  border: 1px solid rgba(120, 247, 232, 0.34);
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--tiffany);
}

.result-score-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-inline-size: 0;
}

.result-score {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3.3dvh, 2.15rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(2, 6, 16, 0.92);
}

.result-score small {
  font-size: 0.68rem;
  margin-inline-start: 4px;
  color: rgba(218, 232, 248, 0.88);
  letter-spacing: 0.16em;
  text-shadow: 0 1px 8px rgba(2, 6, 16, 0.92);
}

.result-best {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: var(--gold-light);
  text-shadow: 0 1px 10px rgba(2, 6, 16, 0.92);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  inline-size: 100%;
}

.stat-box {
  padding: clamp(3px, 0.55dvh, 5px) 4px;
  background: linear-gradient(180deg, rgba(12, 24, 48, 0.3), rgba(6, 13, 28, 0.34));
  border: 1px solid rgba(120, 247, 232, 0.32);
  border-radius: 8px;
  backdrop-filter: blur(7px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.92);
}

.stat-box dt {
  font-family: var(--font-heading);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  color: var(--text-dim);
}

.stat-box dd {
  font-family: var(--font-heading);
  font-size: clamp(0.88rem, 1.8dvh, 1.08rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-block-start: 2px;
}

/* 狭幅画面用の表示切替タブ */
.result-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  background: rgba(8, 16, 32, 0.24);
  border: 1px solid rgba(120, 247, 232, 0.32);
  border-radius: 10px;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.result-tab {
  position: relative;
  min-block-size: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.result-tab:hover {
  color: #ffffff;
}

.result-tab[aria-selected="true"] {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(120, 247, 232, 0.18), rgba(255, 200, 61, 0.16));
}

.result-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 18%;
  inset-block-end: 2px;
  border-block-end: 2px solid var(--gold);
}

.result-showcase {
  flex: 1 1 0;
  min-block-size: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(4px, 0.8dvh, 10px);
  align-items: stretch;
}

.result-showcase > * {
  min-inline-size: 0;
}

.result-container[data-result-tab="art"] .result-panel-music {
  display: none;
}

.result-container[data-result-tab="music"] .result-panel-art {
  display: none;
}

.result-panel-art {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
}

.result-panel-music {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-block-size: 0;
  overflow: hidden;
  overflow: clip;
}

.result-actions-dock {
  grid-row: 2;
  align-self: end;
}

@container result (inline-size > 44rem) {
  .result-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-inline-end: 78px;
  }

  .result-top-bar {
    padding-inline-end: 0;
    flex: 1 1 auto;
  }

  .result-stats {
    flex: 0 1 400px;
  }

  .result-tabs {
    display: none;
  }

  .result-showcase {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "art music"
      "art actions";
    gap: clamp(10px, 1.6dvh, 16px);
  }

  .result-container[data-result-tab] .result-panel-art {
    display: flex;
    grid-area: art;
  }

  .result-container[data-result-tab] .result-panel-music {
    display: flex;
    grid-area: music;
    justify-content: flex-start;
  }

  .result-container[data-result-tab] .track-card {
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 10px;
  }

  .result-container[data-result-tab] .track-bars {
    flex: 1 1 68px;
    min-block-size: 64px;
    max-block-size: 132px;
  }

  .result-actions-dock {
    grid-area: actions;
  }
}

.glass-card {
  min-inline-size: 0;
  padding: clamp(10px, 1.5dvh, 16px) clamp(12px, 1.8vw, 18px);
  background: linear-gradient(165deg, rgba(12, 26, 50, 0.34), rgba(6, 13, 28, 0.36));
  border: 1px solid rgba(120, 247, 232, 0.36);
  border-radius: 12px;
  backdrop-filter: blur(8px) saturate(1.25);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-shadow: 0 1px 6px rgba(2, 6, 14, 0.92);
  text-align: left;
  overflow-wrap: anywhere;
  contain: layout style paint;
}

.card-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-block-end: 2px;
}

.card-tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  white-space: nowrap;
  color: var(--gold);
}

.card-id {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--tiffany);
}

.card-desc {
  flex: 0 0 auto;
  font-size: 0.72rem;
  line-height: 1.38;
  color: var(--text-dim);
  margin-block-end: 6px;
  text-wrap: pretty;
}

.poster-card .card-desc {
  margin-block-end: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nowrap {
  white-space: nowrap;
}

/* アートポスター生成カード */
.poster-card {
  gap: clamp(5px, 0.8dvh, 8px);
  border-color: rgba(255, 212, 118, 0.38);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.65), 0 0 30px rgba(255, 200, 61, 0.14), inset 0 1px 0 rgba(255, 236, 178, 0.22);
}

.poster-preview-wrap {
  flex: 1 1 0;
  min-block-size: 0;
  min-inline-size: 0;
  inline-size: 100%;
  margin: 0;
  padding: 3px;
  container-type: size;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}

#posterCanvas {
  display: block;
  inline-size: min(calc(100cqw - 6px), calc((100cqh - 6px) * 2 / 3));
  block-size: min(calc(100cqh - 6px), calc((100cqw - 6px) * 3 / 2));
  aspect-ratio: 2 / 3;
  border: 1.5px solid rgba(255, 224, 150, 0.46);
  border-radius: 8px;
  background: #040710;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.76), 0 0 24px rgba(120, 247, 232, 0.2);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, border-color 220ms ease;
}

.poster-preview-wrap:hover #posterCanvas {
  transform: translateY(-3px) scale(1.012);
  border-color: rgba(255, 200, 61, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.88), 0 0 34px rgba(255, 200, 61, 0.28);
}

.art-guide {
  list-style: none;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-block-end: 0;
  padding: 5px 8px;
  border: 1px solid rgba(120, 247, 232, 0.28);
  border-radius: 8px;
  background: rgba(6, 14, 28, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.art-guide li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-inline-size: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #dbe6f4;
}

.art-guide strong {
  color: #ffffff;
  font-weight: 700;
}

.guide-dot {
  flex: 0 0 auto;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
}

.guide-path {
  background: linear-gradient(135deg, #78f7e8, #ffc83d);
  box-shadow: 0 0 10px rgba(120, 247, 232, 0.85);
}

.guide-music {
  background: linear-gradient(135deg, #ff7a59, #c48cff);
  box-shadow: 0 0 10px rgba(196, 140, 255, 0.85);
}

.guide-roll {
  border: 2px solid #ffc83d;
  background: rgba(255, 200, 61, 0.16);
  box-shadow: 0 0 10px rgba(255, 200, 61, 0.7);
}

.poster-actions-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.btn-zoom-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-block-size: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(120, 247, 232, 0.45);
  border-radius: 6px;
  background: rgba(120, 247, 232, 0.12);
  color: #e4fdf9;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.btn-zoom-art:hover {
  background: rgba(120, 247, 232, 0.22);
}

.btn-download-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  inline-size: 100%;
  min-block-size: 38px;
  padding: 8px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: linear-gradient(135deg var(--in-oklab), rgba(255, 200, 61, 0.28), rgba(120, 247, 232, 0.24));
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 200, 61, 0.26);
}

.btn-download-art:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

/* ---------- 拡大アート鑑賞ネイティブモーダル ---------- */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(2, 4, 10, 0.88);
  backdrop-filter: blur(8px);
}

.art-lightbox {
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 200, 61, 0.48);
  border-radius: 14px;
  background: #080d18;
  color: var(--text);
  inline-size: min(94vw, 520px);
  max-block-size: 92dvh;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.92), 0 0 42px rgba(120, 247, 232, 0.18);
  overflow: hidden;
  overflow: clip;
}

.art-lightbox[open] {
  display: flex;
  flex-direction: column;
}

.art-lightbox-inner {
  flex: 1 1 auto;
  min-block-size: 0;
  max-block-size: calc(92dvh - 2px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1dvh, 12px);
  padding: clamp(10px, 1.8dvh, 16px) clamp(12px, 2.5vw, 16px);
}

.art-lightbox-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.art-lightbox-meta {
  min-inline-size: 0;
}

.art-lightbox-kicker {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.art-lightbox-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-lightbox-close {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.btn-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.art-lightbox-figure {
  flex: 0 1 auto;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.8dvh, 8px);
  overflow: hidden;
}

.art-lightbox-figure img {
  flex: 0 1 auto;
  min-block-size: 0;
  display: block;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: min(64dvh, calc(92dvh - 190px));
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 6px;
}

.art-lightbox-caption {
  flex: 0 0 auto;
  font-size: clamp(0.68rem, 1.4dvh, 0.78rem);
  line-height: 1.3;
  color: var(--text-dim);
  text-align: center;
}

.art-lightbox-foot {
  flex: 0 0 auto;
  display: flex;
}

.result-music-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(5px, 1dvh, 12px);
}

.track-card {
  flex: 1 1 0;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(3px, 0.7dvh, 6px);
}

.track-card .card-desc {
  margin-block-end: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.track-style-bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.6dvh, 6px);
  margin-block-end: 0;
  padding: clamp(5px, 0.9dvh, 8px) 10px;
  border: 1px solid rgba(120, 247, 232, 0.28);
  border-radius: 8px;
  background: rgba(6, 14, 28, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.track-style-badge {
  font-family: var(--font-heading);
  font-size: clamp(0.62rem, 1.35dvh, 0.7rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
}

.track-style-bar .remix-pills {
  justify-content: flex-start;
}

.track-notes {
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-size: clamp(0.62rem, 1.35dvh, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.25;
  color: var(--tiffany);
  margin-block-end: 0;
}

.track-notes:not([hidden]) {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.track-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1 1 20px;
  min-block-size: 20px;
  max-block-size: clamp(28px, 5.2dvh, 48px);
  margin-block-end: 2px;
}

.track-bars i {
  flex: 1;
  min-inline-size: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(0deg, rgba(120, 247, 232, 0.25), rgba(120, 247, 232, 0.78));
  transform-origin: bottom;
  transition: transform 0.14s ease, background 0.14s ease;
}

.track-bars span {
  flex: 1;
  min-inline-size: 2px;
  border-radius: 2px 2px 0 0;
  background: rgba(120, 247, 232, 0.14);
}

.track-bars i.gold {
  background: linear-gradient(0deg, rgba(255, 200, 61, 0.3), rgba(255, 200, 61, 0.85));
}

.track-bars i.on {
  background: linear-gradient(180deg, #ffffff, var(--tiffany));
  transform: scaleY(1.22);
  box-shadow: 0 0 12px var(--tiffany), 0 -4px 14px rgba(255, 200, 61, 0.55);
}

.btn-track {
  flex: 0 0 auto;
  inline-size: 100%;
  min-block-size: clamp(34px, 5dvh, 38px);
  padding: clamp(6px, 1dvh, 9px) 14px;
  border: 1px solid rgba(120, 247, 232, 0.55);
  border-radius: 6px;
  background: rgba(120, 247, 232, 0.12);
  color: var(--tiffany);
  font-weight: 700;
  font-size: clamp(0.76rem, 1.55dvh, 0.84rem);
  cursor: pointer;
}

.btn-track[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(255, 200, 61, 0.22);
  color: var(--gold-light);
  box-shadow: 0 0 18px rgba(255, 200, 61, 0.28);
}

.btn-track:hover:not(:disabled) {
  background: rgba(120, 247, 232, 0.24);
}

.btn-track:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.7dvh, 6px);
}

.result-actions .btn-start {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: clamp(36px, 5.2dvh, 40px);
  padding: clamp(6px, 1.1dvh, 10px) 14px;
  flex-direction: row;
  font-size: clamp(0.84rem, 1.8dvh, 0.92rem);
  letter-spacing: 0.12em;
}

.result-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-sub-actions .btn-ghost {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: clamp(32px, 4.6dvh, 36px);
  padding: clamp(5px, 0.85dvh, 8px) 10px;
  font-size: clamp(0.72rem, 1.5dvh, 0.78rem);
}

.result-cta {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 0.8dvh, 8px) 10px;
  padding: clamp(6px, 1.05dvh, 10px) clamp(10px, 2vw, 14px);
  text-align: left;
  font-size: clamp(0.7rem, 1.45dvh, 0.78rem);
  color: var(--text-dim);
}

.result-cta strong {
  color: var(--gold);
}

.result-cta-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-block-start: 0;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: clamp(30px, 4.4dvh, 34px);
  padding: 5px 12px;
  border-radius: 6px;
  background: linear-gradient(135deg var(--in-oklab), var(--tiffany), var(--gold));
  color: #05110f;
  font-weight: 700;
  font-size: clamp(0.72rem, 1.45dvh, 0.78rem);
  text-decoration: none;
  box-shadow: 0 0 18px rgba(120, 247, 232, 0.3);
}

.btn-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-link {
  color: var(--tiffany);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

/* ---------- スマホ・極小縦長・高コントラスト調整 ---------- */
@media (max-width: 600px) {
  .title-topbar { padding-inline-end: 84px; min-block-size: 40px; gap: 4px; flex-wrap: nowrap; justify-content: flex-start; }
  .sys-badge { padding: 3px 5px; gap: 4px; font-size: 0.5rem; letter-spacing: 0.03em; white-space: nowrap; }
  .best-pill { padding: 3px 5px; gap: 3px; white-space: nowrap; }
  .best-label { font-size: 0.48rem; letter-spacing: 0.03em; }
  .best-val { font-size: 0.68rem; }
  .title-top-cluster { gap: 4px; }
  .title-hero { padding: 2px 4px; gap: 1px; }
  .title-hero .kicker { font-size: 0.54rem; letter-spacing: 0.16em; }
  .tagline { font-size: clamp(0.58rem, 2.55vw, 0.7rem); line-height: 1.24; white-space: nowrap; }
  .title-bottom-dock { gap: 4px; }
  .title-selectors { gap: 4px; }
  .title-foot { gap: 4px 8px; inline-size: 100%; }
  .craft-selector { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .craft-card { flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 7px; }
  .craft-swatch { inline-size: 100%; block-size: 3px; border-radius: 99px; }
  .craft-meta strong { font-size: clamp(0.62rem, 2.7vw, 0.74rem); letter-spacing: 0.02em; white-space: nowrap; }
  .craft-meta small { font-size: 0.58rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 100%; }
  .bgm-selector { padding: 5px 7px; gap: 4px 5px; }
  .bgm-heading { font-size: 0.62rem; letter-spacing: 0.08em; }
  .bgm-pills, .remix-pills { gap: 4px; }
  .bgm-pill, .remix-pill { padding: 3px 6px; font-size: 0.59rem; letter-spacing: 0.02em; white-space: nowrap; }
  .howto { font-size: 0.65rem; line-height: 1.25; gap: 4px 8px; padding: 6px 8px; inline-size: 100%; }
  .howto-key { font-size: 0.6rem; padding: 1px 5px; }
  .hud-left {
    left: max(10px, env(safe-area-inset-left, 0px));
    padding: 6px 10px 8px;
    min-inline-size: clamp(118px, 34dvw, 180px);
    max-inline-size: calc(100dvw - 186px);
  }
  .hud-center {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    transform: none;
    text-align: left;
    padding: 6px 10px;
    max-inline-size: calc(100dvw - 108px);
  }
  .hud-progress { inline-size: min(44dvw, 165px); max-inline-size: 100%; }
  .banner {
    top: max(174px, 28dvh);
    max-inline-size: calc(100dvw - 24px);
  }
  .toast {
    bottom: max(124px, calc(106px + env(safe-area-inset-bottom, 0px)));
    inline-size: max-content;
    max-inline-size: min(90dvw, 320px);
    border-radius: 14px;
    font-size: 0.7rem;
    line-height: 1.45;
    padding: 7px 14px;
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }
}

/* 極小・サイドパネル幅（<=440px）でも上部HUD・下部バー・ROLLボタンが絶対に重ならない設計 */
@media (max-width: 440px) {
  .corner-buttons {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    gap: 6px;
  }
  .corner-buttons #btnPause {
    padding-inline: 10px;
    min-inline-size: max(var(--target-size, 44px), 38px);
    justify-content: center;
  }
  .corner-buttons #btnPause .btn-label {
    display: none;
  }
  .hud-left {
    max-inline-size: calc(100dvw - 142px);
  }
  .hud-center {
    max-inline-size: calc(100dvw - 98px);
    padding: 5px 9px;
  }
  .hud-center .hud-sector {
    font-size: 0.61rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .roll-fab {
    inline-size: 66px;
    block-size: 66px;
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }
}

/* タイポグラフィの自動バランス調整（孤立行防止・WCAG / MWG準拠） */
h1, h2, h3 {
  text-wrap: balance;
}
p, li {
  text-wrap: pretty;
}

@media (min-width: 860px) and (min-height: 540px) {
  .title-selectors {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
  }
  .title-selectors .craft-selector {
    flex: 1 1 0;
    inline-size: auto;
    max-inline-size: 495px;
  }
  .title-selectors .bgm-selector {
    flex: 0 1 auto;
    inline-size: auto;
    max-inline-size: 535px;
  }
}

@media (max-height: 680px) {
  .title-hero { margin-block: 0; gap: 1px; padding: 1px 10px; }
  .title-bottom-dock { gap: 4px; }
  .title-foot { gap: 4px 8px; }
  .credit { margin-block: 0; }
  .craft-card { padding-block: 5px; }
  .bgm-selector { padding: 4px 8px; }
  .howto { padding: 4px 8px; gap: 3px 8px; }
  .btn-start { padding-block: 7px; }
  .btn-start small { font-size: 0.64rem; }
}

@media (max-height: 540px) {
  .screen { gap: 4px; padding-block: 6px; }
  .title-emblem { display: none; }
  .tagline { font-size: 0.74rem; line-height: 1.28; }
  .btn-start small { display: none; }
  .howto { padding: 4px 8px; gap: 3px 8px; font-size: 0.62rem; }
  .result-header { gap: 3px; }
  .result-stats { gap: 4px; }
  .poster-card, .track-card { padding: 6px 10px; }
  .card-desc { display: none; }
}

/* ---------- モバイル・タッチ端末のガラス合成軽量化（品質維持＆省電力60fps） ---------- */
@media (max-width: 768px), (pointer: coarse) {
  .icon-btn,
  .hud-left,
  .hud-center,
  .hud-right,
  .hud-shields,
  .sys-badge,
  .best-pill,
  .craft-card,
  .bgm-selector,
  .howto,
  .glass-card,
  .stat-box,
  .result-tabs {
    backdrop-filter: blur(4px) saturate(1.18);
  }
}

/* ---------- 高コントラスト環境設定 (prefers-contrast: more) 対応 ---------- */
@media (prefers-contrast: more) {
  :root {
    --surface: rgba(5, 10, 22, 0.84);
    --surface-strong: rgba(4, 8, 18, 0.94);
    --text-dim: #e2ebf5;
    --border-subtle: rgba(120, 247, 232, 0.72);
  }

  .screen {
    background: radial-gradient(ellipse at 50% 42%, rgba(3, 6, 14, 0.36) 0%, rgba(2, 4, 10, 0.8) 100%);
  }

  .screen-result,
  .screen-pause {
    background: rgba(3, 6, 14, 0.82);
  }

  .icon-btn,
  .hud-left,
  .hud-center,
  .hud-shields,
  .craft-card,
  .bgm-selector,
  .howto,
  .btn-ghost,
  .stat-box,
  .result-tabs,
  .glass-card,
  .dialog-frame,
  .art-guide,
  .track-style-bar {
    background: rgba(5, 10, 22, 0.88);
    border-color: rgba(120, 247, 232, 0.72);
  }

  .craft-meta small,
  .howto-desc,
  .credit {
    color: #eef4fa;
  }
}

/* ---------- Forced Colors Mode（ハイコントラスト）対応 ---------- */
@media (forced-colors: active) {
  .craft-card, .glass-card, .stat-box, .result-tabs, .result-tab, .hud-left, .hud-center, .hud-shields, .btn-start, .btn-ghost, .btn-download-art, .btn-zoom-art, .btn-lightbox-close, .art-lightbox, .art-guide, .bgm-selector, .bgm-pill, .remix-pill, .pause-bgm, .track-style-bar, .btn-track, .roll-fab {
    border: 2px solid ButtonText;
    background: Canvas;
    color: CanvasText;
  }
  .craft-card.active {
    outline: 3px solid Highlight;
  }
  .result-tab[aria-selected="true"]::after {
    border-block-end: 3px solid Highlight;
  }
  .logo-sky {
    -webkit-background-clip: initial;
    background-clip: initial;
    color: CanvasText;
  }
}
