/* ==========================================
   ROOM-SPECIFIC STYLES
   ========================================== */

/* Room Background Gradients */
.room-intro {
    background: linear-gradient(180deg, #000000 0%, #1a0000 50%, #000000 100%);
}

.room-1 {
    background: linear-gradient(180deg, #000000 0%, #2d2d2d 50%, #000000 100%);
}

.room-2 {
    background: linear-gradient(180deg, #000000 0%, #1a1a3d 50%, #000000 100%);
}

.room-3 {
    background: linear-gradient(180deg, #000000 0%, #0d2818 50%, #000000 100%);
}

.room-4 {
    background: linear-gradient(180deg, #000000 0%, #2d1b3d 50%, #000000 100%);
}

.room-5 {
    background: linear-gradient(180deg, #000000 0%, #0d2d2d 50%, #000000 100%);
}

.room-6 {
    background: linear-gradient(180deg, #000000 0%, #3d0d0d 50%, #000000 100%);
}

.room-victory {
    background: linear-gradient(180deg, #000000 0%, #3d1a1a 50%, #1a0d0d 100%);
}

/* Puzzle-specific styles */

/* Safe Lock */
.safe-lock {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.dial {
    width: 100px;
    height: 150px;
    background: linear-gradient(180deg, #2d2d2d, #1a1a1a);
    border: 4px solid #444;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.dial-number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

/* Fireplace */
.fireplace-container {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 2px solid rgba(139, 0, 0, 0.5);
}

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

.candle {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.candle:hover {
    transform: scale(1.1);
}

.candle-flame {
    width: 20px;
    height: 50px;
    background: linear-gradient(to top, #ff8c00, #ffd700, #ffed4e);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    margin-bottom: 0.5rem;
    animation: flicker 1s infinite;
}

.candle-body {
    width: 50px;
    height: 80px;
    background: linear-gradient(180deg, #8b7355, #654321);
    border-radius: 5px;
    border: 2px solid #444;
}

.candle-unlit .candle-body {
    background: linear-gradient(180deg, #5a4a3a, #3a2a1a);
}

/* Piano */
.piano-container {
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 4px solid #2d2d2d;
}

.piano-keys {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.piano-key {
    width: 60px;
    height: 120px;
    background: linear-gradient(180deg, #f5f5f5, #e0e0e0);
    border: 2px solid #2d2d2d;
    border-radius: 0 0 8px 8px;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.5rem;
    font-weight: bold;
    color: #000;
    transition: all 0.05s ease;
    box-shadow: 0 4px 0 #999;
}

.piano-key:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #999;
}

.piano-key.correct {
    background: linear-gradient(180deg, #90ee90, #7dda7d);
}

.piano-key.incorrect {
    background: linear-gradient(180deg, #ffb3b3, #ff9999);
}

/* Slider Puzzle */
.slider-puzzle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.slider-tile {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border: 3px solid #8b0000;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-tile:hover {
    transform: scale(1.05);
    border-color: #ffd700;
}

/* Color Mixer */
.color-mixer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.color-button {
    aspect-ratio: 1;
    border: 4px solid #2d2d2d;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
}

.color-button.selected {
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.color-red { background: #ff0000; }
.color-blue { background: #0000ff; }
.color-yellow { background: #ffff00; }

/* Memory Game */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border: 3px solid #444;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.memory-card:hover:not(.matched) {
    border-color: #8b0000;
}

.memory-card.flipped {
    background: linear-gradient(135deg, #3d3d3d, #2a2a2a);
    border-color: #ffd700;
}

.memory-card.matched {
    background: linear-gradient(135deg, #2d5a2d, #1a3d1a);
    border-color: #00ff00;
}

/* Interactive Objects */
.interactive-object {
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-object.draggable {
    cursor: grab;
}

.interactive-object.draggable:active {
    cursor: grabbing;
}

/* Clock */
.clock-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
}

.clock-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3d3d3d, #2d2d2d);
    border: 8px solid #444;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
    position: relative;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: center bottom;
    cursor: grab;
    touch-action: none;
}

.clock-hand:active {
    cursor: grabbing;
}

.clock-hand-hour {
    width: 8px;
    height: 80px;
    background: #ff0000;
    border-radius: 4px;
}

.clock-hand-minute {
    width: 6px;
    height: 110px;
    background: #999;
    border-radius: 3px;
}

/* Responsive Puzzles */
@media (max-width: 768px) {
    .safe-lock {
        gap: 1rem;
    }

    .dial {
        width: 70px;
        height: 120px;
    }

    .dial-number {
        font-size: 2.5rem;
    }

    .piano-keys {
        gap: 0.125rem;
    }

    .piano-key {
        width: 45px;
        height: 100px;
    }

    .memory-grid,
    .slider-puzzle {
        gap: 0.5rem;
    }
}
