/* BRAWL MATH - Styles */

    :root {
      --bg-dark: #0f1322;
      --bg-card: #1b213a;
      --accent-yellow: #facc15;
      --accent-gold: #eab308;
      --accent-blue: #3b82f6;
      --accent-cyan: #06b6d4;
      --accent-purple: #8b5cf6;
      --accent-red: #ef4444;
      --accent-green: #10b981;
      --text-main: #f3f4f6;
      --text-muted: #9ca3af;
      --border-game: 4px solid #1e293b;
      --font-game: 'Luckiest Guy', cursive;
      --font-body: 'Outfit', sans-serif;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-user-select: none;
    }

    body {
      background-color: var(--bg-dark);
      background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
      color: var(--text-main);
      font-family: var(--font-body);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 15px;
      overflow-x: hidden;
    }

    /* Outer Cabinet / App Container */
    .game-cabinet {
      background: radial-gradient(circle at 50% 0%, #2e3b6e 0%, #161a30 100%);
      border: 8px solid #0f172a;
      border-radius: 30px;
      box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(59, 130, 246, 0.25),
        inset 0 4px 0 rgba(255, 255, 255, 0.1);
      width: 100%;
      max-width: 640px;
      padding: 24px;
      text-align: center;
      position: relative;
      overflow: hidden;
      animation: startup 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    @keyframes startup {
      0% { transform: scale(0.9) translateY(20px); opacity: 0; }
      100% { transform: scale(1) translateY(0); opacity: 1; }
    }

    /* Headers & Game Typography */
    .game-title {
      font-family: var(--font-game);
      font-size: 2.8rem;
      letter-spacing: 2px;
      color: var(--accent-yellow);
      text-shadow: 
        3px 3px 0px #1e1b4b, 
        -3px -3px 0px #1e1b4b,
        3px -3px 0px #1e1b4b,
        -3px 3px 0px #1e1b4b,
        0px 6px 0px #9a3412,
        0px 10px 20px rgba(0, 0, 0, 0.5);
      margin-bottom: 5px;
      transform: skew(-5deg);
      display: inline-block;
    }

    .game-subtitle {
      font-size: 0.95rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 2px;
      color: var(--accent-cyan);
      margin-bottom: 20px;
      text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    }

    /* Screen Transitions */
    .screen {
      display: none;
      animation: fade-in 0.3s ease-out forwards;
    }

    .screen.active {
      display: block;
    }

    @keyframes fade-in {
      from { opacity: 0; transform: scale(0.97); }
      to { opacity: 1; transform: scale(1); }
    }

    /* Visual Buttons in Brawl Stars Style */
    .btn-brawl {
      background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
      border: 4px solid #1e293b;
      border-radius: 16px;
      box-shadow: 
        0 6px 0px #854d0e,
        0 10px 20px rgba(0,0,0,0.4);
      color: #1e1b4b;
      font-family: var(--font-game);
      font-size: 1.5rem;
      letter-spacing: 1px;
      padding: 12px 32px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 12px;
      transition: transform 0.1s ease, box-shadow 0.1s ease;
      transform: skew(-4deg);
      margin-top: 15px;
      text-decoration: none;
      text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
    }

    .btn-brawl:hover:not(:disabled) {
      background: linear-gradient(180deg, #fef08a 0%, #eab308 100%);
      transform: scale(1.03) skew(-4deg);
    }

    .btn-brawl:active:not(:disabled) {
      transform: translateY(4px) scale(0.98) skew(-4deg);
      box-shadow: 
        0 2px 0px #854d0e,
        0 4px 10px rgba(0,0,0,0.3);
    }

    .btn-brawl:disabled {
      background: #475569;
      border-color: #334155;
      box-shadow: 0 4px 0 #1e293b;
      color: #94a3b8;
      cursor: not-allowed;
    }

    /* Brawler Selector Cards */
    .brawler-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      margin: 20px 0;
    }

    .brawler-card {
      background: rgba(255, 255, 255, 0.03);
      border: 4px solid rgba(255, 255, 255, 0.1);
      border-radius: 20px;
      padding: 16px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .brawler-card:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: var(--accent-cyan);
      transform: translateY(-4px);
    }

    .brawler-card.selected {
      background: rgba(59, 130, 246, 0.15);
      border-color: var(--accent-blue);
      box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }

    .brawler-avatar {
      width: 72px;
      height: 72px;
      border-radius: 50%;
      border: 3px solid white;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.2rem;
      box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }

    .brawler-name {
      font-family: var(--font-game);
      font-size: 1.25rem;
      letter-spacing: 1px;
      color: white;
      margin-bottom: 6px;
      text-shadow: 1px 1px 2px black;
    }

    .brawler-stat {
      font-size: 0.8rem;
      color: var(--text-muted);
      font-weight: 600;
      margin-top: 4px;
    }

    /* HUD Layout in Game */
    .hud-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(0, 0, 0, 0.35);
      border: 3px solid rgba(255,255,255,0.05);
      border-radius: 18px;
      padding: 10px 16px;
      margin-bottom: 20px;
    }

    .hud-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: var(--font-game);
      font-size: 1.15rem;
      text-shadow: 1px 1px 2px black;
    }

    .hud-item.trophies i { color: #fb923c; }
    .hud-item.cubes i { color: #22c55e; }

    /* Battle Arena Screen Layout */
    .arena-container {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }

    /* Combat Screen: Brawler vs Boss - Premium 3D Desert Arena */
    .combat-stage {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #1e1b4b; /* Sky backdrop behind the 3D floor */
      border-radius: 24px;
      border: 6px solid #78281f;
      padding: 30px 16px;
      position: relative;
      min-height: 200px;
      overflow: hidden;
      box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.8),
        0 10px 20px rgba(0,0,0,0.5);
      perspective: 1000px; /* Enable 3D perspective! */
      transform-style: preserve-3d;
    }

    /* 3D Tilted Desert Floor */
    .combat-stage::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: 
        radial-gradient(ellipse at center, rgba(243, 156, 18, 0.4) 0%, rgba(186, 73, 0, 0.75) 100%),
        linear-gradient(135deg, #e7a058 0%, #ca6f1e 50%, #935116 100%);
      background-size: cover;
      transform: rotateX(50deg) translateY(-25px) scale(1.6);
      transform-origin: bottom center;
      z-index: 0;
      box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
      pointer-events: none;
      border-radius: 20px;
    }

    /* Scenery obstacles for realism - upright billboarded sways in wind */
    .desert-obstacle {
      position: absolute;
      font-size: 2.2rem;
      filter: drop-shadow(0 6px 4px rgba(0,0,0,0.55));
      pointer-events: none;
      z-index: 2;
      opacity: 0.95;
      transform: rotateX(-50deg) translateZ(10px);
      transform-origin: bottom center;
      animation: grassSway 4s ease-in-out infinite alternate;
    }

    @keyframes grassSway {
      0% { transform: rotateX(-50deg) translateZ(10px) skewX(-4deg); }
      100% { transform: rotateX(-50deg) translateZ(10px) skewX(4deg); }
    }

    /* Custom Projectile animation elements - 3D ballistic arc! */
    .projectile-effect {
      position: absolute;
      font-size: 2rem;
      z-index: 30;
      pointer-events: none;
      animation-duration: 0.6s;
      animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
      animation-fill-mode: forwards;
      filter: drop-shadow(0 6px 8px rgba(0,0,0,0.4));
    }

    .projectile-player {
      animation-name: flyPlayerToEnemy;
    }

    .projectile-enemy {
      animation-name: flyEnemyToPlayer;
    }

    @keyframes flyPlayerToEnemy {
      0% {
        left: 20%;
        top: 50%;
        transform: scale(0.6) rotate(0deg) translateZ(0);
        opacity: 0;
      }
      20% {
        opacity: 1;
      }
      50% {
        top: 20%; /* 3D high arc */
        transform: scale(1.5) rotate(180deg) translateZ(40px);
      }
      100% {
        left: 70%;
        top: 50%;
        transform: scale(1.1) rotate(360deg) translateZ(0);
        opacity: 1;
      }
    }

    @keyframes flyEnemyToPlayer {
      0% {
        left: 70%;
        top: 50%;
        transform: scale(0.6) rotate(0deg) translateZ(0);
        opacity: 0;
      }
      20% {
        opacity: 1;
      }
      50% {
        top: 20%; /* 3D high arc */
        transform: scale(1.5) rotate(-180deg) translateZ(40px);
      }
      100% {
        left: 20%;
        top: 50%;
        transform: scale(1.1) rotate(-360deg) translateZ(0);
        opacity: 1;
      }
    }


    /* Billboarded Brawler Stands with float and soft radial shadow */
    .character-stand {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 45%;
      position: relative;
      z-index: 10;
      transform: rotateX(-50deg) translateZ(15px);
      transform-origin: bottom center;
      animation: floatIdle 3s ease-in-out infinite alternate;
      transform-style: preserve-3d;
    }

    .character-stand.enemy {
      animation: floatIdleEnemy 3s ease-in-out infinite alternate;
      animation-delay: 0.5s;
    }

    /* Soft 3D Ground Shadow */
    .character-stand::after {
      content: '';
      position: absolute;
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%) scaleX(1);
      width: 80px;
      height: 14px;
      background: radial-gradient(ellipse at center, rgba(0,0,0,0.55) 0%, transparent 75%);
      z-index: -1;
      border-radius: 50%;
      filter: blur(1.5px);
      animation: shadowPulse 1.5s infinite alternate;
    }

    .character-stand.enemy::after {
      animation-delay: 0.5s;
    }

    @keyframes floatIdle {
      0% { transform: rotateX(-50deg) translateZ(10px) translateY(0); }
      100% { transform: rotateX(-50deg) translateZ(10px) translateY(-8px); }
    }

    @keyframes floatIdleEnemy {
      0% { transform: rotateX(-50deg) translateZ(10px) translateY(0); }
      100% { transform: rotateX(-50deg) translateZ(10px) translateY(-8px); }
    }

    @keyframes shadowPulse {
      0% { transform: translateX(-50%) scale(0.85); opacity: 0.9; }
      100% { transform: translateX(-50%) scale(1.15); opacity: 0.55; }
    }

    .character-avatar-large {
      font-size: 3.5rem;
      width: 95px;
      height: 95px;
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.4);
      border: 4px solid var(--accent-blue);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 
        0 8px 16px rgba(0,0,0,0.6),
        inset 0 0 15px rgba(255,255,255,0.1);
      margin-bottom: 8px;
      position: relative;
      overflow: hidden;
      transition: all 0.2s ease;
    }

    .character-avatar-large.hurt-shake {
      animation: avatarHurt 0.4s ease-out !important;
    }

    @keyframes avatarHurt {
      0%, 100% { transform: scale(1) translateX(0); filter: brightness(1); }
      20%, 60% { transform: scale(1.1) translateX(-8px); filter: brightness(1.8) drop-shadow(0 0 15px #ef4444); }
      40%, 80% { transform: scale(1.1) translateX(8px); filter: brightness(1.8) drop-shadow(0 0 15px #ef4444); }
    }

    .character-stand.enemy .character-avatar-large {
      border-color: var(--accent-red);
    }

    .character-label {
      font-family: var(--font-game);
      font-size: 1.1rem;
      color: white;
      margin-bottom: 6px;
      letter-spacing: 0.5px;
    }

    /* Game Bars (HP & Super) */
    .progress-bar-game {
      width: 100%;
      height: 18px;
      background-color: #334155;
      border: 2px solid #0f172a;
      border-radius: 50px;
      overflow: hidden;
      position: relative;
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    }

    .progress-bar-fill-game {
      height: 100%;
      width: 100%;
      transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.2);
    }

    .progress-bar-fill-game.hp {
      background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    }

    .progress-bar-fill-game.hp-boss {
      background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    }

    .progress-bar-fill-game.super {
      background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
      width: 0%;
      animation: pulse-super 1.5s infinite alternate;
    }

    .progress-bar-text {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 0.68rem;
      font-weight: 800;
      color: white;
      text-shadow: 1px 1px 2px black;
      width: 100%;
    }

    /* Super Attack button */
    .btn-super-brawl {
      background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
      box-shadow: 
        0 6px 0px #581c87,
        0 10px 20px rgba(168, 85, 247, 0.4);
      color: white;
      text-shadow: 1px 1px 0px black;
      animation: pulse-super-btn 0.8s infinite alternate;
    }
    .btn-super-brawl:hover:not(:disabled) {
      background: linear-gradient(180deg, #c084fc 0%, #7e22ce 100%);
    }
    .btn-super-brawl:active:not(:disabled) {
      transform: translateY(4px) scale(0.98) skew(-4deg);
      box-shadow: 
        0 2px 0px #581c87,
        0 4px 10px rgba(168, 85, 247, 0.3);
    }

    @keyframes pulse-super-btn {
      0% { transform: scale(1) skew(-4deg); filter: brightness(1); }
      100% { transform: scale(1.05) skew(-4deg); filter: brightness(1.2) drop-shadow(0 0 10px rgba(168, 85, 247, 0.8)); }
    }

    /* Battleground Flash / Combat Effects */
    .versus-icon {
      font-family: var(--font-game);
      font-size: 1.6rem;
      color: var(--accent-yellow);
      background: #1e1b4b;
      border: 3px solid var(--accent-gold);
      width: 44px;
      height: 44px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 10px rgba(0,0,0,0.5);
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 5;
    }

    /* Floating damage popups */
    .damage-indicator {
      position: absolute;
      font-family: var(--font-game);
      font-size: 1.8rem;
      font-weight: bold;
      color: var(--accent-yellow);
      text-shadow: 2px 2px 0 black, -2px -2px 0 black, 2px -2px 0 black, -2px 2px 0 black;
      animation: floatUpDamage 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
      pointer-events: none;
      z-index: 20;
    }

    .damage-indicator.hurt {
      color: var(--accent-red);
    }

    @keyframes floatUpDamage {
      0% { transform: translateY(0) scale(0.8); opacity: 0; }
      15% { transform: translateY(-20px) scale(1.3); opacity: 1; }
      100% { transform: translateY(-70px) scale(1); opacity: 0; }
    }

    /* Question Container */
    .brawl-question-card {
      background: var(--bg-card);
      border: 4px solid rgba(255, 255, 255, 0.08);
      border-radius: 24px;
      padding: 20px;
      text-align: left;
      box-shadow: inset 0 2px 5px rgba(255,255,255,0.05);
      overflow-y: auto; /* Scroll if content overflows */
      scrollbar-width: thin;
      scrollbar-color: var(--accent-purple) rgba(0, 0, 0, 0.2);
    }

    /* Premium scrollbar styling for Chrome/Safari/Edge */
    .brawl-question-card::-webkit-scrollbar {
      width: 8px;
    }
    .brawl-question-card::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
    }
    .brawl-question-card::-webkit-scrollbar-thumb {
      background: var(--accent-purple);
      border-radius: 10px;
    }
    .brawl-question-card::-webkit-scrollbar-thumb:hover {
      background: var(--accent-cyan);
    }

    /* KaTeX and math expressions line wrapping fix */
    .katex, .math-expr {
      white-space: nowrap !important;
    }

    .question-header {
      font-size: 0.8rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--accent-purple);
      margin-bottom: 8px;
    }

    .question-title-text {
      font-size: 1rem;
      font-weight: 700;
      color: white;
      line-height: 1.55;
      margin-bottom: 18px;
    }

    /* Answer Cards */
    .answer-grid {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .answer-card {
      background: rgba(255, 255, 255, 0.02);
      border: 3px solid rgba(255, 255, 255, 0.08);
      border-radius: 16px;
      padding: 8px 12px;
      display: flex;
      align-items: center;
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .answer-card:hover:not(.disabled) {
      background: rgba(255, 255, 255, 0.05);
      border-color: var(--accent-cyan);
      transform: translateX(4px);
    }

    .answer-card.selected {
      background: rgba(6, 182, 212, 0.08);
      border-color: var(--accent-cyan);
    }

    .answer-card.correct {
      background: rgba(16, 185, 129, 0.12);
      border-color: var(--accent-green);
      box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
    }

    .answer-card.wrong {
      background: rgba(239, 68, 68, 0.1);
      border-color: var(--accent-red);
    }

    .answer-bullet {
      width: 24px;
      height: 24px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.05);
      border: 2px solid rgba(255,255,255,0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 14px;
      font-family: var(--font-game);
      font-size: 0.9rem;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .answer-card.selected .answer-bullet {
      background: var(--accent-cyan);
      border-color: var(--accent-cyan);
      color: #0f1322;
    }

    .answer-card.correct .answer-bullet {
      background: var(--accent-green);
      border-color: var(--accent-green);
      color: white;
    }

    .answer-card.wrong .answer-bullet {
      background: var(--accent-red);
      border-color: var(--accent-red);
      color: white;
    }

    .answer-text {
      font-size: 0.95rem;
      font-weight: 600;
      color: #e5e7eb;
    }

    /* Battle Feedback */
    .brawl-feedback-box {
      border-radius: 18px;
      padding: 16px 20px;
      margin-top: 15px;
      text-align: left;
      display: none;
      animation: slideDownFeedback 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    }

    .brawl-feedback-box.correct {
      background: rgba(16, 185, 129, 0.08);
      border: 2px solid rgba(16, 185, 129, 0.15);
      color: #a7f3d0;
      display: block;
    }

    .brawl-feedback-box.wrong {
      background: rgba(239, 68, 68, 0.06);
      border: 2px solid rgba(239, 68, 68, 0.15);
      color: #fecaca;
      display: block;
    }

    @keyframes slideDownFeedback {
      0% { opacity: 0; transform: translateY(-10px); }
      100% { opacity: 1; transform: translateY(0); }
    }

    .feedback-title-text {
      font-family: var(--font-game);
      font-size: 1.1rem;
      letter-spacing: 0.5px;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .feedback-explanation {
      font-size: 0.88rem;
      line-height: 1.45;
    }

    /* Screen shake for taking damage */
    .shake-anim {
      animation: screenShake 0.4s ease-out;
    }

    @keyframes screenShake {
      0%, 100% { transform: translate(0, 0) rotate(0deg); }
      10%, 90% { transform: translate(-4px, 2px) rotate(-0.5deg); }
      20%, 80% { transform: translate(4px, -2px) rotate(0.5deg); }
      30%, 70% { transform: translate(-4px, -2px) rotate(-0.5deg); }
      40%, 60% { transform: translate(4px, 2px) rotate(0.5deg); }
      50% { transform: translate(0, -3px) rotate(0deg); }
    }

    /* Character Action Animations */
    .attack-forward {
      animation: attackLeft 0.3s ease-out;
    }
    .enemy-attack-forward {
      animation: attackRight 0.3s ease-out;
    }

    @keyframes attackLeft {
      0%, 100% { transform: translateX(0); }
      50% { transform: translateX(40px) scale(1.1); }
    }
    @keyframes attackRight {
      0%, 100% { transform: translateX(0); }
      50% { transform: translateX(-40px) scale(1.1); }
    }



    /* Trophy Road / Progress map */
    .trophy-road {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 15px 0;
      position: relative;
    }

    .trophy-road::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 10px;
      right: 10px;
      height: 4px;
      background: rgba(255,255,255,0.1);
      z-index: 1;
      transform: translateY(-50%);
    }

    .trophy-node {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: #334155;
      border: 3px solid #1e293b;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      font-weight: 800;
      color: #94a3b8;
      z-index: 2;
      position: relative;
      box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }

    .trophy-node.active {
      background: var(--accent-yellow);
      border-color: #78350f;
      color: #78350f;
      box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
    }

    .trophy-node.completed {
      background: var(--accent-green);
      border-color: #064e3b;
      color: white;
    }

    /* Victory / Defeat Screen Layout */
    .victory-badge {
      font-family: var(--font-game);
      font-size: 3.5rem;
      letter-spacing: 2px;
      color: var(--accent-yellow);
      text-shadow: 
        3px 3px 0 #1e1b4b, -3px -3px 0 #1e1b4b, 3px -3px 0 #1e1b4b, -3px 3px 0 #1e1b4b,
        0px 6px 0 #c2410c;
      animation: victoryPulse 1.2s infinite alternate;
      transform: skew(-6deg);
      display: inline-block;
      margin: 20px 0;
    }

    .defeat-badge {
      font-family: var(--font-game);
      font-size: 3.5rem;
      letter-spacing: 2px;
      color: #f87171;
      text-shadow: 
        3px 3px 0 #1e1b4b, -3px -3px 0 #1e1b4b, 3px -3px 0 #1e1b4b, -3px 3px 0 #1e1b4b,
        0px 6px 0 #991b1b;
      animation: victoryPulse 1.2s infinite alternate;
      transform: skew(-6deg);
      display: inline-block;
      margin: 20px 0;
    }

    @keyframes victoryPulse {
      0% { transform: scale(0.95) skew(-6deg); }
      100% { transform: scale(1.05) skew(-6deg); }
    }

    .results-grid {
      background: rgba(0, 0, 0, 0.3);
      border-radius: 20px;
      padding: 20px;
      margin: 20px 0;
      text-align: left;
      border: 3px solid rgba(255,255,255,0.05);
    }

    .results-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .results-row:last-child {
      border-bottom: none;
    }

    .results-label {
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      font-size: 0.85rem;
      letter-spacing: 1px;
    }

    .results-value {
      font-family: var(--font-game);
      font-size: 1.2rem;
      color: white;
      text-shadow: 1px 1px 2px black;
    }

    .star-player-crown {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.15), transparent);
      border: 2px solid rgba(234, 179, 8, 0.3);
      border-left: none;
      border-right: none;
      padding: 10px 0;
      margin-top: 15px;
      font-family: var(--font-game);
      color: var(--accent-yellow);
      letter-spacing: 1px;
      font-size: 1.25rem;
      text-shadow: 1px 1px 2px black;
    }

    /* Layout Helpers */
    .button-group-game {
      margin-top: 20px;
      display: flex;
      gap: 12px;
      justify-content: center;
    }

    .btn-secondary-brawl {
      background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
      box-shadow: 
        0 6px 0px #334155,
        0 10px 20px rgba(0,0,0,0.3);
      color: white;
    }

    .btn-secondary-brawl:hover {
      background: linear-gradient(180deg, #cbd5e1 0%, #475569 100%);
    }

    .btn-secondary-brawl:active {
      box-shadow: 
        0 2px 0px #334155,
        0 4px 10px rgba(0,0,0,0.2);
    }

    .mt-4 { margin-top: 1rem; }
    .hidden { display: none !important; }

    /* Custom Math Formatting inside Game */
    .math-expr {
      font-family: 'Outfit', sans-serif;
      font-style: italic;
      background: rgba(255, 255, 255, 0.05);
      padding: 2px 6px;
      border-radius: 4px;
      font-weight: 700;
      color: var(--accent-cyan);
    }

    /* Pin Emote Bubble */
    .speech-bubble {
      position: absolute;
      top: -32px;
      left: 50%;
      transform: translateX(-50%) scale(0) translateY(10px);
      transform-origin: bottom center;
      background: white;
      border: 3px solid #1e293b;
      border-radius: 12px;
      padding: 6px 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      font-weight: bold;
      color: #1e293b;
      box-shadow: 0 4px 8px rgba(0,0,0,0.3);
      opacity: 0;
      pointer-events: none;
      z-index: 25;
      white-space: nowrap;
      transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .speech-bubble.active {
      opacity: 1;
      transform: translateX(-50%) scale(1) translateY(0);
    }
    .speech-bubble::after {
      content: '';
      position: absolute;
      bottom: -8px;
      left: 50%;
      transform: translateX(-50%);
      border-width: 8px 8px 0;
      border-style: solid;
      border-color: white transparent;
      display: block;
      width: 0;
    }
    .speech-bubble::before {
      content: '';
      position: absolute;
      bottom: -11px;
      left: 50%;
      transform: translateX(-50%);
      border-width: 9px 9px 0;
      border-style: solid;
      border-color: #1e293b transparent;
      display: block;
      width: 0;
    }

    /* Skin Overlay Particles & Floating Animations */
    .skin-overlay-particles {
      position: absolute;
      top: 5px;
      right: 5px;
      font-size: 1.1rem;
      animation: floatParticles 2s ease-in-out infinite alternate;
      pointer-events: none;
      text-shadow: 0 0 5px black;
      z-index: 5;
    }
    @keyframes floatParticles {
      0% { transform: translateY(0) scale(0.9); opacity: 0.8; }
      100% { transform: translateY(-5px) scale(1.1); opacity: 1; }
    }

    /* Mega Box Unboxing */
    .mega-box-cabinet {
      background: rgba(0,0,0,0.35);
      border: 4px solid var(--accent-red);
      border-radius: 24px;
      padding: 20px;
      margin: 20px 0;
      position: relative;
      overflow: hidden;
      display: none;
    }
    .mega-box-unboxing {
      width: 110px;
      height: 110px;
      margin: 15px auto;
      cursor: pointer;
      background: radial-gradient(circle, #ef4444 0%, #991b1b 100%);
      border: 5px solid #facc15;
      border-radius: 20px;
      box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 3.5rem;
      position: relative;
      user-select: none;
      transition: transform 0.1s ease;
    }
    .mega-box-unboxing.shake {
      animation: shakeBox 0.25s infinite alternate;
    }
    @keyframes shakeBox {
      0% { transform: rotate(-6deg) scale(1); }
      100% { transform: rotate(6deg) scale(1.06); }
    }
    .mega-box-items-left {
      position: absolute;
      bottom: -10px;
      right: -10px;
      background: #fbbf24;
      color: #000;
      border: 3px solid #1e293b;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      font-family: var(--font-game);
      font-size: 1.1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    }
    .unboxing-reward-pop {
      font-family: var(--font-game);
      font-size: 1.5rem;
      color: var(--accent-yellow);
      text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
      margin-top: 15px;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    /* Leaderboard Grid */
    .leaderboard-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
      color: white;
      margin-top: 5px;
    }
    .leaderboard-header {
      border-bottom: 2px solid rgba(255,255,255,0.1);
      color: var(--text-muted);
      font-weight: bold;
      text-transform: uppercase;
      font-size: 0.72rem;
      letter-spacing: 0.5px;
      padding-bottom: 5px;
      text-align: left;
    }
    .leaderboard-row {
      border-bottom: 1px solid rgba(255,255,255,0.05);
      transition: background 0.2s;
    }
    .leaderboard-row:last-child {
      border-bottom: none;
    }
    .leaderboard-row:hover {
      background: rgba(255,255,255,0.03);
    }
    .leaderboard-rank {
      font-family: var(--font-game);
      font-size: 1.1rem;
      width: 25px;
    }
    .leaderboard-rank-1 { color: #facc15; }
    .leaderboard-rank-2 { color: #cbd5e1; }
    .leaderboard-rank-3 { color: #b45309; }

    /* Smartboard Presentation Mode Styles */
    .smartboard-layout {
      max-width: 850px !important;
      transition: all 0.3s ease;
    }
    .smartboard-layout .brawler-grid,
    .smartboard-layout #player-name-input,
    .smartboard-layout label,
    .smartboard-layout h2,
    .smartboard-layout p:not(#teacher-settings-panel p),
    .smartboard-layout .btn-brawl:not(#smartboard-toggle-btn) {
      display: none !important;
    }
    .smartboard-layout #teacher-settings-panel {
      display: block !important;
      border-top: none !important;
      margin-top: 0 !important;
      padding-top: 0 !important;
    }
    .smartboard-layout #teacher-settings-panel p,
    .smartboard-layout #teacher-settings-panel label,
    .smartboard-layout #teacher-settings-panel input,
    .smartboard-layout #teacher-settings-panel div,
    .smartboard-layout #teacher-settings-panel button {
      display: block !important;
    }
    .smartboard-layout #teacher-settings-panel div {
      display: flex !important;
    }
    .smartboard-layout #leaderboard-container table {
      font-size: 1.35rem !important;
    }
    .smartboard-layout #leaderboard-container th {
      font-size: 1.05rem !important;
      padding-bottom: 12px !important;
    }
    .smartboard-layout #leaderboard-container td {
      padding: 16px 0 !important;
    }
    .smartboard-layout #leaderboard-container .leaderboard-rank {
      font-size: 1.5rem !important;
      width: 40px !important;
    }
    
    @keyframes pulse-live {
      0% { opacity: 0.6; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
      100% { opacity: 1; box-shadow: 0 0 8px 4px rgba(16, 185, 129, 0.2); }
    }
      .wertetabelle {
      margin: 15px auto;
      border-collapse: collapse;
      width: 90%;
      font-family: var(--font-game);
      text-align: center;
      background-color: rgba(0,0,0,0.4);
      border-radius: 8px;
      overflow: hidden;
      border: 3px solid #1a1a2e;
    }
    .wertetabelle th {
      background-color: var(--accent-purple);
      color: white;
      padding: 12px;
      border: 2px solid #1a1a2e;
    }
    .wertetabelle td {
      padding: 12px;
      color: var(--accent-yellow);
      border: 2px solid #1a1a2e;
      font-size: 1.3rem;
      text-shadow: 1px 1px 0px black;
    }

    /* Responsive Design for iPads & Mobile */
    @media (max-width: 820px) {
      .game-cabinet { padding: 12px; border-width: 4px; border-radius: 16px; min-height: 95vh; }
      .game-title { font-size: 2rem; }
      .brawler-grid { grid-template-columns: 1fr; gap: 10px; }
      .combat-stage { flex-direction: column; min-height: auto; padding: 15px 10px; }
      .character-stand { width: 100%; transform: none !important; animation: none !important; }
      .versus-icon { position: relative; transform: none; top: 0; left: 0; margin: 15px auto; }
      .combat-stage::before { transform: none; }
    }
      .brawl-table {
      width: 100%;
      max-width: 300px;
      margin: 15px auto;
      border-collapse: collapse;
      border: 2px solid #06b6d4;
      background: rgba(0,0,0,0.35);
      font-size: 0.9rem;
      text-align: center;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 4px 10px rgba(0,0,0,0.4);
      color: white;
    }
    .brawl-table th {
      background: #06b6d4;
      color: #0f1322;
      font-weight: bold;
      padding: 8px;
    }
    .brawl-table td {
      padding: 8px;
      border: 1px solid rgba(6, 182, 212, 0.5);
    }
    .math-expr {
      font-family: 'Courier New', monospace;
      font-weight: bold;
      color: #facc15;
      font-size: 1.1em;
      background: rgba(0,0,0,0.3);
      padding: 2px 5px;
      border-radius: 4px;
    }

    /* Stand ordering in vertical mode (Boss at top, Player at bottom) */
    @media (max-width: 820px) {
      .combat-stage {
        flex-direction: column !important;
        min-height: 280px;
        justify-content: space-around;
        padding: 15px 10px;
      }
      #enemy-stand {
        order: 1;
      }
      .versus-icon {
        order: 2;
        position: relative;
        transform: none;
        top: auto;
        left: auto;
        margin: 10px auto;
      }
      #player-stand {
        order: 3;
      }
      .character-stand {
        width: 90% !important;
      }
      
      /* Projectile flight path overrides for vertical orientation */
      @keyframes flyPlayerToEnemy {
        0% { top: 80%; left: 50%; transform: translateX(-50%) scale(0.6); opacity: 0; }
        20% { opacity: 1; }
        100% { top: 20%; left: 50%; transform: translateX(-50%) scale(1.1); opacity: 1; }
      }
      @keyframes flyEnemyToPlayer {
        0% { top: 20%; left: 50%; transform: translateX(-50%) scale(0.6); opacity: 0; }
        20% { opacity: 1; }
        100% { top: 80%; left: 50%; transform: translateX(-50%) scale(1.1); opacity: 1; }
      }

      /* Damage Popup placement for vertical layout */
      .damage-indicator.player-side {
        left: 50% !important;
        top: 75% !important;
        transform: translateX(-50%) !important;
      }
      .damage-indicator.enemy-side {
        left: 50% !important;
        top: 15% !important;
        transform: translateX(-50%) !important;
      }
    }

    /* Position styles for damage popups in horizontal layout */
    .damage-indicator.player-side {
      left: 20%;
      top: 25%;
    }
    .damage-indicator.enemy-side {
      left: 70%;
      top: 25%;
    }

    /* Landscape side-by-side design */
    @media (orientation: landscape) and (min-width: 600px) {
      .game-cabinet {
        max-width: 950px;
        padding: 16px;
      }
      .arena-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: start; /* Fix the height stretching/jumping issue! */
      }
      .combat-stage {
        height: 72vh;
        min-height: auto;
        max-height: 72vh;
        flex-direction: row !important; /* Force side-by-side layout in landscape! */
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        box-sizing: border-box;
      }
      .combat-stage .character-avatar-large {
        width: 120px !important;
        height: 120px !important;
      }
      .combat-stage .character-avatar-large img {
        object-fit: contain !important;
      }
      #player-stand {
        order: 1;
      }
      .versus-icon {
        order: 2;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
      }
      #enemy-stand {
        order: 3;
      }
      .character-stand {
        width: 45% !important;
        transform: rotateX(-30deg) translateZ(10px) !important;
        animation: floatIdleLandscape 3s ease-in-out infinite alternate !important;
      }
      .character-stand.enemy {
        animation: floatIdleEnemyLandscape 3s ease-in-out infinite alternate !important;
        animation-delay: 0.5s !important;
      }
      .combat-stage::before {
        transform: rotateX(30deg) translateY(-10px) scale(1.3);
      }
      .brawl-question-card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 72vh;
        min-height: auto;
        max-height: 72vh;
        box-sizing: border-box;
        overflow-y: auto;
      }
      .question-title-text {
        font-size: clamp(0.85rem, 2vw, 1.1rem) !important;
      }
      .answer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }
      .button-group-game {
        grid-column: 1 / -1;
        margin-top: 10px;
      }
      /* Projectile flight path overrides for horizontal landscape layout */
      @keyframes flyPlayerToEnemy {
        0% { left: 20%; top: 50%; transform: scale(0.6) rotate(0deg) translateZ(0); opacity: 0; }
        20% { opacity: 1; }
        50% { top: 20%; transform: scale(1.5) rotate(180deg) translateZ(40px); }
        100% { left: 70%; top: 50%; transform: scale(1.1) rotate(360deg) translateZ(0); opacity: 1; }
      }
      @keyframes flyEnemyToPlayer {
        0% { left: 70%; top: 50%; transform: scale(0.6) rotate(0deg) translateZ(0); opacity: 0; }
        20% { opacity: 1; }
        50% { top: 20%; transform: scale(1.5) rotate(-180deg) translateZ(40px); }
        100% { left: 20%; top: 50%; transform: scale(1.1) rotate(-360deg) translateZ(0); opacity: 1; }
      }
      .damage-indicator.player-side {
        left: 20% !important;
        top: 25% !important;
        transform: none !important;
      }
      .damage-indicator.enemy-side {
        left: 70% !important;
        top: 25% !important;
        transform: none !important;
      }
    }

    @keyframes floatIdleLandscape {
      0% { transform: rotateX(-30deg) translateZ(10px) translateY(0); }
      100% { transform: rotateX(-30deg) translateZ(10px) translateY(-5px); }
    }

    @keyframes floatIdleEnemyLandscape {
      0% { transform: rotateX(-30deg) translateZ(10px) translateY(0); }
      100% { transform: rotateX(-30deg) translateZ(10px) translateY(-5px); }
    }

    /* ==========================================================================
       ERWEITERTE UI-STILE (START, KLASSENAUSWAHL, SHOP & DRUCK)
       ========================================================================== */
    .start-screen-panel {
      background: rgba(0, 0, 0, 0.35);
      border: 4px solid #1e293b;
      border-radius: 24px;
      padding: 24px;
      margin-bottom: 20px;
      box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
    }
    
    .grade-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin: 20px 0;
    }
    
    .btn-grade {
      background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
      border: 3px solid #1e293b;
      border-radius: 12px;
      box-shadow: 0 4px 0 #1e3a8a;
      color: white;
      font-family: var(--font-game);
      font-size: 1.1rem;
      padding: 10px;
      cursor: pointer;
      transition: all 0.1s;
    }
    .btn-grade:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 0 #1e3a8a;
    }
    .btn-grade.selected {
      background: linear-gradient(180deg, #10b981 0%, #059669 100%);
      box-shadow: 0 4px 0 #047857;
      border-color: #facc15;
    }
    
    .btn-player-grade {
      background: linear-gradient(180deg, #475569 0%, #1e293b 100%);
      border: 3px solid #1e293b;
      border-radius: 12px;
      box-shadow: 0 4px 0 #0f172a;
      color: #94a3b8;
      font-family: var(--font-game);
      font-size: 0.9rem;
      padding: 10px 4px;
      cursor: pointer;
      text-align: center;
      transition: all 0.1s;
      text-shadow: 1px 1px 0px black;
    }
    .btn-player-grade:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 0 #0f172a;
      color: white;
    }
    .btn-player-grade.selected {
      background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
      border-color: #facc15;
      color: white;
      box-shadow: 0 4px 0 #7c2d12;
    }

    .course-toggle-container {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin: 15px 0;
      background: rgba(0,0,0,0.25);
      padding: 12px;
      border-radius: 16px;
      border: 2px solid #334155;
    }
    
    .btn-course {
      background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
      border: 3px solid #1e293b;
      border-radius: 10px;
      box-shadow: 0 4px 0 #374151;
      color: white;
      font-family: var(--font-game);
      font-size: 1rem;
      padding: 8px 20px;
      cursor: pointer;
      transition: all 0.1s;
    }
    .btn-course.selected {
      background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
      box-shadow: 0 4px 0 #c2410c;
      border-color: #facc15;
    }
    
    .shop-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin: 10px 0;
    }
    .shop-card {
      background: rgba(255, 255, 255, 0.05);
      border: 3px solid #334155;
      border-radius: 16px;
      padding: 12px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      transition: all 0.2s;
    }
    .shop-card:hover {
      border-color: var(--accent-yellow);
      transform: translateY(-2px);
    }
    .shop-item-title {
      font-family: var(--font-game);
      font-size: 0.85rem;
      color: white;
      margin-top: 6px;
      line-height: 1.2;
    }
    .shop-item-price {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-family: var(--font-game);
      font-size: 0.95rem;
      color: var(--accent-yellow);
      margin-top: 6px;
    }
    .btn-buy-item {
      background: linear-gradient(180deg, #10b981 0%, #059669 100%);
      box-shadow: 0 3px 0 #047857;
      border: 2px solid #1e293b;
      border-radius: 8px;
      color: white;
      font-family: var(--font-game);
      font-size: 0.8rem;
      padding: 4px 12px;
      cursor: pointer;
      margin-top: 8px;
      transition: transform 0.1s;
    }
    .btn-buy-item:active {
      transform: scale(0.95);
    }
    .btn-buy-item:disabled {
      background: #4b5563;
      box-shadow: none;
      cursor: not-allowed;
      opacity: 0.6;
    }
    
    /* Bigger Avatars in combat */
    .character-avatar-large {
      width: 130px !important;
      height: 130px !important;
    }
    .combat-stage {
      min-height: 220px !important;
    }
    
    
    /* ============================================================
       TEAM MODUS EXTENSION STYLES
       ============================================================ */
    .btn-mode {
      padding: 10px 16px;
      background: rgba(0, 0, 0, 0.4);
      border: 3px solid #334155;
      border-radius: 12px;
      color: #94a3b8;
      font-family: var(--font-game);
      font-size: 1rem;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-mode:hover {
      border-color: #475569;
      color: white;
    }
    .btn-mode.selected {
      background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
      border-color: #1e293b;
      box-shadow: 0 4px 0 #854d0e;
      color: white;
      text-shadow: 1px 1px 0 black;
    }

    .btn-team {
      padding: 12px 6px;
      background: rgba(0, 0, 0, 0.4);
      border: 3px solid #334155;
      border-radius: 12px;
      color: #94a3b8;
      font-family: var(--font-game);
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .btn-team:hover {
      border-color: #475569;
      color: white;
    }
    .btn-team.selected {
      color: white;
      text-shadow: 1px 1px 0 black;
      border-color: #1e293b;
    }
    .btn-team.selected#btn-team-A {
      background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
      box-shadow: 0 4px 0 #7f1d1d;
    }
    .btn-team.selected#btn-team-B {
      background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
      box-shadow: 0 4px 0 #1e3a8a;
    }
    .btn-team.selected#btn-team-C {
      background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
      box-shadow: 0 4px 0 #14532d;
    }
    .btn-team.selected#btn-team-D {
      background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
      box-shadow: 0 4px 0 #5b21b6;
    }

    .team-ranking-container {
      display: flex;
      flex-direction: column;
      gap: 15px;
      margin-top: 15px;
    }
    .team-ranking-row {
      background: rgba(0, 0, 0, 0.45);
      border: 3px solid #334155;
      border-radius: 16px;
      padding: 14px 18px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
    }
    .team-ranking-row.TeamA { border-color: rgba(239, 68, 68, 0.5); }
    .team-ranking-row.TeamB { border-color: rgba(59, 130, 246, 0.5); }
    .team-ranking-row.TeamC { border-color: rgba(34, 197, 94, 0.5); }
    .team-ranking-row.TeamD { border-color: rgba(168, 85, 247, 0.5); }

    .team-ranking-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .team-ranking-name {
      font-family: var(--font-game);
      font-size: 1.25rem;
      letter-spacing: 0.5px;
      text-shadow: 1px 1px 0 black;
    }
    .team-ranking-name.TeamA { color: #ef4444; }
    .team-ranking-name.TeamB { color: #3b82f6; }
    .team-ranking-name.TeamC { color: #22c55e; }
    .team-ranking-name.TeamD { color: #a855f7; }

    .team-ranking-stats {
      display: flex;
      gap: 15px;
      font-size: 0.9rem;
      color: var(--text-muted);
      font-weight: bold;
    }
    .team-ranking-bar-wrapper {
      background: rgba(0, 0, 0, 0.5);
      border-radius: 10px;
      height: 22px;
      width: 100%;
      overflow: hidden;
      position: relative;
      border: 1.5px solid rgba(255, 255, 255, 0.05);
    }
    .team-ranking-bar-fill {
      height: 100%;
      border-radius: 8px;
      width: 0%;
      transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .team-ranking-bar-fill.TeamA { background: linear-gradient(90deg, #ef4444, #f87171); }
    .team-ranking-bar-fill.TeamB { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
    .team-ranking-bar-fill.TeamC { background: linear-gradient(90deg, #22c55e, #4ade80); }
    .team-ranking-bar-fill.TeamD { background: linear-gradient(90deg, #a855f7, #c084fc); }

    .team-ranking-average {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      font-family: var(--font-game);
      font-size: 0.85rem;
      color: white;
      text-shadow: 1px 1px 1px black;
      z-index: 2;
      letter-spacing: 0.5px;
    }

    /* Smartboard layout overrides for Team Modus */
    .smartboard-layout .team-ranking-container {
      gap: 20px;
    }
    .smartboard-layout .team-ranking-row {
      padding: 20px 24px;
    }
    .smartboard-layout .team-ranking-name {
      font-size: 1.6rem;
    }
    .smartboard-layout .team-ranking-stats {
      font-size: 1.1rem;
    }
    .smartboard-layout .team-ranking-bar-wrapper {
      height: 30px;
    }
    .smartboard-layout .team-ranking-average {
      font-size: 1.15rem;
      right: 18px;
    }

    /* Print Styles */
    @media print {
      body {
        background: white !important;
        color: black !important;
        font-family: Arial, sans-serif !important;
      }
      .game-cabinet {
        border: none !important;
        box-shadow: none !important;
        background: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
      }
      .screen {
        display: none !important;
      }
      #result-screen.screen {
        display: block !important;
      }
      .no-print, button, .btn-brawl, .versus-icon, .trophy-road, .progress-bar-game, .mega-box-cabinet, .hud-bar, #mute-btn, #settings-gear-btn {
        display: none !important;
      }
      .game-title {
        color: black !important;
        text-shadow: none !important;
        font-size: 2.2rem !important;
        text-align: center !important;
      }
      .game-subtitle {
        color: black !important;
        text-shadow: none !important;
        font-size: 1.2rem !important;
        margin-bottom: 30px !important;
        text-align: center !important;
      }
      .results-grid {
        border: 2px solid black !important;
        background: white !important;
        color: black !important;
        margin-top: 20px !important;
        box-shadow: none !important;
      }
      .results-row {
        border-bottom: 1px solid black !important;
        padding: 12px !important;
      }
      .results-label {
        color: black !important;
        font-weight: bold !important;
      }
      .results-value {
        color: black !important;
        font-weight: bold !important;
      }
      .star-player-crown {
        color: black !important;
        border: 2px dashed black !important;
        background: white !important;
        margin-top: 20px !important;
        padding: 10px !important;
        text-shadow: none !important;
      }
    }

    /* Feedback Modal Styling */
    .feedback-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.85);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }
    .feedback-modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }
    .feedback-modal-card {
      background: radial-gradient(circle at 50% 0%, #2e3b6e 0%, #161a30 100%);
      border: 6px solid #1e293b;
      border-radius: 24px;
      width: 90%;
      max-width: 480px;
      padding: 24px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.3);
      text-align: center;
      transform: scale(0.9) translateY(20px);
      transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .feedback-modal-overlay.active .feedback-modal-card {
      transform: scale(1) translateY(0);
    }
    .feedback-modal-title {
      font-family: var(--font-game);
      font-size: 1.8rem;
      color: var(--accent-yellow);
      margin-bottom: 15px;
      text-shadow: 2px 2px 0 black;
      letter-spacing: 1px;
    }
    .feedback-label {
      font-family: var(--font-game);
      color: var(--accent-cyan);
      font-size: 1rem;
      display: block;
      margin-bottom: 10px;
      text-shadow: 1px 1px 0 black;
      text-align: left;
    }
    .feedback-options {
      display: flex;
      gap: 15px;
      margin-bottom: 20px;
    }
    .btn-feedback-choice {
      flex: 1;
      background: rgba(0,0,0,0.4);
      border: 3px solid #334155;
      border-radius: 12px;
      padding: 12px;
      color: white;
      font-family: var(--font-game);
      font-size: 1.1rem;
      cursor: pointer;
      transition: all 0.15s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-feedback-choice:hover {
      background: rgba(255,255,255,0.05);
      border-color: var(--accent-cyan);
    }
    .btn-feedback-choice.selected-yes {
      background: rgba(16, 185, 129, 0.2);
      border-color: var(--accent-green);
      color: var(--accent-green);
      box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
    }
    .btn-feedback-choice.selected-no {
      background: rgba(239, 68, 68, 0.2);
      border-color: var(--accent-red);
      color: var(--accent-red);
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    }
    .feedback-textarea {
      width: 100%;
      height: 85px;
      padding: 10px 14px;
      border: 3px solid #334155;
      border-radius: 12px;
      background: rgba(0,0,0,0.4);
      color: white;
      font-family: var(--font-body);
      font-size: 0.92rem;
      outline: none;
      resize: none;
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
      margin-bottom: 18px;
    }
    .feedback-textarea:focus {
      border-color: var(--accent-cyan);
    }
    .feedback-checkbox-wrapper {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 24px;
      text-align: left;
      font-size: 0.88rem;
      color: var(--text-muted);
      cursor: pointer;
    }
    .feedback-checkbox-wrapper input {
      width: 18px;
      height: 18px;
      cursor: pointer;
    }

    /* Poison Damage indicator style */
    .damage-indicator.enemy-side.poison-damage {
      color: #22c55e !important;
      text-shadow: 0 0 8px #15803d, 2px 2px 0 black, -2px -2px 0 black !important;
    }

