/* ==========================================
   DESIGN SYSTEM VARIABLES
   ========================================== */
:root {
    --cyber-bg: #05070a;
    --cyber-panel: rgba(10, 14, 23, 0.75);
    --cyber-panel-hover: rgba(18, 25, 38, 0.85);
    --cyber-border: rgba(255, 144, 82, 0.16);
    --cyber-border-hover: rgba(255, 209, 102, 0.45);
    --cyber-border-blue: rgba(59, 130, 246, 0.2);
    
    --accent-orange: #ff9052;
    --accent-orange-glow: rgba(255, 144, 82, 0.4);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.45);
    --accent-yellow: #ffd166;
    --accent-yellow-glow: rgba(255, 209, 102, 0.4);
    --accent-red: #ef4444;
    --accent-green: #10b981;
    
    --text-light: #edf4ff;
    --text-muted: #8ca4c2;
    --text-dark: #4e627a;
    
    --font-cyber: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body.wolf-brawler-body {
    background-color: var(--cyber-bg);
    color: var(--text-light);
    font-family: var(--font-cyber);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================
   AMBIENT BACKGROUND STYLING
   ========================================== */
.wolf-brawler-atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.35;
    animation: orb-float 15s infinite alternate;
}

.orb-orange {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-orange) 0%, transparent 70%);
    top: -250px;
    left: -100px;
}

.orb-blue {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    bottom: -300px;
    right: -100px;
}

.arena-grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.8;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

/* ==========================================
   SHELL LAYOUT
   ========================================== */
.wolf-brawler-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
    position: relative;
}

.wolf-brawler-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 20px;
}

.wolf-brawler-kicker {
    color: var(--accent-orange);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-shadow: 0 0 10px var(--accent-orange-glow);
}

.wolf-brawler-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-light) 30%, var(--accent-orange) 70%, var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wolf-brawler-copy {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 650px;
    line-height: 1.5;
}

.wolf-brawler-backlink {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid rgba(140, 164, 194, 0.15);
    background: rgba(10, 14, 23, 0.5);
    transition: all 0.3s;
}

.wolf-brawler-backlink:hover {
    color: var(--text-light);
    border-color: var(--accent-orange);
    box-shadow: 0 0 12px var(--accent-orange-glow);
    transform: translateY(-2px);
}

/* ==========================================
   STAGE / SCREENS
   ========================================== */
.wolf-brawler-stage-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.brawler-screen {
    display: none;
    width: 100%;
    flex: 1;
}

.brawler-screen.active {
    display: flex;
    flex-direction: column;
}

/* ==========================================
   BUTTONS & CONTROLS
   ========================================== */
.brawler-btn {
    font-family: var(--font-cyber);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.brawler-btn-primary {
    background: var(--accent-orange);
    color: var(--cyber-bg);
}

.brawler-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-orange-glow);
    filter: brightness(1.1);
}

.brawler-btn-accent {
    background: transparent;
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    box-shadow: inset 0 0 4px rgba(255, 209, 102, 0.1);
}

.brawler-btn-accent:hover:not(:disabled) {
    background: var(--accent-yellow);
    color: var(--cyber-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-yellow-glow);
}

.brawler-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.brawler-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.brawler-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.brawler-btn-danger:hover:not(:disabled) {
    background: var(--accent-red);
    color: var(--text-light);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.brawler-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Input boxes & Select tags */
.select-wrap, .input-wrap {
    position: relative;
    width: 100%;
}

.select-wrap select, .input-wrap input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(8, 12, 19, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-family: var(--font-cyber);
    outline: none;
    transition: all 0.3s;
}

.select-wrap select {
    appearance: none;
    cursor: pointer;
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--accent-orange);
    font-size: 0.8rem;
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: all 0.3s;
}

.input-wrap input:focus ~ .input-focus-border,
.select-wrap select:focus ~ .input-focus-border {
    width: 100%;
    left: 0;
}

.input-wrap input:focus, .select-wrap select:focus {
    border-color: rgba(255, 144, 82, 0.5);
    box-shadow: 0 0 10px rgba(255, 144, 82, 0.15);
}

