:root {
    --ink: #20153f;
    --ink-soft: #625a75;
    --paper: #fffdf7;
    --paper-lilac: #f5f0ff;
    --midnight: #24144d;
    --midnight-light: #41206f;
    --purple: #7653dc;
    --purple-deep: #5734b6;
    --gold: #ffd95a;
    --coral: #ff735f;
    --mint: #70dcc0;
    --line: rgba(50, 31, 88, 0.12);
    --font-display: "Fredoka", "Noto Sans TC", system-ui, sans-serif;
    --font-body: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --page-width: 1280px;
    --shadow-soft: 0 20px 55px rgba(52, 32, 90, 0.11);
    --shadow-card: 0 14px 32px rgba(50, 31, 88, 0.09);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 1rem;
    background: var(--paper-lilac);
    -webkit-tap-highlight-color: transparent;
}

body {
    position: relative;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 3% 16%, rgba(255, 217, 90, 0.28), transparent 22rem),
        radial-gradient(circle at 96% 12%, rgba(121, 82, 221, 0.18), transparent 24rem),
        linear-gradient(180deg, #fbf8ff 0%, #f6f1ff 48%, #fff9ed 100%);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
}

button {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

::selection {
    color: var(--midnight);
    background: var(--gold);
}

:focus-visible {
    outline: 4px solid var(--gold);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: var(--midnight);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 180ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

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

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.8;
}

.ambient-orb--one {
    top: 42rem;
    left: -8rem;
    width: 22rem;
    height: 22rem;
    background: rgba(255, 129, 111, 0.1);
}

.ambient-orb--two {
    top: 78rem;
    right: -10rem;
    width: 28rem;
    height: 28rem;
    background: rgba(78, 196, 186, 0.12);
}

.ambient-orb--three {
    top: 125rem;
    left: 25%;
    width: 18rem;
    height: 18rem;
    background: rgba(255, 217, 90, 0.1);
}

.ambient-star {
    position: absolute;
    color: rgba(90, 55, 160, 0.18);
    font-family: var(--font-display);
    animation: ambientDrift 10s ease-in-out infinite;
}

.ambient-star--one {
    top: 18rem;
    left: 2.2%;
    font-size: 2rem;
}

.ambient-star--two {
    top: 56rem;
    right: 3%;
    font-size: 2.8rem;
    animation-delay: -3s;
}

.ambient-star--three {
    top: 102rem;
    left: 4%;
    font-size: 1.6rem;
    animation-delay: -6s;
}

.ambient-star--four {
    top: 146rem;
    right: 6%;
    font-size: 2.3rem;
    animation-delay: -8s;
}

.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 3rem), var(--page-width));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 1.4rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.9rem;
    height: 2.9rem;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 1rem;
    color: var(--midnight);
    background: var(--gold);
    box-shadow: 0 8px 18px rgba(88, 59, 20, 0.18);
    font-size: 1.25rem;
    transform: rotate(-7deg);
    transition: transform 200ms ease;
}

