html {
    height: 100%;
    width: 100%;
    background-color: #062647;
}

:root {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #062647;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.start-screen {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1rem, 4vw, 2.5rem);
    width: min(600px, 100%);
}

[hidden] {
    display: none !important;
}

.menu-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.banner-stack {
    position: relative;
    width: min(460px, 90vw);
}

.banner-bg {
    width: 100%;
    height: auto;
    display: block;
}

.banner-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.title-image {
    width: min(80%, 320px);
    height: auto;
    padding-bottom: 10%;
}

.language-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.flag-btn {
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.flag-btn img {
    width: clamp(70px, 15vw, 110px);
    height: auto;
    display: block;
}

.flag-btn:hover {
    transform: translateY(-2px);
}

.flag-btn.is-active {
    border-color: #f2c744;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-4px);
}

.instructions-text {
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    width: 100%;
    height: auto;
}

.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
}

.share-label {
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    backdrop-filter: blur(10px);
}

.share-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.share-btn--facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-btn--twitter:hover {
    background: #000000;
    border-color: #000000;
}

.share-btn--linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
}

.share-btn--email:hover {
    background: #ea4335;
    border-color: #ea4335;
}

.actions-group {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.starfield {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: var(--star-size, 32px);
    height: var(--star-size, 32px);
    min-width: 16px;
    min-height: 16px;
    object-fit: contain;
    opacity: 0;
    filter: brightness(1.3);
    display: block;
    will-change: opacity, transform;
}

#application-canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
#application-canvas.fill-mode-NONE {
    margin: auto;
}
#application-canvas.fill-mode-KEEP_ASPECT {
    width: 100%;
    height: auto;
    margin: 0;
}
#application-canvas.fill-mode-FILL_WINDOW {
    width: 100%;
    height: 100%;
    margin: 0;
}

canvas:focus {
    outline: none;
}

.cta-btn {
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #ffffff;
    background: #5b7e5a;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.05em;
    font-weight: 600;
    min-width: 140px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.4);
}

.cta-btn:active {
    transform: translateY(1px);
}

.cta-btn--secondary {
    background: #b05e57;
}

.video-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-overlay[hidden] {
    display: none !important;
}

.video-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.video-overlay__content {
    position: relative;
    z-index: 11;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.video-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 12;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.video-overlay__close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

@keyframes starLife {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(var(--initial-rotation, 0deg));
    }
    15% {
        opacity: 0.8;
        transform: scale(1) rotate(var(--initial-rotation, 0deg));
    }
    85% {
        opacity: 0.8;
        transform: scale(1) rotate(var(--rotation-end, 0deg));
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(var(--rotation-end, 0deg));
    }
}


@keyframes starDeath {
    0% {
        opacity: 0.8;
        transform: scale(1) rotate(var(--rotation-end, 0deg));
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(var(--rotation-end, 0deg));
    }
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.6;
        filter: brightness(1.2);
    }
    50% {
        opacity: 1;
        filter: brightness(1.5);
    }
}
