/*
 * UI revision 2 — Deep-sea starrail × chibi resonator showcase.
 * Presentation-only overrides: gameplay, input, collision and save logic stay in existing modules.
 */

:root {
  --ui-void: #020817;
  --ui-deep: #07162f;
  --ui-surface: rgba(7, 24, 51, 0.74);
  --ui-surface-soft: rgba(10, 34, 66, 0.48);
  --ui-surface-solid: rgba(5, 18, 41, 0.94);
  --ui-stroke: rgba(142, 225, 246, 0.2);
  --ui-stroke-active: rgba(123, 231, 251, 0.72);
  --ui-text: #ecfbff;
  --ui-text-muted: rgba(211, 239, 247, 0.56);
  --ui-cyan: #77e7f8;
  --ui-cyan-strong: #34bad8;
  --ui-gold: #f5d88f;
  --ui-pink: #f58bb8;
  --ui-danger: #ff709d;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 18px;
  --ui-space-5: 26px;
  --ui-radius-small: 7px;
  --ui-radius-medium: 14px;
  --ui-radius-large: 24px;
  --ui-fast: 120ms;
  --ui-normal: 190ms;
  --ui-slow: 320ms;
}

body {
  background:
    radial-gradient(ellipse at 14% 0%, rgba(101, 37, 112, 0.3), transparent 38%),
    radial-gradient(ellipse at 88% 100%, rgba(28, 137, 172, 0.2), transparent 42%),
    linear-gradient(146deg, #020713 0%, #05132b 54%, #071b38 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(205, 247, 255, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(248, 207, 235, 0.5) 0 1px, transparent 1.4px);
  background-position: 12% 18%, 79% 32%;
  background-size: 130px 130px, 190px 190px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.app-shell[data-ui-revision="2"] {
  gap: 8px;
  padding:
    max(9px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(9px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

/* Header: one quiet status rail instead of four competing glass pills. */
.app-shell[data-ui-revision="2"] .app-header {
  min-height: 46px;
  padding-inline: 8px 4px;
}

.app-shell[data-ui-revision="2"] .brand {
  gap: 11px;
}

.app-shell[data-ui-revision="2"] .brand-gem {
  width: 31px;
  height: 31px;
  border-color: rgba(126, 230, 248, 0.55);
  background: linear-gradient(145deg, rgba(78, 212, 233, 0.1), rgba(228, 105, 169, 0.2));
  box-shadow: inset 0 0 16px rgba(67, 209, 238, 0.1), 0 0 20px rgba(64, 205, 233, 0.08);
}

.app-shell[data-ui-revision="2"] .brand-gem::before { inset: 7px; }
.app-shell[data-ui-revision="2"] .brand-gem::after { inset: 12px; }

.app-shell[data-ui-revision="2"] .brand small {
  margin-bottom: 1px;
  color: rgba(205, 239, 245, 0.38);
  font-size: 7px;
  letter-spacing: 0.22em;
}

.app-shell[data-ui-revision="2"] .brand strong {
  font-size: 14px;
  letter-spacing: 0.12em;
}

.app-shell[data-ui-revision="2"] .header-actions {
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(136, 224, 243, 0.12);
  border-radius: 999px;
  background: rgba(3, 14, 33, 0.46);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.app-shell[data-ui-revision="2"] .account-pill,
.app-shell[data-ui-revision="2"] .currency-pill,
.app-shell[data-ui-revision="2"] .round-button {
  min-height: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.app-shell[data-ui-revision="2"] .account-pill {
  min-width: 122px;
  padding: 5px 10px;
}

.app-shell[data-ui-revision="2"] .currency-pill {
  min-width: 88px;
  padding-inline: 11px;
  border-left-color: rgba(136, 224, 243, 0.12);
  border-radius: 0;
}

.app-shell[data-ui-revision="2"] .round-button {
  width: 34px;
}

.app-shell[data-ui-revision="2"] .account-pill:hover,
.app-shell[data-ui-revision="2"] .round-button:hover {
  transform: none;
  background: rgba(95, 218, 237, 0.1);
}

/* The lobby is a composition canvas, not a giant rounded browser card. */
.app-shell[data-ui-revision="2"] .lobby-surface {
  width: min(1580px, 100%);
  aspect-ratio: 16 / 8.55;
  grid-template-columns: 112px minmax(0, 1fr);
  border-color: rgba(136, 224, 243, 0.2);
  border-radius: 6px 28px 6px 28px;
  background:
    linear-gradient(90deg, rgba(2, 11, 29, 0.96) 0 7%, rgba(4, 17, 41, 0.84) 34%, rgba(3, 13, 34, 0.36) 76%, rgba(4, 14, 34, 0.66)),
    linear-gradient(180deg, rgba(4, 15, 38, 0.04), rgba(3, 14, 33, 0.86)),
    url("../assets/backgrounds/stage-3-star-harbor.png") center 43% / cover;
  box-shadow: 0 30px 90px rgba(0, 5, 22, 0.48), inset 0 1px rgba(255, 255, 255, 0.045);
}

.app-shell[data-ui-revision="2"] .lobby-surface::before {
  opacity: 0.36;
  background:
    linear-gradient(115deg, transparent 0 68%, rgba(105, 224, 244, 0.08) 68.1%, transparent 68.35%),
    radial-gradient(ellipse at 76% 48%, rgba(79, 209, 236, 0.1), transparent 32%);
  background-size: auto;
  mask-image: none;
}

.app-shell[data-ui-revision="2"] .lobby-surface::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 17px;
  right: 18px;
  width: 46px;
  height: 46px;
  pointer-events: none;
  border-top: 1px solid rgba(131, 231, 248, 0.34);
  border-right: 1px solid rgba(131, 231, 248, 0.34);
}

/* Navigation becomes a thin route index. */
.app-shell[data-ui-revision="2"] .lobby-nav {
  align-content: center;
  gap: 4px;
  padding: 20px 9px;
  border-right-color: rgba(128, 221, 241, 0.12);
  background: linear-gradient(180deg, rgba(3, 13, 31, 0.66), rgba(4, 18, 40, 0.4));
  backdrop-filter: blur(12px);
}

.app-shell[data-ui-revision="2"] .nav-tab {
  min-height: 58px;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  padding: 10px 8px;
  border: 0;
  border-radius: 4px 14px 4px 14px;
  color: rgba(215, 239, 245, 0.42);
  font-size: 11px;
}

.app-shell[data-ui-revision="2"] .nav-tab span {
  color: rgba(119, 224, 242, 0.42);
  font-size: 7px;
}

.app-shell[data-ui-revision="2"] .nav-tab::before {
  content: "";
  position: absolute;
  left: -1px;
  width: 2px;
  height: 0;
  background: var(--ui-cyan);
  box-shadow: 0 0 12px rgba(98, 227, 246, 0.56);
  transition: height var(--ui-normal) ease;
}

.app-shell[data-ui-revision="2"] .nav-tab::after { display: none; }

.app-shell[data-ui-revision="2"] .nav-tab:hover,
.app-shell[data-ui-revision="2"] .nav-tab.is-active {
  border-color: transparent;
  background: linear-gradient(90deg, rgba(72, 197, 222, 0.14), rgba(80, 177, 210, 0.02));
}

.app-shell[data-ui-revision="2"] .nav-tab.is-active::before { height: 31px; }

.app-shell[data-ui-revision="2"] .lobby-panel {
  padding: clamp(20px, 2.5vw, 40px) clamp(24px, 3.3vw, 54px);
}

.app-shell[data-ui-revision="2"] .home-panel.is-active {
  grid-template-columns: minmax(520px, 1.06fr) minmax(380px, 0.94fr);
  gap: clamp(20px, 3vw, 48px);
}

.app-shell[data-ui-revision="2"] .home-copy {
  max-width: 760px;
  padding-left: 10px;
}

.app-shell[data-ui-revision="2"] .home-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -34px -70px -26px -38px;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 46%, rgba(4, 17, 42, 0.82), rgba(4, 17, 42, 0.26) 58%, transparent 74%);
}

.app-shell[data-ui-revision="2"] .eyebrow {
  margin-bottom: 10px;
  color: rgba(126, 229, 246, 0.78);
  font-size: 7px;
  letter-spacing: 0.26em;
}

.app-shell[data-ui-revision="2"] .eyebrow span {
  width: 42px;
  opacity: 0.72;
}

.app-shell[data-ui-revision="2"] .home-copy h1 {
  max-width: 720px;
  font-size: clamp(38px, 4.25vw, 66px);
  letter-spacing: -0.055em;
  line-height: 1.01;
}

.app-shell[data-ui-revision="2"] .home-copy h1 em {
  -webkit-text-stroke-color: rgba(154, 231, 244, 0.65);
}

.app-shell[data-ui-revision="2"] .home-copy .lead {
  max-width: 650px;
  margin-top: 13px;
  color: rgba(216, 239, 245, 0.54);
  font-size: clamp(9px, 0.9vw, 12px);
  line-height: 1.65;
}

/* Mode selector reads as one navigation instrument. */
.app-shell[data-ui-revision="2"] .mode-switch {
  gap: 0;
  margin-top: 18px;
  padding: 4px;
  border: 1px solid rgba(129, 222, 241, 0.13);
  border-radius: 5px 16px 5px 16px;
  background: rgba(3, 14, 34, 0.44);
}

.app-shell[data-ui-revision="2"] .mode-option {
  min-height: 55px;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-right: 1px solid rgba(130, 220, 239, 0.1);
  border-radius: 3px 12px 3px 12px;
  background: transparent;
  backdrop-filter: none;
}

.app-shell[data-ui-revision="2"] .mode-option:last-child { border-right: 0; }

.app-shell[data-ui-revision="2"] .mode-option:hover {
  transform: none;
  background: rgba(91, 208, 228, 0.07);
}

.app-shell[data-ui-revision="2"] .mode-option.is-active {
  border-color: transparent;
  background:
    linear-gradient(120deg, rgba(48, 175, 207, 0.25), rgba(111, 84, 172, 0.11)),
    rgba(7, 31, 61, 0.48);
  box-shadow: inset 2px 0 var(--ui-cyan), inset 0 1px rgba(255, 255, 255, 0.04);
}

.app-shell[data-ui-revision="2"] .mode-number {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(103, 224, 242, 0.08);
  font-size: 9px;
}

.app-shell[data-ui-revision="2"] .mode-option strong { font-size: 10px; }
.app-shell[data-ui-revision="2"] .mode-option small { font-size: 6px; }

.app-shell[data-ui-revision="2"] .mode-option i {
  right: 6px;
  top: 5px;
  padding: 2px 4px;
  border-radius: 2px 6px 2px 6px;
  font-size: 5px;
}

/* Bosses become a connected route, with portraits as landmarks rather than cards. */
.app-shell[data-ui-revision="2"] .boss-selector,
.app-shell[data-ui-revision="2"] .challenge-selector {
  position: relative;
  gap: 18px;
  margin-top: 8px;
  padding: 5px 7px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell[data-ui-revision="2"] .boss-selector::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 27px;
  right: 14%;
  left: 14%;
  height: 1px;
  background: linear-gradient(90deg, rgba(106, 224, 242, 0.38), rgba(152, 112, 212, 0.4), rgba(241, 125, 180, 0.48));
  box-shadow: 0 0 9px rgba(93, 218, 239, 0.14);
}

.app-shell[data-ui-revision="2"] .boss-option {
  min-height: 53px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
  padding: 4px 5px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(4, 18, 42, 0.9), rgba(5, 19, 43, 0.4));
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.app-shell[data-ui-revision="2"] .boss-option:hover,
.app-shell[data-ui-revision="2"] .boss-option.is-active {
  transform: none;
  background: linear-gradient(90deg, rgba(19, 64, 91, 0.92), rgba(75, 37, 92, 0.48));
  box-shadow: inset 2px 0 rgba(112, 230, 247, 0.7);
}

.app-shell[data-ui-revision="2"] .boss-option img {
  width: 44px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 217, 239, 0.12), transparent 68%);
}

.app-shell[data-ui-revision="2"] .boss-option strong { font-size: 9px; }
.app-shell[data-ui-revision="2"] .boss-option small { font-size: 6px; }

.app-shell[data-ui-revision="2"] .boss-option i {
  right: 5px;
  top: 4px;
  padding: 1px 4px;
  border-radius: 2px;
  background: transparent;
  font-size: 5px;
}

.app-shell[data-ui-revision="2"] .boss-selector > p,
.app-shell[data-ui-revision="2"] .challenge-selector > p {
  margin-top: -2px;
  color: rgba(205, 235, 241, 0.4);
  font-size: 6px;
}

.app-shell[data-ui-revision="2"] .challenge-option {
  min-height: 48px;
  border: 0;
  border-radius: 4px 12px 4px 12px;
  background: rgba(5, 21, 46, 0.58);
}

.app-shell[data-ui-revision="2"] .challenge-option:hover,
.app-shell[data-ui-revision="2"] .challenge-option.is-active {
  transform: none;
  background: linear-gradient(120deg, rgba(40, 154, 185, 0.25), rgba(102, 71, 150, 0.12));
  box-shadow: inset 2px 0 rgba(115, 230, 247, 0.66);
}

/* Advanced tuning is available without permanently occupying the hero screen. */
.app-shell[data-ui-revision="2"] .difficulty-debug {
  display: block;
  margin-top: 7px;
  padding: 0;
  border: 1px solid rgba(239, 207, 137, 0.14);
  border-radius: 4px 11px 4px 11px;
  background: rgba(22, 22, 48, 0.42);
  box-shadow: none;
}

.app-shell[data-ui-revision="2"] .difficulty-debug summary {
  min-height: 32px;
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  cursor: pointer;
  list-style: none;
  color: rgba(225, 239, 242, 0.74);
}

.app-shell[data-ui-revision="2"] .difficulty-debug summary::-webkit-details-marker { display: none; }
.app-shell[data-ui-revision="2"] .difficulty-debug summary::marker { content: ""; }

.app-shell[data-ui-revision="2"] .difficulty-debug summary small,
.app-shell[data-ui-revision="2"] .difficulty-debug summary strong { display: inline; }

.app-shell[data-ui-revision="2"] .difficulty-debug summary small {
  margin-right: 8px;
  color: rgba(244, 211, 143, 0.48);
  font-size: 5px;
  letter-spacing: 0.16em;
}

.app-shell[data-ui-revision="2"] .difficulty-debug summary strong { font-size: 8px; }

.app-shell[data-ui-revision="2"] .difficulty-debug summary em {
  color: rgba(211, 235, 241, 0.38);
  font-size: 6px;
  font-style: normal;
}

.app-shell[data-ui-revision="2"] .difficulty-debug summary i {
  color: var(--ui-gold);
  font-size: 12px;
  font-style: normal;
  transition: transform var(--ui-normal) ease;
}

.app-shell[data-ui-revision="2"] .difficulty-debug[open] summary i { transform: rotate(180deg); }

.app-shell[data-ui-revision="2"] .difficulty-debug-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 2px 10px 9px;
  border-top: 1px solid rgba(239, 207, 137, 0.09);
}

.app-shell[data-ui-revision="2"] .difficulty-debug-controls label {
  min-height: 29px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  color: rgba(222, 240, 244, 0.56);
  font-size: 7px;
}

.app-shell[data-ui-revision="2"] .difficulty-debug select {
  min-width: 66px;
  border-radius: 4px 8px 4px 8px;
  background: rgba(5, 20, 44, 0.94);
}

.app-shell[data-ui-revision="2"] .difficulty-debug-controls > p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: rgba(244, 211, 143, 0.58);
  font-size: 6px;
  text-align: center;
}

