/* ========================================
   TEA AI Tournament Studio - Welcome Splash
   Shown on first paint, before the app shell.
   ======================================== */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.splash-screen.hidden {
    display: none;
}

.splash-hero {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    background: #060608;
    max-height: 46vh;
    overflow: hidden;
}

.splash-hero picture,
.splash-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.splash-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    background: linear-gradient(180deg, transparent 0%, var(--bg-base) 96%);
    pointer-events: none;
}

.splash-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 var(--space-6) var(--space-6);
    margin-top: -8vh;
    position: relative;
    z-index: 1;
}

.splash-welcome-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-xl);
    color: var(--text-primary);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.splash-welcome-title .flame {
    filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.7));
}

.splash-welcome-sub {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    max-width: 420px;
    margin-bottom: var(--space-5);
    line-height: 1.5;
}

.splash-actions {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.splash-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: var(--text-sm);
    font-family: var(--font-body);
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.splash-btn:active {
    transform: scale(0.98);
}

.splash-btn-app {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #241800;
    box-shadow: 0 6px 20px rgba(255, 170, 0, 0.35);
}

.splash-btn-video {
    background: linear-gradient(135deg, var(--color-secondary), #0090c9);
    color: #001820;
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.25);
}

.splash-btn-continue {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.splash-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.splash-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (min-width: 700px) {
    .splash-hero {
        max-width: 460px;
        margin: 0 auto;
    }
}

/* Buttons stay hidden until the admin has saved the matching link */
.splash-btn[hidden] { display: none !important; }

/* ========================================
   Install guide (opened from the App Download button)
   ======================================== */
.ig-backdrop {
    position: absolute; inset: 0; z-index: 5;
    background: rgba(5, 5, 10, 0.72);
    display: flex; align-items: flex-end; justify-content: center;
}
.ig-backdrop[hidden] { display: none !important; }
.ig-sheet {
    width: 100%; max-width: 460px; max-height: 94%;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--bg-base);
    border: 1px solid var(--border-strong);
    border-radius: 20px 20px 0 0;
    padding: var(--space-5) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    text-align: left;
}
.ig-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ig-head h2 { font-size: var(--text-lg); font-weight: 800; margin: 0; }
.ig-x { background: none; border: 0; color: var(--text-secondary); font-size: 28px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.ig-sub { color: var(--text-muted); font-size: var(--text-sm); margin: var(--space-2) 0 var(--space-4); }

/* animated phone demo (an illustration, so it keeps its own light Chrome look) */
.ig-demo { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.ig-phone {
    position: relative; width: 200px; height: 280px; overflow: hidden;
    background: #fff; border: 6px solid #2b2f3a; border-radius: 26px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.ig-scene { position: absolute; inset: 0; opacity: 0; animation: ig-scene 12s infinite; animation-delay: calc(var(--i) * 3s); }
@keyframes ig-scene {
    0% { opacity: 0; } 4% { opacity: 1; } 22% { opacity: 1; } 25% { opacity: 0; } 100% { opacity: 0; }
}
.ig-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; background: #f1f3f4; border-bottom: 1px solid #dadce0; }
.ig-url { flex: 1; background: #fff; border-radius: 12px; padding: 3px 8px; font: 9px/1.4 sans-serif; color: #5f6368; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ig-dots { display: flex; flex-direction: column; gap: 2.5px; padding: 4px 6px; }
.ig-dots i { width: 3.5px; height: 3.5px; border-radius: 50%; background: #5f6368; display: block; }
.ig-page { padding: 14px 12px; display: grid; gap: 8px; }
.ig-page b { display: block; height: 10px; border-radius: 5px; background: #e8eaed; }
.ig-page b:nth-child(2) { width: 70%; }
.ig-page b:nth-child(3) { width: 50%; }
.ig-menu {
    position: absolute; top: 30px; right: 6px; width: 128px; padding: 4px 0;
    background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.35);
    font: 10px/1 sans-serif; color: #202124;
}
.ig-menu span { display: block; padding: 7px 10px; }
.ig-hit { background: #ffe9a8; font-weight: 700; outline: 2px solid #ff9900; outline-offset: -2px; border-radius: 4px; }
.ig-dim { position: absolute; inset: 34px 0 0; background: rgba(0,0,0,.45); }
.ig-dialog {
    position: absolute; left: 14px; right: 14px; top: 92px; padding: 10px;
    background: #fff; border-radius: 12px; color: #202124; font-family: sans-serif;
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.ig-dialog-t { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.ig-dialog-app { display: flex; align-items: center; gap: 8px; font-size: 9.5px; margin-bottom: 10px; }
.ig-dialog-app img { border-radius: 6px; }
.ig-dialog-btns { display: flex; justify-content: flex-end; gap: 6px; font-size: 10px; }
.ig-dialog-btns span { padding: 6px 10px; border-radius: 14px; color: #1a73e8; }
.ig-dialog-btns .ig-hit { background: #1a73e8; color: #fff; outline: 2px solid #ff9900; outline-offset: 1px; }
.ig-tap {
    position: absolute; width: 22px; height: 22px; margin: -4px; border-radius: 50%;
    background: rgba(255, 153, 0, .55); border: 2px solid #ff9900;
    animation: ig-tap 1.2s ease-in-out infinite;
}
@keyframes ig-tap { 0%,100% { transform: scale(.7); opacity: .9; } 50% { transform: scale(1.25); opacity: .5; } }
.ig-home { background: linear-gradient(160deg, #243b6b, #4b2a6b); }
.ig-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; padding: 24px 14px; }
.ig-icons i { aspect-ratio: 1; border-radius: 11px; background: rgba(255,255,255,.22); display: block; }
.ig-newicon { position: absolute; left: 14px; bottom: 56px; width: 44px; text-align: center; color: #fff; font: 9px/1.2 sans-serif; animation: ig-pop 12s infinite; animation-delay: 9s; }
.ig-newicon img { border-radius: 10px; display: block; margin: 0 auto 3px; box-shadow: 0 0 0 2px #ffcc00, 0 0 14px rgba(255,204,0,.7); }
@keyframes ig-pop { 0%,1% { transform: scale(0); } 6% { transform: scale(1.25); } 10%,100% { transform: scale(1); } }

.ig-captions { position: relative; width: 100%; min-height: 44px; }
.ig-cap {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
    text-align: center; font-size: var(--text-sm); font-weight: 600; color: var(--text-primary);
    opacity: 0; animation: ig-scene 12s infinite; animation-delay: calc(var(--i) * 3s);
}
.ig-cap b { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #ff9900; color: #241800; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.ig-cap span { text-align: left; }
.ig-cap strong { color: #ffcc00; }

.ig-steps { list-style: decimal outside; margin: 0 0 var(--space-3); padding-left: 24px; color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.7; }
.ig-steps li { list-style: decimal outside; padding-left: 2px; }
.ig-steps b { color: var(--text-primary); }
.ig-note { color: var(--text-muted); font-size: var(--text-xs, 12px); margin: 0 0 var(--space-4); }
.ig-actions { display: flex; flex-direction: column; gap: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
    .ig-scene, .ig-cap, .ig-tap, .ig-newicon { animation: none; }
    .ig-scene[style*="--i:0"], .ig-cap[style*="--i:0"] { opacity: 1; }
    .ig-newicon { transform: scale(1); }
}

/* iPhone install guide (shown only on iOS, see splash.js) */
.ig-ios-steps { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ig-ios-steps li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; }
.ig-ios-steps .n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #ff9900; color: #241800; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.ig-ios-steps strong { color: var(--text-primary); }
.ig-ios-steps small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.ig-ios-steps .ig-ico { vertical-align: -5px; margin-left: 4px; color: #ffcc00; }
.ig-ios-warn { background: rgba(255,153,0,.12); border: 1px solid rgba(255,153,0,.45); border-radius: 12px; padding: 10px 12px; margin: 0 0 var(--space-3); color: var(--text-primary); font-size: var(--text-sm); }
.ig-ios-warn p { margin: 0 0 8px; }
.is-ios #ig-apk, .is-ios #ig-install-now { display: none !important; }
.is-ios #ig-sub-android, .is-ios #ig-demo-android, .is-ios #ig-steps-android, .is-ios #ig-note-android { display: none !important; }
