/* Game Instructions Modal Styles */

.instructions-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.6);
}

.instructions-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.instructions-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    max-width: 800px;
    width: 100%;
    border-radius: 16px;
    padding: 0;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instructions-header {
    background: linear-gradient(135deg, #00d9ff, #0099cc);
    padding: 25px 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.instructions-header h2 {
    margin: 0;
    color: #000;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.instructions-close:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

.instructions-body {
    padding: 30px;
    color: #fff;
}

.instruction-section {
    margin-bottom: 30px;
}

.instruction-section h3 {
    color: #00d9ff;
    font-size: 22px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-section p {
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 15px;
}

.instruction-steps {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.instruction-steps li {
    counter-increment: step-counter;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #00d9ff;
    position: relative;
    padding-left: 60px;
}

.instruction-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #00d9ff;
    color: #000;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.visual-grid {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.grid-display {
    display: grid;
    gap: 8px;
    margin: 20px auto;
    max-width: fit-content;
}

.grid-5x5 {
    grid-template-columns: repeat(5, 60px);
}

.grid-4x4 {
    grid-template-columns: repeat(4, 60px);
}

.grid-tile {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2a2a4e 0%, #1a1a3e 100%);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s;
}

.grid-tile.safe {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
}

.grid-tile.bomb {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    border-color: #f44336;
}

.grid-tile.unknown {
    background: linear-gradient(135deg, #2a2a4e 0%, #1a1a3e 100%);
}

.roll-visual {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
}

.roll-bar-demo {
    position: relative;
    height: 60px;
    background: linear-gradient(to right, #ff6b6b 0%, #51cf66 100%);
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
}

.roll-bar-marker-demo {
    position: absolute;
    width: 3px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    left: 50%;
}

.roll-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: #ccc;
    font-size: 14px;
}

.plinko-visual {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.plinko-board-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.plinko-row {
    display: flex;
    gap: 20px;
}

.plinko-peg {
    width: 12px;
    height: 12px;
    background: #00d9ff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.plinko-ball {
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.7);
}

.plinko-slots {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.plinko-slot {
    padding: 10px 15px;
    background: rgba(0, 217, 255, 0.2);
    border: 2px solid #00d9ff;
    border-radius: 8px;
    color: #00d9ff;
    font-weight: bold;
}

.towers-visual {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 8px;
    margin: 20px 0;
}

.towers-demo {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    margin: 20px auto;
}

.towers-row-demo {
    display: flex;
    gap: 8px;
}

.towers-tile-demo {
    flex: 1;
    height: 50px;
    background: linear-gradient(135deg, #2a2a4e 0%, #1a1a3e 100%);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.towers-tile-demo.safe {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
}

.towers-tile-demo.bomb {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
    border-color: #f44336;
}

.tips-box {
    background: rgba(0, 217, 255, 0.1);
    border: 2px solid #00d9ff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tips-box h4 {
    color: #00d9ff;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-box ul {
    margin: 0;
    padding-left: 20px;
    color: #ccc;
    line-height: 1.8;
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.example-table th,
.example-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.example-table th {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
    font-weight: bold;
}

.example-table td {
    color: #ccc;
}

.multiplier-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border-radius: 4px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .instructions-content {
        margin: 10px;
        max-height: 95vh;
    }

    .instructions-body {
        padding: 20px;
    }

    .grid-tile {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .grid-5x5 {
        grid-template-columns: repeat(5, 50px);
    }

    .grid-4x4 {
        grid-template-columns: repeat(4, 50px);
    }
}
