/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    background: linear-gradient(90deg, #0f3460 0%, #16537e 100%);
    padding: 1rem 2rem;
    border-bottom: 3px solid #e94560;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
    position: relative;
    z-index: 100;
}

.title {
    font-size: 2rem;
    font-weight: 900;
    color: #e94560;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
    letter-spacing: 3px;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.match-id-input {
    padding: 0.75rem 1rem;
    border: 2px solid #16537e;
    border-radius: 8px;
    background: rgba(22, 83, 126, 0.2);
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.match-id-input:focus {
    outline: none;
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.match-id-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-info {
    background: linear-gradient(45deg, #0891b2, #06b6d4);
    color: white;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #e94560, #f27121);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #16537e, #0f3460);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #dc2626, #991b1b);
    color: white;
}

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

/* Main Content Area */
.main-content {
    display: flex;
    flex: 1;
    height: calc(100vh - 80px);
    position: relative;
    /* transition: width 0.3s ease; */
}

.sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    left: 240px; /* Initial position */
    transform: translateY(-50%);
    width: 25px;
    height: 50px;
    background-color: #e94560;
    border: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    cursor: pointer;
    z-index: 1500;
    transition: left 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn .arrow-icon {
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(135deg); /* Pointing left */
    transition: transform 0.3s ease;
}

.hero-panel.collapsed + .sidebar-toggle-btn .arrow-icon {
    transform: rotate(-45deg); /* Pointing right */
}

/* Sidebar */
.hero-panel {
    width: 240px;
    background: linear-gradient(180deg, #16213e 0%, #0a0a0a 100%);
    border-right: 2px solid #e94560;
    display: flex;
    flex-direction: column;
    position: relative; /* Changed from fixed */
    z-index: 50;
    box-shadow: 4px 0 20px rgba(233, 69, 96, 0.3);
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

.hero-panel.collapsed {
    margin-left: -240px;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0a0a0a 100%);
    overflow: hidden;
    height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

.map-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.map-area {
    position: relative;
    width: 900px; /* Fixed size for consistent layout */
    height: 900px; /* Square aspect ratio for Dota 2 map */
    max-width: min(calc((100vh - 200px) * 1), calc(100vw - 380px));
    max-height: calc(100vh - 200px);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
    margin: auto; /* Center within map container */
    flex-shrink: 0; /* Prevent shrinking */
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from 'cover' to prevent cropping */
    user-select: none;
    pointer-events: none;
}

.formation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: all;
    transition: all 0.2s ease;
}

.placed-hero {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #00ff00;
    cursor: grab;
    transition: transform 0.1s ease;
    pointer-events: all;
    background: rgba(0, 255, 0, 0.3);
    backdrop-filter: blur(2px);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.9), 0 0 30px rgba(0, 255, 0, 0.5);
    overflow: hidden;
    transform: translate(-50%, -50%);
    opacity: 1 !important;
    z-index: 100;
}

.placed-hero:hover {
    transform: translate(-50%, -50%) scale(1.2);
    border-color: #00ff88;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.8);
    opacity: 1 !important;
}

.placed-hero:active {
    cursor: grabbing;
    opacity: 1 !important;
}

.placed-hero.selected {
    border-color: #00bfff !important;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.9), 0 0 40px rgba(0, 191, 255, 0.5) !important;
    z-index: 101;
}

.placed-hero.sticky-mode {
    cursor: grabbing !important;
    transition: none !important;
    pointer-events: none !important;
}

.placed-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    opacity: 1 !important;
}

.placed-hero .hero-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.45rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #00ff00;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.placed-hero:hover .hero-label {
    opacity: 1;
}

/* When drawing is active, make placed heroes non-interactive */
.map-area.drawing-active .placed-hero {
    pointer-events: none;
}

/* Selection Box */
.selection-box {
    position: absolute;
    border: 2px dashed #00bfff;
    background: rgba(0, 191, 255, 0.1);
    pointer-events: none;
    z-index: 1000;
}

/* Movement Indicator */
.movement-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border: 3px solid #00ff00;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.4) 0%, rgba(0, 255, 0, 0.1) 50%, transparent 100%);
    pointer-events: none;
    z-index: 999;
    animation: movement-indicator-pulse 1s ease-out forwards;
}

@keyframes movement-indicator-pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Drawing Canvas */
.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.drawing-canvas.drawing-mode {
    pointer-events: all;
    cursor: crosshair;
}

.drawing-canvas.erasing-mode {
    pointer-events: all;
    cursor: grab;
}

/* Drawing Controls */
.drawing-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid #00ff00;
    z-index: 20; /* Ensure controls are above the canvas */
}

