* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    overflow: hidden;
    background: #000;
    font-family: 'Arial', sans-serif;
  }
  canvas {
    display: block;
  }

  /* ===== TITLE SCREEN ===== */
  #title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
  }
  #title-screen h1 {
    font-size: 80px;
    color: #ffbe0b;
    text-shadow:
      4px 4px 0 #fb5607,
      8px 8px 0 #ff006e;
    animation: bounce 0.6s ease-in-out infinite alternate;
  }
  #title-screen p {
    font-size: 24px;
    color: white;
    margin-top: 20px;
    opacity: 0.8;
  }
  @keyframes bounce {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(-20px);
    }
  }
  /* ===== LOBBY SCREEN ===== */
  #lobby-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    z-index: 200;
    overflow-y: auto;
    padding: 40px 20px;
  }
  #lobby-screen h1 {
    font-size: 60px;
    color: #ffbe0b;
    text-shadow:
      3px 3px 0 #fb5607,
      6px 6px 0 #ff006e;
    margin-bottom: 30px;
  }
  #lobby-screen input {
    font-size: 24px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    text-align: center;
    margin: 8px;
    width: 260px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
  }
  #lobby-screen input::placeholder {
    color: #999;
  }
  #lobby-screen button {
    font-size: 22px;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 8px;
    font-weight: bold;
    width: 260px;
    transition: transform 0.1s;
  }
  #lobby-screen button:hover {
    transform: scale(1.05);
  }
  .btn-create {
    background: #06d6a0;
    color: #000;
  }
  .btn-join {
    background: #ffbe0b;
    color: #000;
  }
  .btn-tutorial {
    background: #00f5d4;
    color: #031616;
  }
  #lobby-status {
    color: white;
    font-size: 18px;
    margin-top: 15px;
    min-height: 24px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  }
  #room-code-display {
    font-size: 48px;
    color: #ffbe0b;
    font-weight: bold;
    letter-spacing: 12px;
    text-shadow: 3px 3px 0 #fb5607;
    margin: 15px 0;
    display: none;
  }
  /* ===== ABOUT SECTION (SEO) ===== */
  .about-section {
    margin-top: 30px;
    padding: 20px 30px;
    max-width: 480px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.6;
  }
  .about-section h3 {
    font-size: 16px;
    color: #ffbe0b;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }
  .about-section p {
    margin-bottom: 12px;
  }
  .about-section p:last-child {
    margin-bottom: 0;
  }

  /* ===== HUD ===== */
  #hud {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
  #hud .score {
    font-size: 32px;
    color: #ffbe0b;
  }
  #hud .total {
    font-size: 16px;
    color: #ccc;
    margin-top: 4px;
  }

  /* ===== TROLL BLOCK MESSAGE ===== */
  #troll-block-message {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 70;
    width: min(760px, calc(100vw - 32px));
    padding: 8px 12px;
    pointer-events: none;
    color: #ffbe0b;
    font-size: 62px;
    font-weight: 900;
    line-height: 1.08;
    text-align: center;
    text-shadow:
      3px 3px 0 #fb5607,
      6px 6px 0 #ff006e,
      0 0 26px rgba(255, 190, 11, 0.85);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.82) rotate(-2deg);
  }
  #troll-block-message.show {
    animation: troll-message-pop 1.8s ease-out forwards;
  }
  @keyframes troll-message-pop {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.82) rotate(-2deg);
    }
    12% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.1) rotate(1deg);
    }
    24% {
      transform: translate(-50%, -50%) scale(1) rotate(-1deg);
    }
    76% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1) rotate(-1deg);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -56%) scale(0.92) rotate(2deg);
    }
  }
  @media (max-width: 520px) {
    #troll-block-message {
      font-size: 34px;
      text-shadow:
        2px 2px 0 #fb5607,
        4px 4px 0 #ff006e,
        0 0 20px rgba(255, 190, 11, 0.85);
    }
  }

  /* ===== TUTORIAL COMBO ===== */
  #tutorial-combo-ui {
    --tutorial-combo-color: #ffbe0b;
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 35;
    width: min(260px, calc(100vw - 32px));
    pointer-events: none;
    text-align: center;
    transform: translateX(-50%);
  }
  .tutorial-combo-panel {
    border: 2px solid var(--tutorial-combo-color);
    border-radius: 8px;
    background: rgba(7, 11, 24, 0.76);
    box-shadow:
      0 0 18px rgba(255, 190, 11, 0.45),
      inset 0 0 18px rgba(255, 255, 255, 0.08);
    color: white;
    padding: 8px 12px 10px;
  }
  .tutorial-combo-label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
  }
  .tutorial-combo-value {
    color: var(--tutorial-combo-color);
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    margin-top: 3px;
    text-shadow:
      0 0 16px var(--tutorial-combo-color),
      2px 2px 0 #000;
  }
  .tutorial-combo-meter {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
  }
  .tutorial-combo-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #00f5d4, var(--tutorial-combo-color), #ffffff);
    box-shadow: 0 0 12px var(--tutorial-combo-color);
    transition: width 0.08s linear;
  }
  .tutorial-combo-pop {
    position: absolute;
    top: 80px;
    left: 50%;
    width: min(720px, calc(100vw - 24px));
    color: var(--tutorial-combo-color);
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(36px, 8vw, 84px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.95;
    opacity: 0;
    text-shadow:
      0 0 20px var(--tutorial-combo-color),
      0 0 42px rgba(255, 255, 255, 0.5),
      4px 4px 0 #000,
      -2px -2px 0 #000;
    transform: translateX(-50%) scale(0.4);
  }
  .tutorial-combo-pop.show {
    animation: tutorialComboPop 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes tutorialComboPop {
    0% {
      opacity: 0;
      transform: translateX(-50%) scale(2.4) rotate(-5deg);
    }
    14% {
      opacity: 1;
      transform: translateX(-50%) scale(1) rotate(0deg);
    }
    70% {
      opacity: 1;
      transform: translateX(-50%) scale(1.08) rotate(1deg);
    }
    100% {
      opacity: 0;
      transform: translateX(-50%) translateY(-42px) scale(0.86);
    }
  }

  /* ===== TUTORIAL WELCOME ===== */
  #tutorial-welcome-message {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 55;
    width: min(900px, calc(100vw - 32px));
    color: #ffffff;
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(34px, 7vw, 78px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.98;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    text-transform: uppercase;
    text-shadow:
      0 0 24px rgba(0, 245, 212, 0.85),
      0 0 46px rgba(255, 190, 11, 0.5),
      4px 4px 0 #000000;
    transform: translate(-50%, -50%) scale(0.92);
    transition:
      opacity 0.8s ease,
      transform 0.8s ease;
  }
  #tutorial-welcome-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  #tutorial-welcome-message.hide {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.96);
  }

  /* ===== INVENTORY BAR ===== */
  #inventory {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: none;
    gap: 6px;
  }
  .inv-slot {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition:
      border-color 0.15s,
      background 0.15s;
  }
  .inv-slot.active {
    border-color: #ffbe0b;
    background: rgba(255, 190, 11, 0.25);
  }
  .inv-slot:hover {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 10px rgba(255, 190, 11, 0.3);
  }
  .inv-slot .key-hint {
    position: absolute;
    top: 2px;
    left: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
  }
  .inv-slot .item-icon {
    font-size: 28px;
    line-height: 1;
  }
  .inv-slot .item-name {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* ===== DAMAGE NUMBERS ===== */
  .damage-number {
    position: fixed;
    z-index: 20;
    pointer-events: none;
    font-size: 28px;
    font-weight: 900;
    color: #ff4444;
    text-shadow:
      2px 2px 0 #000,
      -1px -1px 0 #000;
    animation: damageFloat 0.8s ease-out forwards;
  }
  @keyframes damageFloat {
    0% {
      opacity: 1;
      transform: translateY(0) scale(1.2);
    }
    100% {
      opacity: 0;
      transform: translateY(-60px) scale(0.6);
    }
  }

  .headshot-damage {
    font-size: 72px;
    color: #8b0000;
    text-shadow:
      3px 3px 0 #000,
      -2px -2px 0 #000;
    animation: headshotDamageFloat 1.5s ease-out forwards;
  }
  @keyframes headshotDamageFloat {
    0% {
      opacity: 1;
      transform: translateY(0) scale(3);
    }
    20% {
      transform: translateY(-10px) scale(1.8) rotate(-5deg);
    }
    40% {
      transform: translateY(-25px) scale(2.2) rotate(3deg);
    }
    100% {
      opacity: 0;
      transform: translateY(-120px) scale(0.5) rotate(-10deg);
    }
  }

  .headshot-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 0, 0, 0.6) 100%);
    animation: headshotVignette 0.6s ease-out forwards;
  }
  @keyframes headshotVignette {
    0% { opacity: 1; }
    100% { opacity: 0; }
  }

  .headshot-flash {
    position: fixed;
    inset: 0;
    z-index: 101;
    pointer-events: none;
    background: white;
    animation: headshotFlash 0.3s ease-out forwards;
  }
  @keyframes headshotFlash {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
  }

  .headshot-text {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 102;
    pointer-events: none;
    font-size: 90px;
    font-weight: 900;
    font-family: 'Impact', 'Arial Black', sans-serif;
    color: #ffdd00;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow:
      0 0 20px #ff0000,
      0 0 40px #ff4400,
      0 0 80px #ff0000,
      0 0 120px #ff0000,
      4px 4px 0 #000,
      -2px -2px 0 #000;
    animation: headshotTextSlam 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes headshotTextSlam {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(5) rotate(-10deg);
      filter: blur(10px);
    }
    15% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1) rotate(0deg);
      filter: blur(0);
    }
    20% {
      transform: translate(-50%, -50%) scale(1.3) rotate(2deg);
    }
    30% {
      transform: translate(-50%, -50%) scale(1) rotate(-1deg);
    }
    50% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1.05) rotate(0deg);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
      filter: blur(4px);
    }
  }

  .headshot-skull-particle {
    position: fixed;
    z-index: 103;
    pointer-events: none;
    font-size: 30px;
    animation: skullExplode 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes skullExplode {
    0% {
      opacity: 1;
      transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
      opacity: 0;
      transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.3);
    }
  }

  .headshot-shake {
    animation: headshotScreenShake 0.5s ease-out;
  }
  @keyframes headshotScreenShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-8px, 6px) rotate(-1deg); }
    20% { transform: translate(10px, -8px) rotate(1.5deg); }
    30% { transform: translate(-12px, 4px) rotate(-2deg); }
    40% { transform: translate(8px, -10px) rotate(1deg); }
    50% { transform: translate(-6px, 8px) rotate(-0.5deg); }
    60% { transform: translate(10px, -4px) rotate(1deg); }
    70% { transform: translate(-4px, 6px) rotate(-0.5deg); }
    80% { transform: translate(6px, -2px) rotate(0.5deg); }
    90% { transform: translate(-2px, 4px) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
  }

  /* ===== HEALTH BAR ===== */
  #health-bar-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
    border-radius: 8px;
    overflow: hidden;
    z-index: 20;
  }
  #health-bar-fill {
    width: 100%;
    height: 100%;
    background: #44ff44;
    transition:
      width 0.3s ease-out,
      background 0.3s ease;
    border-radius: 6px;
  }
  #health-text {
    position: fixed;
    bottom: 118px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    z-index: 20;
    pointer-events: none;
  }
  #damage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 25;
    transition: background 0.1s;
  }
  #death-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    color: #ff4444;
    font-size: 72px;
    font-weight: 900;
    text-shadow: 4px 4px 0 #000;
  }
  #death-overlay .respawn-timer {
    font-size: 24px;
    color: white;
    margin-top: 20px;
  }

  /* ===== CROSSHAIR ===== */
  #crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
    display: none;
  }
  #crosshair::before,
  #crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
  }
  #crosshair::before {
    width: 20px;
    height: 2px;
    top: -1px;
    left: -10px;
  }
  #crosshair::after {
    width: 2px;
    height: 20px;
    top: -10px;
    left: -1px;
  }
  #crosshair.aiming {
    width: 0;
    height: 0;
  }
  #crosshair.aiming::before,
  #crosshair.aiming::after {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  }
  #crosshair.aiming::before {
    width: 8px;
    height: 2px;
    top: -1px;
    left: 3px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5), -14px 0 0 rgba(255, 255, 255, 0.9);
  }
  #crosshair.aiming::after {
    width: 2px;
    height: 8px;
    top: 3px;
    left: -1px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 -14px 0 rgba(255, 255, 255, 0.9);
  }
  #crosshair.shotgun::before {
    width: 34px;
    left: -17px;
    background: rgba(255, 165, 0, 0.85);
  }
  #crosshair.shotgun::after {
    height: 34px;
    top: -17px;
    background: rgba(255, 165, 0, 0.85);
  }
  #crosshair.sniper.scoped::before {
    width: 26px;
    height: 1px;
    top: 0;
    left: -13px;
    background: rgba(245, 252, 255, 0.95);
    box-shadow: none;
  }
  #crosshair.sniper.scoped::after {
    width: 1px;
    height: 26px;
    top: -13px;
    left: 0;
    background: rgba(245, 252, 255, 0.95);
    box-shadow: none;
  }
  #crosshair.sniper-fired {
    animation: sniperReticleKick 110ms ease-out;
  }
  #scope-overlay {
    position: fixed;
    inset: 0;
    z-index: 14;
    pointer-events: none;
    opacity: 0;
    transition: opacity 140ms ease;
    background:
      radial-gradient(circle at center, transparent 0 30vmin, rgba(0, 0, 0, 0.92) 30.2vmin 100%),
      radial-gradient(circle at center, transparent 0 29vmin, rgba(255, 255, 255, 0.55) 29.1vmin 29.4vmin, transparent 29.5vmin);
  }
  body.sniper-scoped #scope-overlay {
    opacity: 1;
  }
  @keyframes sniperReticleKick {
    0% {
      transform: translate(-50%, -50%) scale(1);
      filter: brightness(1);
    }
    45% {
      transform: translate(-50%, -50%) scale(1.22);
      filter: brightness(1.8);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      filter: brightness(1);
    }
  }
  #game-fade-in {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 50;
    pointer-events: none;
    animation: fadeOut 1s ease-out 0.2s forwards;
  }
  @keyframes fadeOut {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
