:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --ink: #151923;
    --muted: #6b7280;
    --line: #e5e7eb;
    --red: #e83046;
    --blue: #2563eb;
    --green: #13a36b;
    --dark: #111827;
    --shadow: 0 16px 45px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 4vw, 54px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.brand, .nav, .hero-actions, .facts, .download-actions { display: flex; align-items: center; }
.brand { gap: 10px; font-weight: 800; }
.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--red), var(--blue));
}
.brand-text { font-size: 20px; letter-spacing: 0; }
.nav { gap: 24px; color: #4b5563; font-weight: 700; font-size: 15px; }
.nav a:hover, .nav-menu:hover > button { color: var(--red); }
.nav-menu {
    position: relative;
}
.nav-menu > button {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.nav-menu > button::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
}
.nav-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 20;
    width: 172px;
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}
.nav-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 16px;
}
.nav-menu:hover .nav-dropdown,
.nav-menu:focus-within .nav-dropdown {
    display: grid;
}
.nav-dropdown a {
    padding: 9px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-dropdown a:hover {
    color: var(--red);
    background: #f8fafc;
}

main { min-height: calc(100vh - 66px); }
.hero, .page-title, .section, .layout, .site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    min-height: 430px;
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 26px;
    align-items: center;
    padding: 58px 0 34px;
}
.hero-copy h1, .page-title h1, .detail-info h1 {
    margin: 10px 0 16px;
    line-height: 1.08;
    letter-spacing: 0;
}
.hero-copy h1 {
    max-width: 760px;
    font-size: 50px;
}
.hero-copy p, .page-title p, .detail-info p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}
.eyebrow {
    color: var(--red);
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
}
.hero-actions { gap: 10px; margin-top: 28px; }
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 800;
    border: 1px solid var(--line);
    background: #fff;
}
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { color: var(--dark); }
.hero-panel {
    min-height: 250px;
    padding: 28px;
    border-radius: 8px;
    background: var(--dark);
    color: #fff;
    box-shadow: var(--shadow);
}
.hero-panel span, .hero-panel small { color: #cbd5e1; }
.hero-panel strong { display: block; margin: 18px 0; font-size: 54px; }

.section { padding: 26px 0; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-head h2, .prose h2 { margin: 0; font-size: 24px; }
.section-head a, .section-head span { color: var(--muted); font-weight: 700; }

.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(190px, 1fr);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.game-grid.small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.game-card {
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(17, 24, 39, .05);
}
.cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #d7dde8;
    overflow: hidden;
}
.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}
.game-card:hover .cover img { transform: scale(1.035); }
.cover::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 58%;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0), rgba(17, 24, 39, .78));
}
.cover-title {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 11px;
    z-index: 1;
    color: #fff;
    font-weight: 900;
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .38);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.game-card-body { padding: 13px; }
.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
}
.game-meta span {
    padding: 4px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}
.game-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.compact .game-card-body p { display: none; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
}
.category-grid a, .side-filter a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 900;
}
.category-grid strong, .side-filter strong { color: var(--blue); }

.page-title { padding: 46px 0 24px; }
.page-title h1 { font-size: 46px; }
.layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 22px;
    align-items: start;
    padding-bottom: 34px;
}
.side-filter {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 8px;
}
.side-filter a.active {
    color: #fff;
    background: var(--dark);
    border-color: var(--dark);
}
.side-filter a.active strong { color: #fff; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 26px 0;
    font-weight: 900;
}
.pager a, .pager span {
    min-width: 72px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    text-align: center;
}

.detail-hero {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    gap: 32px;
    padding: 44px 0 26px;
}
.detail-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    background: #d7dde8;
    box-shadow: var(--shadow);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover iframe, .detail-cover video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}
.video-unavailable {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff;
    font-weight: 900;
    text-align: center;
    background: #111827;
}
.play-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 0;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(17, 24, 39, .08), rgba(17, 24, 39, .36));
}
.play-cover span {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(232, 48, 70, .94);
    box-shadow: 0 16px 38px rgba(17, 24, 39, .26);
}
.play-cover span::before {
    content: "";
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 22px solid #fff;
}
.play-cover:hover span { background: var(--blue); }
.crumb { color: var(--red); font-weight: 900; }
.detail-info h1 { font-size: 48px; }
.facts { flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.facts span {
    padding: 7px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 800;
}
.download-box {
    margin-top: 22px;
    padding: 18px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
}
.download-box strong { display: block; margin-bottom: 6px; }
.download-box span { color: var(--muted); }
.download-actions { gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.prose {
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    line-height: 1.85;
    color: #374151;
}
.prose h2 { color: var(--ink); margin-bottom: 14px; }
.prose p { margin: 0 0 14px; }
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 14px auto;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    overflow-wrap: anywhere;
}
.prose th, .prose td {
    padding: 10px;
    border: 1px solid var(--line);
}
.prose ul, .prose ol { padding-left: 24px; }
.prose h1, .prose h2, .prose h3, .prose h4 {
    margin: 20px 0 12px;
    line-height: 1.35;
    color: var(--ink);
}
.prose iframe, .prose video {
    max-width: 100%;
    border-radius: 8px;
}
.screens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.screens img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
}
.prose a, .screens a, .prose img, .screens img {
    cursor: zoom-in;
}
.preview-open {
    overflow: hidden;
}
.image-preview {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 10, 18, .86);
    cursor: zoom-out;
}
.image-preview img {
    max-width: min(1180px, 96vw);
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
    cursor: default;
}
.image-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.empty {
    padding: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}
.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 34px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}
.site-footer div { display: grid; gap: 4px; }

@media (max-width: 820px) {
    .site-header { height: auto; min-height: 62px; align-items: flex-start; flex-direction: column; padding-block: 12px; gap: 10px; }
    .nav { width: 100%; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
    .nav a { white-space: nowrap; }
    .nav-menu { flex: 0 0 auto; }
    .nav-dropdown { left: 0; right: auto; }
    .hero, .layout, .detail-hero { grid-template-columns: 1fr; }
    .hero { padding-top: 34px; }
    .hero-panel { min-height: 170px; }
    .side-filter { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-hero { gap: 18px; }
    .site-footer { flex-direction: column; }
    .hero-copy h1, .page-title h1, .detail-info h1 { font-size: 38px; }
}

@media (max-width: 520px) {
    .hero-copy h1, .page-title h1, .detail-info h1 { font-size: 32px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .side-filter { grid-template-columns: 1fr; }
    .game-grid { grid-template-columns: 1fr; }
}
