* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #05060a;
    color: #ffffff;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  }
  
  button {
    font: inherit;
  }
  
  canvas {
    display: block;
  }
  
  #ui {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
  }
  
  /* Crosshair and hit feedback */
  #crosshair {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 6;
    display: none;
    width: 26px;
    height: 26px;
    transform: translate(-50%, -50%);
    transition: opacity 0.1s;
  }
  
  #crosshair .l {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 2px #000000;
  }
  
  #crosshair .t,
  #crosshair .b {
    left: 50%;
    width: 2px;
    height: 8px;
    transform: translateX(-50%);
  }
  
  #crosshair .t { top: 0; }
  #crosshair .b { bottom: 0; }
  
  #crosshair .lf,
  #crosshair .rt {
    top: 50%;
    width: 8px;
    height: 2px;
    transform: translateY(-50%);
  }
  
  #crosshair .lf { left: 0; }
  #crosshair .rt { right: 0; }
  
  #crosshair .dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  
  #crosshair.aiming {
    opacity: 0.25;
  }
  
  #hit-marker {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 7;
    width: 22px;
    height: 22px;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.08s;
  }
  
  #hit-marker::before,
  #hit-marker::after {
    position: absolute;
    content: "";
    background: #ff4d4d;
    box-shadow: 0 0 4px #000000;
  }
  
  #hit-marker::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%) rotate(45deg);
  }
  
  #hit-marker::after {
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    transform: translateY(-50%) rotate(45deg);
  }
  
  #muzzle-flash {
    position: fixed;
    left: 50%;
    top: 54%;
    z-index: 5;
    width: 120px;
    height: 120px;
    opacity: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 240, 160, 0.95) 0%, rgba(255, 170, 40, 0.6) 35%, transparent 70%);
  }
  
  #damage-overlay,
  #ads-vignette,
  #scope-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
  }
  
  #damage-overlay {
    z-index: 4;
    opacity: 0;
    transition: opacity 0.15s;
    background: radial-gradient(circle, transparent 35%, rgba(255, 30, 30, 0.55) 100%);
  }
  
  #ads-vignette {
    z-index: 3;
    opacity: 0;
    transition: opacity 0.15s;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.55) 80%);
  }
  
  #ads-vignette.active {
    opacity: 1;
  }
  
  #scope-overlay {
    z-index: 8;
    display: none;
  }
  
  #scope-overlay::before {
    position: absolute;
    inset: 0;
    content: "";
    background: rgba(0, 0, 0, 0.96);
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 28vh, #000000 28vh);
    mask: radial-gradient(circle at 50% 50%, transparent 0 28vh, #000000 28vh);
  }
  
  #scope-overlay .cross {
    position: absolute;
    left: 50%;
    top: 50%;
    background: rgba(0, 0, 0, 0.7);
  }
  
  #scope-overlay .h {
    width: 56vh;
    height: 1px;
    transform: translate(-50%, -50%);
  }
  
  #scope-overlay .v {
    width: 1px;
    height: 56vh;
    transform: translate(-50%, -50%);
  }
  
  /* Game HUD */
  #hud {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: none;
  }
  
  .panel {
    position: fixed;
    padding: 10px 14px;
    background: rgba(12, 16, 24, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  
  .lbl {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
  }
  
  .val {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
  }
  
  #score-panel {
    left: 50%;
    top: 18px;
    min-width: 150px;
    text-align: center;
    transform: translateX(-50%);
  }
  
  #score-val {
    color: #ff6644;
    font-size: 34px;
  }
  
  #health-panel {
    left: 22px;
    bottom: 22px;
    min-width: 200px;
  }
  
  #health-bar-wrap {
    height: 9px;
    margin-top: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
  }
  
  #health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #44ff88, #22cc66);
    transition: width 0.12s;
  }
  
  #ammo-panel {
    right: 22px;
    bottom: 22px;
    min-width: 160px;
    text-align: right;
  }
  
  #ammo-val {
    color: #ffcc33;
  }
  
  #weapon-panel {
    right: 22px;
    bottom: 108px;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
  }
  
  #weapon-panel #weapon-icon { width: 55px; }

  #weapon-name {
    font-size: 16px;
    font-weight: 800;
  }
  
  #weapon-cat {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  
  #slots {
    position: fixed;
    left: 50%;
    bottom: 22px;
    display: flex;
    gap: 7px;
    transform: translateX(-50%);
  }
  
  .slot {
    min-width: 62px;
    padding: 6px 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    background: rgba(12, 16, 24, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    transition: all 0.12s;
  }
  
  .slot .n {
    display: block;
    color: #ffffff;
    font-size: 13px;
  }
  
  .slot.act {
    color: #ffffff;
    background: rgba(255, 102, 68, 0.18);
    border-color: #ff6644;
    box-shadow: 0 0 14px rgba(255, 102, 68, 0.35);
  }
  
  #minimap {
    position: fixed;
    right: 22px;
    top: 18px;
    width: 140px;
    height: 140px;
  }
  
  #minimap canvas {
    width: 140px;
    height: 140px;
    background: rgba(8, 12, 8, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
  }
  
  #kill-feed {
    position: fixed;
    right: 22px;
    top: 172px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
  }
  
  .kill-msg {
    padding: 4px 11px;
    color: #ffcc33;
    font-size: 13px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
  }
  
  #msg {
    position: fixed;
    left: 50%;
    top: 34%;
    z-index: 6;
    opacity: 0;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%);
    transition: opacity 0.15s;
  }
  
  #msg.show {
    opacity: 1;
  }
  
  /* Setup and end screens */
  .screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    pointer-events: auto;
  }
  
  #setup-screen {
    background: linear-gradient(30deg, rgba(9, 14, 24, .71), transparent 53%);
    align-items: stretch;
    justify-content: flex-end;
  }
  
  #setup-hero {
    position: absolute;
    left: 48px;
    bottom: 48px;
    max-width: 560px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
  }
  
  #setup-hero .chip {
    display: inline-block;
    padding: 6px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 8px;
  }
  
  #setup-hero h1 {
    font-size: clamp(2.6rem, 6vw, 5.4rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -2px;
    text-transform: uppercase;
  }
  
  #setup-hero p {
    max-width: 440px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
  }
  
  #setup-panel {
    width: min(440px, 42vw);
    height: 100%;
    padding: 22px;
    overflow-y: auto;
    background: rgba(10, 13, 20, 0.86);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
  }
  
  #setup-panel h2 {
    font-size: 20px;
    font-weight: 900;
  }
  
  #setup-panel .sub {
    margin-top: 3px;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
  }
  
  .section-label {
    display: flex;
    justify-content: space-between;
    margin: 18px 0 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  
  .diff-row,
  .tabs {
    display: flex;
    gap: 7px;
  }
  
  .tabs {
    gap: 5px;
    margin-bottom: 7px;
  }
  
  .diff-btn,
  .tab {
    flex: 1;
    color: #ffffff;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    transition: all 0.12s;
  }
  
  .diff-btn {
    padding: 9px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
  }
  
  .tab {
    padding: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }
  
  .diff-btn.sel,
  .tab.act {
    color: #ffffff;
    background: rgba(255, 102, 68, 0.16);
    border-color: #ff6644;
    box-shadow: 0 0 12px rgba(255, 102, 68, 0.3);
  }
  
  #map-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .map-card {
    padding: 0;
    color: inherit;
    text-align: left;
    font: inherit;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: all 0.12s;
  }
  
  .map-card.sel {
    border-color: #ff6644;
    box-shadow: 0 0 0 2px rgba(255, 102, 68, 0.4);
  }
  
  .map-card img {
    display: block;
    object-fit: cover;
    width: 100%;
    height: 78px;
  }
  
  .map-card .cap {
    padding: 6px 8px;
  }
  
  .map-card .cap b {
    font-size: 13px;
    font-weight: 800;
  }
  
  .map-card .cap span,
  .wpn small {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  
  #weapon-list {
    display: grid;
    gap: 5px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
  }
  
  .wpn {
    display: grid;
    grid-template-columns: 42px 1fr 22px;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    transition: all 0.12s;
  }
  
  .wpn:hover {
    border-color: rgba(255, 102, 68, 0.4);
  }
  
  .wpn.sel {
    background: rgba(255, 102, 68, 0.1);
    border-color: #ff6644;
  }
  
  .weapon-art, #weapon-icon {
    display: block;
    width: 100%;
    height: 40px;
    object-fit: contain;
    padding: 3px;
    border-radius: 5px;
    background: radial-gradient(ellipse at center, #536474, #34404e);
  }

  .wpn b {
    font-size: 13px;
    font-weight: 800;
  }
  
  .wpn .pick {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
  }
  
  .wpn.sel .pick {
    background: radial-gradient(circle, #ff6644 0 5px, transparent 6px);
    border-color: #ff6644;
  }
  
  #slot-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
  }
  
  .slot-box {
    min-height: 48px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 7px;
  }
  
  .slot-box b {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    text-transform: uppercase;
  }
  
  .slot-box span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 800;
  }
  
  #start-btn,
  #again-btn {
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(135deg, #ff4422, #ff6644);
    border: none;
    border-radius: 9px;
  }
  
  #start-btn {
    width: 100%;
    padding: 14px;
    margin-top: 18px;
    box-shadow: 0 10px 26px rgba(255, 68, 34, 0.35);
  }
  
  #start-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
    box-shadow: none;
  }

  #startup-error {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    color: #ffd6cf;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    background: rgba(190, 35, 25, 0.28);
    border: 1px solid rgba(255, 90, 70, 0.6);
    border-radius: 7px;
  }

  #startup-error.show {
    display: block;
  }
  
  .note {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.4;
  }
  
  .note span {
    padding: 1px 6px;
    margin: 0 1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }
  
  #end-screen {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
  }
  
  #end-box {
    padding: 40px 50px;
    text-align: center;
    background: rgba(14, 18, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  }
  
  #end-box h2 {
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #44ff88, #ffcc33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  #end-box p {
    margin: 12px 0 26px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
  }
  
  #again-btn {
    padding: 14px 40px;
  }
  
