/* 에이징 커브 오락실 — 네온 오락기 화면. 2026-11-12 (v0.3) */
@font-face { font-family: "Galmuri11"; src: url("../fonts/Galmuri11.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Galmuri11"; src: url("../fonts/Galmuri11-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Galmuri9"; src: url("../fonts/Galmuri9.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "GalmuriMono11"; src: url("../fonts/GalmuriMono11.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #07051a; --bg2: #0e0a2b; --surf: #140f38; --surf2: #1c1648; --line: #2f2766; --line2: #463c8f;
  --ink: #f3f0ff; --ink2: #b9b2e6; --ink3: #7e76b8;
  --cyan: #3ff0ff; --pink: #ff4fb0; --yellow: #ffd84a; --green: #5dff9a; --red: #ff5a5a; --violet: #9b7bff;
  --accent: var(--cyan); --accent-ink: #07051a; --ok: var(--green); --warn: var(--yellow); --err: var(--red);
  --stage: #05030f; --stim: #f3f0ff; --blue: #4fa3ff; --orange: #ff9a3c;
  --px: "Galmuri11", "Galmuri9", system-ui, "Malgun Gothic", sans-serif;
  --mono: "GalmuriMono11", "Galmuri11", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.65 var(--px); -webkit-font-smoothing: none; min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(155, 123, 255, .22), transparent 60%),
    radial-gradient(900px 400px at 50% 120%, rgba(255, 79, 176, .16), transparent 60%),
    var(--bg); }
/* 화면 줄무늬(브라운관) */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--cyan); }
.hidden { display: none !important; }
.muted { color: var(--ink2); } .small { font-size: 13px; }
.grow { flex: 1; }

/* 버튼 — 오락기 단추 */
button { cursor: pointer; border: 2px solid var(--line2); background: var(--surf2); border-radius: 10px; padding: 9px 14px; font-weight: 700;
  box-shadow: 0 4px 0 #0a0724; transition: transform .06s, box-shadow .06s, border-color .15s; }
button:hover { border-color: var(--cyan); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a0724; }
button.primary { background: var(--pink); border-color: #ff8ccb; color: #1a0420; box-shadow: 0 5px 0 #8a1f5c, 0 0 24px rgba(255,79,176,.45); }
button.big { width: 100%; padding: 14px; font-size: 18px; border-radius: 14px; margin-top: 6px; }
button.ghost { background: transparent; box-shadow: none; }
button.small { padding: 4px 10px; font-size: 13px; }
button.danger { color: var(--red); }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line2); border-bottom-width: 3px; border-radius: 5px; color: var(--ink2); background: var(--bg2); }

/* 위 간판 */
header.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 920px; margin: 0 auto; position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand .logo { width: 30px; height: 30px; image-rendering: pixelated; }
.brand b { font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; font: 10px var(--mono); color: var(--ink3); letter-spacing: .25em; }
.credit { font: 12px var(--mono); color: var(--yellow); letter-spacing: .12em; text-shadow: 0 0 8px rgba(255,216,74,.5); }
.icon-btn { padding: 6px 10px; font-size: 14px; }

.page { max-width: 920px; margin: 0 auto; padding: 0 16px 28px; position: relative; z-index: 1; }

