/*
 * kawk10.me — 웹게임 모음.
 * 네 게임이 모두 해 질 무렵이 배경이라, 바탕은 해가 진 직후의 남색(blue hour),
 * 강조색은 노을빛 금색 하나. 게임 제목은 게임 로고들처럼 기울어진 좁은 글씨.
 */
:root {
  --bg: #10121b;
  --bg-2: #151826;
  --card: #1a1e2d;
  --card-2: #222739;
  --line: #2a2f43;
  --text: #eceef4;
  --soft: #c6cad6;
  --muted: #9aa0b4;
  --faint: #6b7189;
  --gold: #ffb23e;
  --gold-2: #ffc56b;
  --on-gold: #231400;
  --r: 6px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --title: "Archivo", "Arial Narrow", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.7 var(--sans); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2 { text-wrap: balance; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 30; background: var(--gold); color: var(--on-gold); padding: 8px 14px; border-radius: var(--r); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* 게임 제목: 기울어진 좁은 대문자 */
.gtitle { font-family: var(--title); font-style: italic; font-weight: 900; font-stretch: 72%; text-transform: uppercase; letter-spacing: -.005em; line-height: .95; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.gtitle.huge { font-size: clamp(48px, 6.6vw, 92px); margin: 0; }

/* ── 머리 ───────────────────────────────── */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(16, 18, 27, .88); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { font: italic 900 27px/1 var(--title); font-stretch: 72%; letter-spacing: .01em; }
.logo em { color: var(--gold); font-style: italic; margin-left: 1px; }
.logo.small { font-size: 22px; }
.bar nav { display: flex; gap: 2px; }
.bar nav a { padding: 7px 14px; border-radius: var(--r); color: var(--muted); font-weight: 600; font-size: 15px; }
.bar nav a:hover { color: var(--text); background: var(--card); }

/* ── 버튼 ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: var(--r); border: 1px solid rgba(255, 255, 255, .16); background: rgba(16, 18, 27, .35); color: var(--text); font-weight: 700; font-size: 15px; transition: background .15s, border-color .15s; }
.btn:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); }
.btn.go { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.go:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn.big { height: 54px; padding: 0 30px; font-size: 17px; }
.btn svg { font-size: 17px; }
.acts { display: flex; gap: 10px; flex-wrap: wrap; }
.link { color: var(--gold); font-weight: 700; }
.link:hover { color: var(--gold-2); }
.devs { display: inline-flex; gap: 6px; color: var(--faint); font-size: 16px; }

/* ── 실시간 1위 기록 ─────────────────────── */
.rec { display: flex; align-items: baseline; gap: 8px; min-height: 1.5em; margin: 0; font-size: 13px; color: var(--muted); }
.rec-label { font: 700 11px/1 var(--mono); color: var(--on-gold); background: var(--gold); padding: 3px 5px; border-radius: 3px; align-self: center; }
.rec-time { font: 700 15px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.rec-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-empty { color: var(--faint); }

/* ── 첫 화면: 돌아가는 큰 화면 + 고르기 목록 ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding-top: 20px; }
.stage { position: relative; min-height: 480px; border-radius: var(--r); overflow: hidden; background: var(--card); isolation: isolate; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.slide.on { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% center; transform: scale(1.04); transition: transform 7s linear; }
.slide.on .slide-bg { transform: scale(1); }
.slide::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(16, 18, 27, .96) 0%, rgba(16, 18, 27, .86) 34%, rgba(16, 18, 27, .25) 62%, rgba(16, 18, 27, 0) 80%),
  linear-gradient(0deg, rgba(16, 18, 27, .75) 0%, rgba(16, 18, 27, 0) 40%); }
.slide-copy { position: absolute; left: 0; bottom: 0; z-index: 1; padding: 40px; width: min(640px, 100%); container-type: inline-size; opacity: 0; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; }
/* 글은 겹치지 않게: 이전 게임 글이 먼저 빠지고, 새 글이 조금 뒤에 올라온다 */
.slide.on .slide-copy { opacity: 1; transform: none; transition: opacity .45s ease .28s, transform .45s ease .28s; }
/* 제목이 글 상자 폭을 넘지 않게(ROOFRUNNER 가 가장 길다) */
.slide .gtitle.huge { font-size: clamp(40px, 14.5cqi, 88px); }
.slide-top { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.slide-top .mono { color: var(--gold); font-size: 13px; }
.slide-line { margin: 14px 0 12px; color: var(--soft); font-size: 17px; max-width: 28em; }
.hero-rec { margin-bottom: 22px; font-size: 14px; }
.hero-rec .rec-time { font-size: 17px; }

.queue { display: flex; flex-direction: column; gap: 6px; }
.queue button { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: var(--r); background: transparent; text-align: left; cursor: pointer; overflow: hidden; transition: background .15s; }
.queue button:hover { background: var(--card); }
.queue button.on { background: var(--card); }
.queue img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; opacity: .55; transition: opacity .2s; }
.queue button:hover img, .queue button.on img { opacity: 1; }
.queue b { display: block; font-size: 21px; color: var(--muted); }
.queue button > span { min-width: 0; }
.queue button.on b { color: var(--text); }
.queue small { color: var(--faint); font-size: 13px; }
.queue i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--gold); }
.queue button.on i { width: 100%; }
.hero.run .queue button.on i { animation: dwell var(--dwell, 7000ms) linear forwards; }
@keyframes dwell { from { width: 0; } to { width: 100%; } }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .queue { flex-direction: row; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  .queue::-webkit-scrollbar { display: none; }
  .queue button { grid-template-columns: 1fr; min-width: 140px; padding: 6px; gap: 6px; }
  .queue img { width: 100%; }
  .queue b { font-size: 17px; }
  .queue small { display: none; }
}
@media (max-width: 600px) {
  .stage { min-height: 520px; }
  .slide-bg { object-position: 60% top; height: 62%; }
  .slide::after { background: linear-gradient(0deg, var(--bg-2) 38%, rgba(21, 24, 38, .7) 55%, rgba(21, 24, 38, 0) 75%); }
  .stage { background: var(--bg-2); }
  .slide-copy { padding: 22px 18px; }
  .slide-line { font-size: 15px; }
}

/* ── 게임 목록 ─────────────────────────── */
.games, .more { margin-top: 56px; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sec h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 10px; }
.sec h2 .mono { font-size: 14px; color: var(--faint); font-weight: 500; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter button { padding: 6px 13px; border-radius: var(--r); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.filter button:hover { color: var(--text); border-color: var(--faint); }
.filter button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.shot { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--card); }
.shot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.tile:hover .shot img { transform: scale(1.06); }
.tile:hover .shot { box-shadow: 0 0 0 2px var(--gold); }
.tile-body { display: flex; flex-direction: column; gap: 4px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* 칸이 좁아지면 제목이 줄어든다(ROOFRUNNER 가 한 줄에 들어가도록) */
.tile-top .gtitle { font-size: clamp(16px, 9cqi, 25px); min-width: 0; }
.tile:hover .gtitle { color: var(--gold); }
.tile-genre { color: var(--muted); font-size: 13px; }
.tile .rec { margin-top: 4px; }
@media (max-width: 1000px) { .tiles, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .tiles, .tiles.three { gap: 20px 12px; } .tile .rec-who { display: none; } }

/* ── 소개 · 질문 ───────────────────────── */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); }
.about h2 { margin: 0 0 14px; font: italic 900 30px/1 var(--title); font-stretch: 72%; text-transform: uppercase; }
.about-text p { color: var(--soft); margin: 0 0 12px; max-width: 34em; }
.faq { margin: 0; }
.faq div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq div:first-child { padding-top: 0; }
.faq dt { font-weight: 700; margin-bottom: 4px; }
.faq dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: 32px; } }

