* {
    box-sizing: border-box;
}

:root {
    --background: #fff8fa;
    --ink: #2d2025;
    --muted: #745f67;
    --line: #ead9df;
    --accent: #bd3e6b;
    --accent-soft: #f6dce5;
    --glass: rgba(255, 255, 255, 0.58);
    --glass-edge: rgba(255, 255, 255, 0.82);
    --glass-shadow: 0 18px 50px rgba(95, 46, 64, 0.1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #171216;
    --ink: #f4e8ec;
    --muted: #c4abb4;
    --line: #403038;
    --accent: #f39ab8;
    --accent-soft: #3b2630;
    --glass: rgba(39, 27, 34, 0.68);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

html {
    scroll-behavior: smooth;
    color-scheme: light;
}

body {
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    isolation: isolate;

    background:
        radial-gradient(ellipse at 12% 8%, rgba(246, 220, 229, 0.9), transparent 36rem),
        radial-gradient(ellipse at 92% 42%, rgba(234, 215, 247, 0.66), transparent 34rem),
        radial-gradient(ellipse at 38% 96%, rgba(255, 230, 222, 0.65), transparent 32rem),
        var(--background);
    color: var(--ink);

    font-family: Arial, Helvetica, sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 18% 24%, rgba(205, 188, 255, 0.42), transparent 44%),
        radial-gradient(ellipse at 82% 36%, rgba(255, 205, 223, 0.34), transparent 42%),
        radial-gradient(ellipse at 46% 82%, rgba(255, 221, 202, 0.3), transparent 46%);
    background-size: 200% 200%;
    animation: background-drift 32s ease-in-out infinite alternate;
    content: "";
    pointer-events: none;
}

:root[data-theme="dark"] body::before {
    opacity: 0.48;
}

@keyframes background-drift {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 100% 100%;
    }
}

a {
    color: inherit;
}

.reading-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 20;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--glass-edge);
    border-radius: 50%;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.back-to-top[hidden] {
    display: none;
}

.not-found {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
}

.not-found-card {
    width: min(100%, 650px);
    padding: clamp(32px, 7vw, 72px);
    border: 1px solid var(--glass-edge);
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.not-found-card h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    letter-spacing: -0.06em;
}

.not-found-card > p:not(.page-label) {
    color: var(--muted);
    line-height: 1.7;
}

.not-found-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    margin-top: 12px;
    padding: 0 18px;
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--ink);
    text-decoration: none;
}


.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 10px 14px;
    transform: translateY(-160%);
    border: 1px solid var(--glass-edge);
    border-radius: 12px;
    background: var(--background);
    color: var(--ink);
}

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



header {
    position: sticky;
    top: 14px;
    z-index: 5;
    width: calc(100% - 40px);
    max-width: 1000px;
    min-height: 70px;

    margin: 14px auto 0;
    padding: 12px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border: 1px solid var(--glass-edge);
    border-radius: 20px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
}

.logo {
    color: var(--ink);

    text-decoration: none;

    font-size: 18px;
    font-weight: bold;
}

nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

nav a.active {
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--accent-soft);
}

.theme-toggle {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--glass);
    color: var(--ink);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    transform: translateY(-1px);
}



main {
    max-width: 1000px;

    margin: 0 auto;
    padding: 0 20px;
    scroll-margin-top: 110px;
}




.home {
    min-height: calc(100vh - 120px);

    display: flex;
    align-items: center;
    justify-content: center;

    gap: clamp(36px, 8vw, 100px);
}

