/* 룰룰 화면 스타일
   바탕은 흰색과 연한 회색, 포인트는 주사위 빨강 한 가지만 씁니다.
   게임 말처럼 굵은 테두리와 아래 그림자를 가진 '토큰' 버튼이 이 사이트의 얼굴입니다. */

:root {
  --paper: #ffffff;
  --mist: #f3f4f6;
  --mist-2: #e9ebef;
  --ink: #1c2230;
  --ink-2: #3a4152;
  --muted: #5f6675;
  --line: #e2e5ea;
  --line-2: #c9cdd6;
  --dice: #e4572e;
  --dice-dark: #c2401a;
  --dice-tint: #fdece6;
  --ok: #1f7a52;
  --ok-tint: #e5f4ec;
  --warn: #8a5300;
  --warn-tint: #fff4dc;
  --r-s: 10px;
  --r: 16px;
  --r-l: 22px;
  --head-h: 60px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --display: "Black Han Sans", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 64px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.012em;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--dice); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 300; text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; margin-top: 28px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

.ico { width: 20px; height: 20px; flex: none; }
.die { width: 18px; height: 18px; flex: none; }

/* ---------- 머리 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 8px; height: var(--head-h); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-size: 25px; line-height: 1; letter-spacing: 0.01em; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); }
.nav a:hover { background: var(--mist); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--mist); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--mist); }
.icon-btn .ico { width: 22px; height: 22px; }
.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--head-h);
    flex-direction: column; gap: 0; padding: 8px 12px 16px;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 17px; }
}

/* ---------- 버튼과 선택 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none;
  border-radius: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink);
  box-shadow: 0 3px 0 var(--ink); cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn-main { background: var(--dice); color: #fff; }
.btn-main:hover { background: var(--dice-dark); }
.btn-sub:hover { background: var(--mist); }
.btn-ghost { border-color: transparent; box-shadow: none; background: transparent; text-decoration: underline; text-underline-offset: 3px; padding-left: 6px; padding-right: 6px; }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn-block { width: 100%; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer; font-weight: 600; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px;
}
.link-btn .ico { width: 18px; height: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 15px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .die { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line-2); text-decoration: none; font-weight: 600; font-size: 15px;
}
.pill:hover { border-color: var(--ink); }

/* ---------- 게임 타일 (상자 대신 쓰는 그림) ---------- */
.tile {
  position: relative; display: grid; place-items: center; flex: none;
  width: 68px; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  background-color: var(--mist); border: 1.5px solid var(--line);
}
.tile span { position: relative; font-family: var(--display); font-size: 32px; line-height: 1; color: var(--ink); }
.tile[data-g="family"] { background-image: radial-gradient(circle at 100% 100%, var(--dice-tint) 0 46%, transparent 47%); }
.tile[data-g="party"] {
  background-image:
    radial-gradient(circle at 18% 22%, var(--dice) 0 3px, transparent 3.6px),
    radial-gradient(circle at 82% 30%, var(--ink) 0 2.5px, transparent 3px),
    radial-gradient(circle at 26% 80%, var(--ink) 0 2.5px, transparent 3px),
    radial-gradient(circle at 78% 78%, var(--dice) 0 3px, transparent 3.6px);
}
.tile[data-g="strategy"] {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(28, 34, 48, 0.08) 13px 14px),
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(28, 34, 48, 0.08) 13px 14px);
}
.tile[data-g="traditional"] {
  background-image:
    linear-gradient(45deg, transparent calc(50% - 1px), rgba(228, 87, 46, 0.45) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), rgba(228, 87, 46, 0.45) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
}
.tile-lg { width: 92px; border-radius: 22px; border-width: 2px; border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.tile-lg span { font-size: 46px; }
.tile-sm { width: 34px; border-radius: 9px; }
.tile-sm span { font-size: 15px; }

/* ---------- 게임 카드 ---------- */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 12px; }
.gcard {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: var(--ink);
}
.gcard:hover { border-color: var(--ink); }
.gcard-body { display: grid; gap: 3px; min-width: 0; }
.gcard-name { font-weight: 800; font-size: 18px; line-height: 1.35; }
.gcard-one { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.gcard-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.gcard-meta span { display: inline-flex; align-items: center; gap: 4px; }
.gcard-meta .ico, .gcard-meta .die { width: 15px; height: 15px; }

/* ---------- 처음 화면 ---------- */
.hero { padding: 40px 0 48px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.hero-grid > * { min-width: 0; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: start; } .hero { padding: 64px 0 72px; } }
.hero-q { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 9vw, 76px); line-height: 1.08; letter-spacing: -0.005em; }
.hero-lead { margin-top: 14px; font-size: 17px; color: var(--muted); max-width: 30em; }
.picker { margin-top: 28px; }
.tokens { display: flex; flex-wrap: wrap; gap: clamp(8px, 2.6vw, 12px); }
.token {
  width: clamp(56px, 15.5vw, 68px); height: clamp(56px, 15.5vw, 68px); border-radius: 50%;
  font-family: var(--display); font-size: clamp(25px, 7vw, 30px); line-height: 1;
  border: 2.5px solid var(--ink); background: #fff; color: var(--ink);
  box-shadow: 0 5px 0 var(--ink); cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
}
.token:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.token:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.token[aria-checked="true"] { background: var(--dice); color: #fff; }
.picker-label { margin: 22px 0 10px; font-weight: 800; font-size: 18px; }
.search-box {
  display: flex; align-items: center; gap: 8px; margin-top: 30px;
  padding: 6px 6px 6px 14px; border: 2px solid var(--ink); border-radius: 16px; background: #fff;
}
.search-box .ico { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; padding: 10px 2px; }
.search-box .btn { min-height: 44px; box-shadow: none; border-width: 0; }
.hero-side { background: var(--mist); border-radius: var(--r-l); padding: 18px; }
.deal-title { font-weight: 800; font-size: 17px; margin: 2px 4px 12px; }
.deal { display: grid; gap: 10px; }
.deal .gcard { border-color: transparent; }
.deal .gcard:hover { border-color: var(--ink); }
.deal-in { animation: deal 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes deal { from { opacity: 0; transform: translateY(10px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.more-link { display: inline-block; margin: 14px 4px 2px; font-weight: 700; }
.deal-empty { background: #fff; border-radius: var(--r); padding: 18px; color: var(--muted); }

.band { background: var(--mist); padding: 56px 0; }
.band-white { background: #fff; }
.sec-title { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 42px); line-height: 1.15; }
.sec-lead { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 38em; }
.band .gcards, .band-white .gcards { margin-top: 26px; }
.col-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.col-card {
  display: grid; gap: 6px; align-content: start; padding: 18px; min-height: 168px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); text-decoration: none;
}
.col-card:hover { border-color: var(--ink); }
.col-name { font-weight: 800; font-size: 19px; }
.col-lead { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.col-tiles { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.col-count { margin-left: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }

.trad-band { padding: 64px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trad-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .trad-grid { grid-template-columns: 360px 1fr; gap: 56px; } }
.trad-art { max-width: 360px; width: 100%; margin: 0 auto; }
.trad-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 24px; }

.space-band { background: var(--dice-tint); padding: 60px 0; }
.space-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .space-grid { grid-template-columns: 1.3fr 1fr; gap: 56px; } }
.space-band .btn { margin-top: 22px; }
.space-art { display: flex; align-items: center; gap: 20px; }
.qr-mock { width: 128px; height: 128px; flex: none; display: grid; place-items: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); }
.qr-mock .ico { width: 76px; height: 76px; }
.qr-steps { display: grid; gap: 8px; counter-reset: q; }
.qr-steps span { counter-increment: q; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.qr-steps span::before { content: counter(q); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; }

/* ---------- 쪽 머리 ---------- */
.page-head { padding: 40px 0 24px; }
.page-title { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 7vw, 56px); line-height: 1.12; }
.page-lead { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 40em; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.tip { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--mist); max-width: 40em; }
.list-sec { padding-bottom: 64px; }
.other-title { margin-top: 48px; }

/* ---------- 게임 찾기 ---------- */
.finder { padding-bottom: 72px; }
.finder .search-box { margin-top: 0; }
.filters { display: grid; gap: 14px; margin: 22px 0 8px; }
.filter { display: grid; gap: 8px; }
@media (min-width: 760px) { .filter { grid-template-columns: 80px 1fr; align-items: center; } }
.filter-k { font-weight: 800; font-size: 15px; }
.filter-more summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.filter-more .chips { margin-top: 10px; }
.finder-bar { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; }
.finder-count { font-weight: 800; }
.empty { padding: 40px 0; text-align: center; }

/* ---------- 게임 쪽 ---------- */
.game { padding: 28px 0 40px; }
.game-head { display: flex; gap: 18px; align-items: center; }
.game-name { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 8vw, 60px); line-height: 1.08; }
.game-orig { color: var(--muted); font-size: 15px; margin-top: 4px; }
.game-one { margin-top: 6px; font-size: 18px; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 22px; }
@media (min-width: 620px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts li { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--mist); }
.facts .ico, .facts .die { width: 24px; height: 24px; color: var(--ink); }
.facts span { display: grid; line-height: 1.3; }
.facts b { font-size: 16px; }
.facts small { font-size: 13px; color: var(--muted); }
.game-intro { margin-top: 20px; font-size: 16.5px; }
.compare { margin-top: 12px; padding: 12px 16px; border-left: 4px solid var(--dice); background: var(--dice-tint); border-radius: 0 12px 12px 0; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 18px; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; }
.status .ico { width: 18px; height: 18px; }
.status-draft { background: var(--warn-tint); color: var(--warn); }
.status-draft .link-btn { color: var(--warn); }
.status-ok { background: var(--ok-tint); color: var(--ok); }

.tabs {
  position: sticky; top: calc(var(--head-h) + 8px); z-index: 20;
  display: flex; gap: 4px; padding: 4px; margin: 26px 0 8px;
  background: var(--mist); border-radius: 14px; border: 1px solid var(--line);
}
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 15.5px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--line-2), 0 0 0 1.5px var(--ink); }
html:not(.js) .tabs { display: none; }
.js .panel:not(.active) { display: none; }
.panel { padding-top: 14px; }
.h2 { font-size: 22px; font-weight: 800; line-height: 1.35; margin: 34px 0 14px; }
.panel > .h2:first-child { margin-top: 10px; }
.h3 { font-size: 18px; font-weight: 800; line-height: 1.4; margin: 30px 0 12px; }

.rcard { border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); background: #fff; overflow: hidden; }
.rcard-row { display: grid; gap: 4px; padding: 16px 18px; }
.rcard-row + .rcard-row { border-top: 1.5px dashed var(--line-2); }
@media (min-width: 620px) { .rcard-row { grid-template-columns: 96px 1fr; gap: 16px; } }
.rcard-k { font-weight: 800; color: var(--dice); font-size: 15px; padding-top: 2px; }
.rcard-v { font-size: 17px; line-height: 1.65; }
.turn { display: grid; gap: 6px; counter-reset: t; }
.turn li { counter-increment: t; position: relative; padding-left: 34px; }
.turn li::before { content: counter(t); position: absolute; left: 0; top: 3px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }

.checklist { display: grid; gap: 6px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--mist); cursor: pointer; }
.checklist input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--dice); flex: none; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.steps { display: grid; gap: 10px; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 2px 0 2px 44px; min-height: 32px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--dice); color: #fff; font-weight: 800; font-size: 15px;
}
.steps-big > li { display: grid; gap: 2px; padding-bottom: 8px; }
.steps-big b { font-size: 17px; }
.steps-big span { color: var(--muted); }
.steps-row { display: grid; gap: 12px; margin-bottom: 28px; }
@media (min-width: 760px) { .steps-row { grid-template-columns: repeat(3, 1fr); } }
.steps-row > li { display: grid; padding: 14px 14px 14px 58px; background: var(--mist); border-radius: 14px; }
.steps-row > li::before { left: 14px; top: 16px; }
.steps-row span { color: var(--muted); font-size: 14.5px; }