/* ==========================================
   SETUP / BUILDER SCREEN (STEP 1)
   ========================================== */
.setup-card {
    background: var(--cyber-panel);
    border: 1px solid var(--cyber-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    margin: 50px auto;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.setup-header {
    text-align: center;
    margin-bottom: 30px;
}

.setup-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 144, 82, 0.12);
    border: 1px solid rgba(255, 144, 82, 0.25);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.setup-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-light);
}

.setup-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.squad-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.ids-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.verify-status {
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.verify-status.status-success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-green);
}

.verify-status.status-error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--accent-red);
}

.shake {
    animation: shake-anim 0.35s ease-in-out;
}

@keyframes shake-anim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ==========================================
   LOBBY SCREEN (STEP 2)
   ========================================== */
.lobby-card {
    background: var(--cyber-panel);
    border: 1px solid var(--cyber-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    margin: 40px auto;
    backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.lobby-header {
    text-align: center;
    margin-bottom: 35px;
}

.lobby-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.lobby-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.lobby-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.lobby-box {
    background: rgba(13, 18, 28, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.lobby-box:hover {
    border-color: rgba(255, 144, 82, 0.3);
    background: rgba(18, 25, 38, 0.8);
}

.lobby-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-light);
}

.lobby-box p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 24px;
    max-width: 260px;
}

.lobby-box button {
    width: 100%;
}

.lobby-footer {
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

/* Matchmaking Loader Overlay */
.queue-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.94);
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.queue-overlay.active {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 144, 82, 0.1);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin-anim 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin-anim {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.queue-overlay p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 5px;
}

.queue-timer {
    font-size: 0.85rem;
    color: var(--accent-yellow);
    font-weight: 700;
    margin-bottom: 20px;
}

/* ==========================================
   BRAWLER ARENA BATTLE SCREEN (STEP 3)
   ========================================== */
.arena-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.arena-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 18, 28, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 24px;
}

.turn-indicator {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-yellow);
}

.timer-indicator {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.timer-indicator.danger {
    color: var(--accent-red);
    animation: flash-red 0.5s infinite alternate;
}

@keyframes flash-red {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ==========================================
   BATTLE STAGE & SPRITES
   ========================================== */
.battle-stage {
    background: radial-gradient(circle at center, rgba(16, 25, 44, 0.6) 0%, rgba(5, 7, 10, 0.95) 100%);
    border: 1px solid var(--cyber-border);
    border-radius: 20px;
    height: 380px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.fighter-side {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
    z-index: 2;
}

.active-fighter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s;
    width: 250px;
}

.sprite-container {
    width: 170px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}

.sprite-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}

.fighter-details {
    width: 100%;
    background: rgba(5, 7, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    backdrop-filter: blur(8px);
}

.fighter-name {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: 0.5px;
}

.fighter-hp-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fighter-hp-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.fighter-hp-fill {
    height: 100%;
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
    border-radius: 4px;
    transition: width 0.4s ease-out;
}

.fighter-hp-fill.warning {
    background: var(--accent-orange);
    box-shadow: 0 0 6px var(--accent-orange-glow);
}

.fighter-hp-fill.danger {
    background: var(--accent-red);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.fighter-hp-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 48px;
    text-align: right;
}

.fighter-energy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.energy-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.energy-slots {
    display: flex;
    gap: 6px;
}

.energy-slot {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 50%;
    transition: all 0.3s;
}

.energy-slot.filled {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange-glow);
}

/* ==========================================
   COMBAT ANIMATION STATES
   ========================================== */
.animate-idle .sprite-img {
    animation: sprite-idle-anim 2s infinite alternate ease-in-out;
}

@keyframes sprite-idle-anim {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

/* Lunge attacks */
.animate-attack-left {
    animation: attack-lunge-left 0.4s ease-in-out;
}

@keyframes attack-lunge-left {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(-30px) scale(0.95); }
    50% { transform: translateX(110px) scale(1.15); }
    100% { transform: translateX(0) scale(1); }
}

.animate-attack-right {
    animation: attack-lunge-right 0.4s ease-in-out;
}

@keyframes attack-lunge-right {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(30px) scale(0.95); }
    50% { transform: translateX(-110px) scale(1.15); }
    100% { transform: translateX(0) scale(1); }
}