.app-shell[data-ui-revision="2"] .launch-row {
  align-items: center;
  gap: 13px;
  margin-top: 10px;
}

.app-shell[data-ui-revision="2"] .launch-button {
  min-width: 244px;
  min-height: 52px;
  padding: 11px 12px 11px 19px;
  border: 0;
  border-radius: 4px 16px 4px 16px;
  background:
    linear-gradient(105deg, rgba(72, 211, 229, 0.96), rgba(47, 145, 201, 0.98) 58%, rgba(116, 91, 191, 0.96));
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
  box-shadow: 0 15px 34px rgba(39, 157, 194, 0.23), inset 0 1px rgba(255, 255, 255, 0.34);
}

.app-shell[data-ui-revision="2"] .launch-button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 36%, rgba(255, 255, 255, 0.18) 50%, transparent 64%);
  transition: transform 520ms ease;
}

.app-shell[data-ui-revision="2"] .launch-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08) brightness(1.04);
}

.app-shell[data-ui-revision="2"] .launch-button:hover::after { transform: translateX(110%); }
.app-shell[data-ui-revision="2"] .launch-button:active { transform: translateY(0) scale(0.985); }

.app-shell[data-ui-revision="2"] .launch-button b {
  border-radius: 4px 10px 4px 10px;
  background: rgba(3, 24, 48, 0.34);
}

