* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    overflow: hidden;
    max-height: var(--tg-viewport-height, 100vh);
    background: #0a0a0f;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Container ── */
#cs-unity-container {
    position: fixed;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
}

#cs-unity-canvas {
    width: 100%;
    height: 100%;
    background: #000;
    touch-action: none;
}

/* ── Loading overlay ── */
#cs-unity-loading-bar {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 24px 24px 10vh;
    background-color: #0a0a0f;
    background-image: url('DurovLoading.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
}

#cs-unity-loading-bar.active { display: flex; }

/* Vignette + gradient so text stays readable on any background */
.vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 100%),
        linear-gradient(to bottom, rgba(10,10,15,0) 30%, rgba(10,10,15,0.85) 100%);
    pointer-events: none;
}

/* ── First-load notice banner ── */
.first-load-notice {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(520px, 88vw);
    margin-bottom: 22px;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(70, 48, 12, 0.96), rgba(28, 18, 4, 0.96));
    border: 2px solid #c8a84e;
    border-radius: 10px;
    color: #fff4d2;
    font-size: clamp(13px, 1.9vw, 15px);
    font-weight: 500;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
    box-shadow:
        0 0 0 1px rgba(255, 217, 106, 0.25),
        0 0 28px rgba(200, 168, 78, 0.45),
        inset 0 1px 0 rgba(255, 217, 106, 0.25),
        inset 0 0 24px rgba(0, 0, 0, 0.45);
    animation: notice-pulse 2.2s ease-in-out infinite;
}

/* Animated gold sweep across the banner */
.first-load-notice::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 244, 194, 0.18) 50%, transparent 70%);
    pointer-events: none;
    animation: notice-sweep 3.4s ease-in-out infinite;
}

.notice-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff4c2, #ffd96a 45%, #c8a84e 75%, #6b4f10 100%);
    color: #1a1207;
    font-weight: 900;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    box-shadow: 0 0 14px rgba(255, 217, 106, 0.85), inset 0 0 6px rgba(255, 244, 194, 0.6);
    animation: notice-icon-flash 1.4s ease-in-out infinite;
}

.notice-text { line-height: 1.4; }

@keyframes notice-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(255, 217, 106, 0.25),
            0 0 28px rgba(200, 168, 78, 0.45),
            inset 0 1px 0 rgba(255, 217, 106, 0.25),
            inset 0 0 24px rgba(0, 0, 0, 0.45);
        border-color: #c8a84e;
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(255, 244, 194, 0.45),
            0 0 48px rgba(255, 217, 106, 0.75),
            inset 0 1px 0 rgba(255, 217, 106, 0.35),
            inset 0 0 24px rgba(0, 0, 0, 0.45);
        border-color: #ffd96a;
    }
}