.examples { display: grid; gap: 10px; }
@media (min-width: 620px) { .examples { grid-template-columns: 1fr 1fr; } }
.example { padding: 14px 16px; border-radius: 14px; background: var(--mist); }
.example-t { font-weight: 800; margin-bottom: 4px; }

.list { display: grid; gap: 8px; }
.list > li { position: relative; padding-left: 20px; }
.list > li::before { content: ""; position: absolute; left: 3px; top: 0.72em; width: 7px; height: 7px; border-radius: 2px; background: var(--dice); transform: rotate(45deg); }

.figure { margin: 22px 0 6px; padding: 20px; border-radius: 18px; background: var(--mist); }
.figure .diagram { max-width: 320px; margin: 0 auto; }
.figure figcaption { margin-top: 12px; font-size: 14.5px; color: var(--muted); text-align: center; }

.rule-find { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; margin: 4px 0 6px; }
.rule-find input { flex: 1; border: 0; outline: none; padding: 9px 0; background: transparent; }
.rule-find .ico { color: var(--muted); width: 18px; height: 18px; }
.rule-sec.miss { display: none; }
.rule-sec li.miss { display: none; }
mark { background: #ffe1a8; color: inherit; border-radius: 3px; padding: 0 1px; }

.qa { display: grid; gap: 0; border-top: 1px solid var(--line); }
.qa-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qa-q { font-weight: 800; }
.qa-q::before { content: "Q. "; color: var(--dice); }
.qa-a { margin-top: 4px; color: var(--ink-2); }

.house { margin-top: 40px; padding: 20px; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 0 4px 0 var(--ink); }
.house .h3 { margin-top: 0; }
.house-list { display: grid; gap: 8px; margin: 14px 0 16px; }
.house-list label { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--mist); cursor: pointer; }
.house-list input { width: 22px; height: 22px; accent-color: var(--dice); flex: none; margin-top: 2px; }
.house-list span { display: grid; }
.house-list small { color: var(--muted); font-size: 14px; line-height: 1.5; }
.house-card { white-space: pre-wrap; font-family: var(--font); font-size: 15.5px; line-height: 1.7; background: var(--dice-tint); padding: 16px; border-radius: 14px; margin: 0; }

