:root {
  color-scheme: dark;
  --panel: rgba(9, 12, 14, 0.78);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f3f6ee;
  --muted: #a9b4b0;
  --accent: #f2c84b;
  --danger: #e65345;
  --good: #50d26f;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101417;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

.ops-shell,
#ops-canvas {
  width: 100vw;
  height: 100vh;
}

#ops-canvas {
  display: block;
  cursor: crosshair;
}

.corner-logo {
  position: fixed;
  z-index: 6;
  top: 16px;
  left: 16px;
  width: 56px;
  height: 56px;
  display: block;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(3, 5, 6, 0.46);
  box-shadow: 0 14px 42px rgba(0,0,0,0.34);
  pointer-events: none;
}

.topbar,
.side-panel,
.wallet-panel,
.center-card,
.landing-panel {
  position: fixed;
  z-index: 5;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,0.1), transparent 34%), var(--panel);
  box-shadow: 0 22px 70px rgba(0,0,0,0.38);
  backdrop-filter: blur(16px) saturate(1.12);
}

.topbar {
  top: 14px;
  left: calc(50% + 42px);
  width: min(960px, calc(100vw - 112px));
  min-height: 62px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) repeat(5, minmax(82px, 0.65fr)) 58px 112px;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border-radius: 8px;
}