/* Special move glow */
.animate-special-glow .sprite-img {
    animation: special-glow-anim 0.5s ease-in-out alternate infinite;
}

@keyframes special-glow-anim {
    0% { filter: drop-shadow(0 0 5px var(--accent-orange-glow)); }
    100% { filter: drop-shadow(0 0 25px rgba(255, 144, 82, 0.85)); }
}

/* Recoil hit shake */
.animate-recoil {
    animation: hit-recoil-anim 0.35s ease-out;
}

@keyframes hit-recoil-anim {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-15px); filter: brightness(1.5) sepia(1) saturate(5) hue-rotate(-50deg); }
    30%, 60%, 90% { transform: translateX(15px); }
}

/* Dodge escape */
.animate-dodge {
    animation: dodge-slide-anim 0.4s ease-out;
}

@keyframes dodge-slide-anim {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: translate(0, -25px) scale(0.7); opacity: 0.3; }
    100% { transform: scale(1); opacity: 1; }
}

/* Block shielding */
.animate-block-shield {
    position: relative;
}

.animate-block-shield::after {
    content: '🛡️';
    position: absolute;
    top: 30%;
    font-size: 4rem;
    animation: shield-fade 0.5s ease-out forwards;
}

@keyframes shield-fade {
    0% { transform: scale(0.5); opacity: 0.1; }
    30% { transform: scale(1.2); opacity: 0.9; filter: drop-shadow(0 0 10px var(--accent-blue-glow)); }
    100% { transform: scale(1); opacity: 0; }
}

/* Knocked out state */
.active-fighter-wrapper.animate-knockdown {
    transform: rotate(75deg) translateY(40px) scale(0.9);
    opacity: 0.5;
}

/* Winner glow */
.active-fighter-wrapper.winner-glow {
    filter: drop-shadow(0 0 15px var(--accent-yellow-glow));
    animation: bounce-victory 0.8s infinite alternate ease-in-out;
}

@keyframes bounce-victory {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-12px) scale(1.04); }
}

/* ==========================================
   BENCHES / SQUAD PANEL
   ========================================== */
.squad-bench-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(13, 18, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 24px;
}

.bench-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bench-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bench-wolves {
    display: flex;
    gap: 12px;
}

.bench-wolf {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 7, 10, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    transition: all 0.3s;
    background-size: cover;
    background-position: center;
    position: relative;
}

.bench-wolf.active {
    border-color: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange-glow);
    color: var(--text-light);
}

.bench-wolf.dead {
    opacity: 0.35;
    border-color: var(--accent-red);
    text-decoration: line-through;
}

.bench-wolf.dead::before {
    content: '✕';
    position: absolute;
    color: var(--accent-red);
    font-size: 1.4rem;
    font-weight: 400;
}

.bench-vs-divider {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-dark);
}

/* ==========================================
   ARENA CONTROLS GRID (BOTTOM SECTION)
   ========================================== */
.arena-controls-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    height: 300px;
}

