@font-face {
    font-family: Jersey;
    src: url('../fonts/jersey-10/regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

/* Shared with the mobile Sunset/Dark themes and PixelTactile metrics. */
:root {
    color-scheme: light dark;
    --background: #fff8f1;
    --surface: #fff;
    --primary: #ea580c;
    --primary-dark: #9a3412;
    --primary-soft: #fed7aa;
    --accent-soft: #ccfbf1;
    --text: #1c1917;
    --text-muted: #78716c;
    --border: #e7e5e4;
    --experience: #facc15;
    --experience-track: #fff8e8;
    --raised-edge: #fff;
    --card-shadow-opacity: .25;
    --badge-shadow: #fed7aa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-wrap: anywhere;
}
button, a { touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary-dark); outline-offset: 4px; }
.page {
    max-width: 390px;
    margin: 0 auto;
    padding: 23px 22px max(16px, env(safe-area-inset-bottom));
    container-type: inline-size;
}
.brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; }
.brand-mark { width: 24px; height: 26px; color: var(--primary-dark); }
.wordmark { font: 40px/1 Jersey, sans-serif; letter-spacing: -.8px; }

.hero-shell { position: relative; margin: 0 3px 3px 0; }
.hero-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translate(3px, 3px);
    border-radius: 12px;
    background: var(--primary-dark);
    opacity: var(--card-shadow-opacity);
}
.hero {
    height: 202px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 2px solid var(--primary);
    border-top-color: var(--raised-edge);
    border-left-color: var(--raised-edge);
    border-radius: 12px;
    background: var(--surface);
}
.arena-left, .arena-right { position: absolute; inset: 0 50% 0 0; z-index: -1; background: var(--accent-soft); opacity: .8; }
.arena-right { inset: 0 0 0 50%; background: var(--primary-soft); }
.arena-divider { position: absolute; left: 50%; top: 0; bottom: 35px; width: 1px; background: var(--border); transform: rotate(15deg); z-index: -1; }
.hero-header { position: absolute; left: 11px; top: 10px; right: 8px; display: flex; align-items: center; justify-content: space-between; gap: 4px; z-index: 4; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid var(--primary);
    border-top-color: var(--raised-edge);
    border-left-color: var(--raised-edge);
    box-shadow: 3px 3px 0 var(--badge-shadow);
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 8px;
    padding: 5px 9px;
    min-height: 30px;
    font: 17px/18px Jersey, sans-serif;
}
.badge svg { width: 15px; height: 15px; flex-shrink: 0; }
.motion-control { height: 44px; width: 44px; flex-shrink: 0; padding: 12px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; color: var(--text-muted); }
.motion-control svg { width: 15px; height: 15px; }
.motion-control .play-icon, .motion-control[aria-pressed='true'] .pause-icon { display: none; }
.motion-control[aria-pressed='true'] .play-icon { display: block; }
.characters { position: absolute; left: 6px; right: 6px; top: 40px; height: 131px; display: flex; justify-content: space-between; align-items: center; }
.character { position: relative; width: 46%; height: 100%; display: grid; place-items: center; --sprite-size: 136px; }
.character::after { content: ''; position: absolute; width: 81%; height: 10px; bottom: 5px; border-radius: 50%; background: var(--text); opacity: .1; z-index: -1; }
.character-inner { position: relative; }
.orientation { transform: scaleX(-1); }
.sprite { position: relative; width: var(--sprite-size); height: var(--sprite-size); }
.sprite img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.sprite-capybud { --frames: 16; --duration: 1.333333s; }
.sprite-melefire { --frames: 8; --duration: .727273s; }
.sprite-animation { display: none; position: absolute; inset: 0; background-size: calc(var(--frames) * 100%) 100%; background-repeat: no-repeat; image-rendering: pixelated; }
.connection {
    position: absolute;
    left: 50%;
    top: 110px;
    transform: translate(-50%, -50%);
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    color: var(--primary-dark);
    background: var(--surface);
    border: 2px solid var(--primary);
    border-top-color: var(--raised-edge);
    border-left-color: var(--raised-edge);
    border-radius: 8px;
    box-shadow: 3px 3px 0 var(--badge-shadow);
    font: 24px/1 Jersey, sans-serif;
    z-index: 3;
}
.spark { position: absolute; width: 5px; height: 5px; background: var(--experience); opacity: .8; left: 26px; top: 88px; }
.spark-second { left: auto; right: 34px; top: 80px; width: 4px; height: 4px; }
.hero-foot { position: absolute; left: 12px; right: 12px; bottom: 11px; display: flex; align-items: center; gap: 10px; }
.hero-foot > span { flex-shrink: 0; max-width: calc(100% - 65px); font: 17px/18px Jersey, sans-serif; }
.progress-shell { height: 14px; flex: 1; position: relative; margin-right: 3px; min-width: 45px; }
.progress-shell::before { content: ''; position: absolute; inset: 0; transform: translate(2px, 2px); background: var(--experience); border-radius: 6px; opacity: .4; }
.progress { position: absolute; inset: 0; border: 2px solid var(--border); border-top-color: var(--raised-edge); border-left-color: var(--raised-edge); border-radius: 6px; background: var(--experience-track); overflow: hidden; }
.progress-fill { height: 100%; width: 100%; transform: scaleX(.8); transform-origin: left; background: var(--experience); }
.energy { position: absolute; top: 108px; left: 50%; width: 70px; height: 70px; transform: translate(-50%, -50%) scale(.7); background: var(--experience); clip-path: polygon(50% 0, 60% 35%, 85% 15%, 70% 45%, 100% 50%, 65% 60%, 85% 90%, 55% 70%, 50% 100%, 40% 65%, 10% 85%, 30% 55%, 0 50%, 35% 40%, 15% 15%, 45% 30%); opacity: 0; pointer-events: none; }

