/* CrazyGames-style Play Page - 3 Column Layout */

body {
    background: var(--background);
}

/* Main Content with 3 columns */
.play-main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
}

.play-layout {
    max-width: 1920px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    padding: 2rem 1.5rem;
}

/* Game Column (Center) */
.game-column {
    width: 100%;
    max-width: 100%;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb i {
    font-size: 0.7rem;
}

/* Game Title */
.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Game Frame - Fixed size, game content adapts */
.game-frame-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    overflow: hidden;
}

/* In-frame Game Loading Overlay */
.game-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.4s ease;
}

.game-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.game-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    max-width: 360px;
    width: 100%;
}

.game-loading-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.game-loading-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-loading-progress-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.game-loading-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.game-loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.game-loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.game-loading-progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 3.5em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.game-loading-status {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.game-loading-status.error {
    color: #ff6b6b;
}

/* Game Info Bar (Below Frame) */
.game-info-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

/* Like / Dislike Vote Buttons */
.vote-group {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn i {
    font-size: 1.1rem;
}

.vote-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.like-btn.active {
    color: var(--primary-color);
}

.dislike-btn {
    border-left: 1px solid var(--border-color);
}

.dislike-btn.active {
    color: #ef4444;
}

/* Rating Display */
.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
    color: #f59e0b;
    font-size: 1rem;
}

.rating-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Developer Info */
.developer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-left: auto;
}

.developer-info .label {
    font-weight: 600;
}

.developer-info span:last-child {
    color: var(--text-primary);
}

/* Game Tags Bar */
.game-tags-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.game-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.game-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.game-tag i {
    font-size: 1rem;
}

/* Game Description */
.game-description {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-description p {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.game-description p:last-child {
    margin-bottom: 0;
}

/* Game Controls */
.game-controls {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-controls h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.game-controls p {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.game-controls strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Related Games Column (Right) */
.related-column {
    position: sticky;
    top: calc(var(--navbar-height) + 2rem);
    height: fit-content;
}

.related-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.related-games-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading-related {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.related-game-card {
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.related-game-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.related-game-info {
    padding: 0.75rem;
}

.related-game-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-game-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.related-game-tag {
    background: var(--background);
    color: var(--primary-color);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .play-layout {
        grid-template-columns: 1fr;
    }

    .related-column {
        position: static;
    }

    .related-games-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .play-main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .play-layout {
        padding: 1rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .game-frame-wrapper {
        max-width: 100%;
    }

    .game-info-bar {
        flex-wrap: wrap;
    }

    .developer-info {
        margin-left: 0;
        width: 100%;
    }

    .related-games-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.25rem;
    }

    .game-info-bar {
        gap: 1rem;
    }

    .vote-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}
