/* =========================================================
   AYJUNITY — HEART OF ASH WEB-PLAYER
   ========================================================= */

:root {
    color-scheme: dark;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(220, 161, 93, 0.18),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            #111419 0%,
            #0b0d10 70%
        );
}

.play-shell {
    min-height: 100vh;

    display: grid;
    grid-template-rows: auto 1fr auto;
}

.play-header {
    position: sticky;
    top: 0;
    z-index: 20;

    background: rgba(11, 13, 16, 0.82);
    border-bottom: 1px solid var(--color-border);

    backdrop-filter: blur(16px);
}

.play-header-inner {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.play-header-actions,
.play-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.play-main {
    display: grid;
    align-content: start;
    gap: 24px;

    padding: clamp(28px, 4vw, 52px) 0;
}

.play-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
}

.play-intro h1 {
    margin-bottom: 10px;

    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.95;
}

.play-intro p:last-child {
    margin-bottom: 0;
}

.desktop-note {
    flex: 0 0 auto;

    padding: 9px 13px;

    color: var(--color-text-muted);
    background: rgba(25, 29, 35, 0.72);

    border: 1px solid var(--color-border);
    border-radius: 999px;

    font-size: 0.8rem;
    font-weight: 680;
}

.play-stage-wrap {
    position: relative;
}

.unity-stage {
    position: relative;

    width: min(100%, 1440px);
    margin: 0 auto;

    overflow: hidden;
    aspect-ratio: 16 / 9;

    background: #050607;
    border: 1px solid rgba(220, 161, 93, 0.34);
    border-radius: clamp(16px, 2.5vw, 28px);

    box-shadow:
        0 34px 100px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

#unity-canvas {
    display: block;

    width: 100%;
    height: 100%;

    background: #050607;
    outline: none;
}

#unity-loading {
    position: absolute;
    inset: 0;
    z-index: 4;

    display: grid;
    place-items: center;

    padding: 32px;

    background:
        linear-gradient(
            180deg,
            rgba(5, 6, 7, 0.38),
            rgba(5, 6, 7, 0.88)
        ),
        url("../images/heart-of-ash/heart-of-ash-title.png")
            center / cover no-repeat;

    opacity: 1;
    visibility: visible;

    transition:
        opacity 300ms ease,
        visibility 300ms ease;
}

#unity-loading.is-complete {
    opacity: 0;
    visibility: hidden;
}

.loading-card {
    width: min(470px, 100%);
    padding: clamp(24px, 4vw, 34px);

    text-align: center;

    background: rgba(11, 13, 16, 0.84);
    border: 1px solid rgba(220, 161, 93, 0.38);
    border-radius: var(--radius-medium);

    box-shadow:
        0 24px 72px rgba(0, 0, 0, 0.45);

    backdrop-filter: blur(16px);
}

.loading-card h2 {
    margin-bottom: 8px;
}

.loading-card p {
    margin-bottom: 22px;
}

.progress-track {
    height: 10px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.09);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

#unity-progress-bar {
    width: 0;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--color-accent),
            var(--color-accent-light)
        );

    border-radius: inherit;

    transition: width 120ms linear;
}

#unity-progress-text {
    display: block;
    margin-top: 12px;

    color: var(--color-text-muted);

    font-size: 0.88rem;
}

#unity-warning {
    position: absolute;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 8;

    display: grid;
    gap: 8px;

    pointer-events: none;
}

#unity-warning > div {
    padding: 12px 14px;

    color: #f7f3ea;
    background: rgba(13, 15, 18, 0.94);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);

    box-shadow: var(--shadow-card);
}

#unity-warning > .warning {
    border-color: rgba(220, 161, 93, 0.65);
}

#unity-warning > .error {
    border-color: rgba(220, 85, 85, 0.8);
}

.unity-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 6;

    display: flex;
    gap: 10px;
}

.unity-control-button {
    min-height: 42px;
    padding: 0 15px;

    color: var(--color-text);
    background: rgba(13, 15, 18, 0.84);

    border: 1px solid var(--color-border-strong);
    border-radius: 999px;

    font: inherit;
    font-size: 0.8rem;
    font-weight: 730;

    cursor: pointer;
    backdrop-filter: blur(10px);

    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.unity-control-button:hover,
.unity-control-button:focus-visible {
    transform: translateY(-1px);

    background: rgba(28, 31, 36, 0.94);
    border-color: var(--color-accent);
}

.unity-control-button:disabled {
    opacity: 0.45;
    cursor: wait;
}

.play-error {
    position: absolute;
    inset: 0;
    z-index: 9;

    display: none;
    place-items: center;

    padding: 32px;

    background: rgba(5, 6, 7, 0.96);
}

.play-error.is-visible {
    display: grid;
}

.error-card {
    max-width: 620px;
    padding: 30px;

    text-align: center;

    background: var(--color-surface);
    border: 1px solid rgba(220, 85, 85, 0.72);
    border-radius: var(--radius-medium);
}

.play-info-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.play-info-card {
    padding: 24px;

    background:
        linear-gradient(
            145deg,
            rgba(220, 161, 93, 0.055),
            transparent 58%
        ),
        var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
}

.play-info-card h2,
.play-info-card h3 {
    margin-bottom: 8px;

    font-size: 1.15rem;
}

.play-info-card p:last-child {
    margin-bottom: 0;
}

.play-footer {
    padding: 26px 0;

    background: var(--color-background-soft);
    border-top: 1px solid var(--color-border);
}

.play-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.play-footer p {
    margin: 0;

    font-size: 0.86rem;
}

.play-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.mobile-blocker {
    display: none;
}

@media (max-width: 980px) {
    .play-intro,
    .play-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .play-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .play-header-inner {
        min-height: 64px;
    }

    .play-header-actions .button-secondary {
        display: none;
    }

    .unity-stage {
        min-height: 440px;
        aspect-ratio: auto;
    }

    .mobile-blocker {
        position: absolute;
        inset: 0;
        z-index: 12;

        display: grid;
        place-items: center;

        padding: 28px;

        text-align: center;

        background:
            linear-gradient(
                rgba(5, 6, 7, 0.82),
                rgba(5, 6, 7, 0.96)
            ),
            url("../images/heart-of-ash/heart-of-ash-title.png")
                center / cover no-repeat;
    }

    .mobile-blocker > div {
        max-width: 420px;
        padding: 24px;

        background: rgba(13, 15, 18, 0.9);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-medium);
    }
}

@media (max-width: 560px) {
    .play-header-actions .button {
        padding-inline: 14px;
    }

    .play-status-row {
        gap: 8px;
    }

    .unity-controls {
        right: 10px;
        bottom: 10px;
        left: 10px;

        justify-content: flex-end;
    }

    .unity-control-button:first-child {
        display: none;
    }
}