.intro { text-align: center; padding: 20px 0 16px; }
.eyebrow { font-size: 10px; line-height: 16px; letter-spacing: 1.2px; font-weight: 800; text-transform: uppercase; color: var(--primary-dark); margin: 0 0 9px; }
h1 { font: 53px/.9 Jersey, sans-serif; letter-spacing: -.8px; margin: 0; }
h1 span { display: block; color: var(--primary-dark); }
.body { font-size: 14px; line-height: 21px; color: var(--text-muted); margin: 15px auto 0; min-height: 63px; max-width: 325px; text-wrap: pretty; }
.body strong { color: var(--text); font-weight: 600; }
.stores { display: grid; gap: 9px; }
.store { position: relative; margin: 0 3px 3px 0; display: block; color: #fff; text-decoration: none; border-radius: 10px; }
.store::before { content: ''; position: absolute; inset: 0; background: var(--primary-dark); transform: translate(3px, 3px); border-radius: 10px; }
.store-face {
    position: relative;
    min-height: 52px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid var(--primary-dark);
    border-top-color: var(--raised-edge);
    border-left-color: var(--raised-edge);
    border-radius: 10px;
    background: var(--primary);
    font: 24px/25px Jersey, sans-serif;
    transition: transform 120ms cubic-bezier(.16, 1, .3, 1);
}
.store-face svg { width: 22px; height: 22px; flex-shrink: 0; }
.store:active .store-face { transform: translate(3px, 3px); }
.store:active::before { opacity: 0; }
.availability, .soon { font-size: 12px; text-align: center; color: var(--text-muted); }
.availability { margin: 11px 0 0; }
.soon { margin: 0; }
footer { margin-top: 15px; text-align: center; color: var(--text-muted); font-size: 11px; }
footer nav, footer > div { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
footer a { color: inherit; min-height: 44px; display: inline-flex; align-items: center; padding: 6px 8px; text-underline-offset: 3px; }
footer a[aria-current='page'] { color: var(--primary-dark); font-weight: 800; }

/* Enhancement only: static images, message and store links do not depend on JS. */
.has-motion .sprite.is-loaded img { visibility: hidden; }
.has-motion .sprite.is-loaded .sprite-animation { display: block; animation: sprite-idle var(--duration) steps(var(--frames)) infinite; }
.has-motion .progress-fill { animation: progress 5s cubic-bezier(.16, 1, .3, 1) both; }
.has-motion .energy { animation: energy 5s ease both; }
.has-motion .character:first-child .character-inner { animation: approach-left 5s ease both; }
.has-motion .character:last-child .character-inner { animation: approach-right 5s ease both; }
.is-paused * { animation-play-state: paused !important; }

@keyframes sprite-idle { to { background-position: calc(var(--sprite-size) * var(--frames) * -1) 0; } }
@keyframes progress { 0%, 22% { transform: scaleX(.3); } 52%, 100% { transform: scaleX(.8); } }
@keyframes energy {
    0%, 31%, 50%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.65); }
    39% { opacity: .32; transform: translate(-50%, -50%) scale(1.12); }
}
@keyframes approach-left { 0%, 29%, 53%, 100% { transform: translateX(0); } 37% { transform: translateX(10px); } 45% { transform: translateX(-3px); } }
@keyframes approach-right { 0%, 29%, 53%, 100% { transform: translateX(0); } 37% { transform: translateX(-10px); } 45% { transform: translateX(3px); } }

@media (prefers-color-scheme: dark) {
    :root {
        --background: #080a0c;
        --surface: #15181b;
        --primary: #c2410c;
        --primary-dark: #fdba74;
        --primary-soft: #4a1d0a;
        --accent-soft: #103b3a;
        --text: #f5f5f4;
        --text-muted: #a8a29e;
        --border: #353a3f;
        --experience: #f59e0b;
        --experience-track: #3a2a0b;
        --raised-edge: #353a3f;
        --card-shadow-opacity: .42;
        --badge-shadow: #c2410c66;
    }
}

@media (max-width: 450px) {
    .page { padding: 22px 18px max(12px, env(safe-area-inset-bottom)); }
    .hero { height: 198px; }
    .characters { top: 39px; }
    .hero-foot { bottom: 10px; }
}

@container (max-width: 290px) {
    .character { --sprite-size: 112px; }
    h1 { font-size: 46px; }
    .body { font-size: 13px; line-height: 20px; }
    .hero-foot { gap: 7px; }
    .hero-foot > span { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .has-motion .sprite.is-loaded img { visibility: visible; }
    .has-motion .sprite.is-loaded .sprite-animation, .motion-control { display: none; }
}
