.sr-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
  --sr-ink: #effff9;
  --sr-muted: #8fb6b0;
  --sr-cyan: #74f4e2;
  --sr-amber: #ffc568;
  --sr-red: #ff735f;
  --sr-night: #07161b;
}

.sr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sr-stats,
.sr-actions,
.sr-hud,
.sr-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-stats {
  min-width: 0;
  flex-wrap: wrap;
}

.sr-stat,
.sr-hud-card {
  min-width: 70px;
  padding: 7px 10px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  box-shadow: 0 8px 20px rgba(22, 31, 34, 0.08);
}

.sr-stat span,
.sr-hud-card span,
.sr-final-grid span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-stat strong,
.sr-hud-card strong,
.sr-final-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--cg-ink);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sr-btn,
.sr-touch-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 8px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 31, 34, 0.08);
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  touch-action: manipulation;
}

.sr-btn {
  padding: 0 13px;
}

.sr-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 12px;
}

.sr-btn:hover,
.sr-touch-btn:hover {
  transform: translateY(-1px);
  border-color: var(--cg-teal);
}

.sr-btn:focus-visible,
.sr-touch-btn:focus-visible,
.sr-canvas:focus-visible {
  outline: 3px solid rgba(49, 145, 157, 0.42);
  outline-offset: 3px;
}

.sr-btn:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.sr-primary {
  border-color: transparent;
  background: var(--cg-teal);
  color: #fff;
}

.sr-hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.sr-hud-card {
  position: relative;
  min-width: 0;
  padding: 8px 10px 9px;
  overflow: hidden;
  border: 1px solid rgba(116, 244, 226, 0.3);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(15, 48, 54, 0.96), rgba(5, 20, 25, 0.96));
  box-shadow: inset 0 1px rgba(255,255,255,0.06), 0 10px 24px rgba(2, 12, 16, 0.24);
}

.sr-hud-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(116, 244, 226, 0.7), transparent);
}

.sr-hud-card:nth-child(3) { border-color: rgba(255, 197, 104, 0.38); }
.sr-hud-card:nth-child(3)::after { background: linear-gradient(90deg, transparent, var(--sr-amber), transparent); }
.sr-hud-card:nth-child(4) { border-color: rgba(255, 115, 95, 0.32); }
.sr-hud-card:nth-child(4)::after { background: linear-gradient(90deg, transparent, var(--sr-red), transparent); }
.sr-distance-card::after { background: linear-gradient(90deg, transparent, #9bafff, transparent); }

.sr-stage {
  position: relative;
  height: clamp(430px, 65vh, 660px);
  overflow: hidden;
  border: 1px solid rgba(116, 244, 226, 0.42);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 34%, #163b43, #07161b 72%);
  box-shadow: 0 24px 60px rgba(5, 16, 20, 0.34), inset 0 0 0 1px rgba(255,255,255,0.05);
  touch-action: none;
}

.sr-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 7px solid rgba(4, 12, 15, 0.28);
  border-radius: inherit;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.sr-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 42%, transparent 38%, rgba(2, 10, 14, 0.3) 100%), linear-gradient(180deg, rgba(0, 9, 13, 0.18), transparent 28%, transparent 70%, rgba(0, 8, 11, 0.28));
  pointer-events: none;
}

.sr-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(116, 244, 226, 0);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.sr-float-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.sr-float {
  position: absolute;
  top: 43%;
  left: 50%;
  color: #c8fff3;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  animation: sr-float-rise 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
}

.sr-float-good { color: #a7ffe0; }
.sr-float-bad { color: #ff9b86; }

@keyframes sr-float-rise {
  0% { opacity: 0; transform: translate(-50%, -25%) scale(0.76); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -125%) scale(0.94); }
}

.sr-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  outline: none;
  touch-action: none;
}

