@import url(' ');

  :root {
    --primary: #ff6b00;
    --secondary: #00d4ff;
    --accent: #ffe600;
    --dark: #0a0a1a;
    --darker: #050510;
    --grass: #1a6b2a;
    --grass2: #155a23;
    --ui-bg: rgba(10,10,30,0.92);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    background: var(--darker);
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    height: 100vh;
    color: #fff;
    image-rendering: pixelated;
  }

  /* ===== SCREENS ===== */
  .screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
  }
  .screen.hidden { opacity: 0; pointer-events: none; }

  /* ===== TITLE SCREEN ===== */
  #titleScreen {
    background: linear-gradient(180deg, #0a0a2e 0%, #1a0a40 50%, #0a1a0a 100%);
  }
  .title-stars {
    position: absolute;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(255,230,0,0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(0,212,255,0.05) 0%, transparent 50%);
  }
  .title-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 3vw, 36px);
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent), 0 0 40px var(--primary), 4px 4px 0 var(--primary);
    text-align: center;
    line-height: 1.4;
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
    margin-bottom: 20px;
  }
  .title-sub {
    font-size: clamp(8px, 1.2vw, 13px);
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary);
    letter-spacing: 3px;
    margin-bottom: 50px;
    z-index: 1;
  }
  .btn-start {
    background: linear-gradient(135deg, var(--primary), #ff3300);
    border: 3px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.5vw, 14px);
    padding: 16px 40px;
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary), 4px 4px 0 #000;
    z-index: 1;
    animation: blinkBtn 1s step-end infinite;
    text-transform: uppercase;
  }
  .btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--primary);
    animation: none;
  }
  @keyframes blinkBtn { 0%,100%{opacity:1} 50%{opacity:0.4} }
  @keyframes pulse { 0%,100%{text-shadow: 0 0 20px var(--accent), 0 0 40px var(--primary), 4px 4px 0 var(--primary)} 50%{text-shadow: 0 0 40px var(--accent), 0 0 80px var(--primary), 4px 4px 0 var(--primary)} }

  /* ===== CHARACTER SELECT ===== */
  #charScreen {
    background: linear-gradient(160deg, #0a0a2e 0%, #1a0030 60%, #001a30 100%);
    gap: 20px;
  }
  .char-title {
    font-size: clamp(10px, 2vw, 18px);
    color: var(--accent);
    text-shadow: 3px 3px 0 var(--primary);
    margin-bottom: 10px;
  }
  .char-subtitle {
    font-size: clamp(6px, 1vw, 10px);
    color: var(--secondary);
    margin-bottom: 30px;
  }
  .char-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .char-card {
    border: 3px solid #333;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    width: 160px;
    position: relative;
  }
  .char-card:hover, .char-card.selected {
    border-color: var(--accent);
    background: rgba(255,230,0,0.1);
    box-shadow: 0 0 20px var(--accent), 4px 4px 0 var(--primary);
    transform: translateY(-4px);
  }
  .char-card img {
    width: 100px;
    height: 100px;
    image-rendering: pixelated;
    object-fit: cover;
  }
  .char-name {
    font-size: clamp(6px, 1vw, 10px);
    color: #fff;
    margin-top: 10px;
    display: block;
  }
  .char-stats {
    margin-top: 8px;
    font-size: 6px;
    color: #aaa;
    line-height: 1.8;
    text-align: left;
  }
  .stat-bar {
    display: inline-block;
    height: 4px;
    background: var(--primary);
    vertical-align: middle;
    margin-left: 4px;
  }
  .btn-confirm {
    background: linear-gradient(135deg, #006600, #009900);
    border: 3px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(7px, 1.2vw, 11px);
    padding: 14px 35px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    margin-top: 20px;
  }
  .btn-confirm:hover { background: linear-gradient(135deg, #009900, #00cc00); transform: scale(1.03); }

  /* ===== GAME SCREEN ===== */
  #gameScreen {
    background: #0a0a1a;
    padding: 0;
    justify-content: flex-start;
  }
  .field-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }

  /* Field */
  .field {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(180deg, var(--grass) 0%, var(--grass2) 100%);
  }
  .field-lines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
      repeating-linear-gradient(90deg, transparent 0px, transparent 49px, rgba(255,255,255,0.05) 50px, rgba(255,255,255,0.05) 51px),
      repeating-linear-gradient(0deg, transparent 0px, transparent 49px, rgba(255,255,255,0.05) 50px, rgba(255,255,255,0.05) 51px);
  }
  .field-center {
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 40%; height: 35%;
    border: 2px solid rgba(255,255,255,0.2);
    border-top: none;
  }

  /* Sky */
  .sky {
    position: absolute;
    top: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(180deg, #0a0a2e 0%, #1a1a4e 60%, #2a2a6e 100%);
  }
  .stars-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(1px 1px at 10% 20%, white, transparent),
      radial-gradient(1px 1px at 30% 10%, white, transparent),
      radial-gradient(1px 1px at 50% 30%, white, transparent),
      radial-gradient(1px 1px at 70% 15%, white, transparent),
      radial-gradient(1px 1px at 90% 25%, white, transparent),
      radial-gradient(1px 1px at 20% 40%, white, transparent),
      radial-gradient(1px 1px at 80% 5%, white, transparent);
    opacity: 0.6;
  }

  /* Goal */
  .goal {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 180px;
    border: 8px solid #ddd;
    border-bottom: none;
    background: rgba(255,255,255,0.05);
    z-index: 5;
  }
  .goal-net {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
      repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(200,200,200,0.15) 18px, rgba(200,200,200,0.15) 20px),
      repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(200,200,200,0.15) 18px, rgba(200,200,200,0.15) 20px);
  }

  /* Goalkeeper Mark */
  .goalkeeper {
    position: absolute;
    top: 2%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
  }
  .goalkeeper img {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.8));
    transition: transform 0.3s;
  }
  .goalkeeper-name {
    font-size: 7px;
    color: var(--secondary);
    text-shadow: 1px 1px 0 #000;
    margin-top: 3px;
  }

  /* Shooter */
  .shooter {
    position: absolute;
    bottom: 38%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
  }
  .shooter img {
    width: 90px;
    height: 90px;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.8));
  }
  .shooter-name {
    font-size: 7px;
    color: var(--accent);
    text-shadow: 1px 1px 0 #000;
  }

  /* Ball */
  .ball {
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 35% 35%, #fff 0%, #ccc 50%, #888 100%);
    border-radius: 50%;
    border: 2px solid #333;
    z-index: 15;
    transition: all 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
    display: none;
  }

  /* HUD */
  .hud {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 30;
    pointer-events: none;
  }
  .score-box {
    background: var(--ui-bg);
    border: 2px solid var(--accent);
    padding: 8px 16px;
    text-align: center;
    box-shadow: 0 0 10px rgba(255,230,0,0.3);
  }
  .score-label { font-size: 7px; color: #aaa; }
  .score-num { font-size: clamp(14px, 2.5vw, 24px); color: var(--accent); }
  .round-box {
    background: var(--ui-bg);
    border: 2px solid var(--secondary);
    padding: 8px 16px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,212,255,0.2);
  }
  .round-label { font-size: 7px; color: #aaa; }
  .round-num { font-size: clamp(10px, 1.8vw, 16px); color: var(--secondary); }

  /* Bottom UI */
  .bottom-ui {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 30;
  }

  /* Power bar */
  .power-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .power-label {
    font-size: 8px;
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent);
  }
  .power-bar-container {
    width: 300px;
    height: 22px;
    background: #111;
    border: 3px solid #444;
    position: relative;
    overflow: hidden;
  }
  .power-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff6600, #ff0000);
    transition: none;
    position: relative;
  }
  .power-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: rgba(255,255,255,0.2);
  }
  .power-bar-marker {
    position: absolute;
    top: -3px; bottom: -3px;
    width: 4px;
    background: #fff;
    box-shadow: 0 0 6px #fff;
    transition: left 0.05s linear;
  }
  .power-click-hint {
    font-size: 7px;
    color: #aaa;
    animation: blinkBtn 1s step-end infinite;
  }

  /* Tech buttons */
  .tech-section {
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .tech-label { font-size: 8px; color: #aaa; }
  .tech-btn {
    background: linear-gradient(135deg, #1a0050, #300080);
    border: 2px solid #7700ff;
    color: #cc88ff;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(119,0,255,0.4);
    white-space: nowrap;
  }
  .tech-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #300080, #5500cc);
    box-shadow: 0 0 20px rgba(119,0,255,0.8);
    transform: translateY(-2px);
  }
  .tech-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
  }
  .tech-uses {
    font-size: 6px;
    color: #9955ff;
    display: block;
    margin-top: 3px;
    text-align: center;
  }

  .shoot-btn {
    background: linear-gradient(135deg, #cc4400, #ff6600);
    border: 3px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.5vw, 13px);
    padding: 12px 30px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255,102,0,0.6), 4px 4px 0 #000;
    transition: all 0.15s;
  }
  .shoot-btn:hover { box-shadow: 0 0 30px rgba(255,102,0,0.9); transform: scale(1.05); }
  .shoot-btn:active { transform: scale(0.97); }

  /* Result overlay */
  .result-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    display: none;
    gap: 20px;
  }
  .result-text {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(28px, 6vw, 64px);
    font-weight: 700;
    text-shadow: 4px 4px 0 #000;
    animation: resultAnim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }
  .result-text.goal { color: var(--accent); text-shadow: 4px 4px 0 var(--primary), 0 0 40px var(--accent); }
  .result-text.saved { color: var(--secondary); text-shadow: 4px 4px 0 #003366, 0 0 40px var(--secondary); }
  @keyframes resultAnim {
    0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
  }
  .result-sub {
    font-size: clamp(8px, 1.5vw, 14px);
    color: #ccc;
    text-align: center;
  }
  .btn-next {
    background: linear-gradient(135deg, #004400, #006600);
    border: 3px solid var(--accent);
    color: var(--accent);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.3vw, 12px);
    padding: 13px 30px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    animation: blinkBtn 0.8s step-end infinite;
  }
  .btn-next:hover { animation: none; background: linear-gradient(135deg, #006600, #009900); transform: scale(1.05); }

  /* Supertechnique animation */
  .super-flash {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 40;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    gap: 20px;
  }
  .super-name {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(18px, 4vw, 42px);
    font-weight: 700;
    text-align: center;
    animation: superName 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    text-shadow: 0 0 30px currentColor, 4px 4px 0 #000;
  }
  @keyframes superName { 0%{transform:scale(0.1) rotate(20deg);opacity:0} 100%{transform:scale(1) rotate(0deg);opacity:1} }
  .super-effects {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
  }
  .super-particles {
    position: absolute;
    width: 100%; height: 100%;
  }
  .super-desc {
    font-size: clamp(8px, 1.3vw, 12px);
    color: #ccc;
    text-align: center;
    max-width: 500px;
  }

  /* Canvas for particles */
  #particleCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 45;
    display: none;
  }

  /* Goalkeeper dive animation */
  @keyframes diveLeft { 0%{transform:translateX(-50%)} 100%{transform:translateX(calc(-50% - 80px)) rotate(-30deg)} }
  @keyframes diveRight { 0%{transform:translateX(-50%)} 100%{transform:translateX(calc(-50% + 80px)) rotate(30deg)} }
  @keyframes diveCenter { 0%{transform:translateX(-50%)} 100%{transform:translateX(-50%) scaleY(0.7)} }
  .dive-left { animation: diveLeft 0.6s ease-out forwards; }
  .dive-right { animation: diveRight 0.6s ease-out forwards; }
  .dive-center { animation: diveCenter 0.6s ease-out forwards; }

  @keyframes ballFly {
    0% { transform: scale(1); }
    50% { transform: scale(0.6); }
    100% { transform: scale(0.4); }
  }

  /* End screen */
  #endScreen {
    background: linear-gradient(160deg, #0a0030 0%, #001a30 100%);
    gap: 25px;
  }
  .end-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(20px, 4vw, 48px);
    font-weight: 700;
    text-align: center;
  }
  .end-stats {
    background: rgba(255,255,255,0.05);
    border: 2px solid #333;
    padding: 20px 40px;
    text-align: center;
    line-height: 2.5;
    font-size: clamp(8px, 1.3vw, 12px);
  }
  .end-score { font-size: clamp(20px, 3vw, 36px); color: var(--accent); }
  .btn-restart {
    background: linear-gradient(135deg, #440000, #880000);
    border: 3px solid var(--primary);
    color: var(--primary);
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.3vw, 12px);
    padding: 14px 35px;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
  }
  .btn-restart:hover { background: linear-gradient(135deg, #880000, #cc0000); }