/* Pipeline Puzzle Game Styles */
:root {
    --bg-main: #F5F5F0;
    --bg-card: #FFFFFF;
    --text-primary: #303030;
    --text-secondary: #595959;
    --accent-sage: #7D8C7A;
    --accent-dark: #2C3632;
    --line: #E0E0DB;
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --slot-bg: #e8e8e8;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent-dark);
    margin-bottom: 10px;
}

.level-badge {
    display: inline-block;
    background: var(--accent-sage);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: inline-block;
}

.back-link:hover {
    color: var(--accent-dark);
}

/* Game Board */
.game-board {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.instruction {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Pipeline Flow (Target) */
.pipeline-track {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 50px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed var(--line);
    min-height: 150px;
    align-items: center;
}

.pipeline-slot {
    width: 160px;
    height: 100px;
    background: var(--slot-bg);
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.pipeline-slot::before {
    content: attr(data-index);
    position: absolute;
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.05);
    font-weight: 700;
    z-index: 0;
}

.pipeline-slot.drag-over {
    background: rgba(125, 140, 122, 0.2);
    border-color: var(--accent-sage);
}

.arrow {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

/* Draggable Blocks */
.source-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: #f0f0eb;
    border-radius: 8px;
    min-height: 120px;
}

.block {
    width: 150px;
    height: 90px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: var(--accent-dark);
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
    z-index: 1;
}

.block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.block.dragging {
    opacity: 0.5;
}

.block.correct {
    background: var(--success-color);
    color: white;
    border-color: transparent;
}

.block.incorrect {
    background: var(--error-color);
    color: white;
    border-color: transparent;
    animation: shake 0.4s;
}

/* Controls */
.controls {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-check {
    background: var(--accent-dark);
    color: white;
}

.btn-check:hover {
    background: var(--accent-sage);
    transform: scale(1.05);
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-reset:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Winner Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.modal-content h2 {
    color: var(--success-color);
    margin-bottom: 10px;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .pipeline-track {
        flex-direction: column;
    }

    .arrow {
        transform: rotate(90deg);
    }
}