/* ── 꼬리 ───────────────────────────────── */
.foot { margin-top: 88px; border-top: 1px solid var(--line); background: var(--bg-2); padding-block: 36px 28px; font-size: 14px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand p { margin: 10px 0 0; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a:hover { color: var(--text); }
.foot-meta { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.foot-meta .mono { margin-left: auto; }
@media (max-width: 600px) { .foot-meta .mono { margin-left: 0; } }

/* ── 게임 페이지 ───────────────────────── */
.crumb { display: flex; gap: 8px; flex-wrap: wrap; color: var(--faint); font-size: 14px; margin: 18px 0 14px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }
.screen { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: var(--card); }
.screen img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.screen-go { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px 16px 22px; border-radius: var(--r); background: var(--gold); color: var(--on-gold); font-size: 18px; box-shadow: 0 16px 48px rgba(0, 0, 0, .45); transition: transform .2s; }
.screen-go svg { font-size: 22px; }
.screen:hover img { transform: scale(1.015); filter: brightness(.8); }
.screen:hover .screen-go { transform: translate(-50%, -50%) scale(1.04); }

.game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 0 26px; border-bottom: 1px solid var(--line); }
.game-line { margin: 12px 0 10px; color: var(--soft); font-size: 17px; max-width: 42em; }
.game-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0; color: var(--muted); font-size: 14px; }
.game-meta .mono { color: var(--faint); font-size: 12px; }

.game-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; margin-top: 32px; align-items: start; }
.prose { max-width: 700px; }
.prose p, .prose li { color: var(--soft); }
.prose > p:first-child { margin-top: 0; font-size: 18px; color: var(--text); }
.prose h2 { margin: 38px 0 10px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.prose ul { padding-left: 1.15em; }
.prose li { margin: 9px 0; }
.prose li::marker { color: var(--gold); }
.prose b { color: var(--text); }

.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.card { background: var(--card); border-radius: var(--r); padding: 18px 20px; }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; }
.lb-total { color: var(--faint); font-size: 12px; font-weight: 500; }
.lb-tabs { display: flex; gap: 4px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }
.lb-tabs button { flex: none; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.lb-tabs button[aria-selected="true"] { background: var(--card-2); color: var(--text); border-color: var(--faint); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lb-row:last-child { border-bottom: 0; }
.lb-rank { font: 700 13px/1 var(--mono); color: var(--faint); }
.lb-row.first .lb-rank { color: var(--gold); }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-time { font: 700 14px/1 var(--mono); font-variant-numeric: tabular-nums; }
.lb-row.first .lb-time { color: var(--gold); }
.lb-wait { padding: 12px 0; color: var(--faint); font-size: 14px; }
.lb-note { margin: 10px 0 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys th, .keys td { text-align: left; vertical-align: top; padding: 7px 0; border-bottom: 1px solid var(--line); }
.keys tr:last-child th, .keys tr:last-child td { border-bottom: 0; }
.keys th { width: 46%; padding-right: 10px; font-weight: 400; }
.keys td { color: var(--soft); }
kbd { display: inline-block; font: 700 11px/1.5 var(--mono); background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--text); }
.info { margin: 0; }
.info div { display: grid; grid-template-columns: 3.5em 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info div:last-child { border-bottom: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; color: var(--soft); }
@media (max-width: 1000px) {
  .game-cols { grid-template-columns: 1fr; gap: 32px; }
  .side { position: static; order: -1; }
}
@media (max-width: 600px) {
  .screen-go { padding: 12px 20px 12px 16px; font-size: 16px; }
  .game-head .btn { width: 100%; }
}

/* ── 글 페이지 ─────────────────────────── */
.doc { max-width: 760px; padding-top: 48px; }
.doc h1 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.doc-lead { font-size: 18px; color: var(--soft); }
.doc-date { color: var(--faint); font-size: 13px; margin-top: -6px; }
.doc h2 { margin: 36px 0 10px; font-size: 20px; font-weight: 800; }
.doc p, .doc li { color: var(--soft); }
.doc li { margin: 8px 0; }
.doc li::marker { color: var(--gold); }
.doc b { color: var(--text); }
.doc a:not(.btn) { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.lost { text-align: center; padding-block: 96px; }
.lost-code { color: var(--gold); font-size: 14px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .slide-bg { transform: none !important; }
}