.brand:hover .brand-mark {
    transform: rotate(8deg) scale(1.05);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-copy strong {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.12em;
}

.brand-copy small {
    margin-top: 0.25rem;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.game-total {
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 600;
}

.game-total b {
    color: var(--purple-deep);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.save-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.8rem;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(51, 32, 91, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 22px rgba(47, 30, 81, 0.08);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.save-button span {
    color: var(--purple-deep);
    font-size: 1.15rem;
}

.save-button:hover {
    color: #fff;
    background: var(--midnight);
    box-shadow: 0 12px 26px rgba(37, 22, 79, 0.2);
    transform: translateY(-2px);
}

.save-button:hover span {
    color: var(--gold);
}

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 575px;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 2.75rem;
    color: #fff;
    background:
        radial-gradient(circle at 82% 38%, rgba(255, 220, 91, 0.22), transparent 26%),
        linear-gradient(135deg, #211343 0%, #392063 50%, #642a72 100%);
    box-shadow:
        0 32px 70px rgba(42, 24, 77, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hero::before,
.hero::after {
    position: absolute;
    z-index: -1;
    content: "";
    border-radius: 50%;
}

.hero::before {
    top: -15rem;
    right: -10rem;
    width: 38rem;
    height: 38rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 0 0 4rem rgba(255, 255, 255, 0.025),
        0 0 0 9rem rgba(255, 255, 255, 0.018);
}

.hero::after {
    bottom: -5rem;
    left: 42%;
    width: 16rem;
    height: 16rem;
    background: rgba(255, 114, 94, 0.12);
    filter: blur(3rem);
}

.hero-pattern {
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: 0.18;
    background-image:
        radial-gradient(circle, #fff 1.2px, transparent 1.2px),
        radial-gradient(circle, #fff 1px, transparent 1px);
    background-position: 0 0, 23px 23px;
    background-size: 46px 46px;
    mask-image: linear-gradient(90deg, transparent 8%, #000 48%, #000 100%);
}

.hero-copy {
    position: relative;
    z-index: 5;
    align-self: center;
    padding: 4rem 1rem 4rem 4.5rem;
    animation: copyReveal 700ms 80ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    color: #f3dfff;
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.eyebrow span {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border-radius: 50%;
    color: var(--midnight);
    background: var(--gold);
    line-height: 1;
}

.hero h1 {
    max-width: 780px;
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(3rem, 5.2vw, 4.65rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.hero h1 em {
    position: relative;
    display: inline-block;
    color: var(--gold);
    font-style: normal;
}

.hero h1 em::after {
    position: absolute;
    right: 0.08em;
    bottom: -0.11em;
    left: 0.08em;
    height: 0.12em;
    content: "";
    border-radius: 999px;
    background: var(--coral);
    transform: rotate(-1.2deg);
}

.hero-description {
    max-width: 36rem;
    margin: 1.7rem 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 1.02rem;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 2rem;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 3.6rem;
    padding: 0.8rem 1.25rem 0.8rem 1.45rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    color: var(--midnight);
    background: var(--gold);
    box-shadow:
        0 8px 0 #c99d26,
        0 14px 28px rgba(14, 7, 34, 0.28);
    font-weight: 800;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action span {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--midnight);
    transition: transform 180ms ease;
}

.primary-action:hover {
    background: #ffe785;
    box-shadow:
        0 5px 0 #c99d26,
        0 10px 24px rgba(14, 7, 34, 0.25);
    transform: translateY(3px);
}

.primary-action:hover span {
    transform: translateY(2px);
}

.hero-actions p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
}

.hero-actions p strong {
    color: rgba(255, 255, 255, 0.92);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 2.2rem 0 0;
    padding: 0;
    list-style: none;
}

.hero-tags li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.76rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.hero-tags li span {
    display: grid;
    min-width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border-radius: 50%;
    color: var(--midnight);
    background: rgba(255, 255, 255, 0.84);
    font-family: var(--font-display);
    font-size: 0.64rem;
    font-weight: 700;
}

.hero-visual {
    position: relative;
    z-index: 2;
    align-self: stretch;
    min-width: 0;
}

.hero-visual::before {
    position: absolute;
    bottom: 0.8rem;
    left: 50%;
    width: min(91%, 31rem);
    aspect-ratio: 1;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 217, 90, 0.34), rgba(255, 217, 90, 0.08) 49%, transparent 70%);
    transform: translateX(-50%);
}

.hero-visual img {
    position: absolute;
    z-index: 3;
    top: 1rem;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: calc(100% - 1rem);
    object-fit: contain;
    object-position: center bottom;
    max-width: none;
    filter: drop-shadow(0 25px 28px rgba(12, 5, 30, 0.33));
    animation: mascotReveal 900ms 160ms cubic-bezier(0.17, 0.85, 0.25, 1.15) both, mascotFloat 5.5s 1.2s ease-in-out infinite;
    transform-origin: 50% 72%;
}

.orbit {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit::before,
.orbit::after {
    position: absolute;
    top: 50%;
    width: 0.55rem;
    height: 0.55rem;
    content: "";
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 16px rgba(255, 217, 90, 0.85);
}

.orbit::before {
    left: -0.3rem;
}

.orbit::after {
    right: -0.3rem;
    background: var(--mint);
    box-shadow: 0 0 16px rgba(112, 220, 192, 0.85);
}

.orbit--outer {
    width: 29rem;
    height: 29rem;
    animation: orbitSpin 24s linear infinite;
}

.orbit--inner {
    width: 21rem;
    height: 21rem;
    border-style: dashed;
    animation: orbitSpinReverse 18s linear infinite;
}

.visual-star {
    position: absolute;
    z-index: 4;
    color: var(--gold);
    filter: drop-shadow(0 0 10px rgba(255, 217, 90, 0.7));
    animation: starTwinkle 2.8s ease-in-out infinite;
}

.visual-star--one {
    top: 11%;
    right: 12%;
    font-size: 2rem;
}

.visual-star--two {
    top: 23%;
    left: 3%;
    color: #fff;
    font-size: 1.4rem;
    animation-delay: -1s;
}

.visual-star--three {
    top: 57%;
    right: 2%;
    color: var(--mint);
    font-size: 1.6rem;
    animation-delay: -2s;
}

.hero-ticket {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 0.9rem;
    color: var(--midnight);
    background: #fff9e9;
    box-shadow: 0 12px 24px rgba(19, 9, 42, 0.22);
    font-family: var(--font-display);
    transform: rotate(var(--ticket-angle));
}

.hero-ticket b {
    font-size: 1.2rem;
    line-height: 1;
}

.hero-ticket span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.hero-ticket--top {
    --ticket-angle: 8deg;
    top: 20%;
    right: 4%;
}

.hero-ticket--bottom {
    --ticket-angle: -7deg;
    bottom: 12%;
    left: 3%;
    color: #fff;
    background: var(--coral);
}

.game-library {
    padding-top: 6.5rem;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.4rem;
}

.section-kicker {
    margin: 0 0 0.4rem;
    color: var(--purple-deep);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.17em;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 3.5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.045em;
}

.section-heading > div:first-child > p:last-child {
    margin: 0.7rem 0 0;
    color: var(--ink-soft);
}

.collection-stamp {
    display: grid;
    flex: 0 0 auto;
    width: 6.4rem;
    height: 6.4rem;
    place-content: center;
    border: 2px dashed rgba(82, 52, 158, 0.35);
    border-radius: 50%;
    color: var(--purple-deep);
    background: rgba(255, 255, 255, 0.65);
    text-align: center;
    transform: rotate(5deg);
}

.collection-stamp span,
.collection-stamp small {
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
}

.collection-stamp strong {
    margin-block: 0.1rem;
    font-family: var(--font-display);
    font-size: 2.3rem;
    line-height: 1;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
}

.game-card {
    --mx: 50%;
    --my: 50%;
    --rx: 0deg;
    --ry: 0deg;
    position: relative;
    isolation: isolate;
    display: flex;
    min-width: 0;
    min-height: 410px;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(45, 29, 77, 0.1);
    border-radius: 1.65rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    transform: perspective(950px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
    transform-style: preserve-3d;
    animation: cardReveal 620ms var(--delay) cubic-bezier(0.18, 0.83, 0.25, 1) both;
    transition: border-color 220ms ease, box-shadow 220ms ease, transform 160ms ease;
}

.game-card::before {
    position: absolute;
    z-index: 4;
    inset: 0;
    content: "";
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.52), transparent 32%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.game-card:hover {
    border-color: rgba(45, 29, 77, 0.18);
    box-shadow: 0 24px 45px rgba(50, 31, 88, 0.16);
    transform: perspective(950px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-7px);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:active {
    transform: perspective(950px) rotateX(0) rotateY(0) translateY(-1px) scale(0.985);
}

.card-art,
.card-content,
.card-category,
.card-title,
.card-description,
.card-cta {
    display: block;
}

.card-art {
    position: relative;
    display: grid;
    min-height: 175px;
    overflow: hidden;
    place-items: center;
    background:
        radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.4), transparent 24%),
        linear-gradient(135deg, var(--tone-1), var(--tone-2));
}

.card-art::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        linear-gradient(115deg, transparent 43%, rgba(255, 255, 255, 0.15) 44%, rgba(255, 255, 255, 0.15) 45%, transparent 46%),
        radial-gradient(circle, rgba(255, 255, 255, 0.34) 1px, transparent 1.5px);
    background-size: 100% 100%, 17px 17px;
    opacity: 0.62;
}

.card-art::after {
    position: absolute;
    bottom: -5.2rem;
    left: 50%;
    width: 15rem;
    height: 9rem;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    box-shadow:
        0 0 0 1.4rem rgba(255, 255, 255, 0.06),
        0 0 0 2.8rem rgba(255, 255, 255, 0.04);
    transform: translateX(-50%);
}

.card-number {
    position: absolute;
    z-index: 2;
    top: 0.9rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.card-icon {
    position: relative;
    z-index: 2;
    display: grid;
    width: 5.5rem;
    height: 5.5rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 2rem;
    color: #fff;
    background: rgba(28, 14, 59, 0.22);
    box-shadow:
        0 15px 30px rgba(29, 12, 60, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    font-family: var(--font-display);
    font-size: 2rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(8px);
    transform: rotate(-4deg);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), background 260ms ease;
}

.game-card:hover .card-icon {
    background: rgba(28, 14, 59, 0.35);
    transform: rotate(5deg) scale(1.08);
}

.card-spark {
    position: absolute;
    z-index: 2;
    color: #fff;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
    transition: transform 260ms ease;
}

.card-spark--one {
    top: 1.8rem;
    right: 1.4rem;
    font-size: 1.1rem;
}

.card-spark--two {
    right: 2.2rem;
    bottom: 1.3rem;
    font-size: 0.75rem;
}

.game-card:hover .card-spark--one {
    transform: translate(-4px, 5px) rotate(30deg) scale(1.25);
}

.game-card:hover .card-spark--two {
    transform: translate(3px, -3px) rotate(-25deg) scale(1.25);
}

.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 235px;
    flex: 1;
    flex-direction: column;
    padding: 1.25rem 1.25rem 1.15rem;
    background: rgba(255, 255, 255, 0.93);
}

.card-category {
    align-self: flex-start;
    padding: 0.25rem 0.58rem;
    border-radius: 999px;
    color: var(--card-ink);
    background: rgba(105, 75, 181, 0.08);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.card-title {
    margin-top: 0.75rem;
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.card-description {
    display: -webkit-box;
    margin-top: 0.55rem;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.83rem;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--card-ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.card-cta i {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--card-ink);
    font-size: 0.9rem;
    font-style: normal;
    transition: transform 200ms ease;
}

.game-card:hover .card-cta i {
    transform: rotate(12deg) scale(1.07);
}

.closing-note {
    display: grid;
    align-items: center;
    margin-block: 5.5rem 2.4rem;
    padding: 2rem 2.25rem;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    border: 1px solid rgba(43, 29, 75, 0.1);
    border-radius: 2rem;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 217, 90, 0.35), transparent 11rem),
        rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.closing-wand {
    display: grid;
    width: 4.2rem;
    height: 4.2rem;
    place-items: center;
    border-radius: 1.4rem;
    color: var(--gold);
    background: var(--midnight);
    box-shadow: 0 12px 22px rgba(37, 22, 79, 0.2);
    font-size: 1.8rem;
    transform: rotate(-7deg);
}

.closing-note p {
    margin: 0 0 0.2rem;
    color: var(--purple-deep);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.closing-note h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.35;
}

.closing-note > a {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.8rem 0.65rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.closing-note > a span {
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--purple-deep);
}

.closing-note > a:hover {
    color: #fff;
    background: var(--midnight);
    transform: translateY(-2px);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.5rem 2.2rem;
    color: var(--ink-soft);
    font-size: 0.72rem;
}

.site-footer p {
    margin: 0;
}

.site-footer p:first-child {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.12em;
}

.site-footer p:first-child span {
    color: var(--purple);
}

.install-dialog {
    width: min(92vw, 660px);
    max-height: 92vh;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 2rem;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 30px 90px rgba(20, 10, 46, 0.35);
}

.install-dialog:not([open]) {
    display: none;
}

.install-dialog::backdrop {
    background: rgba(27, 15, 55, 0.66);
    backdrop-filter: blur(8px);
}

.install-dialog[open] {
    animation: dialogPop 260ms cubic-bezier(0.2, 0.8, 0.2, 1.1) both;
}

.dialog-panel {
    position: relative;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: inherit;
    background:
        radial-gradient(circle at 90% 2%, rgba(255, 217, 90, 0.28), transparent 14rem),
        #fffdf8;
    text-align: center;
}

.dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.dialog-close:hover {
    color: #fff;
    background: var(--midnight);
    transform: rotate(6deg);
}

.dialog-magic {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin-inline: auto;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 1.35rem;
    color: var(--midnight);
    background: var(--gold);
    box-shadow: 0 12px 25px rgba(117, 78, 25, 0.18);
    font-size: 1.6rem;
    transform: rotate(-6deg);
}

.dialog-kicker {
    margin: 1rem 0 0.3rem;
    color: var(--purple-deep);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.dialog-panel h2 {
    margin: 0;
    font-size: clamp(1.65rem, 5vw, 2.25rem);
    line-height: 1.3;
}

.dialog-lead {
    margin: 0.55rem 0 1.6rem;
    color: var(--ink-soft);
}

.install-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    text-align: left;
}

.install-steps section {
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: rgba(245, 240, 255, 0.68);
}

.device-badge {
    display: inline-grid;
    min-width: 2.3rem;
    height: 2.3rem;
    padding-inline: 0.5rem;
    place-items: center;
    border-radius: 0.75rem;
    color: #fff;
    background: var(--midnight);
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 700;
}

.install-steps h3 {
    margin: 0.65rem 0 0.55rem;
    font-size: 1rem;
}

.install-steps ol {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.8;
}

.dialog-confirm {
    width: 100%;
    min-height: 3.2rem;
    margin-top: 1rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--midnight);
    box-shadow: 0 10px 24px rgba(37, 22, 79, 0.2);
    font-weight: 800;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.dialog-confirm:hover {
    background: var(--purple-deep);
    transform: translateY(-2px);
}

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

.magic-spark {
    position: fixed;
    left: var(--spark-x);
    top: var(--spark-y);
    color: var(--spark-color);
    font-family: var(--font-display);
    font-size: var(--spark-size);
    font-weight: 700;
    line-height: 1;
    filter: drop-shadow(0 0 5px currentColor);
    animation: sparkleBurst 620ms cubic-bezier(0.16, 0.78, 0.28, 1) forwards;
}

@keyframes copyReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mascotReveal {
    from {
        opacity: 0;
        transform: translateY(48px) rotate(3deg) scale(0.84);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

@keyframes mascotFloat {
    0%, 100% {
        transform: translateY(0) rotate(0);
    }
    50% {
        transform: translateY(-8px) rotate(0.6deg);
    }
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes orbitSpinReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0); }
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.45; transform: scale(0.75) rotate(0); }
    50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

@keyframes ambientDrift {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-14px) rotate(18deg); }
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: perspective(950px) translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: perspective(950px) translateY(0) scale(1);
    }
}

@keyframes dialogPop {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sparkleBurst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2) rotate(0);
    }
    24% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--spark-dx)), calc(-50% + var(--spark-dy))) scale(1.15) rotate(var(--spark-rotate));
    }
}

@media (max-width: 1120px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) minmax(350px, 0.82fr);
    }

    .hero-copy {
        padding-left: 3.2rem;
    }

    .hero h1 {
        font-size: clamp(2.9rem, 5.7vw, 4rem);
    }

    .game-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .site-header,
    main,
    .site-footer {
        width: min(calc(100% - 2rem), var(--page-width));
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding: 3.3rem 3rem 0;
        text-align: center;
    }

    .eyebrow,
    .hero-actions,
    .hero-tags {
        justify-content: center;
    }

    .hero-description {
        margin-inline: auto;
    }

    .hero-visual {
        min-height: 300px;
    }

    .hero-visual::before {
        width: min(82vw, 29rem);
    }

    .orbit--outer {
        width: 26rem;
        height: 26rem;
    }

    .orbit--inner {
        width: 19rem;
        height: 19rem;
    }

    .game-library {
        padding-top: 4rem;
    }

}