.brand,
.stat,
.topbar button {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(3, 5, 6, 0.52);
  border-radius: 6px;
  padding: 8px 10px;
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.brand strong {
  display: block;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 3px;
}

.brand span,
.stat span,
.side-panel .label,
.side-panel p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.stat b {
  margin-top: 3px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.stat.reward b {
  color: var(--good);
}

.topbar button,
.side-panel button,
.side-panel select {
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(8, 12, 14, 0.82);
  border-radius: 6px;
}

.topbar button,
.side-panel button {
  cursor: pointer;
  font-weight: 800;
}

.topbar button {
  padding: 0 12px;
}

.wallet-panel {
  top: 88px;
  right: 16px;
  width: min(310px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
}

.wallet-panel.hidden {
  display: none;
}

.wallet-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.wallet-panel .label,
.wallet-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.wallet-panel strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.1;
}

.wallet-panel button {
  min-height: 38px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(8, 12, 14, 0.82);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.wallet-provider-list {
  display: grid;
  gap: 8px;
}

.wallet-provider-list button,
.wallet-provider-list a {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(8, 12, 14, 0.82);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.wallet-provider-list small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.side-panel {
  left: 16px;
  bottom: 16px;
  width: min(310px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
}

.room-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
}

.room-panel-head strong {
  display: block;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-panel-body {
  display: grid;
  gap: 10px;
}

.room-toggle-button {
  min-height: 34px;
  padding: 0 10px;
}

.side-panel.rooms-collapsed {
  width: auto;
  min-width: 0;
  padding: 0;
  gap: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.side-panel.rooms-collapsed .room-panel-body {
  display: none;
}

.side-panel.rooms-collapsed .room-panel-head {
  display: block;
}

.side-panel.rooms-collapsed .room-panel-head > div {
  display: none;
}

.side-panel.rooms-collapsed .room-toggle-button {
  width: 76px;
  min-height: 38px;
  border-color: rgba(255,255,255,0.18);
  background: rgba(8, 12, 14, 0.72);
  box-shadow: 0 10px 34px rgba(0,0,0,0.34);
  backdrop-filter: blur(10px) saturate(1.1);
}

.landing-panel {
  left: auto;
  right: 16px;
  top: auto;
  bottom: 14px;
  width: min(980px, calc(100vw - 230px));
  max-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(230px, 0.8fr) minmax(220px, 0.8fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(20, 241, 149, 0.08), transparent 30%),
    linear-gradient(315deg, rgba(153, 69, 255, 0.09), transparent 34%),
    rgba(3, 7, 8, 0.72);
  box-shadow: 0 28px 90px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px) saturate(1.08);
  overflow: auto;
}

.landing-panel.hidden {
  display: none;
}

.landing-copy,
.profile-card,
.leaderboard-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(2, 6, 7, 0.68);
  border-radius: 6px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.landing-copy h1 {
  margin: 0;
  color: var(--accent);
  font-size: 34px;
  line-height: 0.95;
}

.landing-logo {
  width: min(150px, 52%);
  max-height: 82px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.landing-copy p,
.profile-card label,
.leaderboard-card p {
  margin: 0;
  color: #d8e1dc;
  font-size: 14px;
  line-height: 1.42;
}

.landing-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.landing-grid span,
.metrics-grid span,
.leaderboard-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(9, 14, 16, 0.74);
  padding: 7px 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
}

.landing-grid b {
  color: var(--accent);
  font-size: 14px;
}

.metrics-grid b,
.metrics-grid small {
  display: block;
}

.metrics-grid small {
  color: #aebbb6;
  font-size: 11px;
}

.ca-box {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(20, 241, 149, 0.34);
  border-radius: 6px;
  background: rgba(5, 18, 13, 0.72);
  padding: 10px;
}

.ca-box small {
  color: var(--good);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.ca-box code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.32;
}

.social-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.social-links a {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  background: rgba(10, 13, 16, 0.76);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.social-links a:hover {
  border-color: rgba(20, 241, 149, 0.52);
}

.profile-preview {
  width: 100%;
  aspect-ratio: 1;
  min-height: 158px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  background: radial-gradient(circle at 50% 38%, rgba(30, 64, 75, 0.28), rgba(6, 10, 12, 0.74) 68%);
}

.panel-title {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-card input,
.profile-card select,
.profile-card button {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(9, 13, 15, 0.78);
  border-radius: 6px;
  padding: 0 10px;
}

.profile-card button {
  cursor: pointer;
  font-weight: 900;
  font-size: 16px;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.swatch-grid input[type="color"] {
  padding: 2px;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
}

.leaderboard-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row i {
  color: var(--good);
  font-style: normal;
  font-weight: 900;
}

.side-panel select,
.side-panel button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
}

.side-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.room-list {
  display: grid;
  gap: 6px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 2px;
}

.room-row {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(5, 8, 10, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.room-row.active {
  border-color: rgba(242, 200, 75, 0.72);
  box-shadow: inset 0 0 0 1px rgba(242, 200, 75, 0.25);
}

.room-row.full {
  opacity: 0.55;
}

.room-row b,
.room-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row b {
  font-size: 12px;
}

.room-row span {
  color: var(--muted);
  font-size: 10px;
}

.room-count {
  color: var(--good);
  font-weight: 900;
  font-size: 12px;
}

.crosshair {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.crosshair::before {
  left: 12px;
  top: 4px;
  width: 2px;
  height: 18px;
}

.crosshair::after {
  left: 4px;
  top: 12px;
  width: 18px;
  height: 2px;
}

.scope-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(5, 7, 8, 0.95) calc(50% - 1px), rgba(5, 7, 8, 0.95) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), rgba(5, 7, 8, 0.95) calc(50% - 1px), rgba(5, 7, 8, 0.95) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at center, transparent 0 33vmin, rgba(0,0,0,0.96) 33.2vmin 100%);
}

.scope-overlay::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 66vmin;
  height: 66vmin;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(5, 7, 8, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.72), inset 0 0 22px rgba(0,0,0,0.38);
}

.scope-overlay.active {
  display: block;
}

body:has(.scope-overlay.active) .crosshair {
  display: none;
}

.hitmarker {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 2px solid transparent;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.75);
  opacity: 0;
  pointer-events: none;
}

.hitmarker.active {
  border-color: var(--accent);
  opacity: 1;
  animation: hit 130ms ease-out;
}

.hitmarker.kill {
  width: 56px;
  height: 56px;
  border-width: 3px;
  border-color: var(--danger);
  opacity: 1;
  animation: killHit 420ms ease-out;
}

.kill-banner,
.death-banner {
  position: fixed;
  z-index: 7;
  left: 50%;
  top: 31%;
  min-width: min(360px, calc(100vw - 32px));
  max-width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, -50%) scale(0.96);
  display: none;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.86);
  box-shadow: 0 22px 70px rgba(0,0,0,0.48);
  color: var(--text);
  padding: 14px 18px;
  text-align: center;
  pointer-events: none;
}

.kill-banner.active,
.death-banner.active {
  display: block;
  animation: bannerPop 2.55s ease-out forwards;
}

.kill-banner b,
.death-banner b {
  display: block;
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
}

.death-banner b {
  color: var(--danger);
}

.kill-banner span,
.death-banner span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.25;
}

@media (max-width: 1100px) {
  .landing-panel {
    top: auto;
    bottom: 14px;
    right: 16px;
    left: auto;
    width: min(900px, calc(100vw - 96px));
    max-height: calc(100vh - 96px);
    grid-template-columns: minmax(300px, 1.15fr) minmax(220px, 0.85fr);
  }

  .leaderboard-card {
    grid-column: 1 / -1;
  }
}

.kill-feed {
  position: fixed;
  z-index: 6;
  top: 90px;
  right: 16px;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.kill-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  background: rgba(5, 8, 10, 0.78);
  box-shadow: 0 10px 34px rgba(0,0,0,0.28);
  padding: 10px 11px;
  color: var(--text);
  font-size: 13px;
  animation: feedIn 7.6s ease-out forwards;
}

.kill-feed-row b,
.kill-feed-row i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kill-feed-row i {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.damage-vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle, transparent 48%, rgba(230, 83, 69, 0.35));
  opacity: 0;
  transition: opacity 160ms ease;
}

.damage-vignette.active {
  opacity: 1;
}

.center-card {
  left: 50%;
  top: 50%;
  width: min(440px, calc(100vw - 34px));
  transform: translate(-50%, -50%);
  padding: 22px;
  border-radius: 8px;
  text-align: center;
}

.center-card.hidden {
  display: none;
}

.center-card h1 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
}