.drawing-controls button {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #00ff00;
}

.drawing-controls button:hover {
    background: rgba(0, 255, 0, 0.4);
    transform: scale(1.05);
}

.drawing-controls button.active {
    background: #e94560; /* Use a consistent accent color for active mode */
    color: #fff;
    box-shadow: 0 0 10px #e94560;
}

.color-palette {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    transform: scale(1.25);
    border-width: 3px;
    box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.8);
}

/* Drop Zone Indicator */
.drop-zone-outside {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 0, 0, 0.1);
    border: 3px dashed #ff0000;
    display: none;
    z-index: 1000;
    pointer-events: none;
}

.drop-zone-outside.active {
    display: block;
}

.drop-zone-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Formation Info - Footer Overlay */
.formation-info {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 52, 96, 0.85);
    border-top: 2px solid #e94560;
    border-left: 2px solid #e94560;
    border-right: 2px solid #e94560;
    padding: 0.5rem 1.5rem;
    backdrop-filter: blur(8px);
    z-index: 100;
    height: auto;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.team-composition h4 {
    color: #e94560;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.composition-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat {
    font-size: 0.8rem;
    font-weight: 700;
}

.stat span {
    color: #e94560;
}

/* Hero Tooltip */
.hero-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #e94560;
    border-radius: 8px;
    padding: 1rem;
    max-width: 250px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.hero-tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    color: #e94560;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.tooltip-role {
    color: #f27121;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tooltip-description {
    font-size: 0.7rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

/* Drag and Drop States */
.drag-over {
    background: rgba(233, 69, 96, 0.15) !important;
    border: 2px dashed #e94560 !important;
    box-shadow: inset 0 0 20px rgba(233, 69, 96, 0.3) !important;
}