.app-shell[data-ui-revision="2"] .best-chip {
  min-width: 110px;
  border: 0;
  border-left: 1px solid rgba(242, 212, 149, 0.42);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(68, 50, 72, 0.34), transparent);
}

.app-shell[data-ui-revision="2"] .route-strip {
  margin-top: 9px;
  opacity: 0.62;
}

/* Resonator showcase: character art remains the focal point, controls become a floating dock. */
.app-shell[data-ui-revision="2"] .home-hero {
  min-height: 430px;
}

.app-shell[data-ui-revision="2"] .home-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  width: min(40vw, 520px);
  aspect-ratio: 1.08;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 54%, rgba(84, 215, 234, 0.16), transparent 43%),
    linear-gradient(90deg, transparent 49.8%, rgba(119, 227, 244, 0.13) 50%, transparent 50.2%);
  mask-image: linear-gradient(to bottom, #000 0 70%, transparent 94%);
}

.app-shell[data-ui-revision="2"] .orbit-a {
  width: min(34vw, 445px);
  opacity: 0.64;
  border-style: dashed;
  background: none;
}

.app-shell[data-ui-revision="2"] .orbit-b {
  width: min(27vw, 340px);
  opacity: 0.36;
}

.app-shell[data-ui-revision="2"] .chibi-hero {
  width: min(35vw, 490px);
  left: 50%;
  top: 45%;
  filter: drop-shadow(0 28px 28px rgba(0, 7, 24, 0.58)) drop-shadow(0 0 17px rgba(90, 219, 239, 0.14));
}

