/* NCA Evolution - Components */

/* NCA Cells - The Stars of the Show */
.nca-cell {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border: 2px solid rgba(96, 165, 250, 0.15);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.2) inset;
}

/* Corner accents - sci-fi detail */
.nca-cell::before,
.nca-cell::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.4;
    transition: opacity 0.25s ease;
}

.nca-cell::before {
    top: 6px;
    left: 6px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
}

.nca-cell::after {
    bottom: 6px;
    right: 6px;
    border-bottom: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
}

.nca-cell:hover::before,
.nca-cell:hover::after {
    opacity: 1;
}

/* Hover state - dramatic glow */
.nca-cell:hover {
    border-color: var(--primary);
    transform: scale(1.04) translateY(-2px);
    box-shadow:
        0 0 30px var(--primary-glow),
        0 0 60px rgba(96, 165, 250, 0.15),
        0 15px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(96, 165, 250, 0.08);
}

/* Active/pressed state */
.nca-cell:active {
    transform: scale(0.98);
    transition-duration: 0.1s;
}

/* Voting state - success glow */
.nca-cell.voting {
    border-color: var(--success);
    box-shadow:
        0 0 40px var(--success-glow),
        0 0 80px rgba(34, 211, 238, 0.2),
        inset 0 0 30px rgba(34, 211, 238, 0.1);
}

.nca-cell.voting::before,
.nca-cell.voting::after {
    border-color: var(--success);
    opacity: 1;
}

/* NCA Canvas */
.nca-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* NCA Overlay */
.nca-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.7rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.nca-id {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    opacity: 0.7;
}

.nca-votes {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 0 10px var(--gold-glow);
}

.nca-votes::before {
    content: '\2605';
    font-size: 0.65rem;
    filter: drop-shadow(0 0 3px var(--gold-glow));
}

/* Loading Overlay */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(7, 11, 16, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading.active {
    opacity: 1;
    pointer-events: auto;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(96, 165, 250, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow:
        0 0 30px var(--primary-glow),
        inset 0 0 15px rgba(96, 165, 250, 0.1);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: linear-gradient(135deg, rgba(15, 18, 25, 0.95) 0%, rgba(22, 26, 36, 0.95) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--primary);
    border-radius: 25px;
    padding: 0.7rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-bright);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 30px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: toast-in 0.3s ease-out;
}

/* Vote Floater */
.vote-floater {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--success);
    text-shadow:
        0 0 20px var(--success-glow),
        0 0 40px rgba(34, 211, 238, 0.4);
    pointer-events: none;
    z-index: 10;
    animation: float-up 0.4s ease-out forwards;
}

/* Grid Control Buttons */
.instruction-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.grid-control-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Replay button - green/cyan theme */
#replay-btn {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    color: #22d3ee;
}

#replay-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: #22d3ee;
    color: #22d3ee;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.4);
}

/* Enlarge button - blue/purple theme */
#enlarge-btn {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: var(--primary);
}

#enlarge-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--primary);
    color: var(--primary-bright);
    box-shadow: 0 0 15px var(--primary-glow);
}

.grid-control-btn:active {
    transform: scale(0.95);
}

.grid-control-btn svg {
    width: 14px;
    height: 14px;
}