.source { margin-top: 44px; padding: 16px 18px; border-radius: 16px; background: var(--mist); font-size: 14.5px; color: var(--ink-2); display: grid; gap: 6px; }
.related { margin-top: 48px; }
.related .h2 { margin-top: 0; }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
}
.cta-bar .btn { min-height: 54px; font-size: 17px; }
.has-cta { padding-bottom: 92px; }

/* ---------- 전통놀이, 처음이라면, 공간 ---------- */
.trad-page, .space-page { padding-bottom: 72px; }
.trad-feature { display: grid; gap: 28px; align-items: center; padding: 24px; border-radius: var(--r-l); background: var(--mist); margin-bottom: 20px; }
@media (min-width: 860px) { .trad-feature { grid-template-columns: 300px 1fr; } }
.trad-feature .h2 { margin-top: 0; }
.trad-feature .trad-art { max-width: 300px; }
.tip-box { margin-top: 48px; padding: 22px; border-radius: var(--r-l); border: 1.5px solid var(--line-2); }
.tip-box .h2 { margin-top: 0; }
.learn, .about { padding-bottom: 72px; }
.glossary { display: grid; gap: 0; border-top: 1px solid var(--line); }
.glossary > div { display: grid; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 620px) { .glossary > div { grid-template-columns: 160px 1fr; gap: 16px; } }
.glossary dt { font-weight: 800; }
.glossary dd { color: var(--ink-2); }

