/* Game specific styles for Slide Block */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --text-main: #333;

    --board-size: 300px;
    --cell-size: 50px;
}

@media (min-width: 600px) {
    :root {
        --board-size: 420px;
        --cell-size: 70px;
    }
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

.game-container h1 {
    margin-bottom: 1.5rem;
    color: #333;
}

.game-description {
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
}

/* Polished Wrapper */
.game-area-wrapper {
    position: relative;
    padding: 30px;
    background: #81D4FA;
    /* Blue Sky */
    background: linear-gradient(to bottom, #81D4FA 0%, #B3E5FC 100%);
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 2rem;
    min-width: 360px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 4px solid #fff;
}

.level-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    font-weight: 800;
    font-size: 1.4rem;
    color: #01579B;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.5);
    padding: 5px 20px;
    border-radius: 50px;
}

.nav-btn {
    background: #0097A7;
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 0 #006064;
    transition: transform 0.1s;
}

.nav-btn:hover {
    background: #00838F;
}

.nav-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.board-frame {
    background: #5D4037;
    /* Wood frame */
    padding: 12px;
    border-radius: 12px;
    display: inline-block;
    position: relative;
    box-shadow:
        10px 10px 20px rgba(0, 0, 0, 0.3),
        inset 2px 2px 5px rgba(255, 255, 255, 0.1);
    /* Bevel */
}

/* Wood Texture simulation */
.board-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 2px, transparent 2px, transparent 10px);
    pointer-events: none;
}

/* Exit marker */
.board-frame::after {
    content: "EXIT ►";
    position: absolute;
    right: -60px;
    top: 36%;
    color: #E53935;
    font-weight: 800;
    transform: rotate(0deg);
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 #fff;
    animation: pointRight 1s infinite alternate;
}

@keyframes pointRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(5px);
    }
}

.board {
    width: var(--board-size);
    height: var(--board-size);
    background: #8D6E63;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background-image:
        linear-gradient(#6D4C41 1px, transparent 1px),
        linear-gradient(90deg, #6D4C41 1px, transparent 1px);
    background-size: var(--cell-size) var(--cell-size);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    /* Inner depth */
}

/* Polished Blocks */
.block {
    position: absolute;
    background: #FFCA28;
    background: linear-gradient(to bottom right, #FFCA28, #FFB300);
    box-shadow:
        inset 1px 1px 2px rgba(255, 255, 255, 0.4),
        inset -1px -1px 2px rgba(0, 0, 0, 0.2),
        2px 2px 5px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    cursor: grab;
    transition: transform 0.1s;
    border: 1px solid #F57F17;
    box-sizing: border-box;
}

.block::after {
    /* Grip detail */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.05);
}

.block:active {
    cursor: grabbing;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: scale(0.98);
}

.block.red {
    background: linear-gradient(to bottom right, #EF5350, #C62828);
    border-color: #B71C1C;
    z-index: 10;
}

.block.vertical {
    background: linear-gradient(to bottom right, #FFCC80, #EF6C00);
    border-color: #E65100;
}

.controls-area {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.moves-count {
    font-weight: 800;
    color: #006064;
    font-size: 1.3rem;
    text-shadow: 0 1px 0 #fff;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.overlay h2 {
    color: #4CAF50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

/* Buttons */
.secondary-btn {
    background-color: #78909C;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
}

.secondary-btn:hover {
    background: #607D8B;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 1rem 3rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(230, 81, 0, 0.4);
    margin-top: 10px;
    letter-spacing: 1px;
}

.primary-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(230, 81, 0, 0.4);
}

/* Instructions */
.instructions {
    background: #FAFAFA;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 3rem auto 5rem;
    color: #444;
    line-height: 1.8;
}

.instructions h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}