/* PLAYORA 숫자 타일 */
:root {
  --page: #f7f4ec; --page-ink: #1d2433; --page-2: #566074; --page-line: #e2ddd0; --page-soft: #ece8dc; --page-acc: #2c58bd;
  --f-body: "IBM Plex Sans KR", "Pretendard", system-ui, -apple-system, "Malgun Gothic", sans-serif;
  --f-disp: "Bagel Fat One", "Black Han Sans", "Do Hyeon", "Malgun Gothic", sans-serif;
  --f-num: "Fredoka", "Baloo 2", "Arial Rounded MT Bold", "IBM Plex Sans KR", system-ui, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r1: 6px; --r2: 10px; --r3: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
/* 판·타일 색 (테마 0 쪽빛) */
.nt, html.embed {
  --tb: #263a63; --tb-2: #1c2c4e; --tb-3: #30477a; --line: #4a6094; --dot: rgba(255, 255, 255, 0.075);
  --ink: #f6f2e6; --ink-2: #cbd4e8; --ink-3: #9aa8c8;
  --acc: #f2c24b; --acc-ink: #1f2a44; --bad: #f0705c; --good: #86dcae;
  --tile: #fbf8ef; --tile-2: #d9d2bf; --tile-sh: rgba(8, 14, 30, 0.5);
  --c0: #d63f2c; --c1: #2b5fcb; --c2: #1d8a57; --c3: #8a36a0; --cj: #b0791a;
}
.nt.th1 { --tb: #5a3f2b; --tb-2: #46301f; --tb-3: #6c4d36; --line: #8a6a4f; --dot: rgba(255, 240, 215, 0.08); --ink: #fbf3e4; --ink-2: #e6d6bd; --ink-3: #c2ab8c; --acc: #f0cf62; --acc-ink: #3a2616; --tile: #f6ead0; --tile-2: #c9b085; --tile-sh: rgba(30, 16, 6, 0.5); --c0: #c8361f; --c1: #2452b5; --c2: #1b7a4a; --c3: #7c2f93; --cj: #9a6410; }
.nt.th2 { --tb: #1e2127; --tb-2: #15171c; --tb-3: #2a2e36; --line: #474d5a; --dot: rgba(255, 255, 255, 0.06); --ink: #f1efe9; --ink-2: #c9ccd4; --ink-3: #979ca8; --acc: #f2c24b; --acc-ink: #1b1d22; --tile: #343944; --tile-2: #23262e; --tile-sh: rgba(0, 0, 0, 0.6); --c0: #ff8a70; --c1: #7fb2ff; --c2: #74dc9c; --c3: #dc9cf2; --cj: #f2c24b; }
@supports (color: oklch(0 0 0)) {
  :root { --page: oklch(0.967 0.011 92); --page-ink: oklch(0.26 0.03 262); --page-2: oklch(0.48 0.03 262); --page-line: oklch(0.89 0.016 92); --page-soft: oklch(0.93 0.016 92); --page-acc: oklch(0.48 0.17 262); }
  .nt, html.embed { --tb: oklch(0.355 0.07 262); --tb-2: oklch(0.295 0.06 262); --tb-3: oklch(0.415 0.08 262); --line: oklch(0.5 0.075 262); --ink: oklch(0.962 0.016 95); --ink-2: oklch(0.87 0.028 262); --ink-3: oklch(0.73 0.045 262);
    --acc: oklch(0.84 0.14 85); --acc-ink: oklch(0.29 0.05 262); --bad: oklch(0.7 0.17 28); --good: oklch(0.83 0.11 160);
    --tile: oklch(0.978 0.013 92); --tile-2: oklch(0.86 0.027 88); --c0: oklch(0.58 0.2 29); --c1: oklch(0.5 0.18 262); --c2: oklch(0.56 0.13 155); --c3: oklch(0.47 0.18 318); --cj: oklch(0.61 0.12 75); }
  .nt.th1 { --tb: oklch(0.4 0.055 55); --tb-2: oklch(0.33 0.05 55); --tb-3: oklch(0.46 0.06 55); --line: oklch(0.57 0.06 60); --ink: oklch(0.965 0.02 85); --ink-2: oklch(0.88 0.04 80); --ink-3: oklch(0.75 0.05 75); --acc: oklch(0.86 0.13 95); --acc-ink: oklch(0.29 0.05 55);
    --tile: oklch(0.94 0.04 88); --tile-2: oklch(0.77 0.07 80); --c0: oklch(0.54 0.2 30); --c1: oklch(0.46 0.17 262); --c2: oklch(0.5 0.12 155); --c3: oklch(0.43 0.17 318); --cj: oklch(0.54 0.11 70); }
  .nt.th2 { --tb: oklch(0.25 0.012 262); --tb-2: oklch(0.2 0.01 262); --tb-3: oklch(0.3 0.015 262); --line: oklch(0.42 0.02 262); --ink: oklch(0.95 0.008 95); --ink-2: oklch(0.84 0.012 262); --ink-3: oklch(0.69 0.016 262); --acc: oklch(0.84 0.14 85); --acc-ink: oklch(0.22 0.01 262);
    --tile: oklch(0.35 0.018 262); --tile-2: oklch(0.26 0.014 262); --c0: oklch(0.76 0.15 32); --c1: oklch(0.76 0.12 255); --c2: oklch(0.82 0.15 155); --c3: oklch(0.78 0.13 318); --cj: oklch(0.84 0.14 85); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--page); color: var(--page-ink); font: 400 16px/1.7 var(--f-body); word-break: keep-all; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
button:disabled { cursor: default; opacity: 0.42; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- 페이지 머리 */
.mast { display: flex; align-items: baseline; gap: var(--s4); padding: var(--s3) clamp(var(--s4), 3vw, var(--s6)); border-bottom: 1px solid var(--page-line); }
.mast-brand { text-decoration: none; font-size: 14px; color: var(--page-2); white-space: nowrap; }
.mast-brand b { font-weight: 700; letter-spacing: 0.08em; color: var(--page-ink); margin-right: 6px; }
.mast-more { margin-left: auto; font-size: 14px; color: var(--page-2); white-space: nowrap; }
.head { max-width: 1240px; margin: 0 auto; padding: var(--s4) clamp(var(--s3), 3vw, var(--s6)) var(--s3); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.head h1 { margin: 0; font: 400 clamp(34px, 4.4vw, 48px)/1.05 var(--f-disp); letter-spacing: 0.01em; font-style: normal; }
.head p { margin: 0; color: var(--page-2); font-size: 15px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(0px, 2vw, var(--s5)); }

/* ---------------------------------------------------------------- 게임 무대 */
.nt { position: relative; width: 100%; height: clamp(500px, calc(100svh - 132px), 860px); background-color: var(--tb); color: var(--ink); overflow: hidden; border-radius: var(--r2);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; font-family: var(--f-body); font-size: 14px; line-height: 1.45; }
@media (max-width: 640px) { .nt { border-radius: 0; height: min(86svh, 800px); min-height: 560px; } .head { padding-top: var(--s3); } .head p { display: none; } }
html.embed, html.embed body { height: 100%; overflow: hidden; background: var(--tb); }
html.embed .mast, html.embed .head, html.embed .about, html.embed .foot { display: none !important; }
html.embed .wrap { padding: 0; max-width: none; }
html.embed .nt, .nt.fs { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; border-radius: 0; z-index: 50; }
.nt button:focus-visible, .nt input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.nt svg { width: 18px; height: 18px; flex: none; }

/* 위 막대 */
.bar { position: absolute; top: 0; left: 0; right: 0; height: 44px; z-index: 9; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2) 0 var(--s4); background: var(--tb-2); }
.nt.short .bar { height: 38px; }
.bar-l { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; flex: 1; overflow: hidden; }
.bar-t { font: 400 21px/1 var(--f-disp); letter-spacing: 0.02em; white-space: nowrap; }
.bar-m { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.bar-r { display: flex; align-items: center; gap: 4px; flex: none; }
.tb { height: 32px; min-width: 34px; padding: 0 var(--s2); border-radius: var(--r1); border: 1px solid transparent; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.tb:hover:not(:disabled) { border-color: var(--line); background: rgba(255, 255, 255, 0.06); }
.tb .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb .off { display: none; }
.tb.off .off { display: inline; }
.tb.off .on { display: none; }
.tb.off { color: var(--ink-3); }
.nt:not(.on-play) #bMenu { display: none; }

/* ---------------------------------------------------------------- 놀이 화면 */
.play { position: absolute; left: 0; right: 0; bottom: 0; top: 44px; display: flex; flex-direction: column; }
.nt.short .play { top: 38px; }
.opps { flex: none; display: flex; gap: 6px; padding: 6px var(--s2); background: var(--tb-2); border-bottom: 1px solid rgba(0, 0, 0, 0.28); overflow: hidden; }
.opp { flex: 1 1 0; min-width: 0; max-width: 260px; height: 38px; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2) 0 6px; border-radius: var(--r2); border: 1px solid transparent; background: rgba(255, 255, 255, 0.045); position: relative; }
.opp.cur { border-color: var(--acc); background: rgba(255, 255, 255, 0.1); }
.opp-b { flex: none; width: 22px; height: 28px; border-radius: 4px; background: var(--tile); box-shadow: inset 0 -2px 0 var(--tile-2); color: var(--tb-2); font: 700 13px/28px var(--f-num); text-align: center; font-variant-numeric: tabular-nums; }
.nt.th2 .opp-b { color: var(--ink); }
.opp-n { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.opp-n b { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-n small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp.cur .opp-n small { color: var(--ink-2); }
.opp-s { flex: none; font: 700 13px/1 var(--f-body); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dots { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.16s; }
.dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes dot { 0%, 70%, 100% { opacity: 0.25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.nt.short .opps { padding: 3px var(--s2); }
.nt.short .opp { padding: 0 var(--s2) 0 4px; height: 26px; }
.nt.short .opp-b { height: 22px; line-height: 22px; width: 20px; font-size: 12px; }
.nt.short .opp-n { flex-direction: row; align-items: baseline; gap: 6px; }
.nt.short .opp-n b { flex: none; }
.nt.portrait .opps.four { flex-wrap: wrap; }
.nt.portrait .opps.four .opp { flex: 1 1 calc(50% - 4px); max-width: none; height: 32px; }
.nt.portrait .opps.four .opp-n { flex-direction: row; align-items: baseline; gap: 6px; }
.nt.portrait .opps.four .opp-n b { flex: none; }
.nt.portrait .opps.four .opp-s { display: block; }
.nt.narrow .opp { gap: 5px; padding-right: 4px; }
.nt.narrow .opp-s { display: none; }

/* 바닥 */
.tbl { flex: 1 1 0; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: default; }
.tbl-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform;
  background-image: radial-gradient(circle, var(--dot) 1.3px, transparent 1.9px); }
.set { position: absolute; border-radius: 9px; border: 1.5px solid rgba(255, 255, 255, 0.17); background: rgba(0, 0, 0, 0.14); pointer-events: none; transition: left 0.18s var(--ease), top 0.18s var(--ease), width 0.18s var(--ease); }
.set.bad { border-color: var(--bad); background: rgba(240, 90, 60, 0.2); }
.set.few { border-style: dashed; }
.set.join { border-color: var(--acc); background: rgba(242, 194, 75, 0.18); }
.set.hint { border-color: var(--good); box-shadow: 0 0 0 3px rgba(134, 220, 174, 0.3); }
.spot { position: absolute; border-radius: 16% / 12%; border: 2px dashed var(--acc); background: rgba(242, 194, 75, 0.13); color: var(--acc); display: flex; align-items: center; justify-content: center; font: 700 18px/1 var(--f-num); cursor: pointer; padding: 0; }
.spot:hover { background: rgba(242, 194, 75, 0.28); }
.drop { position: absolute; border-radius: 9px; border: 2px solid var(--acc); background: rgba(242, 194, 75, 0.2); pointer-events: none; }
.tbl-hint { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(86%, 30em); margin: 0; text-align: center; color: var(--ink-3); font-size: 14px; line-height: 1.6; pointer-events: none; white-space: normal; }
.zoom { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: flex; gap: 2px; padding: 2px; border-radius: 18px; background: rgba(0, 0, 0, 0.38); }
.zoom button { min-width: 34px; height: 30px; padding: 0 var(--s2); border: 0; border-radius: 15px; background: transparent; color: var(--ink); font: 700 14px/1 var(--f-body); }
.zoom button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.guide { flex: none; align-self: center; width: calc(100% - 16px); max-width: 760px; margin: 8px 0 4px; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4); border-radius: var(--r2); background: var(--tb-2); border: 1px solid var(--line); }
.guide-t { flex: 1; min-width: 0; }
.guide-t b { display: block; font-size: 15px; margin-bottom: 2px; }
.guide-t b em { font-style: normal; color: var(--acc); margin-right: 6px; font-variant-numeric: tabular-nums; }
.guide-t p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; white-space: normal; }
.guide .btn { flex: none; height: 34px; padding: 0 var(--s3); font-size: 13px; }
.guide.done { border-color: var(--good); }

/* 타일 */
.tl { position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); border-radius: 16% / 12%; background: var(--tile); box-shadow: inset 0 calc(var(--w) * -0.075) 0 var(--tile-2), 0 1px 2px var(--tile-sh);
  display: flex; align-items: center; justify-content: center; padding-top: calc(var(--h) * 0.12); padding-bottom: calc(var(--w) * 0.075); color: var(--c0); font: 600 calc(var(--w) * 0.64)/1 var(--f-num); letter-spacing: -0.03em; font-variant-numeric: lining-nums; cursor: pointer;
  transition: left 0.2s var(--ease), top 0.2s var(--ease), transform 0.22s var(--ease), box-shadow 0.15s; touch-action: none; z-index: 1; }
.tl.c1 { color: var(--c1); } .tl.c2 { color: var(--c2); } .tl.c3 { color: var(--c3); } .tl.jk { color: var(--cj); padding-top: 0; }
.tl b { font-weight: 600; display: block; pointer-events: none; }
.tl.d2 { font-size: calc(var(--w) * 0.54); letter-spacing: -0.06em; }
/* 색마다 다른 무늬를 왼쪽 위 귀퉁이에 (숫자 바로 아래에 두면 1이 느낌표, 7이 물음표처럼 보여서) */
.tl i { display: block; position: absolute; left: 13%; top: 9%; width: 22%; aspect-ratio: 1; background: currentColor; border-radius: 50%; pointer-events: none; }
.tl.c1 i { border-radius: 16%; }
.tl.c2 i { border-radius: 0; clip-path: polygon(50% 6%, 100% 94%, 0 94%); width: 25%; left: 12%; }
.tl.c3 i { border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); width: 26%; left: 11.5%; top: 8%; }
.tl svg { width: 74%; height: auto; pointer-events: none; }
.tbl .tl { --w: var(--tw); --h: var(--th); }
.rack .tl { --w: var(--rw); --h: var(--rh); }
.tl.sel { transform: translateY(-3px); box-shadow: inset 0 calc(var(--w) * -0.075) 0 var(--tile-2), 0 0 0 2.5px var(--acc), 0 8px 12px -4px var(--tile-sh); z-index: 3; }
.tl.sel::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 4px; }
.tl.mine::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -5px; height: 3px; border-radius: 2px; background: var(--acc); }
.tl.last { box-shadow: inset 0 calc(var(--w) * -0.075) 0 var(--tile-2), 0 0 0 2px var(--good), 0 1px 2px var(--tile-sh); }
.tl.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { 0%, 60% { box-shadow: inset 0 calc(var(--w) * -0.075) 0 var(--tile-2), 0 0 0 3px var(--acc), 0 1px 2px var(--tile-sh); } }
.tl.hint { animation: hint 0.9s ease-in-out infinite; z-index: 2; }
@keyframes hint { 50% { box-shadow: inset 0 calc(var(--w) * -0.075) 0 var(--tile-2), 0 0 0 3px var(--good), 0 1px 2px var(--tile-sh); transform: translateY(-3px); } }
.tl.drag { opacity: 0.28; }
.tl.fly { transition: none; }
.tl.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.dghost { position: absolute; left: 0; top: 0; z-index: 40; pointer-events: none; display: flex; gap: 2px; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.45)); }
.dghost .tl { position: relative; transition: none; flex: none; }

/* 아래: 알림 줄 · 받침대 · 단추 */
.dock { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "stat stat" "rack acts"; gap: 6px var(--s2); padding: 6px var(--s2) var(--s2); background: var(--tb-2); border-top: 1px solid rgba(0, 0, 0, 0.3); position: relative; }
.stat { grid-area: stat; display: flex; align-items: center; gap: var(--s2); min-height: 28px; min-width: 0; }
.msg { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg b { color: var(--ink); font-weight: 700; }
.msg.warn b, .msg .w { color: var(--bad); }
.msg .g { color: var(--good); }
.clock { flex: none; display: flex; align-items: center; gap: 6px; font: 700 14px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.clock i { display: block; width: 46px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); overflow: hidden; position: relative; }
.clock i::after { content: ""; position: absolute; inset: 0; background: var(--acc); transform-origin: left center; transform: scaleX(var(--p, 1)); }
.clock.low i::after { background: var(--bad); }
.clock.low b { color: var(--bad); }
.sorts { flex: none; display: flex; gap: 4px; }
.sg { height: 28px; padding: 0 var(--s2); border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 600 12.5px/1 var(--f-body); }
.sg.on { border-color: var(--acc); color: var(--ink); background: rgba(242, 194, 75, 0.14); }
.rack { grid-area: rack; position: relative; overflow: hidden; border-radius: var(--r2); background: var(--tb-3); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); height: calc(var(--rh) * 2 + 16px); touch-action: none; min-width: 0; }
.rack-in { position: absolute; left: 0; top: 0; height: 100%; }
.rack.over { box-shadow: inset 0 0 0 2px var(--acc), inset 0 2px 6px rgba(0, 0, 0, 0.3); }
.rack-more { position: absolute; top: 0; bottom: 0; width: 22px; pointer-events: none; opacity: 0; transition: opacity 0.2s; z-index: 5; }
.rack-more.l { left: 0; background: linear-gradient(90deg, var(--tb-2), transparent); }
.rack-more.r { right: 0; background: linear-gradient(270deg, var(--tb-2), transparent); }
.rack-more.on { opacity: 0.9; }
.rack-cover { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: var(--s3); background: var(--tb-3); border-radius: var(--r2); text-align: center; padding: var(--s2); }
.rack-cover p { margin: 0; color: var(--ink-2); white-space: normal; }
.acts { grid-area: acts; display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr); gap: 6px; }
.ab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; border: 1px solid var(--line); border-radius: var(--r2); background: rgba(255, 255, 255, 0.05); color: var(--ink); font: 600 12.5px/1 var(--f-body); min-width: 0; min-height: 0; }
.ab:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.ab.main { grid-column: 1 / -1; grid-row: 1; flex-direction: row; gap: var(--s2); background: var(--acc); border-color: transparent; color: var(--acc-ink); font: 700 16px/1 var(--f-body); }
.ab.main:hover:not(:disabled) { background: var(--acc); filter: brightness(1.06); }
.ab.main.draw { background: transparent; border: 1.5px solid var(--acc); color: var(--ink); }
.ab.main.draw:hover:not(:disabled) { background: rgba(242, 194, 75, 0.16); filter: none; }
.ab.busy { opacity: 0.6; }
.nt.short .acts { grid-template-columns: repeat(3, 50px); gap: 4px; }
.nt.short .ab { font-size: 12px; gap: 1px; }
.nt.short .ab svg { width: 15px; height: 15px; }
.nt.short .ab.main { font-size: 14px; }
.nt.short .stat { min-height: 24px; }
.nt.short .dock { gap: 4px var(--s2); padding: 4px var(--s2) 6px; }
.nt.short .rack { height: calc(var(--rh) * 2 + 12px); }
/* 세로 화면 */
.nt.portrait .msg { white-space: normal; line-height: 1.3; max-height: 2.6em; }
.nt.portrait .stat { min-height: 36px; }
.nt.narrow .bar { padding-left: var(--s3); gap: 4px; }
.nt.narrow .bar-l { gap: var(--s2); }
.nt.narrow .bar-t { font-size: 19px; }
.nt.narrow .tb { min-width: 32px; padding: 0 5px; }
.nt.narrow .bar-r { gap: 2px; }
.nt.portrait .dock { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stat" "rack" "acts"; }
.nt.portrait .acts { grid-template-columns: 1fr 1fr 1fr 1.7fr; grid-template-rows: 48px; }
.nt.portrait .ab.main { grid-column: 4; grid-row: 1; font-size: 15px; }
.nt.portrait .opp { flex-direction: row; }
.nt.portrait .opps { padding: 5px 6px; gap: 4px; }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 40px; padding: 0 var(--s4); border-radius: var(--r2); border: 1px solid var(--line); background: var(--tb-3); color: var(--ink); font: 600 14px/1 var(--f-body); white-space: nowrap; }
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn.big { height: 48px; padding: 0 var(--s5); background: var(--acc); border-color: transparent; color: var(--acc-ink); font-size: 16px; font-weight: 700; }
.btn.ghost { background: transparent; }
.toast { position: absolute; z-index: 45; left: 50%; top: 96px; transform: translate(-50%, -8px); max-width: calc(100% - 24px); padding: var(--s2) var(--s4); border-radius: 20px; background: rgba(10, 16, 32, 0.94); color: #f6f2e6; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.3s var(--ease); white-space: normal; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- 처음 화면 */
.scr { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; top: 44px; background-color: var(--tb); overflow-y: auto; overscroll-behavior: contain; }
.nt.short .scr { top: 38px; }
.home { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--s5) clamp(var(--s5), 5vw, var(--s8)); align-items: center; padding: var(--s5) clamp(var(--s4), 5vw, var(--s8)); min-height: 100%; }
.home-art { display: flex; gap: 5px; margin-bottom: var(--s4); }
.home-art .tl { position: relative; --w: 44px; --h: 59px; cursor: default; flex: none; }
.home-art .tl:nth-child(2) { transform: translateY(8px) rotate(-3deg); }
.home-art .tl:nth-child(4) { transform: translateY(5px) rotate(4deg); }
.home-t { margin: 0; font: 400 clamp(52px, 8.4vw, 96px)/1.02 var(--f-disp); letter-spacing: 0.01em; font-style: normal; }
.home-s { margin: var(--s3) 0 0; max-width: 26em; color: var(--ink-2); font-size: 15px; line-height: 1.6; white-space: normal; }
.home-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.lk { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: 18px; background: transparent; color: var(--ink); font: 600 13px/1 var(--f-body); }
.lk:hover { background: rgba(255, 255, 255, 0.07); }
.home-r { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.cont { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s3) var(--s4); border: 1px solid var(--acc); border-radius: var(--r2); background: rgba(242, 194, 75, 0.1); color: var(--ink); text-align: left; white-space: normal; }
.cont b { font-size: 15px; }
.cont small { color: var(--ink-2); font-size: 13px; margin-left: auto; text-align: right; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.tab { height: 42px; border: 0; background: transparent; color: var(--ink-2); font: 700 14.5px/1 var(--f-body); }
.tab.on { background: var(--tb-3); color: var(--ink); box-shadow: inset 0 -3px 0 var(--acc); }
.opts { display: flex; flex-direction: column; gap: var(--s2); }
.opt { display: flex; align-items: center; gap: var(--s3); min-height: 38px; }
.opt-k { color: var(--ink-3); font-size: 13px; width: 64px; flex: none; }
.segs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 44px; padding: 0 var(--s3); justify-content: center; border: 1px solid var(--line); border-radius: var(--r1); background: transparent; color: var(--ink); font: 600 13.5px/1 var(--f-body); }
.seg.on { border-color: var(--acc); background: rgba(242, 194, 75, 0.15); }
.seg i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.35); }
.nm { width: 74px; height: 36px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r1); background: rgba(0, 0, 0, 0.18); color: var(--ink); font: 600 13.5px/1 var(--f-body); min-width: 0; }
.lv-note { margin: 0; color: var(--ink-3); font-size: 12.5px; min-height: 1.45em; white-space: normal; }
.go { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s1); }
.go .btn.big { flex: 1; }