.app-shell[data-ui-revision="2"] .chibi-hero[data-character] {
  width: min(34vw, 478px);
  top: 46%;
}

.app-shell[data-ui-revision="2"] .hero-cycle-button {
  top: 40%;
  width: 34px;
  height: 62px;
  padding: 5px 3px;
  border: 0;
  border-radius: 3px 12px 3px 12px;
  background: linear-gradient(180deg, rgba(8, 32, 62, 0.62), rgba(4, 16, 37, 0.28));
  box-shadow: inset 1px 0 rgba(126, 229, 247, 0.26);
}

.app-shell[data-ui-revision="2"] .hero-cycle-previous { left: 1%; }
.app-shell[data-ui-revision="2"] .hero-cycle-next { right: 1%; }

.app-shell[data-ui-revision="2"] .hero-cycle-button:hover {
  transform: translateY(-1px);
  background: rgba(57, 137, 172, 0.24);
}

.app-shell[data-ui-revision="2"] .hero-character-console {
  right: 2%;
  bottom: 0;
  left: 2%;
  grid-template-columns: minmax(250px, 1.4fr) minmax(160px, 0.6fr);
  gap: 6px;
  padding: 7px;
  border: 0;
  border-radius: 5px 18px 5px 18px;
  background: linear-gradient(108deg, rgba(3, 17, 39, 0.9), rgba(7, 30, 61, 0.7) 66%, rgba(55, 35, 78, 0.58));
  box-shadow: inset 2px 0 rgba(103, 225, 244, 0.54), 0 16px 32px rgba(0, 7, 25, 0.28);
}

