:root { --teal: #1fb3a6; --tealDk: #12877f; --peach: #ff9f6a; --cream: #fbf7ef; --ink: #23303a; --red: #e8503a; --good: #25b36c; --font: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; color: var(--ink); font-family: var(--font); -webkit-user-select: none; user-select: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* HUD */
#hud { position: fixed; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: stretch; pointer-events: none; z-index: 5; }
#hud > div { background: rgba(251, 247, 239, .94); border-radius: 16px; padding: 8px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.25); display: flex; align-items: center; gap: 8px; border: 2px solid #fff; }
#hud small { font-size: 11px; color: #6a7680; display: block; }
.clock { min-width: 190px; }
.clock b { font-size: 26px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock #moon { font-size: 22px; }
.shift { width: 70px; height: 8px; background: #e5e0d6; border-radius: 6px; overflow: hidden; }
#shiftFill { height: 100%; width: 0; background: linear-gradient(90deg, #3a4a8a, var(--peach)); }
.money { flex-direction: column; align-items: flex-start !important; gap: 0 !important; min-width: 120px; }
.money b { font-size: 22px; color: var(--tealDk); font-variant-numeric: tabular-nums; }
.mood { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
#hearts { font-size: 19px; letter-spacing: 1px; line-height: 1; }
#hearts .h { display: inline-block; width: 22px; height: 20px; position: relative; }
#hearts .h::before { content: "♥"; position: absolute; inset: 0; color: #e3ddd2; }
#hearts .h i { position: absolute; inset: 0; overflow: hidden; color: #f0506e; font-style: normal; }
.mood.low { animation: pulse .6s infinite alternate; }
@keyframes pulse { to { background: #ffd9d2; } }
.btns { margin-left: auto; pointer-events: auto; padding: 6px !important; }
#btnStaff { position: relative; background: #fff3d6 !important; }
#staffBadge { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
#wages { color: #b8573a; font-size: 11px; }
.hireCard { max-width: 620px; max-height: 92vh; overflow: auto; }
.sheetHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheetHead button { border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; background: #fff; box-shadow: 0 3px 0 #d6cfc2; }
.note.left { text-align: left; }
#hireList { display: grid; gap: 8px; margin-top: 12px; }
.hireHead { font-size: 12px; font-weight: 800; color: var(--tealDk); margin: 8px 2px 0; }
.btnCol { display: flex; flex-direction: column; gap: 5px; }
.staffCard .btnCol button.ghost { background: #fff; color: #7a848c; box-shadow: 0 3px 0 #e2d6c8; }
.staffCard { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 10px 12px; border: 2px solid #eee6d8; }
.staffCard .face { width: 52px; height: 52px; border-radius: 14px; background: #fbf1df; display: grid; place-items: center; font-size: 28px; }
.staffCard b { font-size: 16px; } .staffCard small { color: #7a848c; display: block; font-size: 12px; }
.staffCard .stats { font-size: 12px; color: #5a6670; margin-top: 3px; } .staffCard .stats span { margin-right: 10px; white-space: nowrap; }
.staffCard button { border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; font-size: 15px; background: var(--teal); color: #fff; box-shadow: 0 3px 0 var(--tealDk); }
.staffCard.hired { border-color: var(--teal); background: #eefaf7; } .staffCard.hired button { background: #fff; color: #b8573a; box-shadow: 0 3px 0 #e2d6c8; }
.staffCard.locked { opacity: .55; } .staffCard.locked button { background: #d8d2c6; box-shadow: none; cursor: default; }
.staffCard.new { border-color: var(--peach); }
.btns button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: #efe9dd; font-size: 18px; }
#btnHelp { font-weight: 800; color: var(--tealDk); }
#btnHelp.on { background: var(--teal); color: #fff; }
/* how-to-play overlay: see-through, floats over the game, never takes the clicks (the game keeps running underneath) */
#helpOverlay { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto; z-index: 6; pointer-events: none;
  background: rgba(12, 20, 36, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); color: #fff; border-radius: 22px; padding: 18px 24px 14px; border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); animation: helpIn .2s ease-out; }
@keyframes helpIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
#helpOverlay h2 { margin: 0 0 10px; font-size: 20px; text-align: center; letter-spacing: .08em; }
.helpGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 14px; line-height: 1.45; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.helpGrid b { display: block; color: #8ff0e4; font-size: 13px; }
#helpOverlay p { margin: 12px 0 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .75); }
#helpOverlay .touchOnly { display: none; }
@media (pointer: coarse) { #helpOverlay .touchOnly { display: block; } }
@media (max-width: 760px) { .helpGrid { grid-template-columns: 1fr; font-size: 13px; } #helpOverlay { padding: 14px 16px 10px; } }

/* task list */
#tasks { position: fixed; right: 12px; top: 92px; width: 240px; display: flex; flex-direction: column; gap: 6px; z-index: 5; pointer-events: none; }
.task { background: rgba(251, 247, 239, .94); border-radius: 12px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; box-shadow: 0 3px 0 rgba(0,0,0,.15); font-size: 13px; border-left: 5px solid var(--teal); animation: slideIn .25s ease-out; }
.task .ic { font-size: 18px; }
.task.urgent { border-left-color: var(--red); background: #fff1ec; }
.task small { display: block; color: #7a848c; font-size: 11px; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

/* in-world labels */
#world { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.bub { position: absolute; transform: translate(-50%, -100%); background: #fff; border-radius: 14px; padding: 5px 11px; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.2); animation: pop .22s cubic-bezier(.3,1.6,.6,1); }
.bub::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bub.kas { background: #fff6d6; color: #6a4a10; }
.bub.kas::after { border-top-color: #fff6d6; }
.bub.sad { background: #e9eef5; color: #3a4a6a; }
.bub.sad::after { border-top-color: #e9eef5; }
.bub.happy { background: #e4f8ee; color: #1a6a40; }
.bub.happy::after { border-top-color: #e4f8ee; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.5); opacity: 0; } }
.pat { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); }
.pat circle { fill: none; stroke-width: 4; }
.mark { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; animation: bob 1s ease-in-out infinite alternate; }
.mark .pin { background: var(--peach); color: #fff; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.25); border: 2px solid #fff; }
.mark.urgent .pin { background: var(--red); animation: shake .4s infinite; }
.mark .lab { margin-top: 3px; background: rgba(35, 48, 58, .85); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
.mark .ring { position: absolute; top: -3px; width: 40px; height: 40px; }
@keyframes bob { to { margin-top: -6px; } }
@keyframes shake { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.edge { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 18px; transform: translate(-50%, -50%); box-shadow: 0 3px 10px rgba(0,0,0,.4); border: 2px solid #fff; }

#floats { position: fixed; left: 50%; top: 88px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 6; pointer-events: none; }
.fl { padding: 6px 14px; border-radius: 12px; font-weight: 700; font-size: 15px; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2); animation: flo 2.4s forwards; }
.fl.good { color: var(--good); } .fl.bad { color: #fff; background: var(--red); } .fl.info { color: #fff; background: var(--tealDk); }
@keyframes flo { 0% { transform: translateY(8px); opacity: 0; } 10% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }

#prompt { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: rgba(35, 48, 58, .92); color: #fff; padding: 10px 16px 10px 10px; border-radius: 16px; display: flex; align-items: center; gap: 10px; font-size: 16px; z-index: 6; box-shadow: 0 6px 20px rgba(0,0,0,.3); pointer-events: none; }
#prompt .key { background: #fff; color: var(--ink); font-weight: 800; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; box-shadow: 0 3px 0 #9aa; }
#prompt .hold { width: 70px; height: 7px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
#holdFill { height: 100%; width: 0; background: var(--peach); }

/* ===== 5日間モード ===== */
.dayTag { background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; border-radius: 8px; padding: 2px 7px; }
.boss::before { content: attr(data-who) "：「" !important; }
.card.campCard { max-width: 920px; max-height: 94vh; overflow: auto; }
.campCard h2 { margin: 2px 0 6px; }
.flips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.flip { position: relative; min-height: 190px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 #d6cfc2; padding: 12px; text-align: left; font-family: inherit; color: var(--ink); animation: dealIn .35s ease-out; }
.flip.wide { grid-column: span 2; }
.flip .back { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; font-size: 64px; font-weight: 900; color: #fff; background: repeating-linear-gradient(45deg, var(--teal), var(--teal) 14px, var(--tealDk) 14px, var(--tealDk) 28px); }
.flip:not(.open):hover { transform: translateY(-3px); }
.flip.open { animation: flipOpen .45s ease-out; }
.flip img { width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 6px; }
.flip .ic { font-size: 38px; } .flip b { display: block; font-size: 16px; margin: 4px 0; } .flip p { margin: 0; font-size: 13px; line-height: 1.6; color: #4a5660; }
.flip .delta { margin-top: 6px; display: flex; gap: 8px; font-weight: 900; font-size: 18px; }
.plus { color: var(--good); } .minus { color: var(--red); }
@keyframes dealIn { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } }
@keyframes flipOpen { 0% { transform: rotateY(90deg); } 100% { transform: none; } }
.campFoot { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin-top: 10px; }
.campFoot .stat { background: #fff; border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 130px; }
.campFoot .stat small { display: block; font-size: 11px; color: #7a848c; } .campFoot .stat b { font-size: 18px; }
.campFoot .row { width: 100%; }
.funds { background: #fff; border-radius: 12px; padding: 6px 14px; text-align: right; } .funds small { display: block; font-size: 11px; color: #7a848c; } .funds b { font-size: 22px; color: var(--tealDk); }
.shopGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 10px 0; }
.shopCard { display: grid; grid-template-columns: 40px 1fr; gap: 4px 10px; background: #fff; border-radius: 14px; padding: 10px; border: 2px solid #eee6d8; }
.shopCard .ic { font-size: 30px; grid-row: span 2; }
.shopCard small { display: block; font-size: 12px; color: #5a6670; line-height: 1.5; margin-top: 2px; }
.shopCard button { grid-column: 2; justify-self: end; border: 0; border-radius: 10px; padding: 7px 14px; font-weight: 800; background: var(--peach); color: #fff; box-shadow: 0 3px 0 #d9774a; }
.shopCard button:disabled { background: #d8d2c6; box-shadow: none; cursor: default; }
.shopCard.owned { border-color: var(--teal); background: #eefaf7; } .shopCard.owned button { background: var(--teal); }
.shopCard.poor { opacity: .7; }
.tag { font-size: 10px; border-radius: 6px; padding: 1px 6px; color: #fff; background: #8a94a0; vertical-align: 2px; }
.tag.t-定番 { background: var(--tealDk); } .tag.t-奇抜 { background: #b04ae0; } .tag.t-罠 { background: #b8732e; } .tag.t-今夜だけ { background: var(--red); }
.tonight { display: flex; flex-direction: column; gap: 2px; background: #fff6d6; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.nightCard { text-align: center; padding: 10px 4px; }
.nightCard .dayNum { font-size: 90px; font-weight: 900; line-height: 1; color: var(--teal); text-shadow: 0 5px 0 var(--tealDk); }
.nightCard .dayNum small { font-size: 30px; color: #9aa; text-shadow: none; }
.nightCard h1 { margin: 4px 0 8px; font-size: 30px; } .nightCard p { font-size: 16px; line-height: 1.7; max-width: 520px; margin: 0 auto; }
table.hist { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; margin: 10px 0; font-size: 14px; }
table.hist th, table.hist td { padding: 7px 10px; text-align: right; border-bottom: 1px solid #f0ebe2; } table.hist th:first-child, table.hist td:first-child { text-align: left; }
#sleep { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse at 50% 40%, #243863, #070b18); color: #dfe8ff; display: grid; place-content: center; justify-items: center; gap: 16px; opacity: 0; }
#sleep.go { animation: sleepIn 1.2s forwards; }
@keyframes sleepIn { to { opacity: 1; } }
#sleep .zzz { font-size: 64px; font-weight: 900; color: #9fb8ff; } #sleep .zzz span { display: inline-block; animation: zz 1.6s infinite; } #sleep .zzz span:last-child { animation-delay: .4s; font-size: .7em; }
@keyframes zz { 50% { transform: translateY(-14px); opacity: .5; } }
#sleepDream { font-size: 18px; font-style: italic; color: #b9c8ee; }
.sleepClock { text-align: center; } .sleepClock b { display: block; font-size: 54px; font-variant-numeric: tabular-nums; } .sleepClock small { color: #8aa0cc; }
#loading.asleep { background: radial-gradient(ellipse at 50% 40%, #243863, #070b18); }
#ending { position: fixed; inset: 0; z-index: 25; background: rgba(8, 10, 20, .78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; cursor: pointer; }
#ending .endFrame { position: relative; width: min(900px, 94vw); border-radius: 18px; overflow: hidden; border: 6px solid #f3e6cf; box-shadow: 0 10px 0 #4e2e16, 0 30px 80px rgba(0,0,0,.6); }
#endImg { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.endName { position: absolute; left: 14px; top: 12px; background: var(--peach); color: #fff; font-weight: 900; padding: 5px 14px; border-radius: 12px; font-size: 18px; }
#endText { margin: 0; max-width: 820px; background: var(--cream); border-radius: 14px; padding: 12px 18px; font-size: 20px; font-weight: 800; line-height: 1.6; text-align: center; }
#endText.in { animation: pop .3s ease-out; }
#ending .note { color: #cfd6e2; }
@media (max-width: 760px) { .flip.wide { grid-column: span 1; } .nightCard .dayNum { font-size: 64px; } .nightCard h1 { font-size: 22px; } #endText { font-size: 15px; } }

/* opening: 紙芝居 window */
#kami { position: fixed; left: 18px; top: 18px; width: min(460px, calc(100vw - 36px)); z-index: 8; background: #7a4a26; border-radius: 18px; padding: 10px 10px 12px; box-shadow: 0 8px 0 #4e2e16, 0 20px 50px rgba(0,0,0,.45); border: 3px solid #a36a3c; }
#kami .kamiFrame { position: relative; border-radius: 10px; overflow: hidden; background: #2a1c12; aspect-ratio: 16 / 9; border: 3px solid #f3e6cf; }
#kamiImg { width: 100%; height: 100%; object-fit: cover; display: block; }
#kamiNo { position: absolute; right: 8px; bottom: 6px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; border-radius: 8px; padding: 1px 7px; }
#kami.flip .kamiFrame { animation: kamiSlide .45s ease-out; }
@keyframes kamiSlide { from { transform: translateX(-24px); opacity: 0; } }
#kamiText { margin: 10px 4px 8px; background: var(--cream); border-radius: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.6; font-weight: 700; min-height: 3.2em; }
.kamiBtns { display: flex; justify-content: flex-end; gap: 8px; }
.kamiBtns button { border: 0; border-radius: 12px; padding: 9px 16px; font-weight: 800; font-size: 14px; background: #f3e6cf; color: #5a3a22; box-shadow: 0 3px 0 #c8b28e; }
.kamiBtns button.primary { background: var(--peach); color: #fff; box-shadow: 0 3px 0 #d9774a; }
@media (max-width: 760px) { #kami { left: 8px; top: 8px; width: calc(100vw - 16px); } #kamiText { font-size: 14px; } }

/* register panel */
#reg { position: fixed; right: 16px; bottom: 16px; width: min(460px, calc(100vw - 32px)); background: var(--cream); border-radius: 20px; padding: 14px 16px 12px; z-index: 7; box-shadow: 0 6px 0 rgba(0,0,0,.2), 0 18px 50px rgba(0,0,0,.4); border: 3px solid #fff; animation: regIn .2s ease-out; }
@keyframes regIn { from { transform: translateY(20px); opacity: 0; } }
.regHead { display: flex; align-items: center; gap: 8px; }
.regTag { background: var(--teal); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
#regTitle { font-size: 17px; flex: 1; }
#regLeave { border: 0; border-radius: 9px; background: #efe9dd; font-size: 12px; font-weight: 700; padding: 5px 9px; color: #6a7680; }
.timer { width: 70px; height: 7px; background: #e5e0d6; border-radius: 4px; overflow: hidden; }
#regTimer { height: 100%; width: 100%; background: var(--peach); }
.custSay { margin: 10px 0 6px; background: #fff; border-radius: 14px; padding: 9px 12px; font-size: 18px; font-weight: 800; position: relative; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.custSay::before { content: "お客さん"; position: absolute; top: -9px; left: 10px; font-size: 10px; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.custSay:empty { display: none; }
#regText { font-size: 13px; color: #5a6670; margin: 4px 0; }
#regItems { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 5px; }
#regItems li { background: #fff; border-radius: 9px; padding: 4px 9px; font-size: 13px; border: 2px solid #e8e2d6; }
#regItems li.done { background: #e4f8ee; border-color: #9fe0bf; color: #1a6a40; }
#regBtns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
#regBtns button, #regCig button, #regOden button { border: 0; border-radius: 12px; background: #fff; padding: 10px 14px; font-size: 16px; font-weight: 800; box-shadow: 0 3px 0 #d6cfc2; color: var(--ink); }
#regBtns button:hover, #regCig button:hover, #regOden button:hover { background: #fff3e6; }
#regBtns button:active, #regCig button:active { transform: translateY(2px); box-shadow: 0 1px 0 #d6cfc2; }
#regBtns button kbd { font-size: 11px; background: #efe9dd; border-radius: 5px; padding: 1px 5px; margin-right: 6px; color: #7a848c; font-family: inherit; }
#regBtns button.big { background: var(--teal); color: #fff; box-shadow: 0 3px 0 var(--tealDk); font-size: 20px; padding: 12px 24px; }
#regCig { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
#regCig button { padding: 6px 0; font-size: 13px; border-radius: 7px; }
#regOden { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#regOden button.on { background: var(--peach); color: #fff; box-shadow: 0 3px 0 #d9774a; }
#regMicro { margin-top: 10px; font-size: 12px; color: #6a7680; }
#regMicro .bar { position: relative; height: 22px; background: linear-gradient(90deg, #9fd8ef, #fff3c4 55%, #ff9f6a 85%, #e8503a); border-radius: 11px; margin-bottom: 4px; }
#regMicro .zone { position: absolute; left: 60%; width: 24%; top: -3px; bottom: -3px; border: 3px solid var(--good); border-radius: 8px; }
#microNeedle { position: absolute; top: -6px; bottom: -6px; width: 5px; background: var(--ink); border-radius: 3px; left: 0; }
.regNote { margin: 6px 0 0; font-size: 12px; color: #7a848c; min-height: 1em; }

/* touch */
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
#stick { position: absolute; left: 24px; bottom: 24px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); pointer-events: auto; touch-action: none; }
#knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(255,255,255,.85); }
#tAct, #tRun { position: absolute; pointer-events: auto; border: 0; border-radius: 50%; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.3); touch-action: none; }
#tAct { right: 24px; bottom: 34px; width: 86px; height: 86px; background: var(--peach); color: #fff; font-size: 26px; }
#tRun { right: 124px; bottom: 24px; width: 62px; height: 62px; background: rgba(255,255,255,.85); font-size: 13px; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(8, 14, 26, .55); display: grid; place-items: center; z-index: 10; padding: 16px; backdrop-filter: blur(3px); }
.card { background: var(--cream); border-radius: 24px; padding: 24px 28px; max-width: 560px; width: 100%; box-shadow: 0 8px 0 rgba(0,0,0,.2), 0 24px 70px rgba(0,0,0,.5); border: 3px solid #fff; }
.card h2 { margin: 0 0 8px; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.row button { border: 0; border-radius: 14px; padding: 12px 20px; font-size: 16px; font-weight: 800; background: #fff; box-shadow: 0 4px 0 #d6cfc2; }
.row button.primary { background: var(--teal); color: #fff; box-shadow: 0 4px 0 var(--tealDk); font-size: 18px; padding: 14px 28px; }
.note { font-size: 12px; color: #7a848c; text-align: center; margin: 10px 0 0; }
.titleCard { max-width: 640px; }
.logo { display: flex; align-items: center; gap: 14px; }
.logo .cat { width: 64px; height: 64px; border-radius: 18px; background: var(--teal); display: grid; place-items: center; font-size: 34px; box-shadow: 0 4px 0 var(--tealDk); }
.brand { font-size: 13px; font-weight: 800; color: var(--tealDk); letter-spacing: .1em; border-bottom: 4px solid var(--peach); display: inline-block; }
.logo h1 { margin: 2px 0 0; font-size: 30px; }
.lead { font-size: 15px; line-height: 1.7; margin: 14px 0; }
.how { display: grid; gap: 5px; font-size: 13px; background: #fff; border-radius: 14px; padding: 12px 14px; }
.how b { display: inline-block; min-width: 96px; color: var(--tealDk); }
.resCard { text-align: center; }
.eyebrow { font-size: 12px; color: #7a848c; font-weight: 700; letter-spacing: .1em; }
.rank { font-size: 76px; font-weight: 900; line-height: 1; margin: 6px 0; color: var(--teal); text-shadow: 0 4px 0 var(--tealDk); }
.rank.S { color: #ffb020; text-shadow: 0 4px 0 #c47a00; } .rank.D { color: #8a94a0; text-shadow: 0 4px 0 #5a646e; }
#resRows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; text-align: left; background: #fff; border-radius: 14px; padding: 12px 16px; font-size: 14px; }
#resRows b { float: right; }
.boss { background: #fff6d6; border-radius: 14px; padding: 10px 14px; font-size: 14px; text-align: left; }
.boss::before { content: "店長：「"; font-weight: 800; } .boss::after { content: "」"; font-weight: 800; }

#loading { position: fixed; inset: 0; background: #0b1220; color: #cfe; display: grid; place-content: center; justify-items: center; gap: 10px; z-index: 20; font-size: 15px; }
.spin { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--teal); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
#loadNote { font-size: 12px; color: #8aa; }

@media (max-width: 760px) {
  #hud { top: 6px; left: 6px; right: 6px; gap: 5px; }
  #hud > div { padding: 5px 8px; border-radius: 12px; }
  .clock { min-width: 0; } .clock b { font-size: 18px; } .shift { display: none; }
  .money b { font-size: 16px; } .money, .mood small { min-width: 0; } #hearts { font-size: 14px; } #hearts .h { width: 15px; height: 15px; }
  .btns button { width: 32px; height: 32px; }
  #tasks { top: 64px; width: 170px; right: 6px; } .task { font-size: 11px; padding: 5px 7px; } .task small { display: none; }
  #reg { right: 8px; left: 8px; bottom: 8px; width: auto; padding: 10px; }
  #prompt { bottom: 140px; font-size: 13px; }
  .card { padding: 16px; } .logo h1 { font-size: 22px; } .how b { min-width: 0; display: block; }
}

/* title screen: full-bleed key art (imagegen), menu along the bottom, how-to in a pop-up card */
.titleScreen { padding: 0; background: #0d1526; backdrop-filter: none; overflow: hidden; }
.titleArt { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; animation: titleIn 1.2s ease-out both; }
@keyframes titleIn { from { transform: scale(1.04); opacity: 0; } to { transform: none; opacity: 1; } }
.titleMenu { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 22px; background: linear-gradient(to top, rgba(8, 14, 26, .78), rgba(8, 14, 26, 0)); }
.titleMenu .row { margin-top: 0; }
.titleMenu .row button { font-size: 18px; padding: 14px 26px; }
.titleMenu .row button.primary { font-size: 20px; padding: 16px 34px; }
.titleMenu .note { color: #e6edf5; text-shadow: 0 1px 3px #000; }
.howCard { position: relative; max-width: 660px; z-index: 2; }
/* ending book (title screen) */
.bookCard { position: relative; max-width: 900px; z-index: 2; max-height: calc(100vh - 32px); overflow: auto; }
.bookGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.bookItem { display: block; border: 0; padding: 0; background: #fff; border-radius: 14px; overflow: hidden; text-align: left; font: inherit; color: inherit; box-shadow: 0 4px 0 #d6cfc2; cursor: pointer; }
.bookItem:hover { transform: translateY(-2px); }
.bookItem img, .bookItem .q { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.bookItem .q { display: grid; place-items: center; font-size: 56px; font-weight: 800; color: #b9b09d; background: #d9d2c2; }
.bookItem .cap { display: block; padding: 8px 12px 10px; }
.bookItem b { display: block; font-size: 15px; }
.bookItem i { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--peach); border-radius: 8px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.bookItem small { display: block; font-size: 12px; color: #7a848c; margin-top: 3px; }
.bookItem.locked { cursor: default; background: #ece6d9; box-shadow: none; }
.bookItem.locked:hover { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-aspect-ratio: 1/1) { .titleArt { object-position: 50% 30%; } }
