/* 점심 룰렛 — 거상풍(조선 배경 온라인 게임) 캐주얼 전통 UI (2026-10-31 사용자 요청)
   한지 바탕 · 나무 틀 + 금선 카드 · 단청색(주칠 빨강 · 쪽빛 · 황 · 녹) · 엽전 버튼 · 도장 · 두루마리 시트
   글꼴 : 제목 Gowun Batang(명조) · 본문 Gowun Dodum · 붓글씨 Nanum Brush Script (Google Fonts) */
:root {
  --paper: #f1e6cf;
  --paper2: #fbf4e4;
  --paper3: #efe2c6;
  --ink: #2b1d12;
  --ink2: rgba(43, 29, 18, .64);
  --ink3: rgba(43, 29, 18, .38);
  --sep: rgba(91, 58, 30, .22);
  --wood: #5b3a1e;
  --wood2: #7a5230;
  --wood3: #3e2612;
  --gold: #c9a24a;
  --gold2: #e9d28a;
  --red: #b4321f;
  --red2: #d2473a;
  --red-ink: #8f2416;
  --blue: #2a5d7c;
  --green: #3d7a4d;
  --yellow: #d9a73c;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --serif: "Gowun Batang", "Apple SD Gothic Neo", "Nanum Myeongjo", "Malgun Gothic", serif;
  --sans: "Gowun Dodum", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --brush: "Nanum Brush Script", "Gowun Batang", cursive;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--paper); }
