/* Five By Fog — 평면 보드게임풍 스타일
   원칙: 단색 면, 2px 외곽선, 딱 떨어지는 그림자. 번짐·광택·그라데이션 배경 없음. */
@font-face { font-family: 'Pretendard'; src: url('../assets/fonts/PretendardVariable.woff2') format('woff2-variations'); font-weight: 45 920; font-display: swap; }

:root {
  --ink: #45a9f5; --ink2: #2583dc; --ink3: #3f9cf0; --edge: #0d3566; --line: #7cc0f7;
  --bone: #fffbea; --bone2: #eaf5ff; --dim: #cfe6fb;
  --teal: #3fe6cf; --violet: #c39bff; --red: #ff6b6b; --yellow: #ffd633; --green: #5fe391; --orange: #ff9a55;
  --c: var(--teal);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--bone); font: 500 14px/1.45 'Pretendard', 'Malgun Gothic', system-ui, sans-serif; -webkit-font-smoothing: antialiased; user-select: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
h1, h2, h3, h4, p { margin: 0; }
small { font-size: .78em; }
i { font-style: normal; }
.ic { width: 1em; height: 1em; vertical-align: -.14em; flex: none; }

button { font: inherit; font-weight: 700; color: var(--bone); background: var(--ink3); border: 2px solid var(--edge); border-radius: 8px; padding: 8px 16px; cursor: pointer; box-shadow: 0 3px 0 var(--edge); }
button:hover { background: var(--line); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
button.pri { background: var(--bone); color: var(--edge); }
button.pri:hover { background: #ffe07a; }
button.big { font-size: 17px; padding: 13px 28px; min-width: 240px; }
button:disabled { opacity: .35; cursor: default; transform: none; box-shadow: 0 3px 0 var(--edge); }
button.link { background: none; border: 0; box-shadow: none; padding: 4px 8px; color: var(--dim); font-weight: 600; }
button.link:hover { color: var(--bone); }
button.ghostb { background: none; box-shadow: none; border-color: var(--line); color: var(--dim); }

/* 공통 */
.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.title { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.title .logo { width: 132px; height: 132px; }
.title h1 { font-size: 44px; font-weight: 900; letter-spacing: .12em; margin-top: 10px; }
.tag { color: var(--dim); letter-spacing: .32em; font-size: 12px; font-weight: 600; }
.col { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.links { margin-top: 18px; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.hint { color: var(--dim); font-size: 13px; }
.cn { color: var(--c); }
.pts { font-weight: 800; color: var(--yellow); font-size: 12px; }
.cellchip { font-size: 11px; font-weight: 800; padding: 0 5px; border: 1.5px solid var(--line); border-radius: 4px; color: var(--bone2); }

.disc { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--c); color: var(--edge); border: 2px solid var(--edge); box-shadow: 0 3px 0 rgba(0, 0, 0, .5); flex: none; }
.disc .ic { width: 68%; height: 68%; }
.disc.sm { width: 26px; height: 26px; box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.disc.lg { width: 54px; height: 54px; }
.disc.xl { width: 92px; height: 92px; border-width: 3px; box-shadow: 0 5px 0 rgba(0, 0, 0, .5); }
.bolts { display: inline-flex; gap: 0; font-size: 13px; }
.ic.on { color: var(--yellow); } .ic.off { color: var(--line); } .ic.new { color: var(--teal); }

.t-explore { --tc: var(--green); } .t-collect { --tc: var(--yellow); } .t-perform { --tc: var(--orange); } .sec { --tc: var(--violet); }

.modal { position: fixed; inset: 0; background: rgba(8, 11, 16, .78); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.mbox { background: var(--ink2); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 0 6px 0 var(--edge); padding: 22px 24px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; }
.mbox h2 { margin-bottom: 12px; }
.mbox .pri { margin-top: 16px; }
.hlist, .clist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hlist li { display: flex; gap: 12px; align-items: flex-start; }
.hlist b { display: block; }
.hlist div { color: var(--bone2); font-size: 13px; } .hlist div b { color: var(--bone); font-size: 14px; }
.hic { width: 34px; height: 34px; border-radius: 8px; background: var(--ink3); border: 2px solid var(--edge); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--teal); flex: none; }
.clist li { color: var(--bone2); font-size: 13px; } .clist b { color: var(--bone); margin-right: 8px; }
.mbox .hint { margin-top: 12px; }

/* 설명 띠 */
.strip { min-height: 38px; display: flex; align-items: center; gap: 12px; padding: 6px 14px; border-radius: 8px; background: var(--ink2); border: 2px solid var(--edge); color: var(--dim); font-size: 13px; }
.strip:empty { visibility: hidden; }
.strip.show { color: var(--bone); }
.strip.warn { color: var(--yellow); }
.strip.tg { background: var(--bone); color: var(--edge); padding: 4px 6px 4px 12px; }
.strip.tg .shd { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; } .strip.tg .shd .ic { font-size: 20px; }
.strip.tg .stx { flex: 1; font-weight: 600; }
.strip.tg .sbt { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.strip.tg button { padding: 4px 10px; font-size: 13px; box-shadow: 0 2px 0 var(--edge); display: inline-flex; align-items: center; gap: 5px; }
.strip.tg button.on { background: var(--teal); color: var(--edge); }
.strip.tg button.pri { background: var(--edge); color: var(--bone); }

/* 준비 화면 */
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 22px 40px; }
.page.narrow { max-width: 760px; }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.phead h2 { font-size: 24px; font-weight: 800; flex: 1; }
.count { font-weight: 800; padding: 4px 12px; border-radius: 99px; border: 2px solid var(--line); color: var(--dim); }
.count.full { background: var(--bone); color: var(--edge); border-color: var(--edge); }
.page > .strip { margin-top: 14px; }
.page > .hint { margin: -6px 0 14px; }
h3 { font-size: 13px; color: var(--dim); font-weight: 700; letter-spacing: .06em; margin: 0 0 8px; }

.cgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.ccard { background: var(--ink2); border: 2px solid var(--edge); border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: 0 4px 0 var(--edge); transition: transform .08s; }
.ccard:hover { transform: translateY(-3px); }
.ccard.on { transform: translateY(-6px); border-color: var(--bone); box-shadow: 0 4px 0 var(--bone); }
.cband { background: var(--c); color: var(--edge); height: 150px; display: flex; align-items: center; justify-content: center; font-size: 104px; border-bottom: 2px solid var(--edge); }
.cbody { padding: 12px 14px 14px; }
.cname { font-size: 19px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.cname small { color: var(--dim); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.crole { color: var(--c); font-size: 12.5px; font-weight: 700; margin: 2px 0 10px; }
.cpass { font-size: 12.5px; color: var(--bone2); border-top: 2px solid var(--ink3); padding-top: 9px; }
.cpass b { display: block; color: var(--bone); }

.bcols { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.bside h3:not(:first-child) { margin-top: 18px; }
.pbox { border-left: 4px solid var(--c); background: var(--ink2); padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--bone2); }
.pbox b { display: block; color: var(--bone); }
.sgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.scard { display: flex; background: var(--ink2); border: 2px solid var(--edge); border-radius: 10px; overflow: hidden; cursor: pointer; box-shadow: 0 3px 0 var(--edge); }
.scard:hover { background: var(--ink3); }
.scard.on { border-color: var(--bone); box-shadow: 0 3px 0 var(--bone); background: var(--ink3); }
.sband { width: 58px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 34px; background: var(--ink3); color: var(--c); border-right: 2px solid var(--edge); }
.scard.on .sband { background: var(--c); color: var(--edge); }
.sbody { padding: 8px 12px 9px; min-width: 0; flex: 1; }
.sname { font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.smeta { display: flex; align-items: center; gap: 10px; margin: 1px 0 3px; }
.cdchip { font-size: 12px; font-weight: 700; color: var(--dim); display: inline-flex; align-items: center; gap: 2px; }
.sdesc { font-size: 12.5px; color: var(--bone2); line-height: 1.4; }

/* 미션 줄 */
.mrow { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; background: var(--ink2); border: 2px solid var(--edge); margin-bottom: 6px; }
.mic { width: 30px; height: 30px; border-radius: 6px; background: var(--tc); color: var(--edge); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; border: 1.5px solid var(--edge); }
.mtx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.mtx b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtx small { color: var(--bone2); font-size: 12px; }
.mprog { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mend { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.mdots { display: flex; flex-direction: column; gap: 3px; }
.mdots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line); }
.mdots i.y { background: var(--green); border-color: var(--green); }
.mrow.done { background: #1c9f7a; }
.mrow.done .mprog { color: var(--green); font-weight: 700; }

/* 경기 화면 */
.header { display: flex; align-items: center; gap: 18px; padding: 8px 16px; border-bottom: 2px solid var(--edge); background: var(--ink2); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: .12em; font-size: 13px; }
.brand .logo { width: 26px; height: 26px; }
.rounds { display: flex; gap: 3px; flex: 1; justify-content: center; }
.rp { width: 24px; height: 24px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--dim); border: 2px solid var(--line); }
.rp.past { background: var(--line); color: var(--ink2); }
.rp.now { background: var(--bone); color: var(--edge); border-color: var(--edge); transform: scale(1.15); }
.scores { display: flex; align-items: center; gap: 8px; }
.score { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; border: 2px solid transparent; }
.score.cur { border-color: var(--line); background: var(--ink3); }
.score small { color: var(--dim); font-weight: 700; }
.score b { font-size: 20px; font-weight: 900; min-width: 20px; text-align: center; }
.colon { color: var(--dim); font-weight: 900; }
.hbtns { display: flex; }

.play { flex: 1; display: grid; grid-template-columns: 264px minmax(0, 1fr) 250px; gap: 16px; padding: 14px 16px; min-height: 0; }
.left, .right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
h4 { font-size: 11.5px; color: var(--dim); font-weight: 800; letter-spacing: .1em; margin-bottom: 6px; }
.mecard { background: var(--ink2); border: 2px solid var(--edge); border-top: 5px solid var(--c); border-radius: 10px; padding: 12px; }
.mtop { display: flex; align-items: center; gap: 12px; }
.mname { font-size: 18px; font-weight: 800; } .mrole { font-size: 12px; color: var(--c); font-weight: 700; }
.energy { display: flex; gap: 2px; font-size: 26px; margin: 10px 0 8px; }
.passive { display: flex; justify-content: space-between; font-size: 12.5px; border-top: 2px solid var(--ink3); padding-top: 8px; }
.passive i { color: var(--dim); }

.main { display: flex; flex-direction: column; gap: 10px; align-items: center; min-width: 0; }
.main > .strip, .main > .dock { width: 100%; max-width: 760px; }
.board { position: relative; width: min(100%, 600px, calc(100vh - 345px)); min-width: 320px; }
.grid { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 3px solid var(--edge); border-radius: 12px; background: var(--edge); box-shadow: 0 5px 0 var(--edge); }
.cell { position: relative; aspect-ratio: 1; background: #202a39 repeating-linear-gradient(45deg, transparent 0 7px, rgba(255, 255, 255, .035) 7px 8px); color: var(--dim); box-shadow: inset 0 0 0 1.5px var(--edge); overflow: hidden; }
.cell:nth-child(1) { border-top-left-radius: 9px; } .cell:nth-child(5) { border-top-right-radius: 9px; }
.cell:nth-child(21) { border-bottom-left-radius: 9px; } .cell:nth-child(25) { border-bottom-right-radius: 9px; }
.cell.vis { background: var(--bone); color: #4b5262; }
.cell.movable { cursor: pointer; }
.cell.movable::after { content: ''; position: absolute; inset: 5px; border: 2px dashed rgba(19, 25, 34, .28); border-radius: 6px; pointer-events: none; }
.cell.movable:hover::after { border-color: var(--edge); border-style: solid; }
.cell.valid { cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 0 0 5px var(--teal); }
.cell.valid:hover { box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 0 0 8px var(--teal); }
.cell.area, .cell.hov { box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 0 0 100px rgba(143, 214, 214, .32); }
.cell.sealed { background-image: repeating-linear-gradient(45deg, transparent 0 8px, rgba(234, 111, 94, .35) 8px 12px); }
.coord { position: absolute; top: 4px; left: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; opacity: .75; }
.node { position: absolute; top: 4px; right: 5px; font-size: 22px; color: #55627a; display: flex; align-items: center; }
.node b { font-size: 11px; margin-left: -2px; }
.node.on { color: var(--teal); } .cell.vis .node.on { color: #14808a; } .cell.vis .node { color: #a39b86; }
.mis { position: absolute; left: 4px; bottom: 4px; display: flex; align-items: center; gap: 2px; background: var(--tc); color: var(--edge); border: 1.5px solid var(--edge); border-radius: 6px; padding: 1px 5px 1px 3px; font-size: 18px; }
.mis b { font-size: 11px; font-weight: 900; }
.mis.done { background: var(--line); color: var(--bone); }
.seal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--red); }
.marks { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 2px; }
.mk { width: 22px; height: 22px; border-radius: 50%; background: var(--edge); color: var(--bone); display: flex; align-items: center; justify-content: center; font-size: 14px; border: 1.5px solid var(--edge); }
.mk.sk { background: var(--violet); color: var(--edge); } .mk.pick { background: var(--teal); color: var(--edge); }
.tok { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.tok .disc { width: 52%; height: auto; aspect-ratio: 1; }
.tok small { margin-top: -7px; background: var(--edge); color: var(--bone); font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 99px; z-index: 1; border: 1.5px solid var(--edge); }
.tok.foe small { background: var(--red); color: var(--edge); }
.tok.ghost .disc { background: none; border: 2px dashed currentColor; box-shadow: none; color: inherit; }
.tok.ghost small { background: var(--ink3); color: var(--bone2); }
.tok.dest::before { content: ''; width: 52%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed var(--edge); opacity: .55; }
.over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pathline { stroke: var(--edge); stroke-width: 5; stroke-dasharray: 2 11; stroke-linecap: round; opacity: .7; }

.radial { position: absolute; width: 0; height: 0; z-index: 10; }
.rb { position: absolute; width: 62px; height: 62px; margin: -31px; border-radius: 50%; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; background: var(--edge); line-height: 1; }
.rb small { font-size: 10px; margin-top: 2px; }
.rb.on { background: var(--bone); color: var(--edge); }
.rb.top { top: -68px; } .rb.bottom { top: 68px; } .rb.left { left: -68px; } .rb.right { left: 68px; }

.report { position: absolute; inset: 0; background: rgba(13, 17, 24, .82); border-radius: 12px; display: flex; align-items: center; justify-content: center; z-index: 20; padding: 18px; }
.rbox { background: var(--ink2); border: 2px solid var(--edge); border-radius: 12px; box-shadow: 0 5px 0 var(--edge); padding: 16px 18px; width: 100%; max-width: 400px; max-height: 100%; overflow: auto; }
.rbox h3 { font-size: 18px; color: var(--bone); letter-spacing: 0; margin-bottom: 10px; font-weight: 800; }
.rbox .le { font-size: 13.5px; padding: 5px 10px; margin-bottom: 4px; }
.rbox button { margin-top: 12px; width: 100%; }
.le { font-size: 12.5px; padding: 3px 8px; border-left: 3px solid var(--line); color: var(--bone2); margin-bottom: 3px; line-height: 1.4; user-select: text; }
.le.good { border-color: var(--green); color: var(--bone); }
.le.bad { border-color: var(--red); color: var(--bone); }
.le.pub { border-color: var(--teal); }

.dock { background: var(--ink2); border: 2px solid var(--edge); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.basics { display: grid; grid-template-columns: repeat(2, 58px); gap: 6px; }
.bbtn { padding: 5px 0; display: flex; flex-direction: column; align-items: center; font-size: 22px; line-height: 1.1; box-shadow: 0 2px 0 var(--edge); }
.bbtn small { font-size: 10.5px; margin-top: 2px; }
.bbtn.on { background: var(--bone); color: var(--edge); }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.slot { position: relative; background: var(--ink3); border: 2px solid var(--edge); border-radius: 8px; padding: 6px 4px 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; box-shadow: 0 2px 0 var(--edge); min-width: 0; }
.slot:hover { background: var(--line); }
.sic { position: relative; width: 40px; height: 40px; border-radius: 8px; background: var(--c); color: var(--edge); border: 2px solid var(--edge); display: flex; align-items: center; justify-content: center; font-size: 27px; }
.slot .sname { font-size: 11.5px; font-weight: 700; display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .bolts { font-size: 11px; }
.slot.on { background: var(--bone); color: var(--edge); }
.slot.on .ic.off { color: #b5ad98; } .slot.on .ic.on { color: #b07d00; }
.slot.picking { border-color: var(--teal); box-shadow: 0 2px 0 var(--teal); }
.slot.off .sic { background: var(--line); color: var(--ink2); }
.slot.off .sname { color: var(--dim); }
.cool { position: absolute; inset: -2px; border-radius: 8px; background: rgba(13, 17, 24, .8); color: var(--bone); display: flex; align-items: center; justify-content: center; font-size: 13px; gap: 1px; }
.cool b { font-size: 16px; }
.cdb { position: absolute; top: -9px; right: -5px; padding: 0 5px; font-size: 10.5px; border-radius: 99px; box-shadow: none; background: var(--edge); display: inline-flex; align-items: center; }
.cdb.on { background: var(--yellow); color: var(--edge); }
.plan { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; border-top: 2px solid var(--ink3); padding-top: 10px; }
.chips { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; background: var(--ink3); font-size: 12.5px; border: 1.5px solid var(--edge); }
.chip .ic { font-size: 15px; }
.chip.none { background: none; border: 1.5px dashed var(--line); color: var(--dim); } .chip.none b { font-weight: 500; }
.chip.sk { background: var(--violet); color: var(--edge); }
.chip.cost { background: var(--yellow); color: var(--edge); }
.pbtn { display: flex; gap: 8px; }
.pbtn .pri { padding: 9px 30px; font-size: 15px; }

.right { background: var(--ink2); border: 2px solid var(--edge); border-radius: 10px; padding: 12px; gap: 0; }
.log { flex: 1; overflow-y: auto; min-height: 0; max-height: calc(100vh - 140px); padding-right: 4px; }
.lgrp { margin-bottom: 10px; opacity: .6; } .lgrp.last { opacity: 1; }
.lr { font-size: 11px; font-weight: 900; color: var(--dim); margin-bottom: 3px; }
.logempty { color: var(--dim); font-size: 12.5px; }
.log::-webkit-scrollbar { width: 6px; } .log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* 결과 */
.rhead { text-align: center; margin-bottom: 18px; }
.rhead h1 { font-size: 40px; font-weight: 900; letter-spacing: .06em; }
.rhead p { font-size: 22px; font-weight: 800; color: var(--dim); }
.rcols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rcol { background: var(--ink2); border: 2px solid var(--edge); border-top: 6px solid var(--c); border-radius: 12px; padding: 16px; box-shadow: 0 4px 0 var(--edge); }
.rcol.win { border-color: var(--bone); border-top-color: var(--c); box-shadow: 0 4px 0 var(--bone); }
.rtop { display: flex; align-items: center; gap: 14px; }
.rtop h3 { font-size: 22px; color: var(--bone); letter-spacing: 0; margin: 0; font-weight: 800; }
.rtop small { color: var(--dim); font-weight: 800; }
.crown { font-size: 30px; color: var(--yellow); }
.total { margin-left: auto; font-size: 54px; font-weight: 900; line-height: 1; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 4px; }
.stat { background: var(--ink3); border-radius: 8px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; font-size: 18px; color: var(--teal); }
.stat b { font-size: 18px; color: var(--bone); } .stat small { font-size: 10.5px; color: var(--dim); }
.rcol h4 { margin: 12px 0 6px; }
.rchips { display: flex; flex-wrap: wrap; gap: 5px; }
.rchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 9px; border-radius: 99px; border: 1.5px dashed var(--line); color: var(--dim); }
.rchip .ic { font-size: 15px; }
.rchip.y { border: 1.5px solid var(--edge); background: var(--ink3); color: var(--bone); }
.rchip.y[class*='t-'], .rchip.sec.y { background: var(--tc); color: var(--edge); }
.full { margin-top: 20px; }
.rec { width: 100%; border-collapse: collapse; font-size: 12.5px; user-select: text; }
.rec th, .rec td { text-align: left; padding: 6px 8px; border-bottom: 1.5px solid var(--ink3); vertical-align: top; }
.rec th { color: var(--dim); font-size: 11px; }
.logs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.logs2 .log { max-height: 320px; }


/* ── 캐주얼 톤: 둥근 타일, 통통한 버튼, 가벼운 움직임 ── */
body { font-weight: 600; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { border-radius: 14px; box-shadow: 0 4px 0 var(--edge); transition: transform .06s; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
button.pri { background: var(--yellow); color: var(--edge); }
button.link { border-radius: 8px; }
.strip.tg button.pri { background: var(--edge); color: var(--bone); }
.title h1 { letter-spacing: .06em; }
.title .logo { animation: bob 3s ease-in-out infinite; }
.ccard, .mbox, .rbox, .rcol, .dock, .right, .mecard { border-radius: 18px; }
.scard, .mrow, .strip, .slot { border-radius: 14px; }
.sic, .mic, .hic { border-radius: 11px; }
.ccard.on { animation: pop .25s; }
.rnow { display: none; font-weight: 900; padding: 2px 10px; border-radius: 99px; background: var(--bone); color: var(--edge); }

.grid { gap: 5px; padding: 7px; border: 3px solid var(--edge); border-radius: 20px; background: var(--ink2); box-shadow: 0 6px 0 var(--edge); }
.cell { border-radius: 12px; box-shadow: 0 3px 0 #4f97cf; color: #1d5d99;
  background: #8accf9; }
.cell:nth-child(n) { border-radius: 12px; }
.cell.vis { background: var(--bone); color: #5b6b80; box-shadow: 0 3px 0 #e3d49c; }
.cell.valid { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 5px var(--teal); animation: pulse 1s ease-in-out infinite; }
.cell.valid:hover { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 8px var(--teal); }
.cell.area, .cell.hov { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 100px rgba(127, 227, 212, .4); }
.cell.sealed { background-image: repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 123, 107, .45) 8px 12px); }
.cell.movable::after { inset: 4px; border-radius: 9px; border-color: rgba(18, 42, 69, .3); }
.node { color: rgba(13, 53, 102, .3); } .node.on { color: #fff; filter: drop-shadow(0 1px 0 #0d3566); } .cell.vis .node.on { color: #0e9fb5; filter: none; }
.header { background: var(--ink2); } button:hover { background: #5cb2f7; } button.pri:hover { background: #ffe26a; } .scard:hover, .slot:hover { background: #5cb2f7; }
.modal, .report { background: rgba(13, 53, 102, .72); }
.tok.me .disc { animation: bob 1.6s ease-in-out infinite; }
.report .rbox { animation: pop .22s; }
.pathline { stroke-width: 6; stroke-dasharray: 1 13; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } }
@keyframes pulse { 50% { filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ── 좁은 화면 ── */
@media (max-width: 1180px) {
  .play { grid-template-columns: 240px minmax(0, 1fr); }
  .play > .right { display: none; }
  .cgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .header { flex-wrap: wrap; gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand { font-size: 0; gap: 0; }
  .rounds { display: none; } .rnow { display: inline-flex; }
  .scores { flex: 1; justify-content: center; }
  .hbtns .link { padding: 4px 5px; font-size: 12px; }
  .play { grid-template-columns: 1fr; padding: 8px; gap: 8px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .left { display: contents; }
  .mecard { order: 0; padding: 7px 10px; display: flex; align-items: center; gap: 10px; border-top-width: 2px; border-left: 6px solid var(--c); }
  .mtop { flex: 1; } .mecard .disc.lg { width: 36px; height: 36px; } .mrole, .passive { display: none; }
  .energy { margin: 0; font-size: 23px; }
  .main { order: 1; gap: 8px; }
  .left .sect { order: 2; }
  .play > .right { display: flex; order: 3; } .log { max-height: 240px; }
  .board { width: 100%; min-width: 0; }
  .grid { gap: 4px; padding: 5px; border-radius: 16px; }
  .cell, .cell:nth-child(n) { border-radius: 9px; }
  .coord { font-size: 9px; top: 2px; left: 4px; } .node { font-size: 17px; top: 2px; right: 3px; }
  .mis { font-size: 14px; left: 2px; bottom: 2px; padding: 0 3px 0 2px; } .mis b { font-size: 10px; }
  .mk { width: 18px; height: 18px; font-size: 11px; } .marks { right: 2px; bottom: 2px; }
  .tok small { font-size: 9px; padding: 0 5px; }
  .strip { font-size: 12.5px; min-height: 36px; padding: 5px 10px; } .strip.tg { flex-wrap: wrap; }
  .dock { grid-template-columns: 1fr; padding: 8px; gap: 8px; }
  .basics { grid-template-columns: repeat(4, 1fr); }
  .bbtn { flex-direction: row; gap: 5px; justify-content: center; font-size: 18px; padding: 8px 0; } .bbtn small { font-size: 12px; margin: 0; }
  .slots { gap: 4px; } .slot { padding: 6px 2px 5px; } .slot .sname { font-size: 10.5px; } .sic { width: 38px; height: 38px; font-size: 25px; }
  .plan { flex-wrap: wrap; } .pbtn { margin-left: auto; }
  .rb { width: 54px; height: 54px; margin: -27px; } .rb.top { top: -58px; } .rb.bottom { top: 58px; } .rb.left { left: -58px; } .rb.right { left: 58px; }
  .page { padding: 14px 10px 30px; }
  .phead h2 { font-size: 19px; }
  .bcols, .rcols, .logs2, .sgrid { grid-template-columns: 1fr; }
  .cgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cband { height: 88px; font-size: 62px; } .cbody { padding: 9px 10px 10px; } .cname { font-size: 16px; }
  .title h1 { font-size: 32px; } .title .logo { width: 104px; height: 104px; }
  .rhead h1 { font-size: 30px; } .total { font-size: 40px; } .disc.xl { width: 62px; height: 62px; }
  .stat small { font-size: 9px; }
  .full { overflow-x: auto; } .rec { font-size: 11px; min-width: 520px; }
  .row { flex-wrap: wrap; }
}

/* ── 2단계: 재생 연출, 추정 범위, 발자국, 득점 안내 ── */
.row.top { margin: 0 0 16px; justify-content: flex-start; }
.recb { font-size: 10.5px; font-weight: 800; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: var(--edge); align-self: center; }
.pts.half { color: var(--bone2); text-decoration: none; opacity: .8; }
.mrow.ready { border-color: var(--yellow); box-shadow: 0 3px 0 var(--yellow); }
.mrow.ready .mprog { color: var(--yellow); font-weight: 800; }
.mis.ready { animation: bounce .9s ease-in-out infinite; box-shadow: 0 0 0 3px var(--yellow); }
.q { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; color: #fff; opacity: .9; text-shadow: 0 2px 0 #2c78b8; pointer-events: none; }
.cell.poss:not(.vis) { background: #ff9db0; box-shadow: 0 3px 0 #d96a82; }
.cell.poss.vis .q { color: #ff7d95; text-shadow: none; }
.cell.poss .q { text-shadow: 0 2px 0 #c95470; }
.track { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 30px; color: #ff5d7a; pointer-events: none; }
.track.old { opacity: .45; }
.cell.scan { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 6px var(--edge); animation: pop .3s; }
.cell.scan.good { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 7px var(--yellow); }
.cell.scan.bad { box-shadow: 0 3px 0 rgba(10, 25, 45, .45), inset 0 0 0 7px var(--red); }
.board.replay .cell { cursor: default; }
.cap { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -50%); max-width: 96%; z-index: 15; pointer-events: none; animation: capin .25s; }
.cap span { display: block; background: var(--bone); color: var(--edge); border: 3px solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--edge); padding: 7px 16px; font-size: 15px; font-weight: 800; text-align: center; }
.cap.good span { background: var(--yellow); }
.cap.bad span, .cap.foe span { background: var(--red); color: #fff; }
.rpbar { position: absolute; left: 0; right: 0; bottom: -4px; transform: translateY(50%); display: flex; align-items: center; justify-content: center; gap: 12px; z-index: 15; }
.rpbar button { padding: 4px 14px; font-size: 13px; }
.dots { display: flex; gap: 4px; background: var(--edge); padding: 6px 9px; border-radius: 99px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .3); } .dots i.y { background: var(--yellow); }
.pop { position: absolute; top: 4%; left: 50%; font-size: 22px; font-weight: 900; color: var(--edge); background: var(--yellow); border: 2px solid var(--edge); border-radius: 99px; padding: 0 9px; animation: rise 1.05s ease-out forwards; z-index: 3; white-space: nowrap; }
.pop.bad { background: var(--red); color: #fff; }
.dock.dim { opacity: .45; pointer-events: none; }
@keyframes bounce { 50% { transform: translateY(-4px); } }
@keyframes capin { from { transform: translate(-50%, -20%) scale(.9); opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 30%) scale(.7); opacity: 0; } 25% { transform: translate(-50%, -20%) scale(1.15); opacity: 1; } to { transform: translate(-50%, -70%) scale(1); opacity: 1; } }
@media (max-width: 820px) {
  .q { font-size: 22px; } .track { font-size: 22px; }
  .cap span { font-size: 13px; padding: 6px 12px; } .pop { font-size: 17px; }
  .row.top { justify-content: stretch; } .row.top button { flex: 1; padding: 9px 8px; font-size: 13px; }
}

.cell.possw:not(.vis) { background: #c9b8f2; box-shadow: 0 3px 0 #8f7fd0; }

/* 점수 효과는 칸 밖(보드 위)에 그려 잘리지 않게 한다 */
.pop { top: auto; font-size: 30px; padding: 2px 14px; border-width: 3px; box-shadow: 0 4px 0 var(--edge); z-index: 16; pointer-events: none; animation: rise 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes rise { from { transform: translate(-50%, 60%) scale(.4); opacity: 0; } 30% { transform: translate(-50%, -30%) scale(1.25); opacity: 1; } to { transform: translate(-50%, -55%) scale(1); opacity: 1; } }
@media (max-width: 820px) { .pop { font-size: 22px; padding: 1px 10px; } }

/* 규칙 설명서, 색 범례 */
.mbox.wide { max-width: 760px; }
.mhead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -22px; background: var(--ink2); padding: 6px 0 10px; margin-top: -6px; z-index: 2; }
.mhead h2 { margin: 0; } .mbox .mhead .pri { margin: 0; padding: 6px 16px; }
.mbox h3 { margin: 18px 0 8px; font-size: 14px; color: var(--yellow); letter-spacing: 0; }
.hlist .disc { margin-top: 2px; }
.hsw { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--edge); flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; font-size: 18px; }
.hsw.p { background: #ff9db0; } .hsw.w { background: #c9b8f2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; color: var(--bone2); margin-top: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .hsw { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; border-width: 1.5px; }
.legend .ic { font-size: 16px; color: #ff5d7a; }

/* 상대 시작 위치: 눈에 거의 띄지 않는 작은 글씨 */
.startmk { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 9.5px; font-weight: 700; opacity: .4; pointer-events: none; }
@media (max-width: 820px) { .startmk { font-size: 8px; bottom: 2px; } }
