:root {
    --bg-color: #121314;
    --card-bg: rgba(22, 24, 26, 0.85);
    --gold: #dfb259;
    --gold-hover: #f1c76e;
    --text-color: #e3e4e6;
    --text-muted: #8e9297;
    --border-color: rgba(223, 178, 89, 0.2);
    --border-glow: rgba(223, 178, 89, 0.4);
    --btn-bg: #1e2022;
    --btn-primary: linear-gradient(135deg, #b8860b 0%, #dfb259 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --green: #2ecc71;
    --blue: #3498db;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
}

/* Background effects */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15,16,18,0.3) 0%, rgba(10,11,12,0.95) 100%),
                url('/launcher/assets/bg_landscape.png') no-repeat center center;
    background-size: cover;
    filter: blur(12px) brightness(0.25) saturate(1.2);
    z-index: -1;
}

/* Main Container Layout */
.launcher-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.game-header {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.logo-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(223, 178, 89, 0.25);
    display: block;
    margin: 0 auto;
}

.game-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Main Card Glassmorphism */
.main-card {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-bottom: 30px;
}

/* Prompt for iOS */
.install-prompt {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.install-prompt h3 {
    color: var(--blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-prompt p {
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 10px;
}

.install-prompt ol {
    margin-left: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.share-icon, .add-icon {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.btn-primary {
    background: var(--btn-primary);
    color: #000;
    box-shadow: 0 0 15px rgba(223, 178, 89, 0.2);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 5px rgba(223, 178, 89, 0.4);
}

.btn-secondary {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.05);
}

.btn-large {
    padding: 18px 24px;
}

.btn-text {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.btn-subtext {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    text-transform: uppercase;
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.85rem;
}

/* Progress bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--btn-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(223, 178, 89, 0.6);
}

/* Storage usage */
.storage-info {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Packs Section */
.packs-section {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.packs-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.packs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pack-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pack-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pack-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.pack-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pack-status {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.status-installed {
    background: rgba(46, 204, 113, 0.15);
    color: var(--green);
}

.status-pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Account & Cloud save */
.account-section {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.account-card {
    background: rgba(223, 178, 89, 0.03);
    border: 1px solid rgba(223, 178, 89, 0.1);
    border-radius: 12px;
    padding: 15px;
}

.account-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 6px;
}

.account-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

.account-buttons {
    display: flex;
    gap: 10px;
}

.code-display {
    margin-top: 15px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.code-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--gold);
    color: var(--gold);
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 10px;
    border-radius: 6px;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.code-warning {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.3;
}

/* Hidden Utility class */
.hidden {
    display: none !important;
}

/* Fullscreen Game Iframe Container */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Orientation Warning Overlay */
#orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #121314;
    color: #dfb259;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

@media screen and (orientation: portrait) and (max-width: 768px) and (pointer: coarse) {
    #orientation-warning {
        display: flex;
    }
}