.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(0.95);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        overflow: hidden; /* Prevent body from scrolling */
    }

    /* Hide desktop controls on mobile */
    .header .controls,
    .sidebar-toggle-btn,
    .formation-info {
        display: none;
    }

    /* Make the hero panel compact and contain the horizontally-scrolling grid */
    .hero-panel {
        position: relative;
        width: 100%;
        height: auto;
        flex-shrink: 0;
        top: auto;
        bottom: auto;
        left: auto;
        border-right: none;
        border-bottom: 2px solid #e94560;
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        overflow: hidden;
        gap: 0.5rem;
    }

    /* Hide category filters and title on mobile */
    .hero-panel h3,
    .hero-categories {
        display: none !important;
    }

    .search-container {
        margin: 0;
        flex-shrink: 0;
        height: 36px;
    }

    .search-input {
        padding: 0.5rem;
        font-size: 0.9rem;
        height: 36px;
    }

    .map-container {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        flex: 1;
        min-height: 0; /* Allow map to shrink and fit */
        height: auto;
        align-items: flex-start; /* Align to top instead of center */
    }

    .map-wrapper {
        padding: 0.5rem; /* Reduce padding on mobile */
        align-items: flex-start; /* Align to top instead of center */
        justify-content: flex-start; /* Align to top */
    }

    .map-area {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        max-width: 100vw;
        max-height: calc(100vh - 160px); /* Adjusted for tighter fit */
    }

    .main-content {
        flex-direction: column;
        height: calc(100vh - 45px); /* Smaller header on mobile */
        overflow: hidden;
    }

    /* Style the hero grid for horizontal scrolling with one row */
    .hero-grid {
        display: flex;
        flex-direction: row;
        overflow-y: hidden;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0;
        height: 90px;
        align-items: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .hero-item {
        width: 80px;
        height: 90px;
        flex-shrink: 0;
    }

    /* Reposition drawing controls for mobile */
    .drawing-controls {
        top: auto;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: auto;
    }

    .drawing-controls .color-palette {
        margin-top: 0;
        margin-left: 0.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: row;
        gap: 0.5rem;
        text-align: center;
        padding: 0.5rem 1rem;
        justify-content: center;
    }

    .title {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .composition-stats {
        gap: 1rem;
    }

    /* Mobile ward layout - truly side by side */
    .wards-section {
        border-top: 2px solid rgba(233, 69, 96, 0.3);
        padding: 0.75rem 0.5rem;
        margin-top: 0.5rem;
        width: calc(50% - 1px);
        display: inline-block;
        vertical-align: top;
        box-sizing: border-box;
    }

    .wards-section:first-of-type {
        border-right: 2px solid rgba(233, 69, 96, 0.5);
    }

    .wards-section.enemy-wards {
        border-left: none;
    }

    .wards-section h4 {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .wards-container {
        gap: 0.5rem;
        flex-direction: row;
        justify-content: center;
    }

    .ward-item {
        width: 55px;
        height: 55px;
        padding: 0.25rem;
        flex-direction: column;
    }

    .ward-item img {
        width: 32px;
        height: 32px;
    }

    .ward-name {
        font-size: 0.5rem;
        margin-top: 0.15rem;
    }
}

/* Scrollbar Styling for hero panel */
.hero-panel::-webkit-scrollbar,
.hero-grid::-webkit-scrollbar {
    width: 8px;
}

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

.hero-panel::-webkit-scrollbar-thumb,
.hero-grid::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 4px;
}

.hero-panel::-webkit-scrollbar-thumb:hover,
.hero-grid::-webkit-scrollbar-thumb:hover {
    background: #f27121;
} 

/* Hero Panel Styles */
.hero-panel {
    padding: 1rem; /* Reduced padding */
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hero-panel h3 {
    color: #e94560;
    margin-bottom: 0.8rem; /* Slightly reduced */
    font-size: 1.1rem;
    text-align: center;
}

.hero-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem; /* Reduced gap */
    margin-bottom: 0.8rem;
}

/* Team Toggle Styles */
.team-toggle-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.team-toggle-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.team-toggle-btn .toggle-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.team-toggle-btn[data-team="allied"].active {
    background: rgba(0, 255, 0, 0.15);
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.team-toggle-btn[data-team="allied"].active .toggle-indicator {
    background: #00ff00;
    border-color: #00ff00;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.team-toggle-btn[data-team="enemy"].active {
    background: rgba(255, 0, 0, 0.15);
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.team-toggle-btn[data-team="enemy"].active .toggle-indicator {
    background: #ff0000;
    border-color: #ff0000;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.team-toggle-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-container {
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-family: 'Orbitron', monospace;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Desktop hero grid - only apply on larger screens */
@media (min-width: 1025px) {
    .hero-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        max-height: calc(100vh - 400px);
        overflow-y: auto;
        padding-right: 0.5rem;
    }
}

.hero-item {
    width: 90px; /* Slightly larger to fill space better */
    height: 90px;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    user-select: none;
}

.hero-item:hover {
    transform: scale(1.1);
    border-color: #e94560;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.hero-item:active {
    cursor: grabbing;
}

.hero-item.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(0.95);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
    z-index: 1000;
}

.hero-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.hero-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 0.55rem;
    text-align: center;
    padding: 0.2rem;
    font-weight: 700;
}

/* Wards Section Styles */
.wards-section {
    padding: 1rem;
    border-top: 2px solid rgba(233, 69, 96, 0.3);
    margin-top: 1rem;
}

.wards-section.enemy-wards {
    border-top: 2px solid rgba(255, 0, 0, 0.3);
}

.wards-section h4 {
    font-size: 0.9rem;
    color: #e94560;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wards-section.enemy-wards h4 {
    color: #ff4444;
}

.wards-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.ward-item {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
}

.ward-item:hover {
    transform: scale(1.1);
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.ward-item.enemy:hover {
    border-color: #ff0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.ward-item:active {
    cursor: grabbing;
}

.ward-item.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(0.95);
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.4);
    z-index: 1000;
}

.ward-item.enemy.dragging {
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
}

.ward-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.ward-name {
    color: white;
    font-size: 0.5rem;
    text-align: center;
    font-weight: 700;
    margin-top: 0.2rem;
}

/* Placed Ward Styles */
.placed-ward {
    position: absolute;
    width: 24px;
    height: 24px;
    cursor: grab;
    pointer-events: all;
    transform: translate(-50%, -50%);
    z-index: 95;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.placed-ward:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.placed-ward.dragging {
    transition: none !important;
    will-change: left, top;
}

.placed-ward img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(0, 255, 0, 0.9));
}

.placed-ward.enemy img {
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.9));
}

/* Vision Radius Circles */
.vision-radius {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 90;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    will-change: left, top;
}

.vision-radius.observer {
    border: 2px solid #00ff00;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.4) 0%, rgba(0, 255, 0, 0.25) 40%, rgba(0, 255, 0, 0.1) 70%, rgba(0, 255, 0, 0.02) 100%);
}

.vision-radius.sentry {
    border: 2px solid #4dd0e1;
    background: radial-gradient(circle, rgba(77, 208, 225, 0.4) 0%, rgba(77, 208, 225, 0.25) 40%, rgba(77, 208, 225, 0.1) 70%, rgba(77, 208, 225, 0.02) 100%);
}

