/* Lock and Lay — mobile client. Builds on the notebook tokens in /css/style.css. */
html, body.mobile { height: 100%; overflow: hidden; background: var(--paper); }
body.mobile { display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
body.mobile .auth-card { width: min(460px, 100vw); min-height: 100%; padding: max(28px, env(safe-area-inset-top)) 24px 32px; box-shadow: none; border-top: 0; justify-content: center; }
body.mobile .overlay { align-items: stretch; }

#top { display: flex; align-items: stretch; background: var(--paper); background-image: var(--grain); border-bottom: 1px solid var(--ink); padding-top: env(safe-area-inset-top); flex: none; }
#top .stat { flex: 1; padding: 8px 10px; border-right: 1px solid var(--rule); line-height: 1.1; display: flex; flex-direction: column; }
#top .stat b { font-size: 15px; font-weight: 500; }
#top .stat.right { border-right: 0; text-align: right; align-items: flex-end; }

body.mobile #view { position: static; inset: auto; flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 24px; background: var(--paper); background-image: var(--grain); }
#view h2 { font-size: 24px; margin: 6px 0 10px; }
#view h3 { font-size: 17px; margin: 14px 0 6px; }

#tabs { display: flex; flex: none; border-top: 1px solid var(--ink); background: var(--paper-2); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; letter-spacing: .04em; color: var(--ink-3); position: relative; }
#tabs button:hover { background: transparent; color: var(--ink); }
#tabs button.on { color: var(--ink); box-shadow: inset 0 2px 0 var(--moss); }
#tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.on svg { stroke: var(--moss); }
#tabs .badge { position: absolute; top: 4px; right: calc(50% - 18px); }

/* room scene */
.roomwrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--ink); background: #1a1815; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.roomwrap canvas { display: block; }
.tublist { margin: 6px 0 12px; } .tublist summary { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; padding: 6px 0; }
#modal2 { z-index: 55; align-items: flex-end; } #modalBox2 { max-height: 80vh; border-top: 1px solid var(--ink); }
.presets { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.egg canvas { width: 100%; height: 100%; display: block; }
.egg { background: linear-gradient(#d8ccb0, #c3b592); }
.egg.open canvas { height: 68px; }
/* room */
.rack-card { background: #fff; border: 1px solid var(--rule-2); margin-bottom: 12px; box-shadow: 2px 2px 0 var(--paper-3); }
:root[data-theme="dark"] .rack-card { background: #15130f; box-shadow: 2px 2px 0 #0e0d0b; }
.rack-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.rack-head b { color: var(--moss); }
.tubgrid { display: grid; gap: 4px; padding: 8px; }
.tub { min-height: 42px; border: 1px solid var(--rule-2); border-radius: 3px; padding: 4px 6px; font-size: 11px; line-height: 1.2; display: flex; flex-direction: column; justify-content: center; background: var(--paper); position: relative; overflow: hidden; }
.tub.empty { color: var(--ink-3); border-style: dashed; background: transparent; justify-content: center; align-items: center; }
.tub .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tub .w { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.tub .dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; }
.dot.good { background: var(--moss); } .dot.bad { background: var(--brick); } .dot.warn { background: var(--amber); } .dot.info { background: var(--sky); }
.tub .idx { position: absolute; bottom: 2px; right: 5px; font-size: 9px; color: var(--ink-3); font-family: var(--mono); }

/* lists */
.row-card { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.row-card canvas { width: 78px; height: 45px; flex: none; border: 1px solid var(--rule); background: linear-gradient(#f5f1e9, #e8e1d3); }
:root[data-theme="dark"] .row-card canvas { background: linear-gradient(#2a2722, #1a1815); }
.row-card .body { flex: 1; min-width: 0; }
.row-card .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .m { font-size: 12px; color: var(--ink-2); }
.row-card .v { font-family: var(--mono); font-size: 13px; text-align: right; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.tags .tag { margin: 0; font-size: 10px; padding: 0 5px; }
.toolbar { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.toolbar input, .toolbar select { flex: 1; min-width: 0; padding: 7px 9px; font-size: 14px; }
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs button { flex: none; }
.grid { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
.specimen canvas { aspect-ratio: 52 / 26; }
.specimen dl { grid-template-columns: auto 1fr; }
select, input { font-size: 16px; } /* stops iOS zoom */

/* sheet */
#sheet { position: fixed; inset: 0; background: rgba(12, 10, 8, .55); z-index: 40; display: flex; align-items: flex-end; }
.sheet-box { width: 100%; max-height: 88vh; overflow: auto; background: var(--paper); background-image: var(--grain); border-top: 1px solid var(--ink); border-radius: 14px 14px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--rule-2); margin: 2px auto 10px; }
.sheet-box .name { font-family: var(--serif); font-size: 22px; }
.sheet-box canvas.big { width: 100%; aspect-ratio: 52 / 30; border: 1px solid var(--rule); background: linear-gradient(#f5f1e9, #e8e1d3); margin: 8px 0; }
:root[data-theme="dark"] .sheet-box canvas.big { background: linear-gradient(#2a2722, #1a1815); }
.sheet-box .actions button { flex: 1 1 45%; padding: 10px 8px; }
.sheet-box .stats { margin: 8px 0; }

/* modal + toasts on phone */
.modal { width: 100vw; max-height: 100vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); border: 0; }
.eggs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.egg { height: 130px; }
#toasts { left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom)); width: auto; }
.toast { font-size: 13px; }
.phone-nav-m { display: flex; border-bottom: 1px solid var(--rule-2); margin-bottom: 8px; }
.phone-nav-m button { flex: 1; border: 0; border-radius: 0; padding: 8px 0; font-size: 12px; color: var(--ink-3); position: relative; }
.phone-nav-m button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.post canvas { aspect-ratio: 52 / 26; }
.more-list button { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; }
.odds { font-size: 12px; }
.bar { margin-top: 3px; }

/* ---- game feel ---- */
#top { position: relative; }
#top .gear { flex: none; border: 0; border-left: 1px solid var(--rule); border-radius: 0; padding: 0 12px; background: transparent; min-height: 0; }
#top .gear svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
#dayBar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
#dayBar i { display: block; height: 100%; width: 0; background: var(--moss); transition: width .25s linear; }
#hCash.up { color: var(--moss); } #hCash.down { color: var(--brick); }
#tabs button { font-size: 10.5px; padding: 9px 0 8px; }
.roomhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rankchip { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--rule-2); border-radius: 12px; color: var(--ink-2); white-space: nowrap; }
.today { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.today::-webkit-scrollbar { display: none; }
.tcard { flex: none; width: 150px; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 0; border-left: 4px solid var(--ink); border-radius: 10px; background: var(--paper-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); min-height: 0; }
.tcard:hover { background: var(--paper-3); color: var(--ink); }
.tcard b { font-size: 14px; line-height: 1.2; } .tcard span { font-size: 11.5px; color: var(--ink-2); }
.tcard.hatch { border-color: var(--amber); } .tcard.good { border-color: var(--moss); } .tcard.bad { border-color: var(--brick); } .tcard.info { border-color: var(--sky); } .tcard.cash { border-color: #c99b3f; } .tcard.warn { border-color: var(--amber); } .tcard.quiet { border-color: var(--rule-2); }
.goals { margin: 8px 0 6px; padding: 10px 12px; border: 1px dashed var(--rule-2); border-radius: 10px; }
.goals-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.goal { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; padding: 6px 0; font-size: 13.5px; background: transparent; min-height: 0; border-radius: 0; }
.goal:hover { background: transparent; color: var(--ink); }
.goal i { width: 18px; height: 18px; border: 1.5px solid var(--rule-2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; flex: none; }
.goal.done { color: var(--ink-3); text-decoration: line-through; } .goal.done i { background: var(--moss); border-color: var(--moss); color: #fff; }
.ach-pop { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -30px); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .3s; background: var(--paper); border: 1px solid var(--ink); border-left: 5px solid #c99b3f; padding: 10px 16px; z-index: 58; box-shadow: var(--shadow-6); text-align: center; min-width: 200px; }
.ach-pop.in { transform: translate(-50%, 0); opacity: 1; }
.ach-pop b { font-family: var(--serif); font-size: 18px; display: block; }
.search { width: 100%; margin: 4px 0 8px; border-radius: 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; max-height: 190px; overflow: auto; }
.pickc { border: 1px solid var(--rule); padding: 3px; display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; line-height: 1.2; text-align: left; border-radius: 6px; min-height: 0; background: transparent; }
.pickc.on { border-color: var(--moss); box-shadow: 0 0 0 2px var(--moss); }
.pickc canvas { width: 100%; aspect-ratio: 52 / 30; border-radius: 4px; }
.pickc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
canvas.shot { width: 100%; aspect-ratio: 52 / 30; display: block; border-radius: 10px; border: 1px solid var(--rule); }
.row-card { border-radius: 8px; }
.specimen { border-radius: 10px; overflow: hidden; }
button.primary { box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }

/* ---- polish ---- */
#top .stat { padding: 7px 10px 6px; }
#top .stat .lbl { font-size: 9.5px; }
#top .stat b { font-size: 14px; white-space: nowrap; }
#top .stat.right b { font-family: var(--mono); }
.pair-board.m { grid-template-columns: 1fr 1fr; gap: 8px; }
.pair-board.m .pcard { padding: 8px; gap: 4px; }
.pair-board.m .pcard .nm { font-size: 16px; }
.pair-board.m .pcard canvas { aspect-ratio: 52 / 30; }
.pair-board.m .pcard.empty { min-height: 190px; padding: 12px 8px; font-size: 13px; }
.pair-board.m .pcard.empty b { font-family: var(--serif); font-size: 16px; }
.pair-board.m .pc-actions { flex-wrap: wrap; }
.pair-cta { margin: 10px 0 6px; }
.ev { gap: 16px; } .ev b { font-size: 19px; }
.oddchip { min-width: 100px; font-size: 11.5px; }
.coming.m { grid-template-columns: 1fr; gap: 4px; padding: 10px 0; }
.coming.m .meta { font-size: 12px; }
.steps { font-size: 11px; }
body.mobile .ig-top { padding-left: 6px; }
body.mobile .ig-tabs { bottom: 0; padding: 6px 0 4px; }
body.mobile .ig-logo { font-size: 22px; }
body.mobile .app-body { padding: 0; }
body.mobile #view.ig-host { padding: 0; }
body.mobile .chatform { padding: 8px 12px; }
body.mobile .chatlog { padding: 10px 12px; }
.row-card .steps { margin: 3px 0 2px; }

/* ---- online indicator ---- */
.dot.on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ba55d; box-shadow: 0 0 0 2px rgba(59, 165, 93, .22); vertical-align: middle; }
.online-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-2); margin-top: 2px; }
