/* 놀이링크 — 아이보리 바탕 · 남색 신뢰 · 금색 포인트 (GPT×Claude 협의안) */
:root{
  --bg:#F7F5EF; --card:#FFFFFF; --navy:#172742; --gold:#B68A36; --sub:#596579;
  --line:#E6E1D4; --navy2:#24395e; --gold-soft:#F3E7CC; --ok:#2E8B6A; --bad:#C2453D;
  --c1:#E2574C; --c2:#3B7DD8; --c3:#2E9E6B; --c4:#E8B230; --c5:#8A5CD0; --c6:#E07A3A;
  --f:"Pretendard Variable",Pretendard,-apple-system,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  --fd:"Black Han Sans","Pretendard Variable",sans-serif;
  --r:20px;
  color-scheme:light;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--navy);font-family:var(--f);font-size:16px;line-height:1.55}
body{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
button,input,textarea,select{font-family:inherit;font-size:16px;color:inherit}
button{cursor:pointer;touch-action:manipulation}
a{color:var(--navy2)}
h1,h2,h3{margin:0;text-wrap:balance}
p{margin:0}
.num{font-variant-numeric:tabular-nums}
.wrap{max-width:560px;margin:0 auto;padding:0 max(16px,env(safe-area-inset-right,0px)) 40px max(16px,env(safe-area-inset-left,0px))}

/* top bar */
.top{position:sticky;top:0;z-index:20;background:rgba(247,245,239,.94);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.top-in{max-width:560px;margin:0 auto;display:flex;align-items:center;gap:10px;padding:10px max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px));min-height:56px}
.back{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--card);display:grid;place-items:center;flex:none}
.back svg{width:18px;height:18px}
.top-t{flex:1;min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.logo{font-family:var(--fd);font-size:22px;letter-spacing:.5px;color:var(--navy);text-decoration:none}
.logo b{color:var(--gold);font-weight:400}
.chip-time{flex:none;font-size:12px;font-weight:700;padding:5px 10px;border-radius:99px;background:var(--gold-soft);color:#7a5a17;white-space:nowrap}
.chip-time.low{background:#FBE3E1;color:var(--bad)}

/* home */
.hero{padding:26px 0 8px;display:flex;flex-direction:column;gap:10px}
.hero h1{font-family:var(--fd);font-weight:400;font-size:clamp(30px,8vw,40px);line-height:1.15}
.hero h1 em{font-style:normal;color:var(--gold)}
.hero p{color:var(--sub)}
.facts{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.facts span{font-size:13px;font-weight:600;background:var(--card);border:1px solid var(--line);border-radius:99px;padding:5px 11px}
.cats{display:flex;gap:6px;overflow-x:auto;padding:16px 0 6px;scrollbar-width:none}
.cats::-webkit-scrollbar{display:none}
.cats button{flex:none;border:1px solid var(--line);background:var(--card);border-radius:99px;padding:8px 14px;font-size:14px;font-weight:600}
.cats button[aria-pressed="true"]{background:var(--navy);color:#fff;border-color:var(--navy)}
.sec-t{font-size:14px;font-weight:700;color:var(--sub);margin:18px 0 10px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tcard{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:14px;display:flex;flex-direction:column;gap:8px;text-align:left;box-shadow:0 1px 2px rgba(23,39,66,.04);min-width:0;text-decoration:none;color:inherit}
.tcard:active{transform:scale(.98)}
.tcard .ic{width:48px;height:48px;border-radius:14px;display:grid;place-items:center}
.tcard .ic svg{width:30px;height:30px}
.tcard b{font-size:16px}
.tcard span{font-size:13px;color:var(--sub);line-height:1.4}
.tcard.soon{opacity:.55;pointer-events:none;padding:10px 12px;flex-direction:row;align-items:center}
.tcard.soon b{font-size:14px;font-weight:600}
.tag{font-size:11px;font-weight:700;color:var(--gold)}
.grid.soon-g{grid-template-columns:1fr 1fr}

/* panels & forms */
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:18px;display:flex;flex-direction:column;gap:14px;margin-top:14px}
.panel h2{font-size:20px}
.lead{color:var(--sub);font-size:15px}
.fld{display:flex;flex-direction:column;gap:6px}
.fld label{font-size:14px;font-weight:700}
.fld small{font-size:12px;color:var(--sub)}
.inp,textarea.inp,select.inp{width:100%;border:1px solid var(--line);background:#FDFCF9;border-radius:14px;padding:13px 14px;outline:none}
textarea.inp{min-height:120px;resize:vertical;line-height:1.5}
.inp:focus{border-color:var(--navy);background:#fff}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.row>*{min-width:0}
.btn{min-height:52px;border-radius:16px;border:0;background:var(--navy);color:#fff;font-weight:700;font-size:17px;padding:0 18px;width:100%;display:flex;align-items:center;justify-content:center;gap:8px}
.btn:disabled{opacity:.45}
.btn.sub{background:#fff;color:var(--navy);border:1.5px solid var(--navy)}
.btn.gold{background:var(--gold)}
.btn.sm{min-height:42px;font-size:15px;border-radius:12px;width:auto}
.btn:focus-visible,.tcard:focus-visible,.cats button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.lock{display:flex;justify-content:space-between;gap:10px;align-items:center;background:var(--navy);color:#F3E2B8;border-radius:14px;padding:12px 14px;font-size:14px}
.lock b{color:#fff}
.err{color:var(--bad);font-size:14px;font-weight:600}
.note{font-size:13px;color:var(--sub);background:#F2EFE6;border-radius:12px;padding:10px 12px;line-height:1.5}
.pills{display:flex;flex-wrap:wrap;gap:6px}
.pill{border:1px solid var(--line);background:#fff;border-radius:99px;padding:8px 14px;font-weight:600;font-size:15px}
.pill[aria-pressed="true"]{background:var(--navy);color:#fff;border-color:var(--navy)}
.pill.done{background:#F2EFE6;color:var(--sub)}

/* room */
.r-title{padding:18px 0 4px;display:flex;flex-direction:column;gap:4px}
.r-title h1{font-size:24px;line-height:1.25}
.r-title p{color:var(--sub);font-size:14px}
.stage{background:var(--card);border:1px solid var(--line);border-radius:var(--r);padding:16px;margin-top:12px;display:flex;flex-direction:column;gap:14px;position:relative;overflow:hidden}
.board{display:flex;flex-direction:column;gap:6px}
.brow{display:grid;grid-template-columns:34px 1fr auto;gap:8px;align-items:center;padding:10px 12px;border-radius:12px;background:#FAF8F2}
.brow .rk{font-weight:800;color:var(--sub);text-align:center}
.brow.me{outline:2px solid var(--gold);background:var(--gold-soft)}
.brow:nth-child(1) .rk{color:var(--gold)}
.brow .v{font-weight:800}
.empty{color:var(--sub);font-size:14px;text-align:center;padding:14px 0}
.share{display:flex;flex-direction:column;gap:8px;background:var(--gold-soft);border-radius:var(--r);padding:16px}
.share b{font-size:16px}
.share .lnk{font-size:12px;word-break:break-all;background:#fff;border-radius:10px;padding:8px 10px;color:var(--sub);max-height:62px;overflow:hidden}
.promo{margin-top:18px;background:var(--navy);color:#E9ECF4;border-radius:var(--r);padding:18px;display:flex;flex-direction:column;gap:8px}
.promo .k{font-size:12px;letter-spacing:.12em;color:#D9B76A;font-weight:700}
.promo b{font-size:17px;color:#fff;line-height:1.35}
.promo p{font-size:14px;color:#B9C0D3}
.promo .row a{flex:1;text-align:center;text-decoration:none;font-weight:700;border-radius:12px;padding:11px 8px;font-size:14px}
.promo .a1{background:#D9B76A;color:var(--navy)}
.promo .a2{border:1px solid #4a5d82;color:#fff}
.foot{text-align:center;font-size:12px;color:var(--sub);margin-top:22px;line-height:1.7}
.foot a{color:var(--sub)}
.merge{font-size:14px}
.merge summary{cursor:pointer;color:var(--sub);font-weight:600;padding:6px 0}

/* overlay */
.ov{position:fixed;inset:0;background:rgba(23,39,66,.55);z-index:50;display:grid;place-items:center;padding:20px}
.ov-c{background:#fff;border-radius:24px;padding:22px;max-width:420px;width:100%;display:flex;flex-direction:column;gap:14px;text-align:center}
.ov-c h3{font-size:20px}
.count{font-family:var(--fd);font-size:96px;color:#fff;text-shadow:0 6px 30px rgba(0,0,0,.25);animation:pop .8s ease-out}
@keyframes pop{0%{transform:scale(.4);opacity:0}40%{transform:scale(1.15);opacity:1}100%{transform:scale(1)}}
#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--navy);color:#fff;padding:12px 18px;border-radius:14px;font-weight:600;font-size:15px;z-index:60;max-width:calc(100% - 32px)}

/* game HUD */
.hud{display:flex;justify-content:space-between;align-items:center;gap:8px}
.hud div{display:flex;flex-direction:column;align-items:flex-start}
.hud div:last-child{align-items:flex-end}
.hud small{font-size:12px;color:var(--sub);font-weight:600}
.hud b{font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.play{position:relative;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.howto{display:flex;flex-direction:column;gap:12px;align-items:stretch;text-align:center}
.howto .big{font-size:18px;font-weight:700}
.result-big{text-align:center;display:flex;flex-direction:column;gap:4px;padding:6px 0}
.result-big small{color:var(--sub);font-weight:600}
.result-big b{font-size:44px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1}
.result-big span{color:var(--gold);font-weight:700}

/* decide tools */
canvas.cv{width:100%;display:block;border-radius:14px;background:#FDFCF9}
.namebtns{display:flex;flex-wrap:wrap;gap:6px}
.list-ol{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
.list-ol li{display:flex;gap:10px;align-items:center;padding:11px 12px;border-radius:12px;background:#FAF8F2;font-weight:600;animation:slide .35s ease-out both}
.list-ol li i{font-style:normal;width:30px;height:30px;border-radius:10px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:800;font-size:14px;flex:none}
@keyframes slide{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.teams{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.team{border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:6px;border:2px solid}
.team h3{font-size:16px}
.team span{font-weight:600}
.slip{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.slip button{aspect-ratio:1/1.1;border-radius:16px;border:2px solid var(--line);background:#FAF8F2;font-weight:700;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:6px;transition:transform .3s}
.slip button.open{background:var(--navy);color:#fff;border-color:var(--navy)}
.slip button.win{background:var(--gold);border-color:var(--gold);color:#fff}
.slip button small{font-size:12px;opacity:.8;font-weight:600}
.dice{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;padding:10px 0}
.die{width:72px;height:72px;border-radius:18px;background:#fff;border:2px solid var(--navy);display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:10px;box-shadow:0 4px 0 var(--navy)}
.die i{width:12px;height:12px;border-radius:50%;background:var(--navy);place-self:center;visibility:hidden}
.die.roll{animation:shake .5s}
@keyframes shake{0%,100%{transform:rotate(0)}25%{transform:rotate(-14deg)}75%{transform:rotate(14deg)}}
.bomb{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px 0}
.bomb .ball{width:150px;height:150px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#4a5d82,#172742 60%);position:relative;box-shadow:0 10px 30px rgba(23,39,66,.35)}
.bomb .ball::after{content:"";position:absolute;top:-22px;left:50%;width:6px;height:30px;background:#8a6a2a;border-radius:3px;transform:translateX(-50%) rotate(14deg)}
.bomb .ball.tick{animation:tick .5s infinite}
@keyframes tick{50%{transform:scale(1.06)}}
.bomb .holder{font-size:28px;font-weight:800}
.boom{font-family:var(--fd);font-size:64px;color:var(--bad);animation:pop .6s}

/* vote */
.opt{display:flex;flex-direction:column;gap:8px}
.opt button{text-align:left;border:1.5px solid var(--line);background:#fff;border-radius:14px;padding:14px;font-weight:700;font-size:16px}
.opt button[aria-pressed="true"]{border-color:var(--navy);background:#EEF1F7}
.bar{display:flex;flex-direction:column;gap:4px}
.bar .bt{display:flex;justify-content:space-between;gap:8px;font-weight:700;font-size:15px}
.bar .bb{height:12px;border-radius:99px;background:#EEEAE0;overflow:hidden}
.bar .bb i{display:block;height:100%;background:var(--navy);border-radius:99px;transition:width .6s}
.bar.best .bb i{background:var(--gold)}
.bar .who{font-size:12px;color:var(--sub)}
.bal{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.bal button{min-height:96px;border-radius:16px;border:2px solid var(--line);background:#fff;font-weight:800;font-size:16px;padding:10px;line-height:1.35}
.bal button:nth-child(1)[aria-pressed="true"]{background:var(--c2);border-color:var(--c2);color:#fff}
.bal button:nth-child(2)[aria-pressed="true"]{background:var(--c1);border-color:var(--c1);color:#fff}
.balq{font-size:13px;font-weight:700;color:var(--sub)}
.split{display:flex;height:34px;border-radius:12px;overflow:hidden;font-weight:800;font-size:14px;color:#fff}
.split span{display:flex;align-items:center;padding:0 10px;white-space:nowrap;min-width:fit-content}
.split span:first-child{background:var(--c2)}
.split span:last-child{background:var(--c1);justify-content:flex-end}
.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal .dw{font-size:12px;text-align:center;color:var(--sub);font-weight:700}
.cal button{aspect-ratio:1;border-radius:12px;border:1px solid var(--line);background:#fff;font-weight:700;font-size:15px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1;padding:0}
.cal button small{font-size:10px;color:var(--sub);font-weight:600}
.cal button[aria-pressed="true"]{background:var(--navy);color:#fff;border-color:var(--navy)}
.cal button[aria-pressed="true"] small{color:#cfd6e6}
.cal button:disabled{visibility:hidden}
.cal button.heat{color:#fff;border-color:transparent}

/* arcade */
.mole{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.hole{aspect-ratio:1;border-radius:50%;background:radial-gradient(ellipse at 50% 70%,#3b2f22 0 45%,#6b5640 46% 60%,#e9e1cf 61%);position:relative;overflow:hidden;border:0;padding:0}
.hole .m{position:absolute;left:18%;right:18%;bottom:-70%;height:70%;border-radius:50% 50% 40% 40%;background:#8a6a4a;transition:bottom .12s}
.hole .m::before,.hole .m::after{content:"";position:absolute;top:28%;width:12%;height:14%;background:#172742;border-radius:50%}
.hole .m::before{left:28%}.hole .m::after{right:28%}
.hole .m i{position:absolute;left:38%;right:38%;top:48%;height:14%;background:#e7a0a0;border-radius:50%}
.hole.up .m{bottom:12%}
.hole.gold .m{background:#d6a73c}
.hole.hit .m{background:#c2453d}
.tapzone{height:300px;border-radius:20px;background:var(--navy);color:#fff;display:grid;place-items:center;font-size:30px;font-weight:800;border:0;width:100%}
.tapzone:active{background:var(--navy2);transform:scale(.99)}
.react{height:320px;border-radius:20px;border:0;width:100%;color:#fff;font-size:24px;font-weight:800;display:grid;place-items:center;text-align:center;padding:20px;line-height:1.4}
.react.wait{background:var(--c1)}.react.go{background:var(--c3)}.react.idle{background:var(--navy)}
.g25{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.g25 button{aspect-ratio:1;border-radius:12px;border:1.5px solid var(--line);background:#fff;font-weight:800;font-size:20px;padding:0}
.g25 button.done{background:#EEEAE0;color:#c9c2b2;border-color:transparent}
.g25 button.bad{background:#FBE3E1}
.sky{height:420px;border-radius:20px;background:linear-gradient(#cfe3f7,#f7f5ef);position:relative;overflow:hidden}
.bl{position:absolute;width:58px;height:72px;border-radius:50% 50% 48% 48%;border:0;padding:0}
.bl::after{content:"";position:absolute;left:50%;bottom:-16px;width:1px;height:16px;background:#99a}
.bl.bomb2{background:#172742!important}
.bl.bomb2::before{content:"×";color:#fff;font-weight:800;font-size:26px;position:absolute;inset:0;display:grid;place-items:center}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.mc{aspect-ratio:3/4;border-radius:12px;border:0;padding:0;background:var(--navy);position:relative;transition:transform .25s}
.mc::after{content:"";position:absolute;inset:8px;border:1.5px solid rgba(217,183,106,.5);border-radius:8px}
.mc.f,.mc.ok{background:#fff;border:1.5px solid var(--line)}
.mc.f::after,.mc.ok::after{display:none}
.mc svg{width:70%;height:70%;visibility:hidden}
.mc.f svg,.mc.ok svg{visibility:visible}
.mc.ok{opacity:.55}
.simon{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.simon button{aspect-ratio:1;border-radius:24px;border:0;opacity:.55;transition:opacity .1s,transform .1s}
.simon button.lit{opacity:1;transform:scale(.97);box-shadow:0 0 0 4px #fff inset}
.word{text-align:center;font-size:56px;font-family:var(--fd);padding:20px 0;line-height:1}
.choices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.choices button{min-height:64px;border-radius:16px;border:1.5px solid var(--line);background:#fff;font-weight:800;font-size:20px}
.choices button.c{color:#fff;border:0}
.flash-ok{animation:fok .3s}.flash-bad{animation:fbad .3s}
@keyframes fok{50%{background:#E2F3EC}}@keyframes fbad{50%{background:#FBE3E1}}
.seven{display:flex;flex-direction:column;align-items:center;gap:16px;padding:10px 0}
.seven .clock{font-family:var(--fd);font-size:72px;font-variant-numeric:tabular-nums;line-height:1}
.seven .clock.hide{color:#cfc8b6}

/* fortune */
.fcard{border-radius:20px;background:linear-gradient(160deg,#172742,#2b3f69);color:#fff;padding:20px;display:flex;flex-direction:column;gap:12px}
.fcard h3{font-family:var(--fd);font-weight:400;font-size:26px;color:#F3D79A}
.fcard .stars{color:#D9B76A;font-size:20px;letter-spacing:2px}
.fcard dl{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:0;font-size:14px}
.fcard dt{color:#D9B76A;font-weight:700}
.fcard dd{margin:0;color:#E4E8F2}
.fcard .lk{display:flex;gap:8px;flex-wrap:wrap}
.fcard .lk span{background:rgba(255,255,255,.1);border-radius:99px;padding:5px 11px;font-size:13px}
.expired{text-align:center;padding:50px 0;display:flex;flex-direction:column;gap:12px;align-items:center}
.expired .big{font-family:var(--fd);font-size:30px}

@media (max-width:360px){.grid{grid-template-columns:1fr}.teams{grid-template-columns:1fr}.word{font-size:46px}}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