.home-left {
    position: relative;
    max-width: 650px;
    padding: clamp(28px, 5vw, 56px);
    border: 1px solid var(--glass-edge);
    border-radius: 28px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.muted {
    margin: 0 0 12px;

    color: var(--accent);

    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home h1 {
    margin: 0;

    color: var(--ink);
    font-size: clamp(4.5rem, 10vw, 7.25rem);
    line-height: 1;

    letter-spacing: -0.075em;
}

.logo {
    letter-spacing: 0;
}

.home h1,
.page h1 {
    font-weight: 700;
    text-wrap: balance;
}

.home h1 span {
    color: var(--accent);
}

.home-text {
    max-width: 540px;

    margin: 25px 0 0;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.7;
}

.home-text,
.page-intro,
.content p,
.anime-text p {
    color: var(--muted);
}

.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;

    margin-top: 28px;
}

.home-links a {
    padding: 11px 15px;
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--glass);
    color: var(--ink);

    text-decoration: none;
    font-size: 13px;

    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.home-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.home-right {
    position: relative;
}

.home-right img {
    position: relative;

    width: 230px;
    height: 270px;

    object-fit: cover;

    border: 1px solid var(--glass-edge);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}




.page {
    min-height: calc(100vh - 130px);

    padding-top: 76px;
    padding-bottom: 88px;
}

.page-label {
    margin: 0 0 15px;

    color: var(--accent);

    font-size: 13px;
}

.page h1 {
    max-width: 700px;

    margin: 0;

    font-size: clamp(2.6rem, 6vw, 4rem);
    line-height: 1.05;

    letter-spacing: -0.055em;
}

.page h1::after {
    content: "";
    display: block;
    width: 54px;
    height: 2px;
    margin-top: 22px;
    background: var(--accent);
}

.page-intro {
    max-width: 650px;

    margin-top: 22px;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.7;
}

.content {
    max-width: 680px;

    margin-top: 38px;
    padding: 26px;
    border: 1px solid var(--glass-edge);
    border-radius: 22px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}

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

.content p {
    margin: 0 0 22px;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.8;
}




.quick-info {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    max-width: 750px;

    margin-top: 55px;

    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.quick-info div {
    padding: 20px 15px;

    border-right: 1px solid var(--line);
}

.quick-info div:first-child {
    padding-left: 0;
}

.quick-info div:last-child {
    border-right: none;
}

.quick-info span {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 12px;
}

.quick-info strong {
    font-size: 14px;

    font-weight: normal;
}




.game-list {
    max-width: 720px;

    margin-top: 45px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.game-search {
    max-width: 720px;
    margin-top: 30px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    align-items: center;
}

.game-search label {
    color: var(--muted);
    font-size: 13px;
}

.game-search input {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 46px;
    padding: 0 15px;
    border: 1px solid var(--glass-edge);
    border-radius: 14px;
    background: var(--glass);
    color: var(--ink);
    font: inherit;
}

.game-search input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.game-search input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.game-search p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.game {
    min-height: 150px;
    padding: 22px;
    border: 1px solid var(--glass-edge);
    border-radius: 20px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.game[hidden] {
    display: none;
}

.game:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.game-title {
    display: flex;

    align-items: baseline;

    gap: 12px;
}

.game h2 {
    margin: 0;

    font-size: 19px;

    color: var(--ink);
    font-weight: 600;
}

.game-title span {
    color: var(--accent);

    font-size: 11px;
}

.game p {
    max-width: 620px;

    margin: 10px 0 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.7;
}




.anime-content {
    max-width: 680px;

    margin-top: 40px;
}

.anime-text {
    padding: 26px;
    border: 1px solid var(--glass-edge);
    border-radius: 22px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}

.anime-text p {
    margin: 0 0 20px;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.8;
}

.external-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    padding: 10px 13px;
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--glass);
}

.external-link:hover {
    color: var(--ink);
}




.languages {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 16px;

    max-width: 700px;

    margin-top: 50px;
}

.languages div {
    padding: 20px;
    border: 1px solid var(--glass-edge);
    border-radius: 18px;
    background: var(--glass);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(15px) saturate(135%);
    backdrop-filter: blur(15px) saturate(135%);
    transition: transform 0.2s ease;
}

.languages [hidden] {
    display: none;
}

.languages div:hover {
    transform: translateY(-2px);
}

.languages span {
    color: var(--accent);

    font-size: 11px;
}

.languages strong {
    display: block;

    margin-top: 12px;

    color: var(--ink);

    font-size: 18px;

    font-weight: normal;
}

.languages p {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 14px;
    line-height: 1.6;
}

.genre-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.genre-filter button {
    padding: 9px 13px;
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    background: var(--glass);
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.genre-filter button[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.genre-filter button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.genre-count {
    color: var(--muted);
    font-size: 12px;
}




footer {
    max-width: 1000px;

    margin: 0 auto;
    padding: 22px 20px;

    display: flex;
    justify-content: space-between;

    border-top: 1px solid var(--glass-edge);

    color: var(--muted);

    font-size: 11px;
}

.local-time {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

@media (max-width: 700px) {

    header {
        height: auto;
        min-height: 0;
        width: calc(100% - 36px);
        padding: 12px 18px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 14px;
    }

    nav {
        width: 100%;
        justify-content: flex-start;
        gap: 10px 18px;
    }

    nav a {
        font-size: 12px;
    }

    main {
        padding: 0 18px;
    }

    .home {
        min-height: auto;

        padding: 64px 0 72px;

        flex-direction: column;
        align-items: flex-start;
        gap: 38px;
    }

    .home-right img {
        width: 170px;
        height: 196px;
    }

    .home h1 {
        font-size: clamp(4rem, 17vw, 5rem);
    }

    .page {
        min-height: auto;
        padding-top: 52px;
        padding-bottom: 64px;
    }

    .page h1 {
        font-size: clamp(2.3rem, 10vw, 2.8rem);
    }

    .quick-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-info div {
        border-bottom: 1px solid var(--line);
    }

    .quick-info div:nth-child(2) {
        border-right: none;
    }

    .languages {
        grid-template-columns: 1fr;

        gap: 25px;
    }

    footer {
        padding: 22px 18px;
    }

    .home {
        gap: 28px;
    }

    .home-left {
        padding: 26px;
        border-radius: 22px;
    }

    .home-right img {
        width: 150px;
        height: 176px;
        border-radius: 18px;
    }

    .game-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .game {
        min-height: 0;
        padding: 20px;
    }

    .content {
        padding: 20px;
        border-radius: 18px;
    }

    .anime-text {
        padding: 20px;
        border-radius: 18px;
    }

    .languages div {
        padding: 18px;
    }
}

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

    body::before {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}