/* ===================================================================
   NRD SANDBOX - TACTICAL CARD BATTLE INTERFACE STYLES
   =================================================================== */

/* ===================================================================
   LOGIN PAGE STYLES
   =================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 100%);
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00d4ff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
    max-width: 400px;
    width: 100%;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    padding: 20px;
    text-align: center;
    color: #000;
}

.login-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
}

.login-subtitle {
    margin: 5px 0 0 0;
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-form-container {
    padding: 30px;
    color: #ffffff;
}

.login-form-title {
    margin: 0 0 25px 0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    color: #00d4ff;
    letter-spacing: 1px;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: bold;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.login-button {
    width: 100%;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button:hover {
    background: linear-gradient(135deg, #00b8e6, #007399);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.button-icon {
    font-size: 18px;
}

.login-error {
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid #ff3333;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #ff6666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-success {
    background: rgba(0, 255, 100, 0.1);
    border: 1px solid #00cc66;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #00ff66;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-icon, .success-icon {
    font-size: 16px;
}

.input-help {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    display: block;
}

.login-input[type="select"], select.login-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}

.login-footer {
    margin-top: 25px;
    text-align: center;
}

.login-hint {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #999;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #333;
}

.version-info {
    margin: 0;
    font-size: 11px;
    color: #666;
    opacity: 0.7;
}

/* ===================================================================
   RESET & BASE STYLES
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===================================================================
   MAIN CONTAINER
   =================================================================== */
.battlefield-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 100px 20px;
    overflow: hidden;
}

/* ===================================================================
   TOP NAVIGATION BAR
   =================================================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.nav-center {
    flex: 2;
    text-align: center;
}

.game-title {
    font-size: 22px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    letter-spacing: 2px;
}

.config-link, .logout-link {
    color: #88c0ff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 14px;
}

.config-link:hover, .logout-link:hover {
    background: rgba(136, 192, 255, 0.1);
    border-color: #88c0ff;
}

.user-info {
    color: #aaa;
    font-size: 13px;
}

.version-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.version-badge:hover {
    background: #34ce57;
    border-color: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

/* ===================================================================
   BATTLEFIELD LAYOUT
   =================================================================== */
.battlefield {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

/* ===================================================================
   GAME RULES SUMMARY BAR
   =================================================================== */
.game-rules-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 15px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.rules-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.rule-item {
    font-size: 12px;
    color: #ddd;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid #17a2b8;
}

.rules-config-link {
    color: #17a2b8;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #17a2b8;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.rules-config-link:hover {
    background: rgba(23, 162, 184, 0.1);
    transform: translateY(-1px);
}

.combat-zone {
    flex: 1;
    padding: 8px 20px;
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.enemy-zone {
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.08) 0%, transparent 100%);
    border-radius: 8px 8px 0 0;
}

