:root {
    --bg: #eef4ff;
    --surface: rgba(255, 255, 255, 0.92);
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, 0.22);
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --primary-soft: rgba(99, 102, 241, 0.14);
    --accent: #f59e0b;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.1);
    --radius: 26px;
    --radius-sm: 18px;
    --container: 1240px;
    --header-offset: 72px;
}

* { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}
body {
    margin: 0;
    padding: var(--header-offset) 0 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 34%),
        radial-gradient(circle at top right, rgba(168, 85, 247, 0.2), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}
img { max-width: 100%; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
p, h1, h2, h3 { margin: 0; }
.container { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; }
#masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(2, 6, 23, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.header-shell { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { min-width: 0; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
    width: auto;
    height: 48px;
    max-width: min(220px, 40vw);
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}
.brand-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-subtitle {
    margin-top: 4px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#navigation { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(15,23,42,0.92);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}
.nav-button:hover { border-color: rgba(129, 140, 248, 0.4); background: rgba(79, 70, 229, 0.22); color: #fff; }
.nav-button { cursor: pointer; }
.menu-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 14px;
    flex: 0 0 40px;
}
.menu-toggle svg {
    width: 20px;
    height: 20px;
}
.search-form { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.search-form input[type="text"] {
    min-width: 230px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.96);
    color: var(--text);
    outline: none;
}
.search-form input[type="text"]:focus { border-color: rgba(79,70,229,0.45); box-shadow: 0 0 0 4px rgba(99,102,241,0.12); }
.search-form input[type="submit"], .play-game-button, .card-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(99,102,241,0.22);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.search-form input[type="submit"]:hover, .play-game-button:hover, .card-link a:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(99,102,241,0.26); }
#content-area { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 39;
}
.drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.category-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, calc(100vw - 28px));
    height: 100vh;
    padding: 22px;
    background: rgba(2, 6, 23, 0.98);
    box-shadow: 24px 0 60px rgba(2, 6, 23, 0.4);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 40;
    overflow-y: auto;
}
.category-drawer.is-open { transform: translateX(0); }
.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.drawer-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}
.drawer-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}
.drawer-copy {
    margin-bottom: 18px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 14px;
    line-height: 1.7;
}
.drawer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    font-weight: 700;
    transition: 0.18s ease;
}
.drawer-link:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(129, 140, 248, 0.24);
    color: #fff;
}
.drawer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
}
.drawer-note {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96) 0%, rgba(79, 70, 229, 0.24) 100%);
    color: rgba(226, 232, 240, 0.76);
    font-size: 13px;
    line-height: 1.7;
}
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-title, .section-heading h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.02em; }
.section-heading p { color: var(--muted); font-size: 14px; }
.card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin-bottom: 34px; }
.card-content, #sidebar section, .legal-card, .about-us, .game-description { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-content { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card-content:hover { transform: translateY(-6px); border-color: rgba(79,70,229,0.22); box-shadow: 0 28px 64px rgba(15,23,42,0.14); }
.thumb { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.card-content:hover .thumb img { transform: scale(1.05); }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 20px; }
.card h2 { font-size: 20px; line-height: 1.28; }
.card h2 a:hover { color: var(--primary); }
.description { color: var(--muted); font-size: 14px; line-height: 1.75; display: -webkit-box; line-clamp: 3; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card footer { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.cover { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; overflow: hidden; background: #e2e8f0; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stars { flex: 1; color: var(--accent); letter-spacing: 1px; font-size: 16px; white-space: nowrap; }
#sidebar section { padding: 22px; }
#sidebar section h2 { font-size: 22px; line-height: 1.2; margin-bottom: 18px; }
.sidebar-list { display: flex; flex-direction: column; gap: 12px; }
.sidebar-item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: rgba(241,245,249,0.92); transition: background 0.18s ease, transform 0.18s ease; }
.sidebar-item:hover { background: #eef2ff; transform: translateY(-2px); }
.sidebar-thumb { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; background: #e2e8f0; }
.sidebar-info strong { display: block; font-size: 15px; line-height: 1.45; margin-bottom: 6px; }
.sidebar-info span { color: var(--accent); font-size: 14px; }
.game-frame-box { overflow: hidden; border-radius: 32px; background: #0f172a; box-shadow: 0 28px 70px rgba(15,23,42,0.2); margin-bottom: 26px; }
.game-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); min-height: 340px; }
.game-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-hero-info { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 36px; background: linear-gradient(135deg, rgba(15,23,42,0.96) 0%, rgba(79,70,229,0.94) 100%); color: #fff; }
.game-hero-info h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.03em; }
.game-hero-info p { color: rgba(255,255,255,0.82); line-height: 1.8; font-size: 15px; }
.game-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.game-badge { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.18); font-size: 13px; font-weight: 700; }
.game-frame { width: 100%; min-height: 640px; border: 0; display: block; background: #020617; }
.game-description, .legal-card, .about-us { padding: 28px; }
.game-description p, .legal-card p { margin-bottom: 16px; color: #475569; line-height: 1.85; font-size: 15px; }
.about-us { width: min(var(--container), calc(100% - 32px)); margin: 0 auto 56px; }
.about-us h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.privacy-con { display: flex; flex-direction: column; gap: 22px; }
.privacy-con h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.08; }
.privacy-con h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.18; }
.privacy-con a { color: var(--primary); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: 22px; }
.contact-panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(248, 250, 252, 0.94); }
.contact-feedback { padding: 14px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6; }
.contact-feedback.success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.24); color: #166534; }
.contact-feedback.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #b91c1c; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #334155; font-weight: 700; }
.contact-field input,
.contact-field textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    padding: 14px 16px;
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-field input:focus,
.contact-field textarea:focus { border-color: rgba(79, 70, 229, 0.45); box-shadow: 0 0 0 4px rgba(99,102,241,0.12); }
.contact-field textarea { resize: vertical; min-height: 160px; }
.contact-submit {
    min-height: 50px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 16px 30px rgba(99,102,241,0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.contact-submit:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(99,102,241,0.26); }
#colophon { border-top: 1px solid rgba(148, 163, 184, 0.14); background: #020617; }
.footer-top { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; padding: 34px 0 24px; }
.footer-logo { width: 100%; max-width: 170px; height: auto; object-fit: contain; display: block; }
.footer-summary h3 { font-size: 24px; line-height: 1.18; margin-bottom: 12px; color: #f8fafc; }
.footer-summary p, #copyright p { color: rgba(226, 232, 240, 0.72); line-height: 1.8; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 34px; border-top: 1px solid rgba(148, 163, 184, 0.14); }
.footer-menu { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-menu a { color: #e2e8f0; font-weight: 700; }
.footer-menu a:hover { color: #a5b4fc; }
@media (max-width: 1024px) {
    .page-grid,
    .game-hero,
    .footer-top,
    .contact-layout { grid-template-columns: 1fr; }
    .game-frame { min-height: 520px; }
}
@media (max-width: 768px) {
    :root { --header-offset: 118px; }
    .container,
    #content-area,
    .about-us { width: min(var(--container), calc(100% - 24px)); }
    .header-shell { align-items: stretch; flex-direction: column; gap: 10px; }
    .header-left { width: 100%; }
    .brand { flex: 1; min-width: 0; }
    .brand-mark { width: auto; height: 42px; max-width: min(180px, 52vw); }
    .brand-title { font-size: 18px; }
    .brand-subtitle { display: none; }
    #navigation { width: 100%; }
    .search-form { width: 100%; gap: 8px; }
    .search-form input[type="text"] { width: auto; min-width: 0; flex: 1; }
    .search-form input[type="submit"] { flex: 0 0 auto; padding: 0 14px; }
    .game-hero-info,
    .game-description,
    .legal-card,
    .about-us { padding: 22px; }
    .card-list { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
    .card-body { padding: 16px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .game-frame { min-height: 380px; }
}