.sr-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(228, 255, 247, 0.88);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(20, 36, 40, 0.24), 0 0 14px rgba(116, 244, 226, 0.48);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.sr-shell[data-pickup="ready"] .sr-crosshair {
  box-shadow: 0 0 0 4px rgba(20, 36, 40, 0.26), 0 0 22px rgba(116, 244, 226, 0.82);
  transform: translate(-50%, -50%) scale(1.18);
}

.sr-crosshair::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #bffdf0;
}

.sr-pickup-prompt {
  position: absolute;
  top: calc(50% + 30px);
  left: 50%;
  z-index: 4;
  padding: 6px 10px;
  border: 1px solid rgba(145, 255, 240, 0.68);
  border-radius: 999px;
  background: rgba(4, 24, 27, 0.9);
  color: #bffff4;
  box-shadow: 0 0 20px rgba(89, 255, 220, 0.2);
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
  backdrop-filter: blur(7px);
}

.sr-pickup-prompt span,
.sr-pickup-prompt strong {
  display: block;
  white-space: nowrap;
}

.sr-pickup-prompt span {
  color: #7fe9da;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-pickup-prompt strong {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.1;
}

.sr-player {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 3;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
}

.sr-player-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 23px;
  border: 2px solid var(--sr-cyan);
  border-radius: 15px 15px 5px 5px;
  background: #061417;
  transform-origin: 50% 100%;
  transition: transform 90ms ease;
}

.sr-shell[data-sprint="1"] .sr-player-mark {
  transform: scale(1.08, 0.92);
}

.sr-shell[data-air="1"] .sr-player-mark {
  transform: scale(0.94, 1.12);
}

.sr-player-mark::before,
.sr-player-mark::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 8px;
  height: 8px;
  background: #061417;
  border-bottom: 2px solid var(--sr-cyan);
  transform: rotate(45deg);
}

.sr-player-mark::before { left: 2px; }
.sr-player-mark::after { right: 2px; }
.sr-player-mark i {
  position: absolute;
  top: 7px;
  left: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sr-cyan);
  box-shadow: 0 0 9px var(--sr-cyan);
}