@media (max-width: 760px) {
    .game-total {
        display: none;
    }

    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.9rem;
    }

    .section-heading {
        align-items: center;
    }

    .game-card {
        min-height: 365px;
        border-radius: 1.35rem;
    }

    .card-art {
        min-height: 145px;
    }

    .card-content {
        min-height: 220px;
        padding: 1rem;
    }

    .card-title {
        font-size: 1.02rem;
    }

    .closing-note {
        grid-template-columns: auto 1fr;
    }

    .closing-note > a {
        display: none;
    }
}

@media (max-width: 620px) {
    .site-header,
    main,
    .site-footer {
        width: min(calc(100% - 1.25rem), var(--page-width));
    }

    .site-header {
        padding-block: 0.9rem;
    }

    .brand {
        gap: 0.55rem;
    }

    .brand-mark {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.85rem;
    }

    .brand-copy strong {
        font-size: 0.78rem;
    }

    .brand-copy small {
        font-size: 0.66rem;
    }

    .save-button {
        min-height: 2.45rem;
        padding-inline: 0.8rem;
        font-size: 0.76rem;
    }

    .hero {
        border-radius: 1.8rem;
    }

    .hero-copy {
        padding: 2.7rem 1.2rem 0;
    }

    .eyebrow {
        margin-bottom: 0.8rem;
        font-size: 0.72rem;
        letter-spacing: 0.09em;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 11.2vw, 3.2rem);
        letter-spacing: -0.06em;
    }

    .hero-description {
        margin-top: 1.25rem;
        font-size: 0.9rem;
        line-height: 1.75;
    }

    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .primary-action {
        min-height: 3.25rem;
        box-shadow: 0 6px 0 #c99d26, 0 12px 24px rgba(14, 7, 34, 0.25);
        font-size: 0.9rem;
    }

    .hero-tags {
        margin-top: 1.8rem;
    }

    .hero-tags li {
        padding: 0.34rem 0.55rem;
        font-size: 0.68rem;
    }

    .hero-visual {
        min-height: 260px;
    }

    .hero-visual img {
        top: 0.75rem;
        height: calc(100% - 2rem);
    }

    .hero-ticket--top {
        top: 13%;
        right: 5%;
    }

    .hero-ticket--bottom {
        bottom: 11%;
        left: 4%;
    }

    .orbit--outer {
        width: 21rem;
        height: 21rem;
    }

    .orbit--inner {
        width: 15rem;
        height: 15rem;
    }

    .game-library {
        padding-top: 3rem;
    }

    .section-heading {
        margin-bottom: 1.6rem;
    }

    .section-heading h2 {
        font-size: 1.8rem;
    }

    .section-heading > div:first-child > p:last-child {
        font-size: 0.83rem;
    }

    .collection-stamp {
        width: 5rem;
        height: 5rem;
    }

    .collection-stamp span {
        display: none;
    }

    .collection-stamp strong {
        font-size: 1.9rem;
    }

    .game-card {
        min-height: 340px;
    }

    .card-art {
        min-height: 125px;
    }

    .card-icon {
        width: 4.4rem;
        height: 4.4rem;
        border-radius: 1.45rem;
        font-size: 1.6rem;
    }

    .card-number {
        top: 0.7rem;
        left: 0.75rem;
    }

    .card-spark--one {
        top: 1rem;
        right: 0.8rem;
    }

    .card-spark--two {
        right: 1rem;
        bottom: 0.8rem;
    }

    .card-content {
        min-height: 215px;
        padding: 0.9rem;
    }

    .card-category {
        font-size: 0.62rem;
    }

    .card-title {
        margin-top: 0.58rem;
        font-size: 0.92rem;
    }

    .card-description {
        margin-top: 0.42rem;
        font-size: 0.73rem;
        line-height: 1.6;
    }

    .card-cta {
        padding-top: 0.7rem;
        font-size: 0.7rem;
    }

    .card-cta i {
        width: 1.75rem;
        height: 1.75rem;
    }

    .closing-note {
        margin-top: 4rem;
        padding: 1.25rem;
        gap: 0.9rem;
        border-radius: 1.45rem;
    }

    .closing-wand {
        width: 3.3rem;
        height: 3.3rem;
        border-radius: 1rem;
        font-size: 1.3rem;
    }

    .closing-note h2 {
        font-size: 1rem;
    }

    .site-footer {
        flex-direction: column;
        align-items: center;
        padding-bottom: 1.8rem;
        text-align: center;
    }

    .dialog-panel {
        padding: 2rem 1rem 1.2rem;
    }

    .install-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .hero h1 {
        font-size: clamp(2.15rem, 10.25vw, 2.55rem);
    }
}

