/* Game Launcher Styles */
.launcher-body {
    background: #0f172a;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;  /* Only prevent horizontal scroll */
    overflow-y: auto;    /* Allow vertical scroll */
}

.launcher-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;  /* Changed from height to min-height */
}

/* Launcher Header */
.launcher-header {
    background: #1e293b;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.launcher-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: #334155;
    color: white;
}

.game-info h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    margin-bottom: 0.25rem;
}

.operator-name {
    color: #64748b;
    font-size: 0.875rem;
}

/* URL Display */
.url-display {
    background: #0f172a;
    padding: 1rem;
    border-radius: 0.5rem;
}

.url-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.url-label i {
    color: var(--primary-color);
}

.url-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #334155;
}

.url-box code {
    flex: 1;
    color: #60a5fa;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-url-btn,
.open-new-tab-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.copy-url-btn:hover,
.open-new-tab-btn:hover {
    background: #334155;
    color: white;
    border-color: #60a5fa;
}

/* Launcher Controls */
.launcher-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.resize-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.control-btn {
    background: #0f172a;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.control-btn:hover {
    background: #334155;
    color: white;
    border-color: var(--primary-color);
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.iframe-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #0f172a;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    position: relative;
    overflow: visible;  /* Changed from hidden to visible */
}

.game-iframe {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    height: calc(100vh - 250px);
    overflow: hidden;  /* This prevents scrollbars INSIDE the iframe */
}

/* Also hide scrollbars on iframe content */
.game-iframe::-webkit-scrollbar {
    display: none;
}

.game-iframe {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.game-iframe {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    overflow: auto;  /* Changed from hidden to auto - allows scrolling */
}

.game-iframe.size-full {
    width: 100% !important;
    height: calc(100vh - 250px) !important;
}
/* Hide scrollbar for IE, Edge and Firefox */
.game-iframe {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Remove the conflicting height from base class when custom */
.game-iframe.size-custom {
    /* Inline styles will control dimensions */
}

/* Iframe Sizes */
.game-iframe.size-small {
    width: 375px;
    max-width: 100%;
}

.game-iframe.size-medium {
    width: 768px;
    max-width: 100%;
}

.game-iframe.size-large {
    width: 1024px;
    max-width: 100%;
}

.game-iframe.size-full {
    width: 100%;
    height: 100%;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #334155;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: #94a3b8;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .launcher-header {
        padding: 1rem;
    }

    .launcher-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .launcher-controls {
        flex-wrap: wrap;
    }

    .resize-controls {
        margin-left: 0;
        width: 100%;
    }

    .control-btn {
        flex: 1;
    }

    .game-iframe {
        width: 100% !important;
    }
}

/* URL Header with Dimensions */
.url-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.dimensions-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #60a5fa;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.dimensions-display i {
    color: var(--primary-color);
}

/* Control Divider */
.control-divider {
    width: 1px;
    height: 32px;
    background: #334155;
    margin: 0 0.5rem;
}

/* Control Label */
.control-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
}

/* Resize Controls */
.resize-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Custom Size Controls */
.custom-size-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-input-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.size-input-group label i {
    color: #64748b;
    font-size: 0.75rem;
}

.size-input-group input {
    background: transparent;
    border: none;
    color: white;
    width: 80px;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    outline: none;
}

.size-input-group input::placeholder {
    color: #475569;
}

.size-input-group input::-webkit-inner-spin-button,
.size-input-group input::-webkit-outer-spin-button {
    opacity: 1;
}

.size-separator {
    color: #64748b;
    font-weight: bold;
}

.apply-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.apply-btn:hover {
    background: var(--primary-hover);
}

/* Update Iframe for Custom Sizing */
.game-iframe.size-custom {
    /* Dimensions will be set via inline styles */
}

/* Responsive Updates */
@media (max-width: 1200px) {
    .launcher-controls {
        flex-wrap: wrap;
    }

    .control-divider {
        display: none;
    }

    .custom-size-controls,
    .resize-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .url-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .size-input-group {
        flex-wrap: wrap;
    }

    .size-input-group input {
        width: 60px;
    }
}

/* Iframe Sizes */
.game-iframe.size-small {
    width: 375px;
    height: 667px;
    max-width: 100%;
}

.game-iframe.size-medium {
    width: 768px;
    height: 600px;
    max-width: 100%;
}

.game-iframe.size-large {
    width: 1024px;
    height: 768px;
    max-width: 100%;
}

.game-iframe.size-full {
    width: 100%;
    height: calc(100vh - 250px);
}

.game-iframe.size-custom {
    /* Inline styles will control dimensions */
    max-width: 100%;
}

/* Base iframe style */
.game-iframe {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}