/* Copyright (c) 2024-2026. Jericho Crosby (Chalwk) */

.knot-panel {
    background: var(--light);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.knot-title {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.knot-description {
    color: var(--gray);
}

.knot-game-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.knot-game-area {
    flex: 1;
    position: relative;
}

.canvas-wrapper {
    background: var(--darker);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.canvas-stats-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    position: relative;
}

.canvas-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.canvas-stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.canvas-stat-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.5rem;
}

.level-value {
    color: #7ee7c7;
}

.edge-value {
    color: #6ea8fe;
}

.cross-value {
    color: #ff6b6b;
}

.svg-canvas {
    display: block;
    width: 100%;
    height: 500px;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.node {
    cursor: grab;
}

.node:active {
    cursor: grabbing;
}

.node-circle {
    filter: drop-shadow(0 6px 16px rgba(110, 168, 254, 0.12));
}

.node-label {
    font-size: 10px;
    pointer-events: none;
    fill: #e6eef8;
}

.edge {
    stroke: rgba(255, 255, 255, 0.75);
    stroke-width: 3;
    stroke-linecap: round;
}

.edge.crossing {
    stroke: #ff6b6b;
    stroke-width: 4;
}

.win-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20;
}

.win-overlay.hidden {
    display: none !important;
}

.win-card {
    background: var(--light);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    margin: 1rem;
}

.win-title {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.win-message {
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.win-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.knot-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .knot-game-container {
        flex-direction: column !important;
    }

    .canvas-stats-bar {
        padding: 0.5rem;
    }

    .canvas-stat-item {
        min-width: 60px;
    }

    .canvas-stat-label {
        font-size: 0.75rem;
    }

    .canvas-stat-value {
        font-size: 1.25rem;
    }

    .svg-canvas {
        height: 400px !important;
    }

    .knot-controls {
        flex-wrap: wrap;
    }

    .knot-controls .btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .svg-canvas {
        height: 350px !important;
    }

    .canvas-stat-value {
        font-size: 1.1rem;
    }

    .canvas-stat-label {
        font-size: 0.7rem;
    }

    .knot-controls {
        flex-direction: column;
        align-items: stretch;
    }
}