/* PLAYORA 돌림판·제비뽑기 공용 바탕 (색·글꼴·간격·단추·시트·페이지 글) */
:root {
  --paper: #f4eee3; --paper-2: #ece4d5; --paper-3: #e1d6c3; --card: #fffcf6;
  --ink: #1f2440; --ink-2: #4a5070; --ink-3: #74788f; --line: #d6ccb9; --line-2: #c3b7a1;
  --acc: #ff5b3a; --acc-2: #f0482a; --acc-ink: #22090a; --good: #1f8f66; --blue: #3d6fd6;
  --page: #f5f0e6; --page-ink: #1f1b16; --page-2: #5d5548; --page-line: #ddd3c2;
  --f-body: "IBM Plex Sans KR", "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --f-disp: "Gasoek One", "Black Han Sans", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r1: 8px; --r2: 12px; --r3: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --hard: 0 3px 0 var(--ink);
}
@supports (color: oklch(0 0 0)) {
  :root {
    --paper: oklch(0.949 0.017 82); --paper-2: oklch(0.918 0.022 82); --paper-3: oklch(0.874 0.028 80); --card: oklch(0.99 0.008 85);
    --ink: oklch(0.28 0.06 276); --ink-2: oklch(0.44 0.05 276); --ink-3: oklch(0.57 0.035 276); --line: oklch(0.85 0.028 80); --line-2: oklch(0.78 0.035 78);
    --acc: oklch(0.69 0.2 36); --acc-2: oklch(0.64 0.21 35); --good: oklch(0.58 0.12 162);
    --page: oklch(0.959 0.014 85); --page-ink: oklch(0.23 0.015 70); --page-2: oklch(0.47 0.025 75); --page-line: oklch(0.88 0.02 82);
  }
}
* { 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; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.45; }
input, textarea, select { font: inherit; color: inherit; }
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(30px, 4vw, 40px)/1.1 var(--f-disp); letter-spacing: 0.01em; color: var(--ink); }
.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)); }

/* ---------------------------------------------------------------- 게임 무대 */
.pk { position: relative; width: 100%; height: clamp(540px, calc(100svh - 132px), 860px); color: var(--ink); overflow: hidden; border-radius: var(--r2);
  background-color: var(--paper); background-image: radial-gradient(circle at 1px 1px, rgba(31, 36, 64, 0.11) 1.1px, rgba(0, 0, 0, 0) 1.4px); background-size: 18px 18px;
  border: 2px solid var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 640px) { .pk { border-radius: 0; border-left: 0; border-right: 0; height: calc(100svh - 92px); min-height: 560px; } .head { padding-top: var(--s3); } .head p { display: none; } }
html.embed, html.embed body { height: 100%; overflow: hidden; background: var(--paper); }
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 .pk, .pk.isfull { position: fixed; inset: 0; width: auto; height: auto; min-height: 0; border-radius: 0; border: 0; z-index: 10; }
.pk :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pk input, .pk textarea { -webkit-user-select: text; user-select: text; }

/* 위 막대 */
.pk-bar { position: absolute; top: 0; left: 0; right: 0; height: 50px; z-index: 6; display: flex; align-items: center; gap: var(--s2); padding: 0 6px 0 var(--s4); background: var(--paper-2); border-bottom: 2px solid var(--ink); }
.pk.short .pk-bar { height: 44px; }
.bar-l { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex: 1; overflow: hidden; }
.bar-t { font: 400 22px/1 var(--f-disp); letter-spacing: 0.01em; white-space: nowrap; color: var(--ink); }
.pk.short .bar-t { font-size: 19px; }
.bar-m { color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar-r { display: flex; align-items: center; gap: 2px; flex: none; }
.ib { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink); padding: 0; position: relative; }
.ib svg { width: 21px; height: 21px; }
.ib:hover:not(:disabled) { background: rgba(31, 36, 64, 0.08); }
.ib:active:not(:disabled) { background: rgba(31, 36, 64, 0.14); }
.ib[aria-pressed="false"] { color: var(--ink-3); }
.ic { display: inline-flex; }

/* 단추 */
.bt { height: 42px; padding: 0 var(--s4); border: 2px solid var(--ink); border-radius: var(--r2); background: var(--card); color: var(--ink); font: 600 14px/1 var(--f-body); display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--hard); transition: transform .08s, box-shadow .08s; }
.bt svg { width: 18px; height: 18px; flex: none; }
.bt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.bt.pri { background: var(--acc); color: var(--acc-ink); }
.bt.ink { background: var(--ink); color: var(--paper); }
.bt.sm { height: 34px; padding: 0 var(--s3); font-size: 13px; border-radius: 10px; box-shadow: 0 2px 0 var(--ink); }
.bt.sm:active:not(:disabled) { box-shadow: 0 0 0 var(--ink); transform: translateY(2px); }
.bt.flat { box-shadow: none; border-color: var(--line-2); }
.bt.flat:active:not(:disabled) { transform: none; background: var(--paper-2); }
.bt.ghost { box-shadow: none; border-color: transparent; background: transparent; }

/* 큰 시작 단추 */
.go { height: 58px; border: 2.5px solid var(--ink); border-radius: var(--r3); background: var(--acc); color: var(--acc-ink); font: 400 25px/1 var(--f-disp); letter-spacing: 0.04em; box-shadow: 0 5px 0 var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); transition: transform .08s, box-shadow .08s, background .15s; }
.go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.go:disabled { opacity: 1; background: var(--paper-3); color: var(--ink-3); box-shadow: 0 5px 0 var(--line-2); border-color: var(--line-2); }
.pk.short .go { height: 50px; font-size: 22px; }

