/*
    Developer: Molla Samser
    Organization: RSK World
    Website: https://rskworld.in
    Email: help@rskworld.in, support@rskworld.in
    Phone/WhatsApp: +91 93305 39277
    Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
    Copyright © 2026 RSK World. All rights reserved.
*/
/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}
[hidden] { display: none !important; }

/* Prevent horizontal layout shift when scrollbars appear */
:root { scrollbar-gutter: stable both-edges; }
html { overflow-y: auto; }

/* Ensure hidden attribute reliably hides elements across browsers */
[hidden] { display: none !important; }

/* Game Container */
.game-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 25px;
    max-width: 900px;
    width: 100%;
    margin: 20px auto;
}

/* Ensure container keeps centering and full-width feel even when ads load */
.game-container:after {
    content: '';
    display: block;
    clear: both;
}

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

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.game-description {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.stats > div {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timer, .best {
    background: #eef6ff;
}

.stars {
    color: #f1c40f;
}

.stars .star-empty {
    opacity: 0.3;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button, select {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

button {
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

button:disabled {
    background-color: #b0cbe1;
    cursor: not-allowed;
    transform: none;
}

select {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    min-width: 120px;
}

/* Game Board */
.game-board {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 300px;
    margin: 40px 0;
    position: relative;
    padding: 20px 0;
}

.pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(44, 62, 80, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.pause-message {
    background: #ffffff;
    color: #2c3e50;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}

.tower {
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.tower:hover {
    transform: translateY(-5px);
}

.tower.selected .rod {
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.35);
}

.tower:focus-visible .rod {
    outline: 3px solid #3498db;
    outline-offset: 4px;
}

.rod {
    width: 20px;
    height: 200px;
    background: linear-gradient(to right, #bdc3c7, #95a5a6);
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.base {
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, #7f8c8d, #95a5a6);
    border-radius: 10px;
    margin-top: 10px;
}

/* Disks */
.disk {
    height: 30px;
    border-radius: 15px;
    margin: 2px 0;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Disk colors */
.disk[data-size="1"] { width: 80px; background: linear-gradient(135deg, #e74c3c, #c0392b); }
.disk[data-size="2"] { width: 110px; background: linear-gradient(135deg, #e67e22, #d35400); }
.disk[data-size="3"] { width: 140px; background: linear-gradient(135deg, #f1c40f, #f39c12); }
.disk[data-size="4"] { width: 170px; background: linear-gradient(135deg, #2ecc71, #27ae60); }
.disk[data-size="5"] { width: 200px; background: linear-gradient(135deg, #3498db, #2980b9); }
.disk[data-size="6"] { width: 230px; background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.disk[data-size="7"] { width: 260px; background: linear-gradient(135deg, #34495e, #2c3e50); }

/* Selected disk */
.disk.selected {
    transform: translateY(-20px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Invalid move */
.invalid-move {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Features and Meta */
.features, .game-meta {
    margin: 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.features h3, .game-meta > div {
    margin-bottom: 10px;
    color: #2c3e50;
}

.features ul {
    padding-left: 20px;
}

.features li {
    margin-bottom: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalFadeIn 0.3s;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.license-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    outline: none;
    margin: 10px 0 15px 0;
}

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

.modal h2 {
    color: #2ecc71;
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        width: 100%;
        margin-top: 10px;
    }
    
    .game-board {
        height: 250px;
    }
    
    .disk {
        height: 25px;
    }
    
    .disk[data-size="1"] { width: 60px; }
    .disk[data-size="2"] { width: 85px; }
    .disk[data-size="3"] { width: 110px; }
    .disk[data-size="4"] { width: 135px; }
    .disk[data-size="5"] { width: 160px; }
    .disk[data-size="6"] { width: 185px; }
    .disk[data-size="7"] { width: 210px; }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    
    .stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    button, select {
        width: 100%;
    }
    
    .game-board {
        height: 220px;
    }
    
    .disk {
        height: 20px;
        font-size: 0.8em;
    }
}

/* History Panel */
.history-panel {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: 15px;
    max-height: 200px;
    overflow: auto;
    margin-top: -10px;
}

.history-panel h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

#move-history {
    list-style: none;
}

#move-history li {
    padding: 6px 8px;
    border-bottom: 1px dashed #ececec;
    font-size: 0.95em;
}

#move-history li:last-child {
    border-bottom: none;
}

/* Utilities */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Ads */
.ad-slot {
    min-height: 60px;
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 10px, #f1f3f5 10px, #f1f3f5 20px);
    border: 1px dashed #d0d7de;
    border-radius: 8px;
    width: 100%;
}

.ad-top-banner {
    margin: 10px 0 0 0;
    min-height: 90px;
}

.ad-in-content {
    margin: 10px 0 20px 0;
    min-height: 250px;
}

.ad-sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1001;
}

.ad-close {
    position: absolute;
    right: 8px;
    top: 8px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
}

.support-footer {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    font-size: 0.95em;
    width: 100%;
    max-width: 900px;
}

.support-footer a {
    color: #3498db;
    text-decoration: none;
}

.support-footer a:hover {
    text-decoration: underline;
}