.app-shell[data-ui-revision="2"] .hero-character-console::before {
  top: -13px;
  left: 8px;
  color: rgba(123, 226, 244, 0.42);
  font-size: 5px;
}

.app-shell[data-ui-revision="2"] .character-selector {
  gap: 3px;
}

.app-shell[data-ui-revision="2"] .character-option {
  grid-template-columns: 34px;
  justify-content: center;
  gap: 0;
  padding: 3px;
  border: 0;
  border-radius: 3px 9px 3px 9px;
  background: rgba(7, 27, 54, 0.42);
  text-align: center;
}

.app-shell[data-ui-revision="2"] .character-option:hover,
.app-shell[data-ui-revision="2"] .character-option.is-active {
  transform: translateY(-2px);
  background: linear-gradient(145deg, rgba(53, 150, 179, 0.25), rgba(114, 72, 142, 0.18));
  box-shadow: inset 0 -2px var(--ui-gold), 0 8px 16px rgba(0, 9, 26, 0.2);
}

.app-shell[data-ui-revision="2"] .character-portrait {
  width: 34px;
  height: 34px;
}

.app-shell[data-ui-revision="2"] .character-option > span,
.app-shell[data-ui-revision="2"] .character-option > i { display: none; }

.app-shell[data-ui-revision="2"] .hero-signal {
  padding: 4px 8px;
  border-left-color: rgba(113, 229, 247, 0.62);
  background: linear-gradient(90deg, rgba(6, 24, 51, 0.64), transparent);
}