@media (max-width: 380px) {
    .site-header,
    main,
    .site-footer {
        width: min(calc(100% - 0.9rem), var(--page-width));
    }

    .brand-copy small {
        display: none;
    }

    .save-button span {
        display: none;
    }

    .hero-copy {
        padding-inline: 0.8rem;
    }

    .hero-tags {
        gap: 0.3rem;
    }

    .hero-tags li {
        font-size: 0.62rem;
    }

    .section-heading {
        gap: 0.5rem;
    }

    .collection-stamp {
        width: 4.3rem;
        height: 4.3rem;
    }

    .game-grid {
        gap: 0.65rem;
    }

    .game-card {
        min-height: 330px;
        border-radius: 1.15rem;
    }

    .card-art {
        min-height: 112px;
    }

    .card-content {
        min-height: 218px;
        padding: 0.75rem;
    }

    .card-title {
        font-size: 0.86rem;
    }

    .card-description {
        font-size: 0.68rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .game-card,
    .game-card:hover,
    .game-card:active {
        transform: none;
    }
}

@media print {
    .page-ambience,
    .header-actions,
    .hero-visual,
    .closing-note,
    .sparkle-layer {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        color: #000;
        background: #fff;
        box-shadow: none;
    }

    .hero-copy {
        padding: 2rem;
    }

    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .game-card {
        break-inside: avoid;
        box-shadow: none;
    }
}
