:root {
  --cyan: #28a8ff;
  --cyan-bright: #80d9ff;
  --deep: #020712;
  --panel: rgba(4, 16, 31, 0.82);
  --line: rgba(80, 177, 255, 0.36);
  --danger: #ff625f;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
button, a, canvas, img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
button { touch-action: manipulation; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--deep); }
body {
  color: #eff9ff;
  font-family: "Arial Narrow", "Eurostile", "Segoe UI", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

#gameShell { position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate; background: #020712 url("assets/rift-background-v218a.jpg") 45% 46% / 110% auto no-repeat; }
.rift-flat-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #020712 url("assets/rift-background-v218a.jpg") 45% 46% / 110% auto no-repeat;
  filter: none;
  opacity: 1;
  mix-blend-mode: normal;
  transform: scale(1.012);
  transform-origin: center;
  transition: background-position .12s linear, background-size .18s linear;
}

.rift-background-video {
  position: absolute;
  left: 0;
  top: -2px;
  width: 100%;
  height: calc(100% + 4px);
  z-index: 0;
  pointer-events: none;
  object-fit: cover;
  object-position: center center;
  background: #020712;
  opacity: 0;
  display: none;
  transform: scale(1.003);
  transform-origin: center;
}
.rift-background-video.active {
  display: block;
  opacity: var(--rift-bg-video-opacity, 1);
}

#gameCanvas { position: relative; z-index: 1; display: block; width: 100%; height: 100%; background: transparent !important; }

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 38%, rgba(0, 123, 255, .15), transparent 34%),
    linear-gradient(110deg, rgba(1, 7, 15, .94), rgba(2, 9, 18, .60));
}
.screen.active { display: flex; }
.screen.compact { background: rgba(0, 5, 12, .68); backdrop-filter: blur(8px); }

.scanline {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(98, 185, 255, .035) 4px);
  pointer-events: none;
}