/* 오락기 화면 틀 */
.cab { background: linear-gradient(180deg, var(--surf), var(--bg2)); border: 2px solid var(--line2); border-radius: 22px; padding: 22px;
  box-shadow: 0 0 0 6px #0a0724, 0 0 50px rgba(63,240,255,.10), inset 0 0 60px rgba(0,0,0,.35); position: relative; overflow: hidden; }
.cab + .cab { margin-top: 14px; }
.cab h2 { font-size: 16px; margin: 0 0 12px; color: var(--cyan); letter-spacing: .02em; }
.card { background: var(--surf); border: 2px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-top: 12px; }
.card h2 { font-size: 15px; margin: 0 0 10px; color: var(--cyan); }

/* 타이틀 화면 */
.title { text-align: center; padding: 18px 0 6px; }
.title .tag { display: inline-block; font: 11px var(--mono); letter-spacing: .3em; color: var(--ink3); border: 1px solid var(--line2); padding: 3px 10px; border-radius: 99px; }
.title h1 { font-size: clamp(30px, 7vw, 54px); line-height: 1.15; margin: 14px 0 6px; font-weight: 700; letter-spacing: -.01em;
  text-shadow: 0 0 2px #fff, 0 0 14px rgba(63,240,255,.6), 4px 4px 0 #3a1d7a; }
.title h1 .hot { color: var(--pink); text-shadow: 0 0 2px #fff, 0 0 16px rgba(255,79,176,.75), 4px 4px 0 #3a1d7a; }
.title p { color: var(--ink2); margin: 0 auto; max-width: 560px; }
.press { margin: 18px 0 4px; font: 15px var(--mono); color: var(--yellow); letter-spacing: .14em; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .press { animation: none; } }

/* 메뉴 */
.menu { list-style: none; margin: 18px auto 4px; padding: 0; max-width: 560px; display: grid; gap: 8px; }
.menu button { width: 100%; display: grid; grid-template-columns: 26px 44px 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 12px 14px;
  background: var(--bg2); border-color: var(--line); box-shadow: 0 4px 0 #0a0724; }
.menu button .cur { color: var(--yellow); opacity: 0; font-family: var(--mono); }
.menu button .ico { width: 40px; height: 40px; image-rendering: pixelated; }
.menu button b { display: block; font-size: 16px; }
.menu button span.d { display: block; font-size: 12.5px; color: var(--ink2); font-weight: 400; }
.menu button.on, .menu button:hover { border-color: var(--cyan); background: #120d36; box-shadow: 0 4px 0 #0a0724, 0 0 18px rgba(63,240,255,.25); }
.menu button.on .cur { opacity: 1; animation: blink 0.8s steps(2) infinite; }

/* 설정 줄 */
.setrow { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; margin-top: 16px; font-size: 13px; color: var(--ink2); }
.setrow label { display: flex; align-items: center; gap: 8px; }
.setrow input, .setrow select { padding: 6px 9px; border: 2px solid var(--line2); border-radius: 8px; background: var(--bg); width: auto; }
.setrow input { width: 76px; }
#devLine { text-align: center; font-size: 12px; margin: 8px 0 0; color: var(--ink3); }

/* 장르·연습 고르기 */
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.genre { text-align: left; background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.genre b { font-size: 16px; color: var(--ink); } .genre span { color: var(--ink2); font-size: 13px; }
.genre:hover, .genre.on { border-color: var(--pink); box-shadow: 0 4px 0 #0a0724, 0 0 16px rgba(255,79,176,.3); }
.genre .k { font: 11px var(--mono); color: var(--ink3); }
.subhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.subhead h2 { margin: 0; flex: 1; }

details.rules { margin-top: 14px; }
details.rules summary { cursor: pointer; color: var(--ink2); font-size: 13px; }
.rules ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink2); font-size: 13px; } .rules li { margin: 4px 0; } .rules .warn { color: var(--yellow); }
.flag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255,216,74,.12); color: var(--yellow); margin: 2px 4px 2px 0; border: 1px solid rgba(255,216,74,.35); }
.flag.ok { background: rgba(93,255,154,.1); color: var(--green); border-color: rgba(93,255,154,.35); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* 검사 화면 */
.hud { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font: 13px var(--mono); }
.hud .lbl { color: var(--yellow); letter-spacing: .12em; }
#tName { color: var(--ink); font-family: var(--px); font-weight: 700; }
.prog { flex: 1; height: 12px; background: var(--bg2); border: 2px solid var(--line2); border-radius: 4px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; transition: width .2s;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, #2bbd6c 8px 10px); box-shadow: 0 0 10px rgba(93,255,154,.5); }
.stage { position: relative; height: min(62vh, 520px); background: var(--stage); border-radius: 18px; overflow: hidden; outline: none;
  border: 2px solid var(--line2); box-shadow: 0 0 0 6px #0a0724, inset 0 0 80px rgba(63,240,255,.06);
  background-image: linear-gradient(rgba(63,240,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(63,240,255,.05) 1px, transparent 1px); background-size: 32px 32px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.fix { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 700 30px/1 var(--mono); color: var(--ink3); }
.stim { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.stim.bull { width: 120px; height: 120px; border-radius: 50%; filter: drop-shadow(0 0 10px rgba(243,240,255,.35));
  background: radial-gradient(circle, var(--stim) 0 18%, transparent 18% 34%, var(--stim) 34% 50%, transparent 50% 66%, var(--stim) 66%); }
.stim.letter { font: 900 92px/1 "Arial Black", Arial, system-ui, sans-serif; }
.zones { position: absolute; inset: auto 0 0 0; display: grid; grid-template-columns: 1fr 1fr; font-size: 13px; color: var(--ink3); text-align: center; }
.zones div { padding: 10px; border-top: 2px dashed var(--line2); }
.zones div + div { border-left: 2px dashed var(--line2); }
.msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 10px; }
.msg:empty { display: none; }
.msg .box { background: var(--surf); border: 2px solid var(--cyan); border-radius: 16px; padding: 18px 20px; max-width: 540px; box-shadow: 0 0 30px rgba(63,240,255,.2); }
.msg h3 { margin: 0 0 8px; font-size: 20px; color: var(--yellow); }
.msg ul { text-align: left; margin: 8px 0; padding-left: 20px; color: var(--ink2); }
.msg .big { font-size: 14px; color: var(--yellow); font-weight: 700; }
.msg .box button.primary { min-width: 160px; }
.flash { font-weight: 700; font-size: 22px; letter-spacing: .04em; text-shadow: 0 0 12px currentColor; }
.flash.bad { color: var(--red); } .flash.ok { color: var(--green); }
.blueP { color: var(--blue); font-weight: 800; }

/* 결과 */
.result-head { text-align: center; }
.result-head .lbl { font: 13px var(--mono); letter-spacing: .3em; color: var(--ink3); }
.result-head .age { font-size: clamp(42px, 10vw, 72px); font-weight: 700; line-height: 1.1; margin: 8px 0; color: var(--yellow);
  text-shadow: 0 0 2px #fff, 0 0 20px rgba(255,216,74,.6), 4px 4px 0 #5a3a00; }
.grade { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; font: 700 34px/1 var(--mono); margin-bottom: 6px;
  border: 3px solid currentColor; box-shadow: 0 0 20px currentColor; }
.grade.S { color: var(--pink); } .grade.A { color: var(--cyan); } .grade.B { color: var(--green); } .grade.C { color: var(--yellow); } .grade.D { color: var(--orange); }
.note { color: var(--ink2); margin: 10px 0 0; font-size: 14px; }
.tcard .kv { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; align-items: baseline; }
.tcard .kv div b { display: block; font: 700 22px var(--mono); color: var(--cyan); }
.tcard .kv div span { font-size: 12px; color: var(--ink3); }
.bars { display: grid; gap: 5px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 58px 1fr 56px; gap: 8px; align-items: center; font: 12px var(--mono); color: var(--ink2); }
.bar .t { position: relative; height: 12px; background: var(--bg2); border-radius: 3px; border: 1px solid var(--line); }
.bar .t i { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, rgba(155,123,255,.7) 0 6px, rgba(155,123,255,.45) 6px 8px); border-radius: 2px; }
.bar .t b { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.src li { margin: 4px 0; font-size: 13px; color: var(--ink2); }

/* 기록판 */
#hChart { width: 100%; background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; margin-top: 10px; }
.hrow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 8px; font: 13px var(--mono); padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.hrow.h { color: var(--yellow); }
.hrow .rk { color: var(--pink); }
.chip { border-radius: 99px; padding: 5px 12px; font-size: 13px; box-shadow: none; }
.chip.on { background: var(--cyan); color: var(--accent-ink); border-color: var(--cyan); }
.best { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.best div { background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.best b { display: block; font: 700 20px var(--mono); color: var(--yellow); }
.best span { font-size: 12px; color: var(--ink3); }

.foot { max-width: 920px; margin: 18px auto 30px; padding: 0 16px; color: var(--ink3); font-size: 12.5px; text-align: center; position: relative; z-index: 1; }
.brand b { white-space: nowrap; }
@media (max-width: 560px) {
  header.top { gap: 6px; padding: 10px 12px; }
  .brand small, .credit, .lbl-wide { display: none; }
  .brand { min-width: 0; flex: 1 1 auto; overflow: hidden; } .brand > div { min-width: 0; }
  .brand b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; } .brand .logo { display: none !important; }
  header.top .grow { display: none; }
  .icon-btn { padding: 5px 8px; font-size: 13px; }
  .title p br { display: none; }
  .cab { padding: 16px; border-radius: 18px; }
  .menu button { grid-template-columns: 18px 36px 1fr; } .menu button kbd { display: none; } .menu button .ico { width: 34px; height: 34px; }
  .stim.bull { width: 96px; height: 96px; } .stim.letter { font-size: 74px; }
  .hrow { grid-template-columns: 1.3fr 1fr 1fr; } .hrow span:nth-child(4) { display: none; }
}

/* 장르 검사 그림 */
.target { position: absolute; border-radius: 50%; background: radial-gradient(circle, #fff 0 22%, var(--pink) 22% 60%, #fff 60% 72%, var(--pink) 72%);
  transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 18px rgba(255,79,176,.6); }
.tbarfill { position: absolute; left: 8%; right: 8%; top: 46%; height: 28px; background: var(--bg2); border: 2px solid var(--line2); border-radius: 6px; overflow: hidden; }
.tbarfill i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.tbarfill b { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--red); box-shadow: 0 0 10px var(--red); }
.pulse { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 6px solid var(--violet); opacity: .25; }
.pulse.on { opacity: 1; background: rgba(155,123,255,.3); box-shadow: 0 0 40px var(--violet); }
.arrow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 900 120px/1 system-ui, sans-serif; color: var(--cyan); text-shadow: 0 0 20px rgba(63,240,255,.6); }
.guard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 22px 34px; border-radius: 14px; font: 700 34px/1 var(--px); color: #fff; }
.guard.red { background: #E5484D; box-shadow: 0 0 30px rgba(229,72,77,.7); } .guard.blue { background: #3E7BFA; box-shadow: 0 0 30px rgba(62,123,250,.6); }
.cps { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; font: 700 56px/1.2 var(--mono); color: var(--yellow); text-shadow: 0 0 16px rgba(255,216,74,.6); }
.cps small { display: block; font: 16px var(--px); color: var(--ink2); }
