/* Game Page Styles - play/index.php */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #2d2640;
}

.game-frame {
    border: none;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

/* Preload Content Block - visible until game loads */
.preload-content {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 120px;
    color: #e5e7eb;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    font-size: 15px;
}

.preload-content h1 {
    color: #f97316;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.preload-content h2,
.preload-content h3 {
    color: #f97316;
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.preload-content p {
    margin-bottom: 16px;
}

.preload-content strong {
    color: #fff;
    font-weight: 600;
}

.preload-content u {
    color: #f97316;
    text-decoration: none;
    border-bottom: 1px solid #f97316;
}

.preload-content ul,
.preload-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.preload-content li {
    margin-bottom: 8px;
}

.preload-content br {
    display: block;
    content: "";
    margin-bottom: 8px;
}

.play-button {
    display: inline-block;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    margin: 20px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

/* Large spinner for when no image */
.game-preloader .spinner-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 4px solid rgba(249, 115, 22, 0.2);
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Game Preloader - Full viewport height, centered */
.game-preloader {
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

/* Game image with spinner overlay */
.game-preloader .game-image-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 25px;
    animation: fadeInUp 0.6s ease-out;
}

.game-preloader .game-image-wrapper .game-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-preloader .game-image-wrapper .game-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(249, 115, 22, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-preloader .game-image-wrapper .game-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(249, 115, 22, 0.5);
}

/* Small spinner positioned over the image */
.game-preloader .game-image-wrapper .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(249, 115, 22, 0.3);
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    background: rgba(45, 38, 64, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.game-preloader .game-title {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.game-preloader .loading-text {
    color: #9ca3af;
    font-size: 16px;
}

.game-preloader .loading-text strong {
    color: #f97316;
}

.game-preloader .fallback-link {
    margin-top: 20px;
    font-size: 14px;
}

.game-preloader .fallback-link a {
    color: #f97316;
    text-decoration: underline;
}

.game-preloader .fallback-link a:hover {
    color: #fb923c;
}

/* Games Catalog - shown on main page or when no game description */
.games-catalog {
    margin-top: 40px;
    padding: 0 20px;
}

.games-catalog h2 {
    color: #f97316;
    font-size: 24px;
    margin-bottom: 16px;
    text-align: center;
}

.games-catalog p {
    color: #9ca3af;
    text-align: center;
    margin-bottom: 30px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.games-grid .game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.games-grid .game-item:hover {
    transform: translateY(-4px);
    background: rgba(249, 115, 22, 0.1);
}

.games-grid .game-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 8px;
}

.games-grid .game-item .game-name {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 500;
}

/* Placeholder for games without images */
.games-grid .game-placeholder {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.games-grid .game-placeholder span {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
}