#loadingScreen { flex-direction: column; gap: 12px; letter-spacing: .18em; }
.loading-mark {
  font-size: clamp(34px, 7vw, 82px); font-weight: 900; font-style: italic;
  letter-spacing: .10em; text-shadow: 0 0 22px rgba(38, 167, 255, .6);
}
.loading-sub { font-size: 12px; color: #70bce9; }
.loading-track { width: min(420px, 70vw); height: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.loading-track span { display: block; width: 5%; height: 100%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); transition: width .25s; }
#loadingText { color: #8ca8ba; font-size: 11px; letter-spacing: .08em; }

.menu-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 220px #000; pointer-events: none; }
.menu-panel {
  position: relative;
  width: min(760px, calc(100vw - 36px));
  padding: clamp(28px, 6vw, 72px);
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(2, 11, 24, .91), rgba(3, 14, 26, .46), transparent);
  filter: drop-shadow(0 0 34px rgba(0, 125, 255, .16));
}
.home-link { color: #9acbe7; text-decoration: none; font-size: 12px; letter-spacing: .16em; }
.kicker { margin: 34px 0 6px; color: #63bce9; font-size: 12px; font-weight: 800; letter-spacing: .28em; }
.kicker.danger { color: var(--danger); margin-top: 0; }
h1, h2 { margin: 0; font-style: italic; font-weight: 900; line-height: .92; letter-spacing: .075em; }
h1 {
  font-size: clamp(54px, 12vw, 132px);
  background: linear-gradient(180deg, #fff 8%, #8fd8ff 50%, #348dca 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 34px rgba(30, 146, 255, .16);
}
h2 { font-size: clamp(36px, 7vw, 70px); }
.subtitle { margin: 12px 0 0 5px; color: #8fd6ff; font-size: clamp(14px, 2vw, 22px); letter-spacing: .54em; }
.menu-copy { max-width: 540px; margin: 32px 0; color: #a9bcc8; font-size: 15px; letter-spacing: .04em; }

.primary-button {
  min-width: 210px; padding: 14px 26px; border: 1px solid #67c7ff;
  background: linear-gradient(90deg, #0876bd, #0da4ef); color: white;
  font-weight: 900; letter-spacing: .18em; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  box-shadow: 0 0 25px rgba(32, 161, 255, .28);
}
.primary-button:hover, .primary-button:focus-visible { filter: brightness(1.25); }
.text-button {
  margin-top: 15px; border: 0; padding: 8px 0; color: #82b6d5; background: transparent;
  font-size: 11px; font-weight: 800; letter-spacing: .18em; cursor: pointer;
}
.control-hints { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; color: #7892a3; font-size: 11px; letter-spacing: .12em; }
.control-hints b { color: #dff5ff; }

.result-panel {
  width: min(620px, calc(100vw - 32px)); padding: 40px;
  border: 1px solid var(--line); border-left: 3px solid var(--danger);
  background: rgba(2, 11, 23, .94); box-shadow: 0 26px 90px #000a;
}
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 30px 0; }
.result-grid div { padding: 14px; border: 1px solid rgba(105,185,238,.18); background: rgba(14,37,56,.44); }
.result-grid span { display: block; color: #7794a7; font-size: 10px; letter-spacing: .16em; }
.result-grid strong { display: block; margin-top: 7px; font-size: 23px; }

.hud {
  position: absolute; z-index: 10; inset: 0 0 auto 0; height: 92px; padding: max(14px, env(safe-area-inset-top)) 22px 10px;
  display: none; grid-template-columns: minmax(250px,1fr) minmax(260px,.9fr) minmax(300px,1fr); align-items: start; gap: 18px;
  background: linear-gradient(180deg, rgba(0, 6, 14, .90), rgba(0, 7, 17, .30), transparent);
  pointer-events: none;
}
.hud.active { display: grid; }
.hud-stage { display: flex; gap: 16px; }
.hud-stage div { min-width: 78px; }
.hud-stage span { display: block; color: #7291a4; font-size: 8px; letter-spacing: .14em; }
.hud-stage strong { display: block; margin-top: 4px; color: #dff6ff; font-size: 15px; letter-spacing: .08em; }
#riftDistanceValue.warning { color: #ffb35c; text-shadow: 0 0 12px #ff772e; }
#riftDistanceValue.danger { color: #ff625f; text-shadow: 0 0 14px #ff2c22; }
.hud-center { text-align: center; }
.status-message { height: 20px; color: #cfeeff; font-size: 12px; font-weight: 900; letter-spacing: .15em; text-shadow: 0 0 12px var(--cyan); }
.boost-rail { height: 5px; margin-top: 8px; border: 1px solid rgba(88,194,255,.4); background: rgba(0,0,0,.48); transform: skewX(-18deg); overflow: hidden; }
.boost-rail span { display: block; height: 100%; width: 50%; background: linear-gradient(90deg,#176da5,#48c8ff); box-shadow: 0 0 14px var(--cyan); transition: width .08s linear; }
.hud-center small { color: #78a9c5; font-size: 8px; letter-spacing: .22em; }
.hud-stats { display: flex; justify-content: flex-end; gap: 20px; text-align: right; }
.hud-stats div { min-width: 72px; }
.hud-stats span { display: block; color: #7291a4; font-size: 8px; letter-spacing: .14em; }
.hud-stats strong { font-size: 24px; line-height: 1; }
.hud-stats small { margin-left: 3px; color: #7cb5d5; font-size: 8px; }

/* Compact Windows-style game controls. */
.game-window-controls {
  position: fixed;
  z-index: 80;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  display: flex;
  height: 34px;
  border: 1px solid rgba(100, 198, 255, .35);
  background: rgba(2, 12, 24, .82);
  box-shadow: 0 8px 30px rgba(0,0,0,.38);
  backdrop-filter: blur(10px);
}
.game-window-controls button {
  width: 42px;
  height: 32px;
  border: 0;
  border-left: 1px solid rgba(100, 198, 255, .18);
  background: transparent;
  color: #dff6ff;
  font: 800 19px/1 "Segoe UI Symbol", "Arial Unicode MS", Arial, sans-serif;
  cursor: pointer;
}
.game-window-controls button:first-child { border-left: 0; font-size: 17px; }
.game-window-controls button:hover,
.game-window-controls button:focus-visible { background: rgba(38, 154, 222, .38); outline: none; }
.game-window-controls button.close:hover,
.game-window-controls button.close:focus-visible { background: #c83b38; }

/* auth.js mounts the signed-in profile inside the gameplay header. */
.hud > .agn-account-root {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  z-index: 70;
  margin: 0;
  pointer-events: auto;
}


.respawn-overlay {
  position: absolute; inset: 0; z-index: 35; display: none;
  align-items: center; justify-content: center; flex-direction: column;
  background: radial-gradient(circle, rgba(0,134,255,.18), rgba(0,5,14,.82));
  backdrop-filter: blur(3px); pointer-events: none;
}
.respawn-overlay.active { display: flex; }
.respawn-overlay small { color: #ff8f78; font-weight: 900; letter-spacing: .24em; }
.respawn-overlay strong { margin: 10px 0 4px; font-size: clamp(64px,14vw,140px); line-height: .9; text-shadow: 0 0 35px #1fa5ff; }
.respawn-overlay span { color: #9bc8e3; font-size: 10px; font-weight: 900; letter-spacing: .2em; }

#gameCanvas { touch-action: none; }
button:focus { outline: none; }
button:focus-visible { outline: 1px solid rgba(121,214,255,.85); outline-offset: 2px; }

#riftPressure {
  position: absolute; z-index: 8; inset: auto 0 0; height: 34%;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 24px;
  pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 115%, rgba(255,55,18,.62), rgba(255,65,18,.16) 36%, transparent 72%);
  transition: opacity .15s linear;
}
#riftPressure span {
  color: rgba(255,186,139,.88); font-size: 9px; font-weight: 900; letter-spacing: .24em;
  text-shadow: 0 0 12px #ff3c19;
}
#damageFlash { position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0; background: radial-gradient(circle, transparent 30%, rgba(255,40,30,.56)); }
#damageFlash.hit { animation: hitFlash .42s ease-out; }
@keyframes hitFlash { 0% {opacity:.9} 100% {opacity:0} }

.utility-buttons { position: absolute; z-index: 14; top: 100px; right: 16px; display: none; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: min(620px, calc(100vw - 32px)); }
.utility-buttons.active { display: flex; }
.utility-buttons button {
  border: 1px solid rgba(102,187,236,.25); padding: 8px 10px; background: rgba(2,13,25,.74); color: #91bdd4;
  font-size: 9px; font-weight: 900; letter-spacing: .12em; cursor: pointer;
}
.utility-buttons #qualityButton { color: #dff6ff; border-color: rgba(121,214,255,.42); background: rgba(8,52,86,.72); }
.utility-buttons #qualityButton:hover,
.utility-buttons #qualityButton:focus-visible { background: rgba(17,87,136,.88); color: #fff; }
.utility-buttons #perfButton,
.utility-buttons #hitboxButton,
.utility-buttons #debugReportButton { color: #abffd7; border-color: rgba(97,255,181,.34); background: rgba(5,55,38,.66); }
.utility-buttons #debugReportButton { color: #e4fff1; border-color: rgba(125,255,196,.46); }
.utility-buttons #perfButton:hover,
.utility-buttons #perfButton:focus-visible,
.utility-buttons #hitboxButton:hover,
.utility-buttons #hitboxButton:focus-visible,
.utility-buttons #debugReportButton:hover,
.utility-buttons #debugReportButton:focus-visible { background: rgba(13,91,63,.9); color: #fff; }
.perf-overlay {
  position: absolute; z-index: 18; top: 144px; right: 16px; min-width: 280px; max-width: min(420px, calc(100vw - 32px));
  margin: 0; padding: 10px 12px; border: 1px solid rgba(97,255,181,.32); border-radius: 10px;
  background: linear-gradient(180deg, rgba(2,14,20,.88), rgba(1,7,12,.78)); color: rgba(207,255,232,.95);
  font: 700 10px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em;
  box-shadow: 0 14px 40px rgba(0,0,0,.35), 0 0 22px rgba(0,255,180,.12); pointer-events: none; white-space: pre-wrap;
}

.mobile-controls {
  position: absolute; z-index: 12; inset: 0; display: none;
  justify-content: space-between; align-items: flex-end;
  padding: 0 max(18px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  pointer-events: none;
}
.mobile-controls.active { display: none; }
.action-controls { display: flex; gap: 14px; align-items: flex-end; margin-left: auto; pointer-events: none; }
.swipe-hint {
  position: absolute; left: max(88px, calc(env(safe-area-inset-left) + 88px)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 160px);
  transform: translateX(-50%);
  color: rgba(205,239,255,.48); font-size: 9px; font-weight: 900; letter-spacing: .16em;
  pointer-events: none; text-align: center; white-space: nowrap;
}
.mobile-stick {
  position: absolute;
  left: max(22px, env(safe-area-inset-left));
  bottom: max(22px, env(safe-area-inset-bottom));
  width: 168px; height: 168px; border-radius: 50%;
  pointer-events: auto; touch-action: none;
}
.mobile-stick-ring {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 1px solid rgba(142,224,255,.56);
  background: radial-gradient(circle at 50% 50%, rgba(38,154,220,.18), rgba(4,18,34,.24) 56%, rgba(0,0,0,.06) 70%);
  box-shadow: inset 0 0 32px rgba(50,185,255,.22), 0 0 24px rgba(0,128,255,.16);
}
.mobile-stick-ring::before {
  content: ""; position: absolute; left: 17%; right: 17%; top: 50%; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(155,229,255,.50), transparent);
}
.mobile-stick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%;
  border: 1px solid rgba(169,235,255,.72);
  background: radial-gradient(circle at 45% 35%, rgba(218,252,255,.88), rgba(43,170,229,.58) 38%, rgba(4,29,52,.72));
  box-shadow: 0 0 22px rgba(49,191,255,.32), inset 0 0 18px rgba(255,255,255,.12);
  transition: transform .06s linear;
}
.mobile-stick.active .mobile-stick-ring { border-color: rgba(154,235,255,.82); box-shadow: inset 0 0 30px rgba(50,185,255,.28), 0 0 28px rgba(0,166,255,.22); }
.touch-button {
  pointer-events: auto; width: 74px; height: 74px; border-radius: 50%; border: 1px solid rgba(113,205,255,.56);
  background: rgba(3,17,31,.66); color: #dff7ff; font-weight: 900; font-size: 13px; letter-spacing: .06em;
  box-shadow: inset 0 0 20px rgba(14,117,177,.16), 0 0 18px rgba(0,100,180,.12); touch-action: none;
}
.touch-button.jump { display: none; }
.touch-button.boost { width: 118px; height: 118px; border-color: rgba(55,190,255,.9); font-size: 14px; letter-spacing: .08em; background: rgba(4,27,48,.78); box-shadow: inset 0 0 26px rgba(14,117,177,.22), 0 0 24px rgba(0,155,255,.20); }
.touch-button.boost.toggled { background: rgba(14,102,151,.92); border-color: rgba(128,235,255,.95); color: #fff; box-shadow: 0 0 36px rgba(40,198,255,.55), inset 0 0 28px rgba(118,224,255,.24); }
.touch-button.pressed { background: rgba(21,131,197,.72); box-shadow: 0 0 30px rgba(32,175,255,.48); transform: scale(.96); }

@media (pointer: coarse), (max-width: 900px) {
  .mobile-controls.active { display: flex; }
  .hud { height: 96px; grid-template-columns: 1fr 1fr; padding-left: 58px; padding-right: 98px; }
  .hud-stage { gap: 8px; }
  .hud-stage div:nth-child(3) { display: none; }
  .hud-stage strong { font-size: 12px; }
  .hud-center { position: absolute; left: 21%; right: 21%; top: 64px; }
  .hud > .agn-account-root { top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); }
  .game-window-controls { top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); }
  .hud-stats { gap: 10px; }
  .hud-stats strong { font-size: 19px; }
  .hud-stats div:nth-child(3) { display: none; }
  .utility-buttons { top: 102px; right: 10px; }
  .utility-buttons #resetCameraButton, .utility-buttons #hitboxButton { display: none; }
  .utility-buttons button { padding: 7px; font-size: 8px; }
  .perf-overlay { top: 146px; right: 10px; font-size: 8px; min-width: 235px; }
}

@media (max-width: 620px) {
  .menu-panel { padding: 32px 24px; }
  .subtitle { letter-spacing: .30em; }
  .menu-copy { margin: 23px 0; font-size: 13px; }
  .control-hints { gap: 9px 14px; }
  .result-panel { padding: 28px 20px; }
  .result-grid strong { font-size: 18px; }
  .touch-button { width: 64px; height: 64px; }
  .touch-button.boost { width: 104px; height: 104px; font-size: 12px; }
  .mobile-stick { width: 150px; height: 150px; }
  .mobile-stick-knob { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
  .swipe-hint { left: max(78px, calc(env(safe-area-inset-left) + 78px)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 142px); font-size: 8px; }
  .hud-stage div:nth-child(2) strong { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .menu-panel { padding: 18px 32px; }
  .kicker { margin-top: 12px; }
  h1 { font-size: 56px; }
  .subtitle { font-size: 12px; }
  .menu-copy { margin: 12px 0; }
  .control-hints { margin-top: 14px; }
  .touch-button { width: 58px; height: 58px; }
  .touch-button.boost { width: 92px; height: 92px; font-size: 11px; }
  .mobile-stick { width: 132px; height: 132px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .mobile-stick-knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
  .swipe-hint { left: max(68px, calc(env(safe-area-inset-left) + 68px)); bottom: calc(max(8px, env(safe-area-inset-bottom)) + 122px); font-size: 7px; }
}


/* Owner-only RiftDrive live tuner */
.rift-admin-panel {
  position: absolute;
  z-index: 40;
  right: 14px;
  bottom: 14px;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  border: 1px solid rgba(89, 190, 255, .42);
  background: rgba(2, 10, 20, .94);
  color: #dff5ff;
  box-shadow: 0 18px 70px rgba(0,0,0,.65), 0 0 28px rgba(0,132,255,.16);
  backdrop-filter: blur(14px);
  user-select: text;
  touch-action: pan-y;
}
.rift-admin-panel[hidden] { display: none !important; }
.rift-admin-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 15px;
  border-bottom: 1px solid transparent;
  color: #bfeaff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  background: linear-gradient(90deg, rgba(8,85,139,.55), rgba(3,22,39,.88));
}
.rift-admin-panel > summary::-webkit-details-marker { display: none; }
.rift-admin-panel[open] > summary { border-bottom-color: rgba(89,190,255,.24); }
.rift-admin-body { max-height: calc(100vh - 84px); overflow: auto; padding: 13px; }
.rift-admin-heading { padding: 2px 3px 10px; }
.rift-admin-heading strong { display: block; font-size: 12px; letter-spacing: .16em; }
.rift-admin-heading small { display: block; margin-top: 6px; color: #7f9daf; font-size: 10px; line-height: 1.4; }
.rift-admin-section { margin-top: 10px; border: 1px solid rgba(90,178,232,.17); background: rgba(6,24,39,.55); }
.rift-admin-section h3 { margin: 0; padding: 9px 10px; color: #78ceff; font-size: 10px; letter-spacing: .17em; background: rgba(7,57,91,.34); }
.rift-admin-grid { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px; }
.rift-admin-row { display: grid; grid-template-columns: minmax(118px, .9fr) 1.5fr 62px; gap: 8px; align-items: center; }
.rift-admin-row label { color: #a8bfcc; font-size: 10px; letter-spacing: .04em; }
.rift-admin-row input[type="range"] { width: 100%; accent-color: #25aaff; }
.rift-admin-row input[type="number"] {
  width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid rgba(101,190,241,.28);
  background: #04111e; color: #e6f7ff; font: 700 10px/1.2 monospace;
}
.rift-admin-value { color: #7fd7ff; font: 800 10px/1 monospace; text-align: right; }
.rift-admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.rift-admin-actions button {
  min-height: 34px; border: 1px solid rgba(96,196,255,.36); background: rgba(7,74,117,.45);
  color: #d9f4ff; font-size: 9px; font-weight: 900; letter-spacing: .10em; cursor: pointer;
}
.rift-admin-actions button:hover { background: rgba(10,111,170,.62); }
.rift-admin-actions button.danger { border-color: rgba(255,92,82,.35); color: #ffaaa3; background: rgba(103,22,22,.34); }
.rift-admin-actions button:last-child { grid-column: 1 / -1; }
.rift-admin-notice { min-height: 16px; margin-top: 9px; color: #6fa9c7; font: 800 9px/1.4 monospace; letter-spacing: .06em; }
@media (max-width: 760px) {
  .rift-admin-panel { right: 8px; bottom: 8px; width: min(390px, calc(100vw - 16px)); }
  .rift-admin-body { max-height: calc(100vh - 68px); }
  .rift-admin-row { grid-template-columns: 105px 1fr 54px; gap: 6px; }
}

/* v117: keep the tuner and top-right controls from fighting for the same pixels. */
.rift-admin-panel[open] { bottom: 10px; }
@media (max-width: 760px) {
  .game-window-controls button { width: 38px; }
}


/* v121: title, HUD clearance and unblurred menu presentation. */
.menu-panel {
  width: min(920px, calc(100vw - 36px));
  overflow: visible;
  filter: none;
  box-shadow: 0 0 48px rgba(0, 125, 255, .14);
}
.menu-panel h1 {
  white-space: nowrap;
  font-size: clamp(44px, 9vw, 118px);
}
.hud {
  padding-right: max(122px, calc(env(safe-area-inset-right) + 112px));
}
.game-window-controls {
  min-width: 86px;
}
@media (max-width: 900px) {
  .hud {
    padding-right: max(94px, calc(env(safe-area-inset-right) + 88px));
  }
}
@media (max-width: 620px) {
  .menu-panel h1 { font-size: clamp(42px, 13vw, 68px); }
}

/* v179: separate owner-only path blueprint tuner */
.rift-path-admin-panel {
  left: 14px;
  right: auto;
  border-color: rgba(255, 173, 75, .48);
  box-shadow: 0 18px 70px rgba(0,0,0,.65), 0 0 28px rgba(255,128,0,.14);
}
.rift-path-admin-panel > summary {
  color: #ffe0b7;
  background: linear-gradient(90deg, rgba(126,68,8,.62), rgba(24,13,5,.90));
}
.rift-path-admin-panel .rift-admin-section {
  border-color: rgba(255, 174, 82, .18);
  background: rgba(37, 20, 6, .54);
}
.rift-path-admin-panel .rift-admin-section h3 {
  color: #ffc978;
  background: rgba(93, 47, 8, .38);
}
.rift-path-admin-panel .rift-admin-row input[type="range"] { accent-color: #ff9d2e; }
.rift-path-admin-panel .rift-admin-value { color: #ffd18d; }
.rift-path-admin-panel .rift-admin-actions button {
  border-color: rgba(255, 179, 82, .36);
  background: rgba(103, 54, 8, .48);
}
.rift-path-admin-panel .rift-admin-actions button:hover { background: rgba(143, 78, 12, .65); }
@media (max-width: 920px) {
  .rift-path-admin-panel { left: 8px; bottom: 68px; width: min(390px, calc(100vw - 16px)); }
}
@media (min-width: 921px) and (max-width: 1180px) {
  .rift-admin-panel { width: min(390px, calc(50vw - 22px)); }
}

/* V217-E gameplay clarity / respawn polish */
.result-grid { grid-template-columns: repeat(3, minmax(88px, 1fr)); }
.result-grid div:nth-child(n+4) strong { font-size: 18px; }
.respawn-progress {
  width: min(320px, 58vw);
  height: 8px;
  margin: 8px auto 10px;
  border-radius: 999px;
  border: 1px solid rgba(121,214,255,.42);
  background: rgba(4,18,32,.74);
  overflow: hidden;
  box-shadow: 0 0 18px rgba(31,165,255,.18);
}
.respawn-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #117ed8, #49d8ff, #dff6ff);
  box-shadow: 0 0 20px rgba(73,216,255,.7);
  transition: width .08s linear;
}
#riftPressure.collapse-alert span {
  color: #fff4d0;
  text-shadow: 0 0 18px rgba(255,115,42,.95), 0 0 35px rgba(255,43,43,.65);
}
.perf-overlay.hitbox-on::after {
  content: "\A H hitboxes: ON";
  white-space: pre;
  color: #7dffc4;
}
@media (max-width: 720px) {
  .result-grid { grid-template-columns: repeat(2, minmax(82px, 1fr)); }
  .result-grid div:nth-child(n+4) strong { font-size: 15px; }
}


/* V219H clean categorized dropdown tuner */
.rift-admin-fold {
  padding: 0;
  overflow: hidden;
}
.rift-admin-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  color: #d7f5ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  border-bottom: 1px solid rgba(90, 190, 255, .18);
  background: linear-gradient(90deg, rgba(23, 110, 160, .20), rgba(4, 18, 32, .35));
}
.rift-admin-fold > summary::-webkit-details-marker { display: none; }
.rift-admin-fold > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--cyan-bright);
}
.rift-admin-fold[open] > summary::before { transform: rotate(90deg); }
.rift-admin-fold .rift-admin-grid {
  padding: 10px;
}
.rift-admin-row.color-row {
  grid-template-columns: minmax(130px, 1fr) 52px 78px;
}
.rift-admin-row.color-row input[type="color"] {
  width: 46px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(100, 210, 255, .45);
  background: rgba(0, 0, 0, .35);
}

.rift-admin-panel, .rift-admin-panel * {
  -webkit-user-select: auto;
}
.rift-admin-panel input,
.rift-admin-panel summary,
.rift-admin-panel button {
  touch-action: manipulation;
}