.arena-panel {
    background: rgba(13, 18, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.arena-panel h3 {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 6px;
}

/* Action Hand Cards */
.cards-hand {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 1;
    margin-bottom: 12px;
}

.action-card {
    background: rgba(8, 12, 19, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    outline: none;
}

.action-card:hover:not(:disabled) {
    transform: translateY(-8px);
    background: rgba(25, 34, 52, 0.85);
    border-color: rgba(255, 144, 82, 0.4);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.action-card:active:not(:disabled) {
    transform: translateY(-2px);
}

.action-card.selected {
    background: rgba(255, 144, 82, 0.08);
    border-color: var(--accent-orange);
    box-shadow: 0 0 12px var(--accent-orange-glow);
    transform: translateY(-8px);
}

.action-card.selected::before {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--accent-orange);
    font-weight: 900;
    font-size: 0.8rem;
}

.card-art {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.card-name {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-light);
}

.card-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.card-cost-badge {
    position: absolute;
    bottom: -6px;
    background: var(--accent-orange);
    color: var(--cyber-bg);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.action-card:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.03);
}

/* Swap Wolf Section */
.swap-action-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: rgba(5, 7, 10, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
}

.swap-action-container label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.swap-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.swap-controls .select-wrap select {
    padding: 8px 30px 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.swap-controls button {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Console Logs / Chat Tabs */
.panel-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 12px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0; /* Important for scroll */
}

.tab-content.active {
    display: flex;
}

/* Cyber Console Window */
.cyber-console {
    background: rgba(5, 7, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    height: 180px;
    max-height: 180px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.console-line {
    color: var(--text-muted);
}

.console-line.system {
    color: var(--accent-yellow);
}

.console-line.attack {
    color: var(--accent-orange);
}

.console-line.damage-taken {
    color: var(--accent-red);
}

.console-line.victory {
    color: var(--accent-green);
}

/* Combat Chat */
.chat-messages {
    background: rgba(5, 7, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    height: 180px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.chat-message {
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-all;
}

.chat-message .sender {
    font-weight: 800;
    color: var(--accent-orange);
}

.chat-message.system {
    color: var(--text-muted);
    font-style: italic;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-form input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(5, 7, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
    outline: none;
}

.chat-form input:focus {
    border-color: var(--accent-orange);
}

.chat-form button {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* ==========================================
   GAME OVER SCREEN OVERLAY
   ========================================== */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.95);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.overlay-screen.active {
    display: flex;
}

.game-over-card {
    background: var(--cyber-panel);
    border: 2px solid var(--accent-yellow);
    box-shadow: 0 0 25px var(--accent-yellow-glow);
    border-radius: 20px;
    padding: 40px;
    width: 440px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scale-up-card 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scale-up-card {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.game-over-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--accent-yellow);
    margin-bottom: 6px;
}

.game-over-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.winner-display {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 209, 102, 0.15);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.winner-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--accent-yellow);
    box-shadow: 0 0 12px var(--accent-yellow-glow);
    margin-bottom: 12px;
    object-fit: cover;
}

.winner-name {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-light);
}

.winner-badge {
    background: rgba(255, 209, 102, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(255, 209, 102, 0.25);
    border-radius: 100px;
    padding: 3px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================
   PARTICLES LAYER
   ========================================== */
.battle-effects-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: particle-explode 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes particle-explode {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

.damage-popup {
    position: absolute;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-orange);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9), 0 0 4px var(--accent-orange);
    animation: popup-float 0.8s ease-out forwards;
}

@keyframes popup-float {
    0% { transform: translateY(0) scale(0.6); opacity: 0.2; }
    30% { transform: translateY(-20px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-50px) scale(0.8); opacity: 0; }
}

.zzz-bubble {
    position: absolute;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-shadow: 0 0 4px var(--accent-blue-glow);
    animation: zzz-float 1.5s ease-out forwards;
}

@keyframes zzz-float {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0.2; }
    40% { transform: translate(15px, -20px) scale(1); opacity: 1; }
    100% { transform: translate(30px, -50px) scale(0.8); opacity: 0; }
}

/* ==========================================
   FOOTER
   ========================================== */
.wolf-brawler-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-dark);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 40px;
}

/* ==========================================
   RESPONSIVE SCALING
   ========================================== */
@media (max-width: 992px) {
    .arena-controls-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    .cards-hand {
        height: 140px;
    }
    .cyber-console, .chat-messages {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .wolf-brawler-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
    }
    .lobby-options {
        grid-template-columns: 1fr;
    }
    .ids-grid {
        grid-template-columns: 1fr;
    }
    .battle-stage {
        height: 520px;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    .active-fighter-wrapper {
        width: 200px;
    }
    .sprite-container {
        width: 120px;
        height: 120px;
    }
}