.player-zone {
    background: linear-gradient(0deg, rgba(40, 167, 69, 0.08) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
}

.zone-label {
    position: absolute;
    top: 6px;
    left: 20px;
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

/* ===================================================================
   NEW BATTLEFIELD LAYOUT (5-COLUMN)
   =================================================================== */
.battlefield-layout {
    display: grid;
    grid-template-columns: 120px 140px 1fr 140px 120px;
    gap: 20px;
    align-items: center;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 0;
}

/* ===================================================================
   DRAW DECK AREAS
   =================================================================== */
.draw-deck-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.draw-pile {
    position: relative;
    width: 70px;
    height: 90px;
}

.draw-card {
    position: absolute;
    width: 70px;
    height: 90px;
    background: linear-gradient(145deg, #2a2a3e 0%, #1e1e2e 100%);
    border: 2px solid #444;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.draw-card:nth-child(1) { top: 0px; left: 0px; }
.draw-card:nth-child(2) { top: -2px; left: 1px; }
.draw-card:nth-child(3) { top: -4px; left: 2px; }
.draw-card:nth-child(4) { top: -6px; left: 3px; }
.draw-card:nth-child(5) { top: -8px; left: 4px; }

.face-down {
    background: repeating-linear-gradient(
        45deg,
        #2a2a3e,
        #2a2a3e 10px,
        #1e1e2e 10px,
        #1e1e2e 20px
    );
}

/* ===================================================================
   EQUIPMENT CARDS (WEAPON & ARMOR)
   =================================================================== */
.equipment-area {
    display: flex;
    justify-content: center;
}

.equipment-card {
    width: 120px;
    height: 150px;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border: 2px solid #444;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    color: white;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.equipment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.weapon-card {
    background: linear-gradient(145deg, #8b2635 0%, #5f1e2a 100%);
    border-color: #dc3545;
}

.weapon-card:hover {
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
}

.armor-card {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
}

.armor-card:hover {
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.card-type {
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.card-name {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    flex: 1;
    display: flex;
    align-items: center;
}

.card-stats {
    font-size: 12px;
    font-weight: bold;
    color: #00d4ff;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 5px;
}

/* ===================================================================
   MECH CARDS WITH COMPANIONS
   =================================================================== */
.mech-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 160px;
}

.companion-pog {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #666 0%, #333 100%);
    border: 3px solid #888;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.companion-pog:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.enemy-companion {
    border-color: #dc3545;
    background: radial-gradient(circle, #8b2635 0%, #5f1e2a 100%);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.player-companion {
    border-color: #28a745;
    background: radial-gradient(circle, #2d6b35 0%, #1e4a25 100%);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.4);
}

.companion-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.companion-text {
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.companion-active {
    animation: companionPulse 2s infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
    border-color: #ffd700 !important;
}

.companion-active-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffd700;
    color: #000;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    animation: spin 2s linear infinite;
}

@keyframes companionPulse {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
    50% { box-shadow: 0 0 25px rgba(255, 215, 0, 1); }
    100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pog-content {
    text-align: center;
}

.pog-name {
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.mech-card {
    width: 120px;
    height: 160px;
    border-radius: 12px;
    position: relative;
    margin-bottom: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #2a2a3e 0%, #1e2e2e 100%);
    border: 2px solid #444;
}

.mech-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

/* Mech Health States */
.mech-card.healthy {
    border-color: #28a745;
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.mech-card.damaged {
    border-color: #ffc107;
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.3);
}

.mech-card.critical {
    border-color: #dc3545;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3); }
    50% { box-shadow: 0 6px 16px rgba(220, 53, 69, 0.6); }
}

/* HP Circle - Now positioned below the mech card */
.mech-hp-circle {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle, #fff 0%, #e0e0e0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 8px auto;
    position: relative;
    z-index: 5;
}

.hp-value {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    text-shadow: none;
}

/* Faction Label (P/E) - Adjusted to not interfere with companion pogs */
.mech-faction-label {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    border: 2px solid #666;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 5;
}

.enemy-mech .mech-faction-label {
    background: rgba(220, 53, 69, 0.9);
    border-color: #dc3545;
}

.player-mech .mech-faction-label {
    background: rgba(40, 167, 69, 0.9);
    border-color: #28a745;
}

.mech-body {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #555 0%, #333 70%, #222 100%);
    border-radius: 8px;
}

/* Mech Image Styles */
.mech-image-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.1);
}

.mech-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mech-card:hover .mech-image {
    transform: scale(1.05);
}

/* Mech image overlay effects for different health states */
.mech-card.damaged .mech-image {
    filter: contrast(1.1) brightness(0.9);
}

.mech-card.critical .mech-image {
    filter: contrast(1.2) brightness(0.8) hue-rotate(15deg);
}

.mech-card.healthy .mech-image {
    filter: contrast(1.05) brightness(1.1);
}

/* ===================================================================
   MECH INFO & STATS
   =================================================================== */
.mech-info {
    text-align: center;
    max-width: 150px;
}

.mech-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #00d4ff;
}

.mech-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stat {
    font-size: 11px;
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    border-left: 2px solid #666;
}

/* ===================================================================
   HAND SECTIONS (NEW FAN LAYOUT)
   =================================================================== */
.hand-section {
    padding: 15px 0;
    text-align: center;
    position: relative;
    z-index: 50; /* Ensure hand section is above other elements */
}

.enemy-hand-section {
    order: -1; /* Appears at top of enemy zone */
}

.player-hand-section {
    order: 1; /* Appears at bottom of player zone */
}

.hand-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hand-cards-fan {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 80px;
    position: relative;
    perspective: 1000px;
}

.fan-card {
    position: absolute;
    width: 60px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #444;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform-origin: bottom center;
    
    /* Fan positioning and rotation using CSS custom property */
    left: calc(50% + (var(--card-index) - 2) * 20px);
    transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 8deg));
    z-index: calc(100 + var(--card-index)); /* Much higher z-index to ensure cards are always visible */
}

.fan-card:hover {
    transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 8deg)) translateY(-10px) scale(1.1);
    z-index: 200; /* Even higher for hover state */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* Player cards (face-up) styling */
.fan-card.face-up {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
}

.fan-card.face-up:hover {
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.4);
}

/* Enemy cards (face-down) styling */
.fan-card.face-down {
    background: repeating-linear-gradient(
        45deg,
        #2a2a3e,
        #2a2a3e 8px,
        #1e1e2e 8px,
        #1e1e2e 16px
    );
}

/* ===================================================================
   REAL CARD STYLING (NEW FOR JSON INTEGRATION)
   =================================================================== */
.real-card {
    position: relative;
}

.real-card.spell-card {
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border-color: #4dabf7;
}

.real-card.weapon-card {
    background: linear-gradient(145deg, #8b2635 0%, #5f1e2a 100%);
    border-color: #dc3545;
}

.real-card.armor-card {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
}

.real-card.creature-card {
    background: linear-gradient(145deg, #7d4a87 0%, #5f1e3a 100%);
    border-color: #9c27b0;
}

.real-card.support-card {
    background: linear-gradient(145deg, #87652d 0%, #5f4a1e 100%);
    border-color: #ff9800;
}

.card-mini-icon {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 12px;
    z-index: 1;
}

.card-mini-name {
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    margin-top: 16px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.card-mini-cost {
    font-size: 12px;
    font-weight: bold;
    color: #00d4ff;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin-top: auto;
}

.card-mini-damage {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    font-weight: bold;
    color: #dc3545;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 3px;
    border-radius: 3px;
    z-index: 1;
}

.card-mini-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.card-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

/* ===================================================================
   EMPTY CARD SLOT STYLING (NEW)
   =================================================================== */
.empty-card {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px dashed #555 !important;
    cursor: default !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #777 !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
}

.empty-card-content {
    text-align: center;
    opacity: 0.6;
}

.empty-card-text {
    font-size: 9px;
    color: #888;
    font-weight: bold;
    margin-bottom: 4px;
}

.empty-card-icon {
    font-size: 14px;
    color: #666;
}

/* ===================================================================
   DECK LABELS
   =================================================================== */
.deck-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* ===================================================================
   BATTLEFIELD DIVIDER
   =================================================================== */
.battlefield-divider {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 8px 0;
    flex-shrink: 0;
}

.divider-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #444 20%, #666 50%, #444 80%, transparent 100%);
    border-radius: 1px;
}

.divider-label {
    position: absolute;
    background: #1a1a2e;
    padding: 4px 12px;
    border: 1px solid #666;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    color: #ccc;
    letter-spacing: 1px;
}

/* ===================================================================
   CONTROLS PANEL
   =================================================================== */
.controls-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #333;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.control-group {
    width: 100%;
    margin-bottom: 20px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #00d4ff;
}

.control-group:last-child {
    flex: 1.4; /* Log section takes more space but stays compact */
}

.control-group h3 {
    font-size: 12px;
    margin-bottom: 5px;
    color: #00d4ff;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

/* ===================================================================
   ACTION BUTTONS
   =================================================================== */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    min-width: 90px;
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

.debug-btn {
    padding: 4px 8px;
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    margin: 0 3px;
}

.debug-btn:hover {
    background: rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

.energy-debug-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.discard-btn {
    background: linear-gradient(145deg, #ffa500 0%, #ff8c00 100%);
    color: white;
}

.discard-btn:hover {
    background: linear-gradient(145deg, #ff8c00 0%, #ff7f00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 165, 0, 0.3);
}

.discard-info {
    margin-top: 10px;
    text-align: center;
}

.attack-btn {
    background: linear-gradient(145deg, #dc3545 0%, #a71e2a 100%);
    color: white;
    border: 1px solid #dc3545;
}

.attack-btn:hover {
    background: linear-gradient(145deg, #e74c5c 0%, #c0392b 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
}

.defend-btn {
    background: linear-gradient(145deg, #6c757d 0%, #495057 100%);
    color: white;
    border: 1px solid #6c757d;
}

.defend-btn:hover {
    background: linear-gradient(145deg, #7c858d 0%, #5a6268 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.4);
}

.reset-btn {
    background: linear-gradient(145deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: 1px solid #28a745;
}

.reset-btn:hover {
    background: linear-gradient(145deg, #34ce57 0%, #257e42 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.4);
}

/* ===================================================================
   GAME LOG
   =================================================================== */
.log-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-log {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-radius: 5px;
    padding: 5px;
    height: 60px;
    overflow-y: auto;
    font-size: 10px;
    line-height: 1.2;
}

.log-entry {
    padding: 1px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ddd;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-empty {
    color: #888;
    text-align: center;
    font-style: italic;
    margin-top: 15px;
    font-size: 9px;
}

.log-controls {
    display: flex;
    justify-content: flex-end;
}

.clear-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* ===================================================================
   FOOTER
   =================================================================== */
.game-footer {
    margin-top: 8px;
    padding: 8px 0;
    border-top: 1px solid #333;
    text-align: center;
    flex-shrink: 0;
}

.build-info {
    font-size: 10px;
    color: #888;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */
@media (max-width: 1200px) {
    .battlefield-layout {
        grid-template-columns: 100px 120px 1fr 120px 100px;
        gap: 15px;
    }
    
    .equipment-card {
        width: 100px;
        height: 130px;
        padding: 8px;
    }
    
    .mech-card {
        width: 100px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    .battlefield-container {
        padding: 0 10px;
    }
    
    .battlefield-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
        gap: 10px;
        text-align: center;
    }
    
    .controls-panel {
        flex-direction: column;
        gap: 10px;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .nav-left, .nav-right {
        justify-content: center;
    }
    
    .fan-card {
        width: 50px;
        height: 70px;
    }
    
    .card-mini-name {
        font-size: 7px;
    }
    
    .card-mini-cost {
        width: 15px;
        height: 15px;
        font-size: 10px;
    }
    
    /* Game Rules Summary - Mobile */
    .game-rules-summary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .rules-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .rule-item {
        font-size: 10px;
    }
}

/* ===================================================================
   CARD CREATOR PANEL
   =================================================================== */
.card-creator-btn {
    background: none;
    border: none;
    color: #88c0ff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.card-creator-btn:hover {
    background: rgba(136, 192, 255, 0.1);
    border-color: #88c0ff;
}

.card-creator-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.card-creator-overlay.active {
    opacity: 1;
    visibility: visible;
}

.card-creator-panel {
    position: fixed;
    top: 0;
    right: -600px;
    width: 600px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-left: 2px solid #333;
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.card-creator-panel.active {
    right: 0;
}

.card-creator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #333;
    background: rgba(0, 0, 0, 0.3);
}

.card-creator-header h2 {
    color: #00d4ff;
    margin: 0;
    font-size: 20px;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e74c5c;
    transform: scale(1.1);
}

.card-creator-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card-form-section h3,
.card-preview-section h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Form Styling */
.card-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

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

.form-group label {
    color: #ddd;
    font-size: 14px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 5px;
    padding: 8px 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Image Upload Styles */
.image-upload-hint {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.image-preview {
    margin-top: 10px;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-image-btn:hover {
    background: #c82333;
}

/* Card Preview Styling */
.card-preview-container {
    display: flex;
    justify-content: center;
}

.preview-card {
    width: 200px;
    height: 280px;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 15px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    color: white;
    display: flex;
    flex-direction: column;
}

.preview-cost {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 30px;
    height: 30px;
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid #333;
}

.preview-name {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.preview-type {
    font-size: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.preview-art {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed #666;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-style: italic;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.preview-art #previewArtImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.preview-damage {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 8px;
}

.preview-description {
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
    color: #ddd;
    margin-bottom: 8px;
    min-height: 40px;
}

.preview-rarity {
    position: absolute;
    bottom: -8px;
    right: -8px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #333;
}

/* Card Type Styling */
.spell-card {
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border-color: #4dabf7;
}

.weapon-card {
    background: linear-gradient(145deg, #8b2635 0%, #5f1e2a 100%);
    border-color: #dc3545;
}

.armor-card {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
}

.creature-card {
    background: linear-gradient(145deg, #7d4a87 0%, #5f1e3a 100%);
    border-color: #9c27b0;
}

.support-card {
    background: linear-gradient(145deg, #87652d 0%, #5f4a1e 100%);
    border-color: #ff9800;
}

/* Rarity Styling */
.common-rarity {
    background: #6c757d;
    color: white;
}

.uncommon-rarity {
    background: #28a745;
    color: white;
}

.rare-rarity {
    background: #007bff;
    color: white;
}

.legendary-rarity {
    background: linear-gradient(45deg, #ffc107, #ff6b35);
    color: white;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 107, 53, 0.7); }
}

/* ===================================================================
   CARD LIBRARY SECTION
   =================================================================== */
.card-library-section {
    margin-top: 20px;
}

.library-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid #333;
}

.refresh-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #138496;
    transform: scale(1.05);
}

.card-library {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.library-empty,
.library-error {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
    font-size: 12px;
}

.library-error {
    color: #dc3545;
}

.library-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    border-radius: 6px;
    margin: 8px;
    padding: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.library-card:hover {
    border-color: #00d4ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.library-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.library-card-name {
    font-weight: bold;
    color: #fff;
    font-size: 13px;
}

.library-card-cost {
    background: #ffc107;
    color: #000;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.library-card-visual {
    width: 100%;
    height: 60px;
    margin-bottom: 6px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-card-icon {
    font-size: 20px;
    opacity: 0.6;
}

.library-card-type {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.library-card-damage {
    font-size: 11px;
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 5px;
    min-height: 15px;
}

.library-card-description {
    font-size: 10px;
    color: #ddd;
    line-height: 1.3;
    margin-bottom: 8px;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-card-rarity {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
}

.library-card-actions {
    display: flex;
    gap: 4px;
}

.edit-btn,
.delete-btn {
    background: none;
    border: 1px solid #666;
    color: #ddd;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.delete-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Library card type styling */
.library-card.spell-card {
    border-left: 3px solid #4dabf7;
}

.library-card.weapon-card {
    border-left: 3px solid #dc3545;
}

.library-card.armor-card {
    border-left: 3px solid #28a745;
}

.library-card.creature-card {
    border-left: 3px solid #9c27b0;
}

.library-card.support-card {
    border-left: 3px solid #ff9800;
}

/* ===================================================================
   CARD DETAIL MODAL
   =================================================================== */
.card-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.card-detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.card-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #333;
    border-radius: 15px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.card-detail-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.card-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
}

.card-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #333;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.card-detail-header h2 {
    color: #00d4ff;
    margin: 0;
    font-size: 20px;
}

.card-detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Large Card Display */
.large-card-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.large-card {
    width: 280px;
    height: 400px;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border: 3px solid #444;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    flex-direction: column;
}

.large-card-cost {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 40px;
    height: 40px;
    background: #ffc107;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    border: 3px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.large-card-name {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.large-card-type {
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: bold;
}

.large-card-art {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed #666;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 150px;
}

.art-placeholder {
    color: #888;
    font-style: italic;
    font-size: 16px;
}

.large-card-damage {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 8px;
}

.large-card-description {
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    color: #ddd;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.large-card-rarity {
    position: absolute;
    bottom: -12px;
    right: -12px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Card Information Section */
.card-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-info-section h3 {
    color: #00d4ff;
    margin: 0 0 10px 0;
    font-size: 18px;
    border-bottom: 2px solid #333;
    padding-bottom: 5px;
}

.card-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #444;
}

.info-label {
    font-weight: bold;
    color: #aaa;
    min-width: 80px;
    font-size: 14px;
}

.info-value {
    color: #fff;
    text-align: right;
    flex: 1;
    font-size: 14px;
}

.info-value.description {
    text-align: left;
    margin-left: 10px;
    line-height: 1.4;
}

/* Card Metadata */
.card-metadata {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #333;
}

.card-metadata h4 {
    color: #00d4ff;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.metadata-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.metadata-label {
    color: #aaa;
    font-weight: bold;
}

.metadata-value {
    color: #ddd;
    font-family: monospace;
    font-size: 11px;
}

/* Card Detail Actions */
.card-detail-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.card-detail-actions .action-btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 12px;
}

/* Large Card Type Styling */
.large-card.spell-card {
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border-color: #4dabf7;
}

.large-card.weapon-card {
    background: linear-gradient(145deg, #8b2635 0%, #5f1e2a 100%);
    border-color: #dc3545;
}

.large-card.armor-card {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
}

.large-card.creature-card {
    background: linear-gradient(145deg, #7d4a87 0%, #5f1e3a 100%);
    border-color: #9c27b0;
}

.large-card.support-card {
    background: linear-gradient(145deg, #87652d 0%, #5f4a1e 100%);
    border-color: #ff9800;
}

/* Responsive Design for Card Detail Modal */
@media (max-width: 768px) {
    .card-detail-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .card-detail-body {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .large-card {
        width: 220px;
        height: 320px;
        padding: 15px;
    }
    
    .large-card-name {
        font-size: 18px;
    }
    
    .large-card-cost {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .card-detail-actions {
        flex-direction: column;
    }
}
.card-creator-panel::-webkit-scrollbar {
    width: 6px;
}

.card-creator-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.card-creator-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.card-creator-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===================================================================
   SCROLLBAR CUSTOMIZATION
   =================================================================== */
.game-log::-webkit-scrollbar {
    width: 4px;
}

.game-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.game-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.game-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* ===================================================================
   EMPTY EQUIPMENT SLOT STYLING (NEW)
   =================================================================== */

/* Empty Equipment Slot Base Styling */
.empty-equipment-slot {
    background: linear-gradient(145deg, #3a3a3a 0%, #2a2a2a 100%) !important;
    border: 2px dashed #666 !important;
    opacity: 0.7;
    cursor: default !important;
    position: relative;
    overflow: hidden;
}

.empty-equipment-slot:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-color: #888 !important;
    opacity: 0.9;
}

.empty-equipment-slot .empty-slot-text {
    color: #aaa !important;
    font-size: 12px !important;
    font-weight: normal !important;
    text-align: center;
    font-style: italic;
}

.empty-equipment-slot .empty-slot-stats {
    color: #777 !important;
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px;
}

/* Empty Slot Animation */
.empty-equipment-slot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px dashed #666;
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse-empty 3s infinite;
}

@keyframes pulse-empty {
    0%, 100% { 
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Enhanced Equipment Card Styling */
.equipment-card.equipped {
    border-color: #00d4ff !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3) !important;
    position: relative;
}

.equipment-card.equipped::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    background: #00d4ff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
}

/* Equipment Slot Type Indicators */
.empty-equipment-slot.weapon-card::before {
    content: '⚔️';
    font-size: 18px;
    border: none;
    width: auto;
    height: auto;
    animation: none;
    opacity: 0.4;
}

.empty-equipment-slot.armor-card::before {
    content: '🛡️';
    font-size: 18px;
    border: none;
    width: auto;
    height: auto;
    animation: none;
    opacity: 0.4;
}

/* Player vs Enemy Equipment Styling */
.player-equipment.empty-equipment-slot {
    border-color: #28a745;
}

.player-equipment.empty-equipment-slot:hover {
    border-color: #34ce57;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.enemy-equipment.empty-equipment-slot {
    border-color: #dc3545;
}

.enemy-equipment.empty-equipment-slot:hover {
    border-color: #e74c5c;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

/* Hand Card Equipment Highlighting */
.hand-card.weapon-card, 
.hand-card.armor-card {
    position: relative;
    cursor: pointer;
}

.hand-card.weapon-card:hover::after,
.hand-card.armor-card:hover::after {
    content: 'Click to Equip';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #00d4ff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

/* Equipment Slot Click Areas */
.equipment-area {
    position: relative;
}

.equipment-area .empty-equipment-slot {
    /* Allow drag events but prevent normal clicks */
    pointer-events: auto;
}

/* Enhanced Tooltips for Equipment */
.equipment-card[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    pointer-events: none;
}
/* ===================================================================
   CLICKABLE DECK SYSTEM (NEW - STEP 2)
   =================================================================== */

/* Clickable Deck Styling */
.clickable-deck {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    width: 70px;
    height: 90px;
    transition: all 0.3s ease;
}

.clickable-deck:hover {
    transform: translateY(-3px);
}

.clickable-deck:hover .draw-card {
    border-color: #00d4ff;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* Deck Hint Text */
.deck-hint {
    font-size: 9px;
    color: #00d4ff;
    font-style: italic;
    margin-top: 2px;
    opacity: 0.8;
}

/* Draw Pile Hover Effects */
.draw-deck-area:hover .deck-label {
    color: #00d4ff;
}

.draw-deck-area:hover .deck-hint {
    opacity: 1;
    animation: pulse-hint 1.5s infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Empty Deck State */
.empty-deck {
    opacity: 0.4;
    cursor: not-allowed;
}

.empty-deck:hover {
    transform: none;
}

.empty-deck .draw-card {
    background: #333 !important;
    border-color: #555 !important;
}

/* Deck Click Feedback */
.clickable-deck:active {
    transform: translateY(0px);
}

.clickable-deck:active .draw-card {
    transform: scale(0.95);
}
/* ===================================================================
   HAND LAYOUT FIX - Prevent Cards Being Cut Off
   =================================================================== */

/* Ensure hand section doesn't overflow viewport */
.hand-section {
    max-width: 100%;
    overflow: visible;
    padding: 15px 20px; /* Add side padding */
}

.hand-cards-fan {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: visible;
    justify-content: center;
    
    /* Constrain the fan width */
    width: fit-content;
    min-width: 400px;
    max-width: 90vw; /* Responsive to viewport */
}

/* Adjust fan card positioning to stay within bounds */
.fan-card {
    position: absolute;
    width: 60px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #444;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform-origin: bottom center;
    
    /* Improved fan positioning - tighter spread */
    left: calc(50% + (var(--card-index) - 2) * 15px); /* Reduced from 20px to 15px */
    transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 6deg)); /* Reduced from 8deg to 6deg */
    z-index: calc(100 + var(--card-index)); /* Much higher z-index to ensure cards are always visible */
}

/* Responsive fan adjustments */
@media (max-width: 768px) {
    .fan-card {
        /* Even tighter on mobile */
        left: calc(50% + (var(--card-index) - 2) * 12px);
        transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 4deg));
        width: 50px;
        height: 70px;
    }
    
    .hand-cards-fan {
        min-width: 300px;
    }
}

@media (max-width: 480px) {
    .fan-card {
        /* Very tight on small screens */
        left: calc(50% + (var(--card-index) - 2) * 10px);
        transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 3deg));
    }
}
/* ===================================================================
   SIMPLIFIED DECK STRUCTURE - No Z-Index Conflicts
   =================================================================== */

/* Clean draw deck area */
.draw-deck-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Simple deck button - no complex z-index */
.simple-deck-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 70px;
    height: 90px;
    position: relative;
}

.simple-deck-button:hover {
    opacity: 0.8;
}

/* Non-clickable deck display for enemy */
.simple-deck-display {
    width: 70px;
    height: 90px;
    position: relative;
}

/* Simple deck stack - just 3 cards, no individual z-index */
.deck-stack {
    position: relative;
    width: 70px;
    height: 90px;
}

.deck-card {
    position: absolute;
    width: 70px;
    height: 90px;
    background: linear-gradient(145deg, #2a2a3e 0%, #1e1e2e 100%);
    border: 2px solid #444;
    border-radius: 8px;
    background-image: repeating-linear-gradient(
        45deg,
        #2a2a3e,
        #2a2a3e 10px,
        #1e1e2e 10px,
        #1e1e2e 20px
    );
}

.deck-card:nth-child(1) { top: 0px; left: 0px; }
.deck-card:nth-child(2) { top: -2px; left: 1px; }
.deck-card:nth-child(3) { top: -4px; left: 2px; }

/* Simple deck label - no conflicts */
.simple-deck-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Remove all the old complex deck CSS */
.clickable-deck,
.deck-container,
.deck-hint,
.draw-pile,
.draw-card,
.deck-label {
    /* These classes are no longer used */
    display: none !important;
}
/* ===================================================================
   DEBUG PANEL STYLES (Add to style.css)
   =================================================================== */

/* Debug Toggle Button */
.debug-toggle-btn {
    background: none;
    border: none;
    color: #88c0ff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.debug-toggle-btn:hover {
    background: rgba(136, 192, 255, 0.1);
    border-color: #88c0ff;
}

/* Debug Panel Overlay */
.debug-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.debug-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Debug Panel (slides in from left) */
.debug-panel {
    position: fixed;
    top: 0;
    left: -600px;
    width: 600px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-right: 2px solid #333;
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.debug-panel.active {
    left: 0;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid #333;
    background: rgba(0, 0, 0, 0.3);
}

.debug-header h2 {
    color: #ffc107;
    margin: 0;
    font-size: 20px;
}

.debug-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.debug-section h3 {
    color: #ffc107;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* System Status */
.status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.status-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #444;
}

.status-value {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}

/* Game State */
.game-state-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.state-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid #444;
}

.player-state {
    border-left-color: #28a745;
}

.enemy-state {
    border-left-color: #dc3545;
}

.state-header {
    color: #00d4ff;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.state-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-line {
    color: #ddd;
    font-size: 11px;
}

.hand-status {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
}

.hand-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
}

/* Reset Controls */
.reset-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.debug-btn {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(145deg, #6c757d 0%, #495057 100%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.debug-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.reset-health {
    background: linear-gradient(145deg, #dc3545 0%, #a71e2a 100%);
}

.reset-hands {
    background: linear-gradient(145deg, #28a745 0%, #1e7e34 100%);
}

.clear-log {
    background: linear-gradient(145deg, #17a2b8 0%, #117a8b 100%);
}

.reset-all {
    background: linear-gradient(145deg, #ffc107 0%, #d39e00 100%);
    color: #000;
    grid-column: span 2;
}

/* Action Log */
.action-log {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    height: 120px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.log-entry {
    color: #ddd;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

/* Technical Info */
.tech-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tech-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 11px;
}

.tech-label {
    color: #aaa;
}

.tech-value {
    color: #00d4ff;
    font-family: 'Courier New', monospace;
}

/* Scrollbar for Debug Panel */
.debug-panel::-webkit-scrollbar {
    width: 6px;
}

.debug-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.debug-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.debug-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* ===================================================================
   UNEQUIP BUTTON STYLING
   =================================================================== */
.equipment-unequip-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
}

.equipment-unequip-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.equipment-unequip-btn:active {
    transform: scale(0.95);
}

/* Ensure equipment cards have relative positioning for absolute button */
.equipment-card.equipped {
    position: relative;
}
/* ===================================================================
   CARD ZOOM MODAL SYSTEM - Add this to the end of your style.css
   =================================================================== */

/* Zoom Modal Overlay */
.card-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Zoomed Card Container */
.card-zoom-container {
    position: relative;
    transform: scale(0.5) rotateY(180deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    perspective: 1000px;
}

.card-zoom-overlay.active .card-zoom-container {
    transform: scale(1) rotateY(0deg);
}

/* Large Card Display */
.card-zoom-large {
    width: 350px;
    height: 500px;
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border: 3px solid #00d4ff;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transform-style: preserve-3d;
}

/* Close Button */
.card-zoom-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #dc3545 0%, #a71e2a 100%);
    border: 3px solid #fff;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-zoom-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: linear-gradient(145deg, #e74c5c 0%, #c0392b 100%);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* Cost Badge */
.zoom-cost {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #ffc107 0%, #d39e00 100%);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Card Header */
.zoom-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.zoom-name {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    margin-bottom: 8px;
}

.zoom-type {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
    font-weight: bold;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card Art Area */
.zoom-art {
    flex: 1;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 180px;
    position: relative;
    overflow: hidden;
}

.zoom-art::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.02) 10px,
            rgba(255, 255, 255, 0.02) 20px
        );
    pointer-events: none;
}

.zoom-art-placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 18px;
    text-align: center;
    z-index: 1;
    position: relative;
}

.zoom-art-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Stats Section */
.zoom-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-stat {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #444;
}

.zoom-stat.damage {
    border-left-color: #dc3545;
}

.zoom-stat.rarity {
    border-left-color: #ffc107;
}

.zoom-stat.type {
    border-left-color: #00d4ff;
}

.zoom-stat-label {
    font-size: 10px;
    color: #aaa;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.zoom-stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

/* Description */
.zoom-description {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    font-style: italic;
    line-height: 1.4;
    color: #ddd;
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.zoom-description::before {
    content: '"';
    font-size: 40px;
    color: rgba(0, 212, 255, 0.3);
    position: absolute;
    top: 5px;
    left: 10px;
    font-family: serif;
}

.zoom-description::after {
    content: '"';
    font-size: 40px;
    color: rgba(0, 212, 255, 0.3);
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-family: serif;
}

/* Rarity Badge */
.zoom-rarity {
    position: absolute;
    bottom: -12px;
    right: -12px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.zoom-rarity.common { background: linear-gradient(45deg, #6c757d, #495057); color: white; }
.zoom-rarity.uncommon { background: linear-gradient(45deg, #28a745, #1e7e34); color: white; }
.zoom-rarity.rare { background: linear-gradient(45deg, #007bff, #0056b3); color: white; }
.zoom-rarity.legendary { 
    background: linear-gradient(45deg, #ffc107, #ff6b35, #e83e8c, #6f42c1);
    color: white;
    animation: legendary-glow 2s infinite;
    background-size: 200% 200%;
}

@keyframes legendary-glow {
    0%, 100% { 
        background-position: 0% 50%;
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.6);
    }
    50% { 
        background-position: 100% 50%;
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.8);
    }
}

/* Card Type Specific Styling */
.card-zoom-large.spell-card {
    background: linear-gradient(145deg, #2d4a87 0%, #1e3a5f 100%);
    border-color: #4dabf7;
}

.card-zoom-large.weapon-card {
    background: linear-gradient(145deg, #8b2635 0%, #5f1e2a 100%);
    border-color: #dc3545;
}

.card-zoom-large.armor-card {
    background: linear-gradient(145deg, #2d6b35 0%, #1e4a25 100%);
    border-color: #28a745;
}

.card-zoom-large.creature-card {
    background: linear-gradient(145deg, #7d4a87 0%, #5f1e3a 100%);
    border-color: #9c27b0;
}

.card-zoom-large.support-card {
    background: linear-gradient(145deg, #87652d 0%, #5f4a1e 100%);
    border-color: #ff9800;
}

/* Click Hint */
.card-zoom-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #00d4ff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid rgba(0, 212, 255, 0.3);
    animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-zoom-large {
        width: 280px;
        height: 400px;
        padding: 20px;
    }
    
    .zoom-name {
        font-size: 20px;
    }
    
    .zoom-cost {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .zoom-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

/* Animation for card flip effect */
.card-zoom-container.flipping {
    animation: cardFlip 0.6s ease-in-out;
}

@keyframes cardFlip {
    0% { transform: scale(1) rotateY(0deg); }
    50% { transform: scale(0.8) rotateY(90deg); }
    100% { transform: scale(1) rotateY(0deg); }
}
/* ===================================================================
   PHASE 2: DRAG VISUAL FEEDBACK - Add this to the end of your style.css
   =================================================================== */

/* Make cards feel draggable */
.hand-card[data-card] {
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

.hand-card[data-card]:active {
    cursor: grabbing;
}

/* Enhanced hover effects for draggable cards */
.hand-card[data-card]:hover {
    transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 6deg)) translateY(-12px) scale(1.08);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(0, 212, 255, 0.2);
    z-index: 30 !important;
}

/* Dragging state */
.hand-card.dragging {
    cursor: grabbing !important;
    transform: translateX(-50%) scale(1.15) rotate(8deg) !important;
    z-index: 1000 !important;
    opacity: 0.9;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(0, 212, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease-out;
}

/* Ghost/trail effect while dragging */
.hand-card.dragging::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: inherit;
    pointer-events: none;
    animation: drag-glow 1s infinite;
}

@keyframes drag-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.02); }
}

/* Equipment cards also get drag feedback */
.equipment-card.equipped {
    cursor: grab;
    transition: all 0.3s ease;
}

.equipment-card.equipped:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(0, 212, 255, 0.2);
}

.equipment-card.dragging {
    cursor: grabbing !important;
    transform: scale(1.1) rotate(5deg) !important;
    z-index: 1000 !important;
    opacity: 0.9;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.7),
        0 0 25px rgba(0, 212, 255, 0.3);
}

/* Visual hint for draggable items */
.hand-card[data-card]::after {
    content: '⟨⟩';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    color: rgba(0, 212, 255, 0.4);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hand-card[data-card]:hover::after {
    opacity: 0.7;
}

/* Drag start animation */
.hand-card.drag-starting {
    animation: drag-start 0.3s ease-out;
}

@keyframes drag-start {
    0% { transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 6deg)) scale(1); }
    50% { transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 6deg)) scale(1.1) translateY(-5px); }
    100% { transform: translateX(-50%) scale(1.15) rotate(8deg); }
}

/* Drag end animation */
.hand-card.drag-ending {
    animation: drag-end 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drag-end {
    0% { transform: translateX(-50%) scale(1.15) rotate(8deg); }
    50% { transform: translateX(-50%) scale(0.95) rotate(-2deg); }
    100% { transform: translateX(-50%) rotate(calc((var(--card-index) - 2) * 6deg)) scale(1); }
}

/* Potential drop zone hint (for future phases) */
.hand-card.dragging ~ .battlefield-layout {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
    transition: background 0.3s ease;
}

/* Improved card interaction states */
.hand-card[data-card] {
    position: relative;
    overflow: visible;
}

/* Subtle interaction feedback for non-dragging actions */
.hand-card[data-card]:focus {
    outline: 2px solid rgba(0, 212, 255, 0.6);
    outline-offset: 2px;
}

/* Disable drag on certain elements */
.card-delete-btn,
.equipment-unequip-btn,
.action-btn {
    cursor: pointer !important;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
    .hand-card[data-card] {
        cursor: default;
    }
    
    .hand-card[data-card]:hover::after {
        opacity: 0;
    }
    
    /* Touch-specific drag feedback */
    .hand-card.touch-dragging {
        transform: translateX(-50%) scale(1.1) rotate(5deg) !important;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
    }
}

/* Prevent text selection during drag */
.dragging * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Enhanced equipment card drag states */
.equipment-card.equipped.dragging::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 212, 255, 0.2), 
        rgba(255, 255, 255, 0.1), 
        rgba(0, 212, 255, 0.2));
    border-radius: inherit;
    pointer-events: none;
    animation: equipment-drag-glow 0.8s infinite;
}

@keyframes equipment-drag-glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}
/* ===================================================================
   DELETE BUTTON DRAG FIX - Add this to your style.css
   =================================================================== */

/* Hide delete button while dragging */
.hand-card.dragging .card-delete-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Also hide unequip button while dragging equipment */
.equipment-card.dragging .equipment-unequip-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Optional: Hide delete button during drag start animation too */
.hand-card.drag-starting .card-delete-btn {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Ensure delete button is visible in normal state */
.hand-card .card-delete-btn {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.equipment-card .equipment-unequip-btn {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Prevent clicks on library card actions while dragging */
.dragging .library-card-actions {
  pointer-events: none; /* Prevent clicks during drag */
  opacity: 0.5; /* Optional: visually indicate disabled state */
}

/* ===================================================================
   TRASH ZONE FOR CARD DELETION
   =================================================================== */
.trash-zone {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4a0e0e 0%, #6d1a1a 100%);
    border: 2px dashed #ff6b6b;
    border-radius: 15px;
    display: none; /* Hidden to prevent interference with cards */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0.7;
}

.trash-zone:hover,
.trash-zone.drag-over {
    opacity: 1;
    transform: scale(1.1);
    border-color: #ff4757;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.trash-icon {
    font-size: 2.5em;
    margin-bottom: 5px;
    transition: transform 0.2s ease;
}

.trash-zone:hover .trash-icon,
.trash-zone.drag-over .trash-icon {
    transform: scale(1.2);
}

.trash-label {
    font-size: 0.7em;
    text-align: center;
    color: #ff9999;
    font-weight: 500;
}

/* ===================================================================
   ELEMENTAL CARD BORDERS
   =================================================================== */
.hand-card.fire-element,
.preview-card.fire-element,
.card-zoom-large.fire-element,
.equipment-card.fire-element {
    border: 2px solid #ff6348 !important;
    box-shadow: 0 0 10px rgba(255, 99, 72, 0.3);
}

.hand-card.ice-element,
.preview-card.ice-element,
.card-zoom-large.ice-element,
.equipment-card.ice-element {
    border: 2px solid #74b9ff !important;
    box-shadow: 0 0 10px rgba(116, 185, 255, 0.3);
}

.hand-card.poison-element,
.preview-card.poison-element,
.card-zoom-large.poison-element,
.equipment-card.poison-element {
    border: 2px solid #00b894 !important;
    box-shadow: 0 0 10px rgba(0, 184, 148, 0.3);
}

.hand-card.plasma-element,
.preview-card.plasma-element,
.card-zoom-large.plasma-element,
.equipment-card.plasma-element {
    border: 2px solid #a29bfe !important;
    box-shadow: 0 0 10px rgba(162, 155, 254, 0.3);
}

/* ===================================================================
   CARD BACKGROUND IMAGES - TEXT OVERLAY SYSTEM
   =================================================================== */

/* Base card with background image support */
.hand-card[data-card],
.preview-card,
.card-zoom-large,
.equipment-card {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ensure text stays above background images */
.hand-card .card-mini-name,
.hand-card .card-mini-cost,
.hand-card .card-mini-damage,
.hand-card .card-type-icon,
.preview-card .preview-name,
.preview-card .preview-cost,
.preview-card .preview-type,
.preview-card .preview-damage,
.preview-card .preview-description,
.preview-card .preview-rarity,
.equipment-card .card-name,
.equipment-card .card-type,
.equipment-card .card-stats {
    position: relative;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    backdrop-filter: blur(2px);
}

/* Semi-transparent overlay for better text readability */
.hand-card[data-card]::before,
.preview-card::before,
.card-zoom-large::before,
.equipment-card.equipped::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    border-radius: inherit;
    z-index: 1;
    pointer-events: none;
}

/* Special styling for cards with images */
.hand-card.has-image,
.preview-card.has-image,
.equipment-card.has-image {
    border: 2px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Enhanced text contrast for cards with background images */
.has-image .card-mini-name,
.has-image .preview-name,
.has-image .card-name {
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.has-image .card-mini-cost,
.has-image .preview-cost {
    background: rgba(0, 212, 255, 0.8) !important;
    color: #000 !important;
    font-weight: bold;
}

/* ===================================================================
   LEGENDARY CARD GLOW EFFECTS
   =================================================================== */
.hand-card.legendary-rarity,
.preview-card.legendary-rarity,
.card-zoom-large.legendary-rarity {
    animation: legendaryGlow 2s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.6);
}

@keyframes legendaryGlow {
    0% {
        box-shadow: 
            0 0 20px rgba(255, 165, 0, 0.6),
            0 0 30px rgba(255, 165, 0, 0.4),
            inset 0 0 10px rgba(255, 165, 0, 0.2);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(255, 165, 0, 0.8),
            0 0 40px rgba(255, 165, 0, 0.6),
            inset 0 0 15px rgba(255, 165, 0, 0.3);
    }
}

/* Epic rarity gets a purple glow */
.hand-card.epic-rarity,
.preview-card.epic-rarity,
.card-zoom-large.epic-rarity {
    animation: epicGlow 3s ease-in-out infinite alternate;
}

@keyframes epicGlow {
    0% {
        box-shadow: 0 0 15px rgba(147, 51, 234, 0.5);
    }
    100% {
        box-shadow: 0 0 25px rgba(147, 51, 234, 0.7);
    }
}

/* ===================================================================
   DRAG-TO-EQUIP VISUAL FEEDBACK
   =================================================================== */
.equipment-card.valid-drop-target {
    border: 2px solid #57ff47 !important;
    box-shadow: 0 0 15px rgba(87, 255, 71, 0.7) !important;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.equipment-card.invalid-drop-target {
    border: 2px solid #ff4757 !important;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.7) !important;
    transition: all 0.2s ease;
}

.equipment-card {
    transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

/* ===================================================================
   ZOOM MODAL EQUIP ACTION (INTEGRATED STYLING)
   =================================================================== */
.zoom-equip-action {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9) 0%, rgba(0, 150, 255, 0.9) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    user-select: none;
}

.zoom-equip-action:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 1) 0%, rgba(0, 150, 255, 1) 100%);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.equip-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.equip-text {
    font-size: 0.9em;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Card-specific equip action colors */
.weapon-card .zoom-equip-action {
    background: linear-gradient(135deg, rgba(255, 99, 72, 0.9) 0%, rgba(255, 69, 0, 0.9) 100%);
}

.weapon-card .zoom-equip-action:hover {
    background: linear-gradient(135deg, rgba(255, 99, 72, 1) 0%, rgba(255, 69, 0, 1) 100%);
    box-shadow: 0 5px 20px rgba(255, 99, 72, 0.4);
}

.armor-card .zoom-equip-action {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.9) 0%, rgba(56, 103, 214, 0.9) 100%);
}

.armor-card .zoom-equip-action:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 1) 0%, rgba(56, 103, 214, 1) 100%);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
}

/* ===================================================================
   SPECIAL ATTACK LAYERED CARD SYSTEM
   =================================================================== */
.weapon-combo-area {
    position: relative;
    transition: all 0.3s ease;
}

.weapon-combo-area:hover {
    transform: translateY(-2px);
}

.special-attack-card {
    position: absolute;
    top: -25px; /* Show quarter above weapon card */
    left: 2px;
    right: 2px;
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.95) 0%, rgba(116, 185, 255, 0.95) 100%);
    border: 2px solid rgba(162, 155, 254, 0.8);
    border-radius: 12px 12px 8px 8px;
    padding: 10px 10px 6px 10px;
    z-index: 3; /* Above weapon card */
    backdrop-filter: blur(8px);
    min-height: 55px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.special-attack-card::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10px;
    right: 10px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    border-radius: 2px;
}

.special-card-name {
    font-size: 0.85em;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
    text-align: center;
}

.special-card-description {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    text-align: center;
}

.special-unequip-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 71, 87, 0.8);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    font-size: 0.7em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.special-unequip-btn:hover {
    background: rgba(255, 71, 87, 1);
    transform: scale(1.1);
}

/* Equipment card needs higher z-index to appear on top */
.weapon-combo-area .equipment-card {
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

/* When weapon has special attack, add visual connection */
.weapon-combo-area .equipment-card.equipped {
    margin-top: 30px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
}

.weapon-combo-area:hover .equipment-card.equipped {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Add a subtle glow connection between weapon and special attack */
.weapon-combo-area .equipment-card.equipped::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 6px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 212, 255, 0.4) 50%, transparent 100%);
    border-radius: 3px;
    opacity: 0.8;
}

/* Element-specific special attack colors */
.special-attack-card[data-element="fire"] {
    background: linear-gradient(135deg, rgba(255, 99, 72, 0.9) 0%, rgba(255, 69, 0, 0.9) 100%);
    border-color: rgba(255, 99, 72, 0.7);
}

.special-attack-card[data-element="ice"] {
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.9) 0%, rgba(74, 144, 226, 0.9) 100%);
    border-color: rgba(116, 185, 255, 0.7);
}

.special-attack-card[data-element="poison"] {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.9) 0%, rgba(0, 150, 136, 0.9) 100%);
    border-color: rgba(0, 184, 148, 0.7);
}

.special-attack-card[data-element="plasma"] {
    background: linear-gradient(135deg, rgba(162, 155, 254, 0.9) 0%, rgba(142, 68, 173, 0.9) 100%);
    border-color: rgba(162, 155, 254, 0.7);
}

/* ===================================================================
   ENERGY AND TURN SYSTEM STYLES
   =================================================================== */
.player-resources {
    text-align: center;
    margin-bottom: 10px;
}

.energy-display {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    color: #ffc107;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #333;
}

#endTurnBtn {
    background: linear-gradient(145deg, #17a2b8 0%, #117a8b 100%);
    color: white;
    border: 1px solid #17a2b8;
}

#endTurnBtn:hover {
    background: linear-gradient(145deg, #1fc8e3 0%, #138496 100%);
}

/* ===================================================================
   ENEMY EQUIPMENT MANAGER STYLES
   =================================================================== */
.enemy-equipment-manager {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    margin: 10px 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    background: rgba(255, 0, 0, 0.1);
}

.manager-header h3 {
    margin: 0;
    color: #ff6b6b;
    font-size: 16px;
}

.toggle-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.manager-content {
    padding: 15px;
}

.equipment-assignment {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.assignment-slot {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.assignment-slot label {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 14px;
}

.assignment-slot select {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid #666;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

.assignment-slot select:focus {
    border-color: #ff6b6b;
    outline: none;
}

.manager-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.clear-btn, .random-btn {
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.clear-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border-color: #dc3545;
}

.clear-btn:hover {
    background: rgba(220, 53, 69, 0.3);
}

.random-btn {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border-color: #28a745;
}

.random-btn:hover {
    background: rgba(40, 167, 69, 0.3);
}

/* ===================================================================
   TURN-BASED SYSTEM STYLES
   =================================================================== */

/* Energy Display */
.player-resources {
    text-align: center;
    margin-bottom: 15px;
}

.energy-display {
    display: inline-block;
    background: rgba(0, 0, 0, 0.5);
    color: #ffc107;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* End Turn Button */
#endTurnBtn {
    background: linear-gradient(145deg, #17a2b8 0%, #117a8b 100%);
    color: white;
    border: 1px solid #17a2b8;
}

#endTurnBtn:hover {
    background: linear-gradient(145deg, #138496 0%, #0d5e6e 100%);
    transform: translateY(-1px);
}

#endTurnBtn:disabled {
    background: rgba(128, 128, 128, 0.5);
    border-color: #666;
    cursor: not-allowed;
    transform: none;
}

/* Turn Indicator */
.turn-indicator {
    position: absolute;
    background: #1a1a2e;
    padding: 4px 20px;
    border: 1px solid;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    z-index: 10;
    left: 50%;
    transform: translateX(-50%);
    top: -10px;
}

.player-turn {
    color: #28a745;
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.enemy-turn {
    color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

/* Battlefield divider positioning */
.battlefield-divider {
    position: relative;
    margin: 20px 0;
}

/* ===================================================================
   HELP SYSTEM STYLES
   =================================================================== */

/* Help Button */
.help-button {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.help-button:hover {
    background: rgba(255, 193, 7, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* Audio Toggle Button */
.audio-toggle-button {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.audio-toggle-button:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #333;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.help-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.help-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 90vh;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #333;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px 15px 0 0;
    gap: 15px;
}

.help-old-man-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #00d4ff;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.help-header-text {
    flex: 1;
}

.help-modal-header h2 {
    color: #00d4ff;
    margin: 0 0 5px 0;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.help-subtitle {
    color: #aaa;
    margin: 0;
    font-size: 14px;
    font-style: italic;
}

.help-close-btn {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.help-close-btn:hover {
    background: rgba(220, 53, 69, 0.4);
    transform: scale(1.1);
}

.help-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.help-sections {
    padding: 25px;
}

.help-section {
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
}

.help-section h3 {
    color: #ffc107;
    margin: 0 0 15px 0;
    font-size: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
}

.help-section p {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 15px;
}

.help-subsection {
    margin-bottom: 20px;
}

.help-subsection h4 {
    color: #88c0ff;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.help-section ul {
    color: #ccc;
    margin-left: 20px;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 8px;
}

.help-section strong {
    color: #fff;
}

.help-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #333;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 15px 15px;
    text-align: center;
}

.help-close-button {
    background: linear-gradient(145deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: 1px solid #28a745;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.help-close-button:hover {
    background: linear-gradient(145deg, #218838 0%, #1a6e2e 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .help-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .help-modal-header h2 {
        font-size: 20px;
    }
    
    .help-sections {
        padding: 15px;
    }
    
    .help-section {
        padding: 15px;
    }
    
    .help-section h3 {
        font-size: 18px;
    }
}

/* ===================================================================
   ACTION BAR STYLES
   =================================================================== */

.action-bar {
    position: fixed;
    top: 35%;
    right: 30px;
    transform: translateY(-50%);
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333;
    text-align: center;
    width: 280px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 1500; /* Above most elements but below modals */
}

.action-bar-text {
    color: #ffc107;
    font-size: 16px;
    font-style: italic;
    margin-bottom: 15px;
}

.action-bar-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.action-bar-buttons .action-btn {
    min-width: 140px;
    font-size: 14px;
    padding: 10px 20px;
}

.action-bar-buttons .config-btn {
    background: linear-gradient(145deg, #6c757d 0%, #495057 100%);
    font-size: 12px;
    min-width: 120px;
    margin-top: 5px;
}

.action-bar-buttons .config-btn:hover {
    background: linear-gradient(145deg, #5a6268 0%, #3d4045 100%);
}

/* Enemy Configuration Interface */
.config-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.config-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.config-row .action-btn {
    flex: 1;
    min-width: 0;
    font-size: 12px;
}

.clear-btn {
    background: linear-gradient(145deg, #dc3545 0%, #c82333 100%) !important;
}

.clear-btn:hover {
    background: linear-gradient(145deg, #c82333 0%, #a71e2a 100%) !important;
}

.random-btn {
    background: linear-gradient(145deg, #17a2b8 0%, #138496 100%) !important;
}

.random-btn:hover {
    background: linear-gradient(145deg, #138496 0%, #0f6674 100%) !important;
}

.back-btn {
    background: linear-gradient(145deg, #28a745 0%, #1e7e34 100%) !important;
}

.back-btn:hover {
    background: linear-gradient(145deg, #1e7e34 0%, #155724 100%) !important;
}

.config-info {
    text-align: center;
    margin: 5px 0;
}

.config-info small {
    color: #aaa;
    font-size: 10px;
    font-style: italic;
}

/* ===================================================================
   NARRATIVE GUIDE PANEL STYLES
   =================================================================== */

.narrative-guide-panel {
    position: fixed;
    top: 80px; /* Below the top nav bar */
    left: 20px;
    width: 250px;
    z-index: 1100; /* Above the battlefield but below modals */
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transform: translateX(-150%);
    transition: transform 0.5s ease-in-out;
}

.narrative-guide-panel.visible {
    transform: translateX(0);
}

.portrait-container {
    position: relative;
    width: 100%;
    height: 250px; /* Square portrait */
    background-color: #111;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
}

#guidePortrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease-in-out, transform 0.15s ease-out, filter 0.2s ease;
}

#guidePortrait.changing {
    opacity: 0.75;
    transform: scale(1.01);
    filter: brightness(1.1) contrast(1.05);
}

.blink-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    opacity: 0;
}

.speech-bubble {
    padding: 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #ddd;
    font-style: italic;
    border-top: 1px solid #444;
    transition: opacity 0.15s ease-in-out, transform 0.1s ease;
}

.speech-bubble.updating {
    opacity: 0.7;
    transform: translateY(2px);
}