body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  position: relative;
}
/* 한지 결 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app, #sheet, #toast { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; border: 0; background: none; outline: none; }
button { cursor: pointer; }
input::placeholder { color: var(--ink3); }
#app { max-width: 600px; margin: 0 auto; }

.view { min-height: 100dvh; padding: calc(var(--top) + 8px) 0 calc(var(--bottom) + 116px); }

svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.chev { width: 14px; height: 14px; color: var(--ink3); stroke-width: 2.6; }

/* 위쪽 줄 · 제목 */
.nav { position: relative; height: 44px; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.nav .sp { flex: 1; }
.round { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; z-index: 1; background: var(--paper2); border: 1.5px solid var(--wood); color: var(--wood); box-shadow: inset 0 0 0 2px var(--paper2), inset 0 0 0 3px var(--gold); }
.title { padding: 0 20px 0; font-family: var(--brush); font-size: 46px; font-weight: 400; letter-spacing: 0; line-height: 1.05; color: var(--ink); }
.title.small { font-family: var(--serif); font-size: 27px; font-weight: 700; padding-bottom: 4px; letter-spacing: -0.01em; }
.sub { padding: 2px 20px 12px; font-size: 13px; color: var(--ink2); }
.sub b { color: var(--red-ink); font-weight: 700; }

/* 카드 = 나무 틀 + 금선 */
.card { margin: 0 16px; background: var(--paper2); border: 2px solid var(--wood); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 2px var(--paper2), inset 0 0 0 3px var(--gold), 0 3px 0 var(--wood3), 0 8px 16px rgba(62, 38, 18, .14); }
.card + .card { margin-top: 12px; }
.card > :first-child { margin-top: 3px; }
.card > :last-child { margin-bottom: 3px; }
.head { padding: 18px 20px 8px; display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink2); }
.head b { font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--wood); }
.head b::before { content: "◆ "; color: var(--gold); font-size: 10px; vertical-align: 2px; }
.row { display: flex; align-items: center; gap: 12px; padding-left: 14px; width: 100%; text-align: left; }
.tile { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--wood2); display: grid; place-items: center; font-size: 19px; box-shadow: inset 0 0 0 2px var(--paper2); }
.row .body { flex: 1; min-width: 0; min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 0; border-bottom: 1px dashed var(--sep); }
.row:last-child .body { border-bottom: 0; }
.txt { flex: 1; min-width: 0; }
.t { font-family: var(--serif); font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s { margin-top: 2px; font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 12px; color: var(--ink2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta b { display: block; font-size: 13.5px; font-weight: 700; color: var(--wood); }
.tag { font-family: var(--sans); font-size: 10px; font-weight: 700; color: var(--wood); background: var(--paper3); border: 1px solid var(--sep); padding: 1px 6px; border-radius: 4px; flex: none; }
.tag.off { color: #fff; background: var(--red); border-color: var(--red-ink); }
.empty { padding: 26px 20px; text-align: center; font-size: 14px; color: var(--ink2); line-height: 1.55; }
.row.dim .t, .row.dim .s { color: var(--ink3); }
.row.dim .tile { opacity: .5; }

/* 칩 = 나무패 */
.chips { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 8px; background: var(--paper2); border: 1.5px solid var(--wood2); font-size: 13px; font-weight: 700; color: var(--wood); box-shadow: 0 2px 0 var(--wood3); }
.chips button.on { background: linear-gradient(var(--red2), var(--red)); color: #fff6e6; border-color: var(--red-ink); box-shadow: 0 2px 0 var(--red-ink), inset 0 1px 0 rgba(255, 255, 255, .25); }
.chips button:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--wood3); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* 오늘의 추천 (방) */
.pick { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; }
.pick .ti { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--wood2); display: grid; place-items: center; font-size: 25px; box-shadow: inset 0 0 0 2px var(--paper2); }
.pick .k { font-size: 12px; font-weight: 700; color: var(--blue); }
.pick .n { margin-top: 1px; font-family: var(--serif); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 54px; }
.pick .s { margin-top: 2px; }
/* 도장 */
.seal { position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(-10deg); width: 44px; height: 44px; border: 2.5px solid var(--red); border-radius: 6px; color: var(--red); font-family: var(--brush); font-size: 22px; line-height: 1; display: grid; place-items: center; opacity: .9; box-shadow: inset 0 0 0 1.5px var(--paper2), inset 0 0 0 2.5px var(--red); mix-blend-mode: multiply; }
.seal.big { position: static; transform: rotate(-10deg); width: 58px; height: 58px; font-size: 28px; margin: 0 auto; }

/* 룰렛 — 나무 테두리 바퀴 + 엽전 축 */
.wheelbox { position: relative; width: 304px; height: 304px; margin: 8px auto 0; }
.wheelbox canvas { position: absolute; left: 2px; top: 2px; width: 300px; height: 300px; display: block; border-radius: 50%; box-shadow: 0 12px 28px rgba(62, 38, 18, .28); transition: transform 4.6s cubic-bezier(.12, .7, .08, 1); will-change: transform; }
.wheelbox canvas.fast { transition-duration: .7s; }
.pointer { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 34px; height: 40px; z-index: 3; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.hub { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 40% 35%, #f3dc92, #c9a24a 55%, #9a7527 100%); border: 2px solid #7a5a1c; box-shadow: 0 3px 8px rgba(0, 0, 0, .3), inset 0 0 0 3px rgba(255, 240, 190, .45); display: grid; place-items: center; }
.hub::before { content: ""; width: 16px; height: 16px; background: var(--wood3); border: 2px solid #7a5a1c; }
.hub i { position: absolute; font-family: var(--serif); font-size: 11px; font-weight: 700; color: #4a3410; font-style: normal; }
.hub i:nth-child(1) { top: 5px; } .hub i:nth-child(2) { bottom: 5px; } .hub i:nth-child(3) { right: 7px; } .hub i:nth-child(4) { left: 7px; }
.wheelnote { margin: 12px 20px 0; text-align: center; font-size: 13px; color: var(--ink2); min-height: 18px; }
/* 큰 버튼 = 주칠 옻칠 버튼 */
.spinbtn { display: block; width: calc(100% - 32px); margin: 14px 16px 0; height: 56px; border-radius: 12px; background: linear-gradient(var(--red2), var(--red)); color: #fff6e6; font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .08em; border: 2px solid var(--red-ink); box-shadow: inset 0 0 0 2px rgba(255, 230, 170, .35), 0 4px 0 var(--red-ink), 0 10px 18px rgba(143, 36, 22, .3); }
.spinbtn:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px rgba(255, 230, 170, .35), 0 2px 0 var(--red-ink); }
.spinbtn:disabled { opacity: .5; }
.spinbtn.ghost { background: var(--paper2); color: var(--wood); border-color: var(--wood2); box-shadow: inset 0 0 0 2px var(--paper2), inset 0 0 0 3px var(--gold), 0 3px 0 var(--wood3); height: 48px; font-size: 15px; margin-top: 10px; letter-spacing: 0; }

/* 검색 */
.search { margin: 0 16px 12px; height: 42px; border-radius: 8px; background: var(--paper2); border: 1.5px solid var(--wood2); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--ink2); box-shadow: inset 0 1px 3px rgba(62, 38, 18, .12); }
.search input { flex: 1; min-width: 0; height: 100%; font-size: 15px; color: var(--ink); }
.search svg { width: 17px; height: 17px; }

/* 기록 통계 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 14px; }
.stat { border-radius: 8px; background: var(--paper); border: 1px solid var(--sep); padding: 10px 10px; }
.stat span { font-size: 11.5px; color: var(--ink2); font-weight: 700; }
.stat b { display: block; margin-top: 2px; font-family: var(--serif); font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--wood); }
.del { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink3); }
.del svg { width: 18px; height: 18px; }

/* 정보 */
.info .body { min-height: 50px; }
.info .t { font-size: 15px; font-family: var(--sans); font-weight: 600; }
.info .v { font-size: 13.5px; color: var(--ink2); text-align: right; white-space: nowrap; }
.note { padding: 14px 18px 16px; font-size: 13.5px; line-height: 1.6; color: var(--ink2); }
.note b { color: var(--ink); font-weight: 700; }
.note p + p { margin-top: 8px; }
.steps { padding: 6px 18px 16px; font-size: 13.5px; line-height: 1.65; color: var(--ink2); }
.steps li { margin-left: 18px; }
.linkbtn { color: var(--blue); font-weight: 700; font-size: 13px; }

/* 떠 있는 탭바 = 나무 현판 */
.dock { position: fixed; left: 16px; right: 16px; bottom: calc(var(--bottom) + 10px); display: flex; gap: 10px; z-index: 20; max-width: 560px; margin: 0 auto; align-items: center; }
.tabs { flex: 1; height: 60px; border-radius: 14px; padding: 5px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  background: linear-gradient(#8a5f38, var(--wood) 55%, #4a2e16); border: 2px solid var(--wood3); box-shadow: inset 0 1px 0 rgba(255, 220, 160, .3), inset 0 0 0 3px rgba(201, 162, 74, .35), 0 6px 0 var(--wood3), 0 12px 22px rgba(0, 0, 0, .28); }
.tab { border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: #e6d3ad; font-family: var(--serif); }
.tab svg { width: 21px; height: 21px; }
.tab.on { background: var(--paper2); color: var(--red-ink); box-shadow: inset 0 0 0 1.5px var(--gold); }
.tab.on svg { color: var(--red); stroke-width: 2.3; }
/* 엽전 버튼 */
.add { position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #4a3410;
  background: radial-gradient(circle at 40% 35%, #f3dc92, #c9a24a 55%, #9a7527 100%); border: 2px solid #7a5a1c; box-shadow: 0 5px 0 #6b4e14, 0 10px 18px rgba(0, 0, 0, .3), inset 0 0 0 3px rgba(255, 240, 190, .45); }
.add::before { content: ""; width: 15px; height: 15px; background: var(--wood3); border: 2px solid #7a5a1c; }
.add i { position: absolute; font-family: var(--serif); font-size: 11px; font-weight: 700; font-style: normal; }
.add i:nth-child(1) { top: 5px; } .add i:nth-child(2) { bottom: 5px; } .add i:nth-child(3) { right: 7px; } .add i:nth-child(4) { left: 7px; }
.add:active { transform: translateY(3px); box-shadow: 0 2px 0 #6b4e14, inset 0 0 0 3px rgba(255, 240, 190, .45); }

/* 아래에서 올라오는 두루마리 */
#sheet:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(43, 29, 18, .45); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 600px; margin: 0 auto; background: var(--paper); border-top: 14px solid var(--wood); border-radius: 12px 12px 0 0; padding: 14px 0 calc(var(--bottom) + 16px); max-height: 90dvh; overflow-y: auto; animation: up .32s cubic-bezier(.2, .9, .25, 1.15); box-shadow: 0 -8px 40px rgba(0, 0, 0, .3), inset 0 2px 0 var(--gold); }
.sheet .card { margin: 0 16px; }
.sheet .card + .card { margin-top: 10px; }
.res { padding: 18px 18px 14px; text-align: center; position: relative; }
.res .k { font-family: var(--brush); font-size: 24px; color: var(--blue); line-height: 1; }
.res .big { margin: 10px auto 0; width: 78px; height: 78px; border-radius: 50%; background: var(--paper); border: 2px solid var(--wood2); display: grid; place-items: center; font-size: 40px; box-shadow: inset 0 0 0 3px var(--paper2), inset 0 0 0 4px var(--gold); }
.res .n { margin-top: 10px; font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.2; }
.res .s { margin-top: 5px; font-size: 13px; white-space: normal; }
.res .why { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.res .seal { right: 16px; top: 16px; transform: rotate(12deg); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px 14px; }
.facts div { border-radius: 8px; background: var(--paper); border: 1px solid var(--sep); padding: 9px 8px; text-align: center; }
.facts span { display: block; font-size: 11px; color: var(--ink2); font-weight: 700; }
.facts b { display: block; margin-top: 2px; font-family: var(--serif); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--wood); }
.menus { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 16px 14px; }
.menus span { font-size: 12.5px; font-weight: 700; color: var(--wood); background: var(--paper); padding: 5px 10px; border-radius: 6px; border: 1px solid var(--sep); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 16px 0; }
.acts button, .acts a { height: 50px; border-radius: 10px; background: var(--paper2); border: 1.5px solid var(--wood2); font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--wood); display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 3px 0 var(--wood3); }
.acts .pri { background: linear-gradient(var(--red2), var(--red)); color: #fff6e6; border-color: var(--red-ink); box-shadow: inset 0 0 0 2px rgba(255, 230, 170, .35), 0 3px 0 var(--red-ink); }
.acts button:active, .acts a:active { transform: translateY(2px); box-shadow: none; }
.acts.one { grid-template-columns: 1fr; }
.acts svg { width: 18px; height: 18px; }
.subacts { display: flex; justify-content: center; gap: 22px; margin: 14px 16px 0; font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.subacts button.on { color: var(--blue); }
.sheet .title.small { padding-top: 2px; }
.sheet .sub { padding-bottom: 8px; }
.sheet .chips { padding-bottom: 6px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--paper3); border: 1.5px solid var(--wood2); flex: none; transition: .2s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 23px; height: 23px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f3dc92, #c9a24a 60%, #9a7527); border: 1px solid #7a5a1c; transition: .2s; }
.switch.on { background: var(--green); border-color: #2a5a37; }
.switch.on::after { transform: translateX(20px); }

#toast { position: fixed; left: 50%; bottom: calc(var(--bottom) + 94px); transform: translateX(-50%) translateY(20px); background: var(--wood3); color: #f6e9cc; border: 1.5px solid var(--gold); padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 700; opacity: 0; transition: .25s; pointer-events: none; z-index: 99; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .wheelbox canvas { transition-duration: .5s; }
  .sheet, .scrim { animation: none; }
}
@media (min-width: 600px) { .view { padding-top: 24px; } }