/* 창 */
.modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: var(--s3); background: rgba(6, 10, 22, 0.66); }
.mbox { position: relative; width: 100%; max-width: 600px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: var(--s5) var(--s5) var(--s4); border-radius: var(--r3); background: var(--tb-2); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); font-size: 14px; line-height: 1.6; white-space: normal; }
.mbox.wide { max-width: 720px; }
.mx { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); }
.m-k { margin: 0; color: var(--ink-3); font-size: 13px; }
.m-t { margin: 0 44px var(--s2) 0; font: 400 clamp(24px, 4vw, 30px)/1.15 var(--f-disp); font-style: normal; }
.m-s { margin: 0 0 var(--s3); color: var(--ink-2); }
.m-h { margin: var(--s4) 0 var(--s1); font: 700 15px/1.4 var(--f-body); }
.m-l { padding-left: 1.2em; margin: var(--s2) 0 0; color: var(--ink-2); }
.m-l li { margin: 4px 0; }
.m-b { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.m-list { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.m-list .btn { justify-content: flex-start; height: 44px; }
.ex { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 6px 0 2px; }
.ex .tl { position: relative; --w: 26px; --h: 35px; cursor: default; flex: none; }
.ex .cap { margin: 0 var(--s2) 0 6px; color: var(--ink-2); font-size: 13px; }
.ex .cap.no { color: var(--bad); }
.res-tab { width: 100%; border-collapse: collapse; margin-top: var(--s2); }
.res-tab th, .res-tab td { padding: 7px 6px 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.09); text-align: left; vertical-align: middle; }
.res-tab thead th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.res-tab td.n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-tab th.n { text-align: right; white-space: nowrap; }
.res-tab tr.win td { color: var(--acc); }
.res-tab .who { font-weight: 700; white-space: nowrap; }
.res-tab .left { display: flex; flex-wrap: wrap; gap: 2px; }
.res-tab .left .tl { position: relative; --w: 19px; --h: 25px; cursor: default; flex: none; box-shadow: inset 0 -1.5px 0 var(--tile-2); }
.res-tab .left em { font-style: normal; color: var(--ink-3); font-size: 12.5px; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; margin-top: var(--s2); }
.ach div { padding: var(--s2) var(--s3); border-radius: var(--r1); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--ink-3); }
.ach div b { display: block; color: var(--ink-2); font-size: 13.5px; }
.ach div small { font-size: 12.5px; }
.ach div.got { border-color: var(--acc); background: rgba(242, 194, 75, 0.1); }
.ach div.got b { color: var(--ink); }
.rec-tab { width: 100%; border-collapse: collapse; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.rec-tab th, .rec-tab td { padding: 6px 4px 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.09); text-align: left; }
.rec-tab thead th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.newach { margin: var(--s3) 0 0; padding: var(--s2) var(--s3); border-radius: var(--r1); background: rgba(242, 194, 75, 0.14); border: 1px solid var(--acc); }