.center-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@keyframes hit {
  from { transform: translate(-50%, -50%) rotate(45deg) scale(1.2); }
  to { transform: translate(-50%, -50%) rotate(45deg) scale(0.75); }
}

@keyframes killHit {
  from { transform: translate(-50%, -50%) rotate(45deg) scale(1.45); }
  to { transform: translate(-50%, -50%) rotate(45deg) scale(0.75); }
}

@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(0.98); }
}

@keyframes feedIn {
  0% { opacity: 0; transform: translateX(18px); }
  12% { opacity: 1; transform: translateX(0); }
  82% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(12px); }
}

@media (max-width: 760px) {
  .corner-logo {
    width: 42px;
    height: 42px;
    top: 10px;
    left: 10px;
  }

  .topbar {
    top: 60px;
    left: 50%;
    width: calc(100vw - 20px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .brand,
  .topbar button {
    grid-column: span 2;
  }

  .stat b {
    font-size: 18px;
  }

  .side-panel {
    left: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: 42vh;
    overflow: auto;
  }

  .wallet-panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }

  .kill-feed {
    top: auto;
    right: 10px;
    bottom: 58px;
    width: min(310px, calc(100vw - 20px));
  }

  .side-panel.rooms-collapsed {
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .landing-panel {
    left: 10px;
    right: 10px;
    top: 96px;
    bottom: 10px;
    width: auto;
    max-height: none;
    grid-template-columns: 1fr;
    overflow: auto;
    padding: 12px;
  }

  .landing-copy,
  .profile-card,
  .leaderboard-card {
    padding: 12px;
  }

  .landing-logo {
    width: min(132px, 58%);
  }

  .landing-copy p,
  .profile-card label,
  .leaderboard-card p {
    font-size: 13px;
  }

  .landing-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
