﻿    body { margin: 0; overflow: hidden; background: linear-gradient(to bottom, #1e1e30, #2e2e50); position: relative; }
    canvas { display: block; }
    #gameOverScreen {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.75);
      display: flex; justify-content: center; align-items: center;
      flex-direction: column;
      color: white; font-family: Arial, sans-serif;
      font-size: 24px;
      visibility: hidden;
      z-index: 10;
      gap: 12px;
    }
    .gameover-title {
      font-size: 40px;
      font-weight: bold;
      letter-spacing: 1px;
    }
    .gameover-score { font-size: 26px; }
    #leaderboardSection {
      margin-top: 8px;
      min-width: 280px;
      background: rgba(12, 18, 40, 0.65);
      border: 2px solid rgba(62,245,255,0.45);
      border-radius: 16px;
      padding: 14px 18px;
      box-shadow: 0 10px 26px rgba(0,0,0,0.45);
      text-align: center;
    }
    .leaderboard-title {
      font-size: 22px;
      font-weight: bold;
      margin-bottom: 8px;
      letter-spacing: 1px;
    }
    .leaderboard-list {
      list-style: decimal;
      list-style-position: inside;
      padding-left: 26px;
      margin: 0 0 10px 0;
      text-align: left;
      font-size: 18px;
    }
    .leaderboard-list li {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      padding: 2px 0;
    }
    .leaderboard-entry { margin-top: 10px; }
    .leaderboard-note {
      font-size: 16px;
      color: #eaf6ff;
      margin-bottom: 6px;
    }
    .leaderboard-input-row {
      display: flex;
      justify-content: center;
      gap: 8px;
    }
    #leaderboardName {
      width: 70px;
      text-transform: uppercase;
      text-align: center;
      font-size: 18px;
      padding: 6px 8px;
      border-radius: 6px;
      border: 2px solid rgba(255,255,255,0.45);
      background: rgba(8,12,32,0.65);
      color: #ffffff;
      outline: none;
    }
    #leaderboardSubmit {
      padding: 6px 14px;
      font-size: 16px;
      cursor: pointer;
      border: none; border-radius: 6px;
      background: #3ef5ff; color: #00111f;
    }
    #restartBtn {
      margin-top: 20px;
      padding: 10px 20px;
      font-size: 18px;
      cursor: pointer;
      border: none; border-radius: 5px;
      background: #00aa00; color: white;
    }
    #pauseMenu {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      background: rgba(0, 0, 0, 0.65);
      display: flex; justify-content: center; align-items: center;
      flex-direction: column;
      color: white; font-family: Arial, sans-serif;
      font-size: 28px;
      visibility: hidden;
      z-index: 15;
      gap: 20px;
    }
    #pauseMenu.visible { visibility: visible; }
    .pause-title { font-size: 42px; font-weight: bold; }
    #pauseButtons {
      display: flex;
      gap: 14px;
      margin-bottom: 6px;
    }
    #pauseTutorial {
      max-width: 720px;
      padding: 18px 24px;
      border-radius: 18px;
      background: rgba(8,12,32,0.55);
      border: 2px solid rgba(62,245,255,0.45);
      color: #eaf6ff;
      text-align: center;
      font-family: 'Arial Black', Arial, sans-serif;
      box-shadow: 0 10px 26px rgba(0,0,0,0.45);
      margin-bottom: 10px;
    }
    #continueBtn {
      padding: 10px 28px;
      font-size: 18px;
      cursor: pointer;
      border: none; border-radius: 6px;
      background: #3ef5ff; color: #00111f;
    }
    #pauseMenuBtn {
      padding: 10px 28px;
      font-size: 18px;
      cursor: pointer;
      border: none; border-radius: 6px;
      background: #111827; color: #eaf6ff;
      border: 2px solid rgba(255,255,255,0.4);
    }
    #startMenu {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      display: flex; align-items: center; justify-content: center;
      flex-direction: column;
      z-index: 25;
    }
    #startMenu.hidden { visibility: hidden; pointer-events: none; }
    #characterSelect {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 28px;
      background: rgba(10, 14, 28, 0.85);
      z-index: 24;
      text-align: center;
    }
    #characterSelect.hidden { display: none; }
    .character-title {
      font-family: 'Arial Black', Arial, sans-serif;
      font-size: 42px;
      color: #e9f7ff;
      text-shadow: 0 6px 18px rgba(0,0,0,0.55);
    }
    .character-cards {
      display: flex; gap: 28px; align-items: center; justify-content: center;
      flex-wrap: wrap;
      padding: 0 24px;
    }
    .character-card {
      width: 360px; height: 460px;
      border-radius: 32px;
      border: 4px solid rgba(62,245,255,0.7);
      background: linear-gradient(160deg, #142042 0%, #0b1226 100%);
      box-shadow: 0 16px 48px rgba(0,0,0,0.6);
      cursor: pointer;
      display: flex; flex-direction: column; align-items: center;
      padding: 22px 20px 26px;
      transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }
    .character-card img {
      width: 100%; height: 100%;
      object-fit: contain;
      border-radius: 24px;
      background: rgba(0,0,0,0.35);
    }
    .character-card:hover {
      transform: translateY(-6px) scale(1.03);
      border-color: #6bffef;
      box-shadow: 0 14px 40px rgba(25,216,203,0.45);
    }
    #menuButtons {
      position: absolute; top: 24px; left: 24px;
      display: flex; gap: 14px;
    }
    #menuTutorial {
      max-width: 720px;
      padding: 18px 24px;
      border-radius: 18px;
      background: rgba(8,12,32,0.55);
      border: 2px solid rgba(62,245,255,0.45);
      color: #eaf6ff;
      text-align: center;
      font-family: 'Arial Black', Arial, sans-serif;
      box-shadow: 0 10px 26px rgba(0,0,0,0.45);
      margin-bottom: 28px;
    }
    .tutorial-title {
      font-size: 28px;
      letter-spacing: 1px;
      margin-bottom: 10px;
      text-shadow: 0 4px 10px rgba(0,0,0,0.6);
    }
    .tutorial-line {
      font-family: Arial, sans-serif;
      font-size: 18px;
      font-weight: 600;
      margin: 6px 0;
    }
    .icon-btn {
      width: 54px; height: 54px;
      border-radius: 14px;
      border: 2px solid rgba(255,255,255,0.4);
      background: rgba(8,12,32,0.6);
      color: #ffffff;
      font-size: 30px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 6px 16px rgba(0,0,0,0.35);
      position: relative;
    }
    .icon-btn.off { opacity: 0.45; }
    .icon-btn.off::after {
      content: '';
      position: absolute;
      width: 52px; height: 4px;
      background: #ff3b3b;
      border-radius: 2px;
      transform: rotate(-35deg);
    }
    #startBtn {
      font-family: 'Arial Black', Arial, sans-serif;
      font-size: 56px;
      letter-spacing: 2px;
      padding: 18px 80px;
      margin-top: 12px;
      border-radius: 28px;
      border: 3px solid #b4ffb4;
      background: linear-gradient(180deg, #66ff66 0%, #00cc3a 100%);
      color: #0b2a12;
      cursor: pointer;
      box-shadow: 0 0 24px rgba(77,255,122,0.7), 0 16px 40px rgba(0,0,0,0.5);
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }
    #startBtn:hover {
      transform: translateY(-1px) scale(1.02);
      box-shadow: 0 0 30px rgba(77,255,122,0.9), 0 20px 46px rgba(0,0,0,0.55);
    }
    #startBtn:active { transform: translateY(1px) scale(0.99); }
    #storyBtn {
      margin-top: 14px;
      font-family: 'Arial Black', Arial, sans-serif;
      font-size: 28px;
      letter-spacing: 2px;
      padding: 10px 48px;
      border-radius: 18px;
      border: 2px solid rgba(62,245,255,0.7);
      background: rgba(12,18,40,0.6);
      color: #e9f7ff;
      cursor: pointer;
      box-shadow: 0 10px 26px rgba(0,0,0,0.45);
      transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    }
    #storyBtn:hover {
      transform: translateY(-1px) scale(1.02);
      border-color: #7ff5ff;
      box-shadow: 0 12px 30px rgba(20,200,220,0.35);
    }
    #storyBtn:active { transform: translateY(1px) scale(0.99); }
    #storyOverlay {
      position: absolute; top: 0; left: 0;
      width: 100%; height: 100%;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      background: rgba(6, 8, 18, 0.92);
      z-index: 30;
    }
    #storyOverlay.hidden { display: none; }
    .story-frame {
      width: min(900px, 92vw);
      height: min(520px, 70vh);
      border-radius: 26px;
      border: 3px solid rgba(62,245,255,0.6);
      background: rgba(10, 14, 28, 0.7);
      box-shadow: 0 20px 50px rgba(0,0,0,0.7);
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      position: relative;
      overflow: hidden;
    }
    #storyImage {
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: rgba(0,0,0,0.35);
    }
    #storyCaption {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      padding: 14px 18px;
      text-align: center;
      color: #e9f7ff;
      font-family: Arial, sans-serif;
      font-size: 20px;
      font-weight: 600;
      background: rgba(6, 8, 18, 0.8);
    }
    #storyNextBtn {
      position: absolute;
      right: 24px;
      bottom: 24px;
      font-family: 'Arial Black', Arial, sans-serif;
      font-size: 22px;
      padding: 10px 26px;
      border-radius: 16px;
      border: 2px solid rgba(255,255,255,0.6);
      background: rgba(8,12,32,0.75);
      color: #ffffff;
      cursor: pointer;
      box-shadow: 0 8px 22px rgba(0,0,0,0.5);
      transition: transform 0.12s ease, box-shadow 0.12s ease;
    }
    #storyNextBtn:hover {
      transform: translateY(-1px) scale(1.02);
      box-shadow: 0 10px 26px rgba(0,0,0,0.6);
    }
    .hidden { display: none !important; }
    @media (max-width: 600px) {
      #startBtn { font-size: 40px; padding: 14px 50px; }
      .icon-btn { width: 46px; height: 46px; font-size: 26px; }
      #menuButtons { top: 16px; left: 16px; gap: 10px; }
      #pauseButtons { top: 16px; left: 16px; gap: 10px; }
      #menuTutorial { margin: 0 16px 20px; }
      #pauseTutorial { margin: 0 16px 20px; }
      .tutorial-title { font-size: 22px; }
      .tutorial-line { font-size: 16px; }
      #storyBtn { font-size: 20px; padding: 8px 36px; }
      .story-frame { height: min(420px, 62vh); }
      #storyCaption { font-size: 16px; }
      #storyNextBtn { font-size: 18px; padding: 8px 20px; right: 16px; bottom: 16px; }
      .character-title { font-size: 32px; }
      .character-card { width: 280px; height: 360px; }
    }
    /* === РЈСЂРѕРІРµРЅСЊ Рё РїСЂРѕРєР°С‡РєРё === */
    #upgradeMenu {
      position: absolute; top: 0; left: 0;
      width: 100vw; height: 100vh;
      background: rgba(18,20,40,0.97);
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      visibility: hidden;
      z-index: 20;
    }
    #upgradeMenu.visible { visibility: visible; }
    #upgradeTitle { color: #fff; font-size: 36px; font-weight: bold; margin-bottom: 36px; }
    .upgrade-cards { display: flex; gap: 32px; }
    .upgrade-card {
      width: 260px; height: 240px; background: linear-gradient(140deg, #1e3350 60%, #224488 100%);
      border-radius: 22px; box-shadow: 0 6px 32px #000a;
      color: #fff; font-size: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center;
      cursor: pointer; user-select: none; transition: transform 0.16s;
      border: 3px solid #2ef5e3; position: relative;
    }
    .upgrade-card:hover { transform: scale(1.08) rotate(-2deg); box-shadow: 0 8px 44px #1fd0b9ee; border-color: #3ef5ff; }
    .upgrade-icon { font-size: 48px; margin-bottom: 18px; }