@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; align-items: start; gap: var(--s4); padding: var(--s4); }
  .home-art { display: none; }
  .home-t { font-size: 54px; }
  .home-s { font-size: 14px; margin-top: var(--s2); }
  .home-links { margin-top: var(--s3); }
  .mbox { padding: var(--s4) var(--s4) var(--s3); }
}
@media (max-height: 520px) and (min-width: 600px) {
  .home { padding-top: var(--s3); padding-bottom: var(--s3); gap: var(--s3) var(--s5); }
  .home-art { display: none; }
  .home-t { font-size: 50px; }
  .home-s { font-size: 13.5px; }
  .home-r { gap: var(--s2); }
  .opt { min-height: 32px; }
  .seg, .nm { height: 30px; }
  .tab { height: 34px; }
  .btn.big { height: 40px; }
  .opts { gap: 4px; }
  .lv-note { display: none; }
  .mbox { padding: var(--s3) var(--s4); }
}

/* ---------------------------------------------------------------- 소개 글 */
.about { max-width: 1240px; margin: 0 auto; padding: var(--s7) clamp(var(--s4), 3vw, var(--s6)) var(--s6); display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s6) clamp(var(--s5), 4vw, var(--s8)); }
.about h2 { font: 400 clamp(24px, 2.8vw, 30px)/1.25 var(--f-disp); margin: var(--s7) 0 var(--s3); font-style: normal; }
.about h2:first-child { margin-top: 0; }
.about h3 { font: 700 17px/1.4 var(--f-body); margin: var(--s5) 0 var(--s2); }
.about p, .about li { color: var(--page-ink); }
.about ol, .about ul { padding-left: 1.3em; }
.about li { margin: 6px 0; }
.about dl { margin: 0; }
.about dt { font-weight: 700; margin-top: var(--s4); }
.about dd { margin: 4px 0 0; color: var(--page-2); }
.about .note { margin-top: var(--s4); padding: var(--s3) var(--s4); border-left: 3px solid var(--page-acc); background: var(--page-soft); font-size: 14.5px; color: var(--page-2); }
.about .more { margin-top: var(--s6); font-size: 14px; color: var(--page-2); line-height: 1.9; }
.about .more a { color: var(--page-ink); }
.about-side h3:first-child { margin-top: 0; }
.keytab { width: 100%; border-collapse: collapse; font-size: 14px; }
.keytab th, .keytab td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--page-line); vertical-align: top; }
.keytab th { font-weight: 600; width: 40%; padding-right: var(--s2); }
.keytab td { color: var(--page-2); }
.rule-fig { margin: var(--s4) 0 var(--s2); padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--page-soft); }
.rf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s4) var(--s5); }
.rf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rf svg { display: block; width: 100%; max-width: 250px; height: auto; }
.rf span { font-size: 13.5px; line-height: 1.4; color: var(--page-ink); }
.rf span.no { color: #b3321f; }
.rule-fig figcaption { margin-top: var(--s3); font-size: 14px; color: var(--page-2); }
.foot { max-width: 1240px; margin: 0 auto; padding: var(--s5) clamp(var(--s4), 3vw, var(--s6)) var(--s7); border-top: 1px solid var(--page-line); font-size: 13px; color: var(--page-2); }
.foot a { margin-right: var(--s4); white-space: nowrap; }
.foot p { margin: var(--s3) 0 0; max-width: 60em; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }
.nojs { padding: var(--s6); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .tl, .set, .toast { transition: none; }
  .tl.hint, .tl.fresh, .dots i, .tl.shake { animation: none; }
}
.nt.calm .tl, .nt.calm .set { transition: none; }