.vision-radius.enemy {
    border: 2px solid #ff0000;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.4) 0%, rgba(255, 0, 0, 0.25) 40%, rgba(255, 0, 0, 0.1) 70%, rgba(255, 0, 0, 0.02) 100%);
}

.placed-ward:hover + .vision-radius {
    opacity: 0.75;
}

/* Save Modal Styles */
.save-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.save-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-modal-content {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #e94560;
    box-shadow: 0 20px 60px rgba(233, 69, 96, 0.4);
    min-width: 400px;
    max-width: 500px;
}

.save-modal-content h3 {
    color: #e94560;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.save-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.save-form label {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.save-form input {
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.save-form input:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.save-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.save-modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.save-modal-buttons .btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

/* Recording Controls */
.recording-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(22, 83, 126, 0.2);
    border-radius: 8px;
    border: 2px solid #16537e;
}

.btn-record {
    background: linear-gradient(45deg, #dc2626, #991b1b);
    color: white;
    animation: pulse-record 2s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

.btn-record.recording {
    animation: blink-record 1s ease-in-out infinite;
}

@keyframes blink-record {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.recording-status {
    font-family: 'Orbitron', monospace;
    color: #e94560;
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 80px;
}

.recording-status.active::before {
    content: '⏺ ';
    animation: blink-dot 1s ease-in-out infinite;
}

@keyframes blink-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.playback-speed {
    padding: 0.5rem;
    background: rgba(22, 83, 126, 0.2);
    border: 2px solid #16537e;
    border-radius: 6px;
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

.playback-speed:focus {
    border-color: #e94560;
}

/* Annotations Layer */
.annotations-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.annotation-marker {
    position: absolute;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid;
    border-radius: 8px;
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    max-width: 250px;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%);
    transform-origin: center;
}

.annotation-marker:hover {
    transform: scale(1.05);
    z-index: 101;
}

.annotation-marker.info {
    border-color: #0891b2;
    box-shadow: 0 0 15px rgba(8, 145, 178, 0.5);
}

.annotation-marker.warning {
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.annotation-marker.strategy {
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.annotation-marker.mistake {
    border-color: #dc2626;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
}

.annotation-marker .note-icon {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.annotation-marker .note-text {
    display: inline;
    line-height: 1.4;
}

.annotation-marker .note-time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #e94560;
    opacity: 0.8;
}

/* Note Modal */
.note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.note-modal-content {
    background: linear-gradient(135deg, #16213e 0%, #0a0a0a 100%);
    border: 2px solid #e94560;
    border-radius: 12px;
    padding: 2rem;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 10px 50px rgba(233, 69, 96, 0.3);
}

.note-modal-content h3 {
    color: #e94560;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-form label {
    color: #fff;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.note-form textarea {
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.note-form textarea:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}

.note-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.note-type-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.note-type-selector select {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.note-type-selector select:focus {
    border-color: #e94560;
}

.note-modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.note-modal-buttons .btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
}

/* ========== New button variants ========== */
.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
}

/* ========== Timeline controls ========== */
.timeline-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.timeline-slider {
    width: 200px;
}

/* ========== Drawing mode buttons ========== */
.drawing-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #533483;
    background: rgba(83, 52, 131, 0.3);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.drawing-btn:hover {
    background: rgba(83, 52, 131, 0.5);
    transform: scale(1.05);
}

.drawing-btn.active {
    background: #e94560;
    border-color: #e94560;
    box-shadow: 0 0 10px #e94560;
}

/* ========== Enemy hero styling ========== */
.placed-hero.enemy img {
    border-color: #ff0000;
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.8);
}

/* ========== Responsive drawing controls ========== */
@media (max-width: 900px) {
    .drawing-controls {
        top: auto;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        width: auto;
    }

    .drawing-controls .color-palette {
        margin-top: 0;
        margin-left: 0.5rem;
    }
}

/* ========== Time ruler ========== */
.bf-time-ruler {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

.bf-time-ruler::before {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 255, 0, 0.5);
}

.bf-tick {
    position: absolute;
    bottom: 2px;
    height: 10px;
    width: 2px;
    background: #00ff00;
    transform: translateX(-1px);
    box-shadow: 0 0 4px rgba(0, 255, 0, 0.8);
}

.bf-tick-label {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 700;
    color: #00ff00;
    font-family: 'Orbitron', monospace, sans-serif;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9);
}