.maker { display: grid; gap: 24px; }
@media (min-width: 900px) { .maker { grid-template-columns: 1.15fr 1fr; align-items: start; } .maker-out { position: sticky; top: calc(var(--head-h) + 16px); } }
.maker-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 16px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.25); }
.maker-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 2px 12px; }
.maker-search input { border: 0; padding: 10px 0; }
.maker-search input:focus { box-shadow: none; }
.maker-search .ico { color: var(--muted); width: 18px; height: 18px; }
.maker-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 6px; max-height: 420px; overflow: auto; padding: 4px 2px; }
.maker-games label { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--mist); cursor: pointer; font-weight: 600; font-size: 15px; }
.maker-games input { width: 19px; height: 19px; accent-color: var(--dice); flex: none; margin: 0; }
.maker-games label.miss { display: none; }
.qr-card { padding: 22px; border: 2px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); text-align: center; background: #fff; }
.qr-card-name { font-family: var(--display); font-size: 28px; line-height: 1.2; }
.qr-box { display: grid; place-items: center; min-height: 220px; margin: 14px 0; }
.qr-box canvas, .qr-box img { width: 220px; height: 220px; image-rendering: pixelated; }
.qr-card-hint { font-weight: 700; color: var(--ink-2); }

.venue { padding: 32px 0 72px; }
.venue-head { margin-bottom: 22px; }
.venue .chips { margin-bottom: 16px; }