@keyframes notice-sweep {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

@keyframes notice-icon-flash {
    0%, 100% { box-shadow: 0 0 14px rgba(255, 217, 106, 0.85), inset 0 0 6px rgba(255, 244, 194, 0.6); transform: scale(1); }
    50%      { box-shadow: 0 0 22px rgba(255, 244, 194, 1),     inset 0 0 8px rgba(255, 255, 255, 0.8); transform: scale(1.08); }
}

/* ── Tip card (rotating) ── */
.tip-stage {
    position: relative;
    z-index: 2;
    margin-bottom: 36px;
    width: min(520px, 88vw);
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-card {
    width: 100%;
    padding: 14px 20px 16px;
    background: linear-gradient(180deg, rgba(18, 16, 28, 0.78), rgba(8, 7, 14, 0.78));
    border: 1px solid rgba(200, 168, 78, 0.35);
    border-radius: 10px;
    text-align: center;
    color: #e7e3d4;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 0 30px rgba(200, 168, 78, 0.05);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.tip-card.tip-in  { opacity: 1; transform: translateY(0); }
.tip-card.tip-out { opacity: 0; transform: translateY(-6px); }

.tip-label {
    font-size: 10px;
    letter-spacing: 4px;
    color: #c8a84e;
    text-transform: uppercase;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(200, 168, 78, 0.4);
}

.tip-body {
    font-size: clamp(12px, 1.7vw, 14px);
    line-height: 1.5;
    color: #d8d3c1;
}

.tip-body b { color: #ffd96a; font-weight: 600; }

/* ── Progress row: bar + lootbox side-by-side ── */
.progress-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    width: min(520px, 88vw);
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: rgba(255,255,255,0.75);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(200, 168, 78, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, #8b6914, #c8a84e, #e8d48a);
    transition: width 0.3s ease-out;
    position: relative;
    box-shadow: 0 0 12px rgba(200, 168, 78, 0.6);
}

/* Shimmer on the fill */
.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%);
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Subtle scrolling rune-line above the bar (purely decorative) */
.progress-runes {
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 1px;
    background:
        repeating-linear-gradient(90deg,
            rgba(200, 168, 78, 0.35) 0 6px,
            transparent 6px 14px);
    animation: rune-scroll 8s linear infinite;
    opacity: 0.5;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes rune-scroll {
    0% { background-position: 0 0; }
    100% { background-position: 140px 0; }
}

/* ── Text ── */
.loading-percent {
    font-size: 13px;
    font-weight: 600;
    color: #e8d48a;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 8px rgba(200, 168, 78, 0.35);
}

.loading-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ── Lootbox reward block ── */
.lootbox-reward {
    position: relative;
    flex: 0 0 auto;
    width: 84px;
    height: 96px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.lootbox-glow {
    position: absolute;
    width: 110px;
    height: 110px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle, rgba(255, 217, 106, 0.55) 0%, rgba(200, 168, 78, 0.25) 35%, transparent 65%);
    filter: blur(2px);
    animation: glow-pulse 2.4s ease-in-out infinite;
}

.lootbox-img {
    position: relative;
    width: 76px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 12px rgba(255, 217, 106, 0.4));
    animation: lootbox-float 3.2s ease-in-out infinite;
    transform-origin: 50% 80%;
}

.lootbox-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 9px;
    letter-spacing: 2px;
    color: #ffd96a;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(200, 168, 78, 0.7), 0 1px 2px rgba(0,0,0,0.9);
}

.lootbox-spark {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff4c2;
    box-shadow: 0 0 8px #ffd96a, 0 0 14px #c8a84e;
    opacity: 0;
}

.lootbox-spark.s1 { top: 10%; left: 18%; animation: spark 2.6s ease-in-out infinite 0.1s; }
.lootbox-spark.s2 { top: 24%; right: 12%; animation: spark 2.6s ease-in-out infinite 0.9s; }
.lootbox-spark.s3 { top: 50%; left: 8%;  animation: spark 2.6s ease-in-out infinite 1.7s; }

@keyframes lootbox-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -55%) scale(1); }
    50%      { opacity: 1;   transform: translate(-50%, -55%) scale(1.12); }
}

@keyframes spark {
    0%, 100% { opacity: 0; transform: scale(0.4); }
    40%      { opacity: 1; transform: scale(1.1); }
    70%      { opacity: 0.4; transform: scale(0.8); }
}

/* ── Small screens ── */
@media (max-width: 480px) {
    #cs-unity-loading-bar { padding-bottom: 8vh; }
    .tip-stage { margin-bottom: 20px; min-height: 70px; }
    .lootbox-reward { width: 68px; height: 80px; }
    .lootbox-img { width: 62px; }
    .lootbox-glow { width: 92px; height: 92px; }
    .first-load-notice {
        margin-bottom: 16px;
        padding: 12px 14px;
        gap: 10px;
    }
    .notice-icon { flex: 0 0 24px; width: 24px; height: 24px; line-height: 24px; font-size: 15px; }
}

/* ── Orientation overlay ── */
#orientation-gif-container {
    display: none;
    position: fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
    background: #0a0a0f;
}

#orientation-gif {
    max-width: 150px;
    max-height: 150px;
}