.sr-player small {
  margin-top: 7px;
  color: #d8fff5;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sr-objective,
.sr-stealth {
  position: absolute;
  top: 14px;
  z-index: 3;
  padding: 8px 10px;
  border: 1px solid rgba(143, 224, 210, 0.4);
  border-radius: 8px;
  background: rgba(4, 18, 22, 0.88);
  color: var(--sr-ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  backdrop-filter: blur(7px);
}

.sr-objective {
  left: 14px;
  width: min(250px, calc(100% - 168px));
}

.sr-objective span,
.sr-objective small,
.sr-stealth span,
.sr-stealth small {
  display: block;
  color: #8ed8cb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sr-objective strong {
  display: block;
  margin: 2px 0;
  color: #f1fff9;
  font-size: 15px;
  line-height: 1.1;
}

.sr-objective small {
  color: #b8d6cf;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.sr-objective[data-gate="sealed"] {
  border-color: rgba(255, 174, 82, 0.52);
}

.sr-objective[data-gate="sealed"] span {
  color: #ffc16f;
}

.sr-objective[data-gate="open"] {
  border-color: rgba(105, 255, 170, 0.68);
  box-shadow: 0 0 20px rgba(89, 255, 157, 0.2);
}

.sr-objective[data-gate="open"] span,
.sr-objective[data-gate="open"] strong {
  color: #9affc4;
}

.sr-stealth {
  right: 14px;
  width: 126px;
  text-align: right;
}

.sr-stealth strong {
  display: block;
  margin: 1px 0;
  color: #f1fff9;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sr-stealth[data-phase="seen"],
.sr-stealth[data-phase="hunt"] {
  border-color: rgba(255, 91, 69, 0.72);
}

.sr-stealth[data-phase="seen"] span,
.sr-stealth[data-phase="hunt"] span {
  color: #ff8c72;
}

.sr-stealth[data-phase="searching"] {
  border-color: rgba(242, 185, 83, 0.66);
}

.sr-stealth[data-phase="searching"] span {
  color: #ffd27b;
}

.sr-alertbar {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  height: 5px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(10, 22, 26, 0.55);
  pointer-events: none;
}

.sr-alertbar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #e2b04b, #f1604d);
  transition: width 100ms linear;
}

.sr-loading,
.sr-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(88%, 380px);
  max-height: calc(100% - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(116, 244, 226, 0.42);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(10, 38, 45, 0.98), rgba(3, 14, 19, 0.98));
  color: #edfbf4;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255,255,255,0.08), 0 0 30px rgba(55, 191, 185, 0.1);
  backdrop-filter: blur(12px);
}

.sr-loading strong,
.sr-panel h1,
.sr-panel h2 {
  margin: 0;
  color: #f2fff9;
  font-size: 26px;
  line-height: 1.05;
}

.sr-panel h2 {
  font-size: 22px;
}

.sr-loading span,
.sr-panel p {
  margin: 0;
  color: #b5cbc5;
  font-size: 14px;
  line-height: 1.45;
}

.sr-panel .sr-keyline {
  color: #81d9c8;
  font-size: 12px;
  font-weight: 800;
}

.sr-eyebrow {
  color: #71d9c7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sr-loading.sr-hidden,
.sr-panel.sr-hidden,
.sr-toast.sr-hidden,
.sr-pickup-prompt.sr-hidden,
.sr-modal.sr-hidden {
  display: none !important;
}

.sr-result {
  border-color: rgba(116, 244, 226, 0.48);
  background: linear-gradient(150deg, rgba(9, 42, 43, 0.98), rgba(5, 18, 23, 0.98));
}

.sr-result[data-outcome="exposed"] {
  border-color: rgba(255, 115, 95, 0.5);
  background: linear-gradient(150deg, rgba(55, 25, 28, 0.98), rgba(5, 18, 23, 0.98));
}

.sr-result-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 2px;
  color: var(--sr-cyan);
  font-size: 17px;
  font-weight: 900;
  transform: rotate(45deg);
}

.sr-result-sigil i {
  position: absolute;
  inset: 0;
  border: 2px solid currentColor;
  box-shadow: 0 0 24px rgba(116, 244, 226, 0.25), inset 0 0 16px rgba(116, 244, 226, 0.12);
}

.sr-result-sigil span { transform: rotate(-45deg); }
.sr-result[data-outcome="exposed"] .sr-result-sigil { color: var(--sr-red); }

.sr-result {
  animation: sr-pop 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sr-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sr-final-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.sr-final-grid > div {
  padding: 9px 3px;
  border: 1px solid rgba(116, 244, 226, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.sr-final-grid > div:first-child {
  border-color: rgba(255, 197, 104, 0.45);
  background: rgba(255, 197, 104, 0.08);
}

.sr-final-grid strong {
  color: #ecfff5;
  font-size: 15px;
}

.sr-result-actions {
  margin-top: 3px;
}

.sr-result-actions .sr-btn {
  flex: 1 1 0;
}

.sr-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  padding: 9px 14px;
  border: 1px solid rgba(136, 242, 216, 0.45);
  border-radius: 7px;
  background: rgba(14, 36, 38, 0.92);
  color: #b9ffed;
  font-size: 13px;
  font-weight: 800;
  transform: translateX(-50%);
  pointer-events: none;
}

.sr-note {
  margin: 10px 2px 0;
  color: var(--cg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.sr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 31, 0.58);
}

.sr-modal-card {
  position: relative;
  width: min(100%, 460px);
  padding: 22px;
  border: 1px solid var(--cg-line);
  border-radius: 9px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.sr-modal-card h2 {
  margin: 0 48px 12px 0;
  font-size: 24px;
  line-height: 1.1;
}

.sr-modal-card p {
  margin: 10px 0 0;
  color: var(--cg-muted);
  font-size: 14px;
  line-height: 1.45;
}

.sr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.sr-touch {
  display: none;
}

.sr-dpad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 4px;
}

.sr-touch-btn {
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  background: rgba(18, 38, 42, 0.84);
  color: #d7fff1;
  font-size: 12px;
  user-select: none;
  -webkit-user-select: none;
}

.sr-touch-btn.is-held,
.sr-touch-btn:active {
  border-color: rgba(174, 255, 232, 0.9);
  background: rgba(40, 112, 103, 0.95);
  box-shadow: 0 0 0 3px rgba(116, 244, 226, 0.16), 0 5px 16px rgba(0, 0, 0, 0.32);
  transform: translateY(1px) scale(0.94);
}

.sr-up { grid-column: 2; grid-row: 1; }
.sr-left { grid-column: 1; grid-row: 2; }
.sr-right { grid-column: 3; grid-row: 2; }
.sr-down { grid-column: 2; grid-row: 3; }

.sr-touch-actions {
  display: grid;
  gap: 8px;
  align-content: end;
}

.sr-touch-actions .sr-touch-btn {
  width: 74px;
}

.sr-jump {
  border-color: rgba(126, 242, 208, 0.58);
  background: rgba(24, 96, 91, 0.88);
}

@media (pointer: coarse) {
  .sr-shell[data-state="playing"] .sr-touch {
    position: absolute;
    right: 14px;
    bottom: 30px;
    left: 14px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    pointer-events: none;
  }

  .sr-shell[data-state="playing"] .sr-touch > * {
    pointer-events: auto;
  }
}

@media (max-width: 700px) {
  .sr-shell { padding: 0 10px 18px; }
  .sr-topbar { gap: 7px; }
  .sr-stat { min-width: 58px; padding: 6px 7px; }
  .sr-stat:nth-child(1), .sr-stat:nth-child(3) { display: none; }
  .sr-actions { gap: 4px; }
  .sr-icon-btn { width: 44px; min-width: 44px; padding: 0; }
  .sr-hud { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .sr-hud-card { padding: 6px 3px 7px; }
  .sr-hud-card span { font-size: 8px; letter-spacing: 0; }
  .sr-hud-card strong { font-size: 14px; }
  .sr-stage { height: min(69vh, 600px); min-height: 430px; }
}

@media (max-width: 430px) {
  .sr-objective {
    top: 10px;
    left: 10px;
    width: min(202px, calc(100% - 126px));
    padding: 7px 8px;
  }
  .sr-objective strong { font-size: 13px; }
  .sr-objective small { font-size: 8px; }
  .sr-stealth { top: 10px; right: 10px; width: 104px; padding: 7px 8px; }
  .sr-toast { top: 72px; max-width: calc(100% - 24px); }
  .sr-pickup-prompt { top: calc(50% + 24px); padding: 5px 8px; }
  .sr-pickup-prompt strong { font-size: 11px; }
  .sr-stealth strong { font-size: 17px; }
  .sr-topbar { align-items: center; }
  .sr-stat { min-width: 52px; }
  .sr-hud-card strong { font-size: 13px; }
  .sr-hud-card span { font-size: 7px; }
  .sr-distance-card span { white-space: nowrap; transform: scale(.92); }
  .sr-stage { height: 67vh; min-height: 410px; }
  .sr-player { bottom: 15px; }
  .sr-panel { width: min(92%, 350px); padding: 16px; }
  .sr-panel h1, .sr-loading strong { font-size: 23px; }
  .sr-result { gap: 6px; }
  .sr-result-sigil { width: 48px; height: 48px; font-size: 14px; }
  .sr-final-grid { gap: 4px; }
  .sr-final-grid > div { padding: 7px 2px; }
  .sr-dpad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); }
  .sr-touch-btn { width: 52px; min-width: 52px; height: 52px; min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .sr-btn,
  .sr-touch-btn,
  .sr-crosshair,
  .sr-player-mark,
  .sr-alertbar span {
    transition: none;
  }

  .sr-result {
    animation: none;
  }

  .sr-flash {
    display: none;
  }

  .sr-float {
    top: 46%;
    animation: none;
  }
}