/* ---------- 쪽 바닥 ---------- */
.site-foot { background: var(--mist); padding: 44px 0 36px; margin-top: 0; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 20px; }
@media (min-width: 860px) { .foot-grid { grid-template-columns: 1fr 1.4fr; } .foot-note, .foot-copy { grid-column: 1 / -1; } }
.brand-foot { margin: 0; }
.foot-lead { margin-top: 10px; color: var(--muted); max-width: 26em; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; align-content: start; }
.foot-nav a, .foot-nav .link-btn { font-weight: 600; text-decoration: none; color: var(--ink-2); }
.foot-nav a:hover { text-decoration: underline; }
.foot-note { font-size: 13.5px; color: var(--muted); max-width: 56em; }
.foot-copy { font-size: 13px; color: var(--muted); }

/* ---------- 신고창 (아래에서 올라오는 시트) ---------- */
.sheet { padding: 0; border: 0; background: transparent; max-width: 560px; width: 100%; margin: auto; }
.sheet::backdrop { background: rgba(28, 34, 48, 0.45); }
.sheet-body { background: #fff; border-radius: 24px; padding: 20px 20px 22px; display: grid; gap: 14px; max-height: 90vh; overflow: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 21px; font-weight: 800; }
.sheet-actions { display: flex; justify-content: flex-end; }
@media (max-width: 620px) {
  .sheet { margin: auto 0 0; max-width: none; }
  .sheet-body { border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.hp { position: absolute; left: -9999px; }
.form-msg { font-weight: 700; min-height: 1.2em; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--dice-dark); }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 400;
  box-shadow: 0 8px 24px rgba(28, 34, 48, 0.25);
}

/* ---------- 테이블 모드 ---------- */
.tm {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: #fff; color: var(--ink);
  --tm-size: 1;
}
.tm.night { background: #151a24; color: #f1f2f5; }
.tm-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line); }
.tm.night .tm-top { border-color: #2b3242; }
.tm-name { font-family: var(--display); font-size: 24px; line-height: 1.1; margin-right: auto; }
.tm .icon-btn { color: inherit; }
.tm.night .icon-btn:hover { background: #232a38; }
.tm-wake { font-size: 12.5px; font-weight: 700; color: var(--ok); white-space: nowrap; }
.tm-steps { display: flex; gap: 6px; padding: 12px 16px 0; }
.tm-steps button { flex: 1; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; text-align: left; }
.tm-steps i { display: block; height: 7px; border-radius: 4px; background: var(--mist-2); }
.tm.night .tm-steps i { background: #2b3242; }
.tm-steps button[aria-current="step"] i, .tm-steps button.done i { background: var(--dice); }
.tm-steps span { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tm-steps button[aria-current="step"] span { color: inherit; }
.tm-main { flex: 1; overflow: auto; padding: 16px; }
.tm-card { max-width: 720px; margin: 0 auto; padding: 20px; border: 2.5px solid var(--dice); border-radius: 22px; }
.tm.night .tm-card { background: #1c2230; }
.tm-k { font-weight: 800; color: var(--dice); font-size: calc(16px * var(--tm-size)); }
.tm-big { font-size: calc(24px * var(--tm-size)); font-weight: 800; line-height: 1.45; margin-top: 8px; }
.tm-list { display: grid; gap: 12px; margin-top: 10px; counter-reset: tm; }
.tm-list li { counter-increment: tm; position: relative; padding-left: 44px; min-height: 34px; font-size: calc(20px * var(--tm-size)); font-weight: 700; line-height: 1.5; }
.tm-list li::before { content: counter(tm); position: absolute; left: 0; top: calc(0.75em - 16px); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 15px; line-height: 1; }
.tm.night .tm-list li::before { background: var(--dice); }
.tm-check li { cursor: pointer; }
.tm-check li.done { opacity: 0.45; text-decoration: line-through; }
.tm-check li.done::before { content: "✓"; background: var(--ok); }
.tm-sub { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--line-2); font-size: calc(17px * var(--tm-size)); }
.tm-help { margin: 14px auto 0; max-width: 720px; display: block; width: 100%; }
.tm-tools { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.tm.night .tm-tools { border-color: #2b3242; }
.tm-tool { flex: 1 0 auto; min-width: 76px; display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border: 0; border-radius: 12px; background: var(--mist); font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.tm.night .tm-tool { background: #232a38; color: #f1f2f5; }
.tm-tool .ico, .tm-tool .die { width: 22px; height: 22px; }
.tm-nav { display: flex; gap: 8px; max-width: 720px; margin: 16px auto 0; }
.tm-nav .btn { flex: 1; }
.tm.night .btn-sub { background: #1c2230; color: #f1f2f5; border-color: #f1f2f5; box-shadow: 0 3px 0 #f1f2f5; }

.tsheet { position: fixed; inset: 0; z-index: 260; display: flex; align-items: flex-end; justify-content: center; background: rgba(28, 34, 48, 0.45); }
.tsheet-body { width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; background: #fff; color: var(--ink); border-radius: 24px 24px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .tsheet { align-items: center; } .tsheet-body { border-radius: 24px; } }
.tsheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tsheet-head h2 { font-size: 21px; font-weight: 800; }

.score-list { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px; border-radius: 14px; background: var(--mist); }
.score-row input { width: 100%; border: 0; background: transparent; font-weight: 700; font-size: 16px; padding: 6px; border-radius: 8px; }
.score-row input:focus { background: #fff; outline: 2px solid var(--dice); }
.score-ctrl { display: flex; align-items: center; gap: 6px; }
.score-ctrl button { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--ink); background: #fff; font-weight: 800; font-size: 16px; cursor: pointer; }
.score-val { min-width: 54px; text-align: center; font-family: var(--display); font-size: 28px; line-height: 1; }
.timer-face { font-family: var(--display); font-size: clamp(64px, 22vw, 120px); line-height: 1; text-align: center; margin: 12px 0 16px; font-variant-numeric: tabular-nums; }
.timer-face.ring { color: var(--dice); animation: ring 0.6s ease 3; }
@keyframes ring { 50% { transform: scale(1.06); } }
.dice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 18px 0; min-height: 84px; }
.dface { width: 76px; height: 76px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; position: relative; box-shadow: 0 4px 0 var(--ink); }
.dface i { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.dface.red i { background: var(--dice); }
.rolling .dface { animation: shake 0.35s ease; }
@keyframes shake { 30% { transform: rotate(-12deg) translateY(-6px); } 60% { transform: rotate(10deg); } }
.big-result { text-align: center; font-family: var(--display); font-size: 44px; line-height: 1.1; margin: 8px 0; }
.yut-row { display: flex; justify-content: center; gap: 12px; margin: 18px 0 8px; }
.yut { width: 30px; height: 120px; border-radius: 15px; border: 3px solid var(--ink); background: #fff; position: relative; }
.yut.round { background: #d9a066; border-color: #7a4f24; }
.yut.mark::after { content: "×"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-weight: 900; color: var(--dice); }
.finger-pad { position: relative; height: 56vh; border-radius: 20px; background: var(--mist); touch-action: none; overflow: hidden; display: grid; place-items: center; text-align: center; color: var(--muted); font-weight: 700; padding: 20px; user-select: none; -webkit-user-select: none; }
.finger { position: absolute; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; border: 6px solid var(--ink); background: rgba(255, 255, 255, 0.7); pointer-events: none; }
.finger.win { border-color: var(--dice); background: var(--dice); box-shadow: 0 0 0 14px rgba(228, 87, 46, 0.25); }
.finger.lose { opacity: 0.15; }
.team-out { display: grid; gap: 10px; margin-top: 14px; }
.team { padding: 12px 14px; border-radius: 14px; background: var(--mist); }
.team b { color: var(--dice); }
.role-card { margin: 16px 0; padding: 28px 18px; border-radius: 22px; border: 3px solid var(--ink); text-align: center; background: #fff; min-height: 200px; display: grid; place-items: center; cursor: pointer; user-select: none; }
.role-card .role-name { font-family: var(--display); font-size: 46px; line-height: 1.1; color: var(--dice); }
.role-card p { margin-top: 8px; }
.role-cfg { display: grid; gap: 8px; }
.role-cfg .score-row { grid-template-columns: 1fr auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 관리자 ---------- */
.admin { padding: 32px 20px 80px; }
.admin-form { display: grid; gap: 14px; max-width: 420px; margin-top: 16px; }
.admin-body .tabs { position: static; max-width: 560px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 14px 0 22px; }
.stat { padding: 16px; border-radius: 16px; background: var(--mist); }
.stat b { display: block; font-family: var(--display); font-size: 34px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 13.5px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.report { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; display: grid; gap: 8px; }
.report-list { display: grid; gap: 10px; margin-top: 12px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13.5px; color: var(--muted); }
.report-msg { white-space: pre-wrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--mist); }
.badge.new { background: var(--dice-tint); color: var(--dice-dark); }
.badge.draft { background: var(--warn-tint); color: var(--warn); }
.badge.checked { background: var(--ok-tint); color: var(--ok); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 10px 0 4px; }
.bars span { flex: 1; background: var(--dice); border-radius: 4px 4px 0 0; min-height: 2px; }
.notice { padding: 14px 16px; border-radius: 14px; background: var(--warn-tint); color: var(--warn); margin: 12px 0; }
.notice ol { list-style: decimal; padding-left: 20px; margin-top: 6px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--mist); padding: 12px; border-radius: 12px; white-space: pre; overflow: auto; max-height: 360px; }

/* ---------- 인쇄 ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block !important; font-family: var(--font); color: #000; }
  .print-page { page-break-after: always; text-align: center; }
  .print-page:last-child { page-break-after: auto; }
  .print-title { font-family: var(--display); font-size: 40px; margin-top: 10mm; }
  .print-sub { font-size: 18px; margin-top: 4mm; }
  .print-qr { width: 110mm; height: 110mm; margin: 10mm auto; image-rendering: pixelated; }
  .print-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; text-align: center; }
  .print-grid div { border: 1px dashed #999; padding: 4mm; border-radius: 4mm; }
  .print-grid img { width: 38mm; height: 38mm; margin: 0 auto; image-rendering: pixelated; }
  .print-grid b { display: block; font-size: 14px; margin-top: 2mm; }
  .print-grid small { font-size: 11px; color: #555; }
}

/* 브랜드 설명 문구: 룰룰 | 보드게임 룰 하는법 설명서 */
.brand-tag { display: none; margin-left: 2px; padding-left: 10px; border-left: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; white-space: nowrap; }
@media (min-width: 380px) { .brand-tag { display: inline; } }
.foot-tag { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: var(--muted); }