/* 스위치 */
.sw { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw i { width: 38px; height: 22px; border-radius: 22px; border: 2px solid var(--ink); background: var(--card); position: relative; flex: none; transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform .2s var(--ease); }
.sw input:checked + i { background: var(--acc); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 3px solid var(--blue); outline-offset: 2px; }

/* 칸 고르기(세그먼트) */
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--card); flex: none; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 var(--s3); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* 입력 */
.fld { width: 100%; height: 40px; padding: 0 var(--s3); border: 2px solid var(--ink); border-radius: 10px; background: var(--card); font-size: 15px; outline: none; }
.fld:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 111, 214, 0.22); }
textarea.fld { height: auto; padding: var(--s2) var(--s3); line-height: 1.5; resize: vertical; }
.num { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); height: 40px; overflow: hidden; flex: none; }
.num button { width: 36px; height: 100%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.num button svg { width: 16px; height: 16px; }
.num button:active { background: var(--paper-2); }
.num input { width: 54px; height: 100%; border: 0; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); text-align: center; font-weight: 700; font-size: 16px; background: transparent; outline: none; -moz-appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 탭 */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ink); padding: 0 var(--s2); flex: none; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; height: 44px; padding: 0 var(--s3); font-weight: 600; font-size: 14px; color: var(--ink-3); position: relative; flex: none; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 4px; border-radius: 4px 4px 0 0; background: var(--acc); }
.tabs .cnt { font-weight: 500; color: var(--ink-3); margin-left: 4px; font-size: 12px; }

/* 알림 */
.pk-toast { position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 12px); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .3s var(--ease); z-index: 60; box-shadow: 0 8px 22px rgba(20, 22, 40, 0.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-toast.on { opacity: 1; transform: translate(-50%, 0); }
.pk-toast.act { display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px 16px; }
.pk-toast.act.on { pointer-events: auto; }
.pk-toast span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pk-toast button { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* 시트(휴대폰: 아래에서 올라오는 창) */
.pk-back { position: absolute; inset: 0; background: rgba(31, 36, 64, 0.34); z-index: 20; opacity: 0; transition: opacity .2s; }
.pk-back.on { opacity: 1; }
.pk-modal { position: absolute; left: 50%; top: 50%; z-index: 30; width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; transform: translate(-50%, -46%) scale(0.98); opacity: 0; transition: opacity .18s, transform .3s var(--ease);
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--r3); box-shadow: 0 6px 0 var(--ink); padding: var(--s4); }
.pk-modal.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pk-modal h3 { margin: 0 0 var(--s3); font: 700 18px/1.35 var(--f-body); }
.pk-modal p { margin: 0 0 var(--s3); color: var(--ink-2); }
.pk-modal .acts { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); flex-wrap: wrap; }

/* 빈 상태 */
.empty { padding: var(--s6) var(--s4); text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------------------------------------------------------------- 소개 글 */
.about { max-width: 1240px; margin: 0 auto; padding: var(--s7) clamp(var(--s4), 4vw, var(--s7)) var(--s6); display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.8fr); gap: var(--s6) clamp(var(--s5), 5vw, var(--s8)); }
.about-main { min-width: 0; }
.about h2 { margin: var(--s6) 0 var(--s2); font: 400 26px/1.3 var(--f-disp); color: var(--ink); letter-spacing: 0.01em; }
.about h2:first-child { margin-top: 0; }
.about p, .about li { font-size: 16px; color: var(--page-ink); }
.about p { margin: 0 0 var(--s3); }
.about ul, .about ol { margin: 0 0 var(--s3); padding-left: 1.3em; }
.about li { margin-bottom: 6px; }
.about strong { font-weight: 600; }
.about dl { margin: 0; }
.about dt { margin-top: var(--s4); font-weight: 600; }
.about dd { margin: 4px 0 0; color: var(--page-2); }
.about-side { min-width: 0; font-size: 14px; color: var(--page-2); }
.about-side h3 { margin: 0 0 var(--s2); font: 400 20px/1.3 var(--f-disp); color: var(--ink); }
.keytab { width: 100%; border-collapse: collapse; margin-bottom: var(--s5); font-size: 14px; }
.keytab th { text-align: left; font-weight: 500; padding: 6px var(--s2) 6px 0; color: var(--page-2); width: 50%; }
.keytab td { padding: 6px 0; font-weight: 600; color: var(--page-ink); }
.keytab tr + tr th, .keytab tr + tr td { border-top: 1px solid var(--page-line); }
.credits { margin-top: var(--s5); font-size: 13px; color: var(--page-2); }
.more { margin-top: var(--s5); font-size: 14px; color: var(--page-2); line-height: 1.9; }
.more a { white-space: nowrap; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; padding-top: var(--s6); } }
.foot { border-top: 1px solid var(--page-line); padding: var(--s5) clamp(var(--s4), 4vw, var(--s7)) var(--s6); font-size: 13px; color: var(--page-2); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); max-width: 1240px; margin: 0 auto; }
.foot a { color: var(--page-2); white-space: nowrap; }
.foot p { flex-basis: 100%; margin: var(--s2) 0 0; }
.nojs { padding: var(--s5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
