body {
    margin: 0px;
    padding: 0px;
    width: 100%;
    height: 100%;
    background-color: #004c3d;
    font-family: "Myriad Pro", Myriad, "Helvetica Neue", Helvetica, Arial, sans-serif;
    overflow: hidden;
    overscroll-behavior: none;
}

#unity-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

#unity-canvas {
    width: 100%;
    height: 100%;
}

/* --- Spine scene (full-screen animated background) --- */
#spine-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    /* Sunset-toned fallback while the scene loads */
    background: linear-gradient(180deg, #f6c98f 0%, #f4a06a 45%, #d98a63 100%);
}

#unity-loading-bar {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* --- Wooden loading bar --- */
#loader-bar {
    position: absolute;
    left: 50%;
    bottom: 10%;                    /* vertical position of the whole bar */
    transform: translateX(-50%);

    /* ============ TUNABLE KNOBS (edit these) ============ */
    --bar-width: min(70vw, 700px);  /* LENGTH of the whole bar (= max width of the fill line) */
    --bar-cap: 11%;                 /* bar THICKNESS + wooden-cap/chicken size (fraction of the length) */
    --fill-height: 65%;            /* HEIGHT of the red fill line inside the groove (100% = fills the groove) */
    /* ==================================================== */

    width: var(--bar-width);
}

.track {
    display: flex;
    align-items: stretch;
    width: 100%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.track-cap {
    height: auto;
    width: auto;
    display: block;
    flex: 0 0 auto;
}

.track-cap.track-left  { align-self: stretch; }

/* Left/right caps keep their natural aspect; sized by the --bar-cap fraction.
   Smaller fraction => thinner bar + longer center. */
.track-left  { width: var(--bar-cap); }
.track-right { width: var(--bar-cap); }

.track-center {
    flex: 1 1 auto;
    align-self: stretch;
    background-image: url("Progress_Track_Center.png");
    background-repeat: no-repeat;
    background-position: center;
    /* Same scale as the caps. The two numbers are the PNG HEIGHTS:
         196 = Progress_Track_Center.png height (numerator)
         196 = Progress_Track_Left/Right.png height (denominator)
       Both are 196 now, so this equals 100%. If you swap in a center png of a
       different height, just change the first 196 to its height. */
    background-size: 100% calc(100% * 196 / 196);
}

.fill-groove {
    position: absolute;
    /* Maroon opening of the track art: groove starts ~44.7% into the left cap
       and ends ~57% into the right cap, spanning the middle 80% of the height
       (measured from the pngs). Offsets track --bar-cap automatically. */
    left: calc(var(--bar-cap) * 0.447);
    right: calc(var(--bar-cap) * 0.43);
    top: 10%;
    bottom: 10%;
    overflow: visible;
}

#fill {
    position: absolute;
    left: -7px;
    top: 47%;
    transform: translateY(-47%);
    height: var(--fill-height);     /* red fill line height (see knobs above) */
    width: 0%;
    /* Two rounded caps meeting = the smallest possible pill (caps can't overlap) */
    min-width: 15%;
    display: flex;
    align-items: center;
    transition: width 0.15s linear;
}

.fill-cap {
    display: block;
    width: auto;
    height: 100%;
    flex: 0 0 auto;
}

/* Center is attached to the left cap and grows to the right as progress rises */
.fill-center {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background-image: url("Fill_center.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

.fill-right-wrap {
    position: relative;
    height: 100%;
    flex: 0 0 auto;
}

.fill-right-wrap .fill-cap {
    height: 100%;
}

#loader-chicken {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 150%;
    width: auto;
    pointer-events: none;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
}

#unity-fullscreen-button {
    height: 32px;
    width: 32px;
    position: absolute;
    z-index: 1;
    bottom: 10px;
    left: 10px;
    background-color: transparent;
    background-image: url("fullscreen-button-out.png");
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    opacity: 0.333;
}

#unity-fullscreen-button:hover {
    opacity: 1.0;
}

#unity-warning {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%);
    background: white;
    padding: 10px;
    display: none;
    z-index: 200;
}

/* --- Splash Screen --- */
#custom-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.splash-logo {
    display: flex;
    align-items: center;
    gap: 18px;
}

.splash-logo-four {
    height: min(16vw, 110px);
    width: auto;
    opacity: 0;
    filter: brightness(.9);
}

.splash-logo-friends {
    height: min(7vw, 56px);
    width: auto;
    opacity: 0;
    transform: translateX(-8px);
}

/* The logo animation only starts once the user has pressed START
   (so the sound and the logo appear at the exact same moment). */
#custom-splash.playing .splash-logo-four {
    animation: fourFlicker 1.9s ease forwards;
}

#custom-splash.playing .splash-logo-friends {
    animation: friendsReveal .9s ease forwards;
    animation-delay: 1.7s;
}

/* --- START gate (a user click here unlocks audio playback) --- */
#start-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: #000000;
    z-index: 10000;
}

#start-screen.hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.start-card {
    width: min(520px, 100%);
    padding: 38px 32px;
    text-align: center;
    background: rgba(5, 10, 14, .72);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
    backdrop-filter: blur(14px);
    box-sizing: border-box;
}

.start-btn {
    font-family: inherit;
    font-weight: 700;                 /* bold */
    font-size: clamp(18px, 4vw, 24px);
    letter-spacing: .06em;
    color: #111;                      /* black text */
    /* green with a downward glow */
    background: linear-gradient(180deg, #daf97a 0%, #b8ea49 100%);
    box-shadow: 0 12px 30px rgba(200, 242, 90, .25);
    border: none;
    border-radius: 16px;
    padding: 16px 56px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease;
}

.start-btn:hover {
    box-shadow: 0 16px 40px rgba(200, 242, 90, .4);
}

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

#custom-splash.fade-out {
    pointer-events: none;
    animation: splashFadeOut 0.8s ease-in-out forwards;
}

@keyframes fourFlicker {
    0%   { opacity: 0;   filter: brightness(.1)  drop-shadow(0 0 0   rgba(200,242,90,0)) }
    8%   { opacity: .18 }
    14%  { opacity: .04 }
    22%  { opacity: .45 }
    28%  { opacity: .16 }
    40%  { opacity: .72; filter: brightness(1.05) drop-shadow(0 0 8px  rgba(200,242,90,.25)) }
    52%  { opacity: .28 }
    66%  { opacity: .92; filter: brightness(1.15) drop-shadow(0 0 22px rgba(200,242,90,.45)) }
    78%  { opacity: .76 }
    100% { opacity: 1;   filter: brightness(1.2)  drop-shadow(0 0 26px rgba(200,242,90,.55)) }
}

@keyframes friendsReveal {
    from { opacity: 0; transform: translateX(-10px) }
    to   { opacity: 1; transform: none }
}

@keyframes splashFadeOut {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}