.app-shell[data-ui-revision="2"] .hero-signal strong {
  font-size: 11px;
  letter-spacing: 0.16em;
}

.app-shell[data-ui-revision="2"] .hero-signal p {
  color: rgba(220, 239, 244, 0.45);
}

.app-shell[data-ui-revision="2"] .lobby-footer {
  padding: 6px 14px;
  border-top-color: rgba(124, 221, 240, 0.1);
  background: rgba(2, 11, 27, 0.7);
  font-size: 6px;
}

/* Consistent interactive language for the remaining lobby surfaces. */
.app-shell[data-ui-revision="2"] button,
.app-shell[data-ui-revision="2"] select,
.app-shell[data-ui-revision="2"] summary {
  transition-duration: var(--ui-normal);
}

.app-shell[data-ui-revision="2"] button:focus-visible,
.app-shell[data-ui-revision="2"] summary:focus-visible,
.app-shell[data-ui-revision="2"] select:focus-visible {
  outline: 2px solid var(--ui-gold);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .app-shell[data-ui-revision="2"] .lobby-surface {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .app-shell[data-ui-revision="2"] .lobby-panel {
    padding-inline: 24px;
  }

  .app-shell[data-ui-revision="2"] .home-panel.is-active {
    grid-template-columns: minmax(460px, 1.08fr) minmax(310px, 0.82fr);
    gap: 14px;
  }

  .app-shell[data-ui-revision="2"] .nav-tab {
    min-height: 52px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 7px 3px;
    text-align: center;
  }

  .app-shell[data-ui-revision="2"] .home-copy h1 { font-size: clamp(35px, 4.5vw, 54px); }
  .app-shell[data-ui-revision="2"] .mode-option small { display: none; }
}

@media (pointer: coarse), (max-width: 780px) {
  .app-shell[data-ui-revision="2"] .lobby-surface {
    grid-template-columns: 62px minmax(0, 1fr);
    border-radius: 4px 16px 4px 16px;
  }

  .app-shell[data-ui-revision="2"] .lobby-nav { padding: 6px 4px; }
  .app-shell[data-ui-revision="2"] .nav-tab { min-height: 0; }

  .app-shell[data-ui-revision="2"] .home-panel.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.5fr);
  }

  .app-shell[data-ui-revision="2"] .hero-character-console {
    grid-template-columns: 1fr;
  }

  .app-shell[data-ui-revision="2"] .hero-signal {
    grid-row: 1;
    text-align: center;
  }

  .app-shell[data-ui-revision="2"] .character-selector { grid-row: 2; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px),
       (max-height: 520px) and (orientation: landscape) {
  .app-shell[data-ui-revision="2"] {
    gap: 3px;
    padding:
      max(3px, env(safe-area-inset-top))
      max(5px, env(safe-area-inset-right))
      max(3px, env(safe-area-inset-bottom))
      max(5px, env(safe-area-inset-left));
  }

  .app-shell[data-ui-revision="2"] .app-header {
    min-height: 30px;
    height: 30px;
  }

  .app-shell[data-ui-revision="2"] .brand-gem {
    width: 22px;
    height: 22px;
  }

  .app-shell[data-ui-revision="2"] .brand-gem::before { inset: 5px; }
  .app-shell[data-ui-revision="2"] .brand-gem::after { inset: 8px; }
  .app-shell[data-ui-revision="2"] .brand small { display: none; }
  .app-shell[data-ui-revision="2"] .brand strong { font-size: 10px; }

  .app-shell[data-ui-revision="2"] .header-actions {
    height: 28px;
    padding: 2px;
  }

  .app-shell[data-ui-revision="2"] .account-pill,
  .app-shell[data-ui-revision="2"] .currency-pill,
  .app-shell[data-ui-revision="2"] .round-button {
    min-height: 24px;
    height: 24px;
  }

  .app-shell[data-ui-revision="2"] .round-button { width: 25px; }
  .app-shell[data-ui-revision="2"] .account-pill { min-width: 76px; padding: 2px 6px; }
  .app-shell[data-ui-revision="2"] .account-pill small { display: none; }
  .app-shell[data-ui-revision="2"] .account-pill strong { margin: 0; font-size: 7px; }
  .app-shell[data-ui-revision="2"] .currency-pill { min-width: 56px; padding: 0 6px; }
  .app-shell[data-ui-revision="2"] .currency-pill strong { min-width: 24px; font-size: 9px; }

  .app-shell[data-ui-revision="2"] .lobby-surface {
    grid-template-columns: 58px minmax(0, 1fr);
    aspect-ratio: auto;
    height: 100%;
  }

  .app-shell[data-ui-revision="2"] .lobby-nav { gap: 2px; }
  .app-shell[data-ui-revision="2"] .nav-tab {
    gap: 1px;
    padding: 3px 2px;
    border-radius: 2px 7px 2px 7px;
    font-size: 6px;
  }

  .app-shell[data-ui-revision="2"] .nav-tab span { font-size: 5px; }

  .app-shell[data-ui-revision="2"] .lobby-panel { padding: 5px 14px; }

  .app-shell[data-ui-revision="2"] .home-panel.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(174px, 0.46fr);
    align-items: stretch;
    gap: 5px;
  }

  .app-shell[data-ui-revision="2"] .home-copy {
    min-height: 0;
    max-height: 100%;
    display: grid;
    align-content: center;
    padding-left: 4px;
  }

  .app-shell[data-ui-revision="2"] .home-copy > .eyebrow,
  .app-shell[data-ui-revision="2"] .home-copy > .lead { display: none; }

  .app-shell[data-ui-revision="2"] .home-copy h1 {
    font-size: clamp(19px, 5.2vh, 25px);
    line-height: 1;
    white-space: nowrap;
  }

  .app-shell[data-ui-revision="2"] .home-copy h1 br { display: none; }

  .app-shell[data-ui-revision="2"] .mode-switch {
    margin-top: 5px;
    padding: 2px;
  }

  .app-shell[data-ui-revision="2"] .mode-option {
    min-height: 30px;
    gap: 3px;
    padding: 3px 4px;
  }

  .app-shell[data-ui-revision="2"] .mode-number {
    width: 21px;
    height: 21px;
    font-size: 6px;
  }

  .app-shell[data-ui-revision="2"] .mode-option strong { font-size: 6px; }
  .app-shell[data-ui-revision="2"] .mode-option i { display: none; }

  .app-shell[data-ui-revision="2"] .boss-selector,
  .app-shell[data-ui-revision="2"] .challenge-selector {
    gap: 4px;
    margin-top: 3px;
    padding: 2px;
  }

  .app-shell[data-ui-revision="2"] .boss-selector::before { top: 20px; }

  .app-shell[data-ui-revision="2"] .boss-option,
  .app-shell[data-ui-revision="2"] .challenge-option {
    min-height: 34px;
    gap: 3px;
    padding: 2px 3px;
  }

  .app-shell[data-ui-revision="2"] .boss-option { grid-template-columns: 28px minmax(0, 1fr); }
  .app-shell[data-ui-revision="2"] .boss-option img { width: 28px; height: 26px; }
  .app-shell[data-ui-revision="2"] .boss-option strong,
  .app-shell[data-ui-revision="2"] .challenge-option strong { font-size: 6px; }
  .app-shell[data-ui-revision="2"] .boss-option small,
  .app-shell[data-ui-revision="2"] .boss-selector > p,
  .app-shell[data-ui-revision="2"] .challenge-option small,
  .app-shell[data-ui-revision="2"] .challenge-selector > p { display: none; }

  .app-shell[data-ui-revision="2"] .difficulty-debug { margin-top: 3px; }
  .app-shell[data-ui-revision="2"] .difficulty-debug summary {
    min-height: 25px;
    padding: 3px 7px;
  }
  .app-shell[data-ui-revision="2"] .difficulty-debug summary small,
  .app-shell[data-ui-revision="2"] .difficulty-debug summary em { display: none; }
  .app-shell[data-ui-revision="2"] .difficulty-debug summary strong { font-size: 6px; }

  .app-shell[data-ui-revision="2"] .difficulty-debug-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    padding: 2px 6px 5px;
  }

  .app-shell[data-ui-revision="2"] .difficulty-debug-controls label { min-height: 22px; font-size: 5px; }
  .app-shell[data-ui-revision="2"] .difficulty-debug-controls > p { display: none; }

  .app-shell[data-ui-revision="2"] .launch-row {
    min-height: 35px;
    margin-top: 4px;
  }

  .app-shell[data-ui-revision="2"] .launch-button {
    min-width: 162px;
    min-height: 35px;
    padding: 5px 8px 5px 11px;
    font-size: 8px;
  }

  .app-shell[data-ui-revision="2"] .launch-button i,
  .app-shell[data-ui-revision="2"] .best-chip,
  .app-shell[data-ui-revision="2"] .route-strip { display: none; }

  .app-shell[data-ui-revision="2"] .launch-button b { width: 24px; height: 24px; }

  .app-shell[data-ui-revision="2"] .home-hero { min-height: 0; height: 100%; }
  .app-shell[data-ui-revision="2"] .home-hero .chibi-hero,
  .app-shell[data-ui-revision="2"] .home-hero .chibi-hero[data-character] {
    width: min(29vw, calc((var(--app-height, 100dvh) - 38px) * 0.74));
    left: 50%;
    top: 42%;
  }

  .app-shell[data-ui-revision="2"] .orbit-a { width: 138%; }
  .app-shell[data-ui-revision="2"] .orbit-b { display: none; }

  .app-shell[data-ui-revision="2"] .hero-cycle-button {
    top: 34%;
    width: 24px;
    height: 42px;
    padding: 2px;
  }

  .app-shell[data-ui-revision="2"] .hero-cycle-previous { left: -2%; }
  .app-shell[data-ui-revision="2"] .hero-cycle-next { right: -2%; }
  .app-shell[data-ui-revision="2"] .hero-cycle-button kbd,
  .app-shell[data-ui-revision="2"] .hero-cycle-button small { display: none; }
  .app-shell[data-ui-revision="2"] .hero-cycle-button span { font-size: 19px; }

  .app-shell[data-ui-revision="2"] .hero-character-console {
    right: -3%;
    bottom: 1px;
    left: -7%;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 3px;
    border-radius: 3px 9px 3px 9px;
  }

  .app-shell[data-ui-revision="2"] .hero-character-console::before,
  .app-shell[data-ui-revision="2"] .hero-signal small,
  .app-shell[data-ui-revision="2"] .hero-signal span,
  .app-shell[data-ui-revision="2"] .hero-signal p { display: none; }

  .app-shell[data-ui-revision="2"] .hero-signal {
    padding: 1px 4px;
    text-align: center;
  }

  .app-shell[data-ui-revision="2"] .hero-signal strong {
    margin: 0;
    font-size: 6px;
  }

  .app-shell[data-ui-revision="2"] .character-selector { gap: 2px; }
  .app-shell[data-ui-revision="2"] .character-option { grid-template-columns: 24px; padding: 1px; }
  .app-shell[data-ui-revision="2"] .character-portrait { width: 24px; height: 24px; }

  .app-shell[data-ui-revision="2"] .lobby-footer {
    position: absolute;
    right: max(5px, env(safe-area-inset-right));
    bottom: max(1px, env(safe-area-inset-bottom));
    width: auto;
    padding: 1px 5px;
    border: 0;
    background: rgba(3, 12, 29, 0.66);
    font-size: 5px;
  }

  .app-shell[data-ui-revision="2"] .lobby-footer > span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell[data-ui-revision="2"] .launch-button::after { display: none; }
  .app-shell[data-ui-revision="2"] .launch-button,
  .app-shell[data-ui-revision="2"] .character-option,
  .app-shell[data-ui-revision="2"] .mode-option,
  .app-shell[data-ui-revision="2"] .nav-tab { transition: none; }
}
