:root {
  --gold: #ffd166;
  --fist: #ffba6b;
  --speed: #7ce7ff;
  --giant: #74ffb0;
  --accent: #ffd166;
  --text: #f8fafc;
  --ui-font: "Noto Sans SC", "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif-font: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --num-font: "Anton", "Impact", sans-serif;
}

body[data-focus="fist"] { --accent: var(--fist); }
body[data-focus="speed"] { --accent: var(--speed); }
body[data-focus="giant"] { --accent: var(--giant); }

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: #0b1424;
  color: var(--text);
  font-family: var(--ui-font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#scene {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.modeFrame {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 40;
  background: #0b1424;
  display: block;
}
[hidden] { display: none !important; }

/* ==================== EXACT ORIGINAL INDIE TITLE SCREEN AESTHETIC ==================== */
#title {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(48px, 6.5vw, 104px);
  background: linear-gradient(
    90deg,
    rgba(5, 12, 26, 0) 0%,
    rgba(5, 12, 26, 0) 51.5%,
    rgba(5, 12, 26, 0.28) 64%,
    rgba(4, 10, 22, 0.50) 100%
  );
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), background 0.45s ease;
}

body[data-focus="fist"] #title,
body[data-focus="speed"] #title,
body[data-focus="giant"] #title {
  background: linear-gradient(
    90deg,
    rgba(5, 12, 26, 0) 0%,
    rgba(5, 12, 26, 0) 46%,
    rgba(5, 12, 26, 0.42) 63%,
    rgba(4, 10, 22, 0.68) 100%
  );
}

.tStage {
  width: clamp(320px, 35vw, 460px);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tTitle {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  font-family: var(--serif-font);
  font-weight: 900;
  font-size: clamp(54px, 5vw, 72px);
  line-height: 1.04;
  gap: clamp(18px, 1.9vw, 28px);
  color: #ffffff;
  text-shadow: 0 8px 30px rgba(3, 8, 20, 0.55);
}

.tSubLine {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.tSubLine .tLine {
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.62;
  transition: background 0.35s ease;
}
.tSubText {
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.46em;
  padding-left: 0.46em;
  color: rgba(248, 250, 252, 0.72);
}

.tMenu {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mDivider {
  width: 22px;
  height: 1px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.18);
}

.mItem {
  position: relative;
  appearance: none;
  border: 0;
  outline: none;
  margin: 0;
  padding: 9px 12px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--serif-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(241, 245, 249, 0.64);
  text-shadow: 0 2px 12px rgba(3, 8, 20, 0.58);
  transition: color 0.18s ease, opacity 0.2s ease;
}
.mHost {
  font-size: 20px;
  color: rgba(248, 250, 252, 0.80);
  text-decoration: none;
}
.mSub {
  font-size: 16px;
  color: rgba(241, 245, 249, 0.58);
}

.mItem::before,
.mItem::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--gold);
  opacity: 0;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, background 0.25s ease;
}
.mFist::before,
.mFist::after { background: var(--fist); }
.mSpeed::before,
.mSpeed::after { background: var(--speed); }
.mGiant::before,
.mGiant::after { background: var(--giant); }

.mItem .tLabel { padding-left: 0.28em; }

.mItem.is-active,
.mItem:not(:disabled):hover,
.mItem:focus-visible {
  color: #ffffff;
}
.mItem.is-active::before,
.mItem.is-active::after,
.mItem:not(:disabled):hover::before,
.mItem:not(:disabled):hover::after {
  width: 24px;
  opacity: 1;
}
.mItem:disabled {
  opacity: 0.35;
  cursor: default;
}

.mBadge {
  font-family: var(--num-font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.mSpeed .mBadge { color: var(--speed); }
.mGiant .mBadge { color: var(--giant); }

.tCaption {
  margin: 24px 0 0;
  min-height: 20px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(241, 245, 249, 0.66);
  text-shadow: 0 2px 10px rgba(3, 8, 20, 0.65);
  transition: opacity 0.25s ease;
}

.tLoad {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(248, 250, 252, 0.62);
  transition: opacity 0.35s ease;
}
.tLoad.ready { opacity: 0; pointer-events: none; }
.tLoad.error { color: #ff8593; letter-spacing: 0.06em; }
#startupProgress:not([hidden]) { display: block; width: 100%; max-width: 220px; height: 4px; margin: 0 auto 8px; accent-color: var(--gold); }

#launchFlash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 38% 55%, rgba(255, 255, 255, 0.96), rgba(14, 24, 48, 0.92));
  transition: opacity 0.34s ease;
}
#launchFlash.is-go { opacity: 1; }

/* Mobile landscape (360-440px height) & non-forced portrait support with Toy safe areas */
@media (max-height: 500px) and (orientation: landscape) {
  #title {
    padding-top: max(12px, var(--toy-safe-top, 0px));
    padding-bottom: max(12px, var(--toy-safe-bottom, 0px));
    padding-right: max(clamp(24px, 5vw, 64px), calc(var(--toy-safe-right, 0px) + 16px));
  }
  .tStage { width: clamp(240px, 40vw, 360px); }
  .tTitle { font-size: clamp(34px, 7.5vh, 48px); gap: 14px; }
  .tSubLine { margin-top: 8px; gap: 10px; }
  .tSubText { font-size: 9px; letter-spacing: 0.34em; }
  .tMenu { margin-top: 16px; gap: 2px; }
  .mDivider { margin: 4px 0; }
  .mItem { padding: 5px 10px; font-size: 15px; }
  .mHost { font-size: 17px; }
  .mSub { font-size: 13px; }
  .tCaption { margin-top: 10px; font-size: 11px; min-height: 16px; }
  .tLoad { margin-top: 6px; }
}

@media (orientation: portrait) {
  #title {
    justify-content: center;
    padding: max(76px, calc(var(--toy-safe-top, 0px) + 64px)) 20px max(24px, var(--toy-safe-bottom, 0px));
    background: linear-gradient(180deg, rgba(4, 10, 22, 0.25) 0%, rgba(4, 10, 22, 0.52) 55%, rgba(4, 10, 22, 0.74) 100%);
  }
  .tStage { width: min(360px, 100%); }
  .tTitle { font-size: clamp(44px, 11vw, 60px); gap: 16px; }
  .tMenu { margin-top: 32px; gap: 6px; }
}
