:root {
  --desk: #2b2622; --desk-2: #1d1915; --paper: #f3ecdb; --ink: #2a2420; --ink-2: #6b5d4d;
  --red: #d64541; --green: #3ecf8e; --gold: #f5b82e; --wall: #f4f1ea;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--desk-2); color: #f3e9d8; font-family: var(--font); overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

#app { position: relative; width: min(100vw, 520px); height: 100dvh; margin: 0 auto; background: var(--desk); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 60px rgba(0,0,0,.6); }
#bar { position: relative; flex: 0 0 var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; padding-top: env(safe-area-inset-top); background: linear-gradient(#352d27, #2b2622); z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.level-chip { min-width: 84px; max-width: 112px; height: 44px; padding: 4px 8px; border-radius: 10px; text-align: left; background: rgba(255,255,255,.07); display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.level-chip .lv-top { display: flex; align-items: center; gap: 4px; font-size: 15px; }
.level-chip b { font-weight: 800; }
#lv-name { font-size: 11px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#deposit { flex: 1; min-width: 0; text-align: center; line-height: 1; }
#dep-label { display: block; font-size: 10px; letter-spacing: .08em; opacity: .65; margin-bottom: 2px; }
#dep-val { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; transition: color .2s; white-space: nowrap; }
#deposit.low #dep-val { color: #ff6a5f; }
#deposit.low.pulse #dep-val { animation: dpulse .5s ease; }
@keyframes dpulse { 40% { transform: scale(1.14); } }
.tools { display: flex; gap: 2px; }
.tool { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.tool:active, .level-chip:active { background: rgba(255,255,255,.14); }
.tool svg { width: 22px; height: 22px; }
#dep-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.4); }
#dep-bar i { display: block; height: 100%; width: 100%; background: #e9a23b; transform-origin: left; transition: width .3s, background .3s; }
#bar.low #dep-bar i { background: var(--red); }
#bar.critical #dep-bar i { animation: blink .5s infinite alternate; }
@keyframes blink { to { background: #ff9a90; } }

#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#board.grabbing { cursor: grabbing; }
#vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; box-shadow: inset 0 0 70px 12px rgba(214,69,65,.55); }
#vignette.low { opacity: .4; }
#vignette.critical { opacity: 1; animation: blink2 .6s infinite alternate; }
@keyframes blink2 { to { opacity: .45; } }

#btn-restart { position: absolute; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: #f4efe4; color: #2b2622; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.5), inset 0 -2px 0 rgba(0,0,0,.12); z-index: 20; }
#btn-restart svg { width: 28px; height: 28px; stroke-width: 2.4; }
#btn-restart:active { transform: scale(.92); }
#btn-restart.pulse { animation: rpulse .8s ease 2; }
@keyframes rpulse { 50% { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(255,255,255,.25); } }

#layer { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#layer > * { pointer-events: auto; }

/* 重ね表示の共通 */
.btn { height: 52px; min-width: 96px; padding: 0 20px; border-radius: 14px; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 20px; height: 20px; }
.btn.main { background: var(--green); color: #0d2b1f; box-shadow: 0 3px 0 #1f9a68; flex: 1.5; height: 56px; font-size: 18px; }
.btn.sub { background: rgba(255,255,255,.12); color: #f3e9d8; flex: 1; }
.btn.tiny { height: 40px; min-width: 0; padding: 0 12px; font-size: 13px; font-weight: 700; background: none; color: #d9ccb6; }
.btn.tiny svg { width: 16px; height: 16px; }
.btn.wide { width: min(320px, calc(100% - 48px)); }
.btn.danger { background: rgba(214,69,65,.18); color: #ffb3ad; width: 100%; margin-top: 6px; }
.btn.danger.armed { background: var(--red); color: #fff; }
.btns { display: flex; gap: 10px; align-items: center; }
.btns.small { justify-content: center; margin-top: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn:active { background: rgba(255,255,255,.12); }
.note { text-align: center; font-size: 12px; opacity: .7; margin: 10px 0 0; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(0,0,0,.85); padding: 10px 16px; border-radius: 12px; font-size: 14px; white-space: nowrap; animation: toast 1.8s ease forwards; pointer-events: none; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

.star { width: 38px; height: 38px; }
.star.on { fill: var(--gold); stroke: #b8860b; stroke-width: 1.2; filter: drop-shadow(0 0 6px rgba(245,184,46,.55)); }
.star.off { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.35); stroke-width: 1.4; }
.star.mini { width: 14px; height: 14px; filter: none; }

/* クリア */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(#3a322b, #2b2622); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.5); animation: sheetUp .35s cubic-bezier(.2,.9,.3,1); display: flex; flex-direction: column; gap: 12px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.handle { width: 40px; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; margin: 0 auto; }
.clear-top { display: flex; gap: 14px; align-items: stretch; }
.plan-wrap { position: relative; flex: 0 0 auto; border-radius: 10px; overflow: hidden; line-height: 0; background: var(--desk-2); }
.plan { display: block; }
.clear-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.refund-head .lbl { font-size: 13px; opacity: .75; }
.refund-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; margin-top: 2px; }
.refund-line s { font-size: 14px; opacity: .55; }
.refund-line .arrow { opacity: .5; font-size: 14px; }
.refund-amt { font-size: 34px; font-weight: 800; color: #ffe08a; font-variant-numeric: tabular-nums; line-height: 1; }
.star-row { display: flex; gap: 8px; }
.star-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; opacity: 0; animation: starIn .35s ease forwards; }
.star-cell .star { width: 34px; height: 34px; }
.star-cell.got .star { animation: starPop .45s cubic-bezier(.3,1.8,.5,1) both; animation-delay: inherit; }
@keyframes starIn { to { opacity: 1; } }
@keyframes starPop { 0% { transform: scale(.2) rotate(-40deg); } 100% { transform: none; } }
.why { display: flex; align-items: center; gap: 2px; font-size: 10px; opacity: .7; flex-direction: column; }
.why svg { width: 14px; height: 14px; }
.why i { font-style: normal; white-space: nowrap; }
.star-cell.miss .why { opacity: .45; }
.meta { font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 8px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.flash-stars { position: absolute; left: 0; right: 0; top: 30%; display: flex; justify-content: center; gap: 14px; pointer-events: none; }
.flash-stars .fs { animation: starPop .45s cubic-bezier(.3,1.8,.5,1) both; }
.flash-stars .star { width: 64px; height: 64px; }

/* 判子 */
.stamp { position: absolute; font-weight: 900; color: var(--red); border: 4px solid var(--red); border-radius: 6px; padding: 2px 10px; letter-spacing: .06em; transform: rotate(-12deg); background: rgba(255,255,255,.12); text-shadow: 0 0 1px currentColor; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; -webkit-mask-image: radial-gradient(circle at 20% 30%, #000 60%, rgba(0,0,0,.7) 100%); }
.stamp.small { right: 4px; bottom: 14px; font-size: 14px; line-height: 1.2; animation: stampIn .3s ease .9s both; background: rgba(243,236,219,.9); max-width: 120px; text-align: center; }
.stamp.big { position: relative; font-size: 44px; padding: 6px 22px; animation: stampIn .15s ease both; background: rgba(40,10,10,.35); border-width: 6px; box-shadow: 0 0 0 2px rgba(214,69,65,.4); }
@keyframes stampIn { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }

/* 契約解除 */
.fail { position: absolute; inset: 0; background: rgba(20,12,10,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; animation: fadeIn .12s ease; padding-bottom: 60px; }
@keyframes fadeIn { from { opacity: 0; } }
.fail-box { display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: 0; animation: fadeIn .3s ease .9s forwards; }
.fail .btn.main { opacity: 0; animation: fadeIn .3s ease .9s forwards; }
.fail .btn.tiny { opacity: 0; animation: fadeIn .3s ease .9s forwards; }
.lost { font-weight: 800; font-size: 20px; color: #ff8f86; font-variant-numeric: tabular-nums; }

/* 一覧と設定 */
.panel { position: absolute; inset: 0; background: rgba(34,28,24,.97); padding: calc(10px + env(safe-area-inset-top)) 14px 16px; overflow-y: auto; animation: fadeIn .15s ease; touch-action: pan-y; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lv-card { position: relative; border-radius: 14px; background: rgba(255,255,255,.07); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 176px; text-align: center; }
.lv-card:active { background: rgba(255,255,255,.14); }
.lv-card .plan-wrap { background: none; }
.lv-card canvas { max-width: 100%; height: auto !important; }
.lv-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.lv-meta b { font-size: 18px; line-height: 1; }
.lv-meta .stars { display: flex; gap: 1px; }
.lv-meta .best { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-card .lock { position: absolute; top: 8px; right: 8px; opacity: .8; }
.lv-card .lock svg { width: 22px; height: 22px; }
.lv-card.locked { opacity: .6; }
.lv-card.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.lv-card.bill { background: var(--paper); color: var(--ink); justify-content: center; border: 2px solid #b8aa90; }
.bill-title { font-weight: 800; font-size: 13px; }
.bill-amt { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bill-sub { font-size: 11px; opacity: .7; }
.bill-title2 { margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 2px 6px; transform: rotate(-6deg); }
.panel.small { inset: auto 16px auto 16px; top: 72px; border-radius: 18px; max-width: 420px; margin: 0 auto; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: #2f2823; }
.row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 15px; }
.seg { display: flex; background: rgba(0,0,0,.3); border-radius: 10px; padding: 3px; }
.seg-btn { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 700; opacity: .7; }
.seg-btn.on { background: #f4efe4; color: var(--ink); opacity: 1; }
.switch { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 20px; background: rgba(255,255,255,.1); font-weight: 800; font-size: 13px; min-width: 76px; }
.switch i { width: 30px; height: 30px; border-radius: 50%; background: #8a7e70; transition: transform .15s, background .15s; }
.switch.on { background: rgba(62,207,142,.25); }
.switch.on i { background: var(--green); transform: translateX(4px); }
.panel.share { display: flex; flex-direction: column; align-items: center; }
.card-img { width: auto; max-width: 100%; max-height: calc(100dvh - 210px); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.5); -webkit-touch-callout: default; user-select: auto; margin: 6px 0; }
.panel.share .btns { width: 100%; margin-top: 10px; }
.noscript { padding: 24px; }

@media (min-width: 700px) {
  :root { --bar-h: 60px; }
  .toast { bottom: 110px; }
}
@media (max-height: 640px) {
  .refund-amt { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 調整（画面確認の後） */
.level-chip { line-height: 1.25; }
#lv-name { line-height: 1.3; padding-bottom: 1px; }
.panel { background: #221c18; }
.stamp.big { font-size: clamp(26px, 8vw, 44px); text-align: center; max-width: 88%; line-height: 1.15; }
.sheet { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.btns.small { padding-right: 70px; }
.panel.share .panel-head { width: 100%; }
@keyframes fadeInTo { to { opacity: 1; } }
.fail-box, .fail .btn.main, .fail .btn.tiny { animation-name: fadeInTo; }
.fail .btn.main { flex: none; }
.level-chip { height: 48px; padding: 3px 8px; }
.level-chip .lv-top { font-size: 14px; }
#lv-name { font-size: 10.5px; }

/* 工程7 ux: 敷金の残りの線を数字の下へ、時間の表示、当たりの脈打ち */
#dep-bar { position: relative; left: auto; right: auto; bottom: auto; width: 128px; max-width: 100%; height: 6px; margin: 4px auto 0; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
#dep-bar i { border-radius: 3px; }
#deposit.hit #dep-val { animation: dhit .5s ease; }
@keyframes dhit { 0% { transform: scale(1); color: #fff; } 25% { transform: scale(1.28); color: #ff5a4e; } 100% { transform: scale(1); } }
#timer { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 2px 10px; border-radius: 999px; background: rgba(20,14,10,.62); color: #f3e9d8; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; pointer-events: none; transition: color .3s, opacity .3s; white-space: nowrap; }
#timer.over { color: #9a8f82; opacity: .7; }
.stamp.small { white-space: nowrap; max-width: none; font-size: 13px; padding: 2px 8px; }
.stamp.big { white-space: nowrap; }
.star-cell { opacity: 1; animation: none; }
.star-cell.got .star { animation: starPop .45s cubic-bezier(.3,1.8,.5,1) both; }
.meta.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.breakdown { font-size: 12.5px; font-weight: 700; color: #ffb3a8; line-height: 1.3; font-variant-numeric: tabular-nums; }
.sumline { font-size: 11px; opacity: .75; line-height: 1.3; font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* 工程7 ux（2回目）: 時計の星、やり直しの脈打ち、共有の画面の余白、結果の行 */
#timer { display: flex; align-items: center; gap: 5px; }
#tstar { flex: none; fill: #f5c84b; stroke: #f5c84b; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(245,200,75,.6)); transition: fill .3s, stroke .3s; }
#timer.over #tstar { fill: transparent; stroke: #9a8f82; filter: none; }
@keyframes urge { 0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 0 0 0 rgba(255,255,255,0); } 50% { transform: scale(1.12); box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 0 0 9px rgba(255,255,255,.22); } }
#btn-restart.urge { animation: urge 1.8s ease-in-out infinite; }
#btn-restart.urge.pulse { animation: rpulse .8s ease 2, urge 1.8s ease-in-out 1.6s infinite; }
.panel.share .btns { padding-right: 70px; box-sizing: border-box; }
.breakdown .nw, .breakdown { white-space: normal; }
.breakdown .nw { white-space: nowrap; }

/* 工程7 ux（PO差し戻し1）: 上の帯。フォントが15%広くても重ならない */
#bar { gap: 4px; padding: 0 6px; }
.level-chip { min-width: 0; width: 86px; max-width: 86px; flex: 0 0 86px; overflow: hidden; }
#deposit { overflow: hidden; }
#dep-val { display: block; font-size: min(26px, 5.2vw); letter-spacing: -.02em; max-width: 100%; overflow: hidden; }
#dep-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { gap: 0; flex: 0 0 auto; }
.tool { width: 38px; height: 44px; }
#btn-lang { width: 40px; font-size: 11px; letter-spacing: 0; }
@media (min-width: 700px) { #dep-val { font-size: 26px; } }

/* 工程7 ux（差し戻し2）: 枠の近く。離せばはまる */
/* 工程7 ux（差し戻し6）: 結果の小さな間取り図の札・判 */
.plan-wrap .stamp.small { right: 6px; bottom: 8px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; font-size: 12px; padding: 1px 6px; }
.plan-wrap .stamp.small { left: 8px; right: 8px; bottom: 10px; max-width: none; white-space: normal; text-align: center; line-height: 1.15; overflow: visible; font-size: 12px; }
.level-chip { width: 94px; max-width: 94px; flex-basis: 94px; }
.level-chip .lv-top { white-space: nowrap; font-size: 13px; }
.level-chip .lv-top b { overflow: hidden; text-overflow: ellipsis; }
#lv-name { padding-top: 1px; }
.level-chip .lv-top b { overflow: visible; text-overflow: clip; flex: none; }
.level-chip { padding: 3px 6px; }
#lv-chev svg { width: 14px; height: 14px; display: block; }

/* 面の始めの敷金（約2秒。操作は止めない。押しても邪魔をしない） */
#intro { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 3; padding: 7px 16px; border-radius: 999px; background: rgba(20,14,10,.78); color: #fff3d6; font-size: 15px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; pointer-events: none; opacity: 0; font-variant-numeric: tabular-nums; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
#intro.show { animation: introShow 2.2s ease both; }
#intro2 { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: calc(100% - 24px); padding: 6px 14px; border-radius: 999px; background: rgba(120,30,20,.9); color: #fff3d6; font-size: 14px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; pointer-events: none; opacity: 0; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
#intro2.show { animation: introShow 3s ease both; }
@keyframes introShow { 0% { opacity: 0; transform: translate(-50%, -8px); } 12% { opacity: 1; transform: translate(-50%, 0); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -4px); } }
.bill-amt.togo { font-size: 16px; }
@media (prefers-reduced-motion: reduce) { #intro.show { animation: introFade 2.2s linear both; } @keyframes introFade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } } }

/* 周回2 ux: PC の左右の余白（幅 1000px 以上）。面の名前と部屋の説明、敷金、星、目標の時間、面の一覧 */
.side { display: none; }
@media (min-width: 1000px) {
  .side { display: flex; position: fixed; top: 0; bottom: 0; z-index: 1; align-items: center; width: calc((100vw - 520px) / 2 - 28px); max-width: 330px; min-width: 190px; pointer-events: none; }
  #side-l { right: calc(50vw + 260px + 18px); justify-content: flex-end; }
  #side-r { left: calc(50vw + 260px + 18px); }
  .side-card { pointer-events: auto; width: 100%; padding: 18px 18px 16px; border-radius: 18px; background: linear-gradient(#352d27, #2b2622); box-shadow: 0 8px 28px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.07); }
  .side-kicker { font-size: 12px; letter-spacing: .12em; opacity: .65; font-weight: 700; }
  .side-name { margin: 6px 0 8px; font-size: 26px; line-height: 1.2; font-weight: 800; }
  .side-desc { margin: 0 0 14px; font-size: 14px; line-height: 1.6; opacity: .85; }
  .side-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
  .side-facts > div { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
  .side-facts dt { opacity: .7; } .side-facts dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 16px; }
  .side-stars { display: flex; gap: 2px; } .side-stars .star { width: 20px; height: 20px; }
  .side-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
  .side-row { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 10px; text-align: left; background: rgba(255,255,255,.05); }
  .side-row:hover { background: rgba(255,255,255,.12); }
  .side-row.on { background: rgba(62,207,142,.2); outline: 1.5px solid rgba(62,207,142,.6); }
  .side-row.locked { opacity: .45; }
  .side-row b { flex: 0 0 18px; font-size: 16px; }
  .side-row .nm { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-row .stars { display: flex; gap: 1px; flex: none; }
  .side-all { width: 100%; margin-top: 10px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.12); font-weight: 800; font-size: 15px; }
  .side-all:hover { background: rgba(255,255,255,.2); }
}

/* 周回3: 面の一覧の「1軒目」「2軒目」、4面クリアの知らせ、高級品の札 */
.house-head { margin: 14px 0 8px; font-size: 14px; font-weight: 800; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; letter-spacing: .02em; }
.house-head:first-of-type { margin-top: 2px; }
.house-head span { min-width: 0; overflow-wrap: anywhere; }
.house-head .h2tot { font-style: normal; font-size: 12px; font-weight: 800; color: #ffe29a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-card .opens { position: absolute; left: 6px; right: 34px; top: 6px; padding: 3px 4px; border-radius: 8px; background: rgba(20,14,10,.82); color: #fff3d6; font-size: 11px; font-weight: 800; line-height: 1.3; text-align: center; }
.house-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,226,122,.16); border: 1.5px solid rgba(255,226,122,.55); font-size: 13px; line-height: 1.35; }
.house-note b { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.house-note .go { flex: none; white-space: nowrap; }
.house-note.total { background: rgba(62,207,142,.14); border-color: rgba(62,207,142,.5); }
.house-note.total b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.side-house { margin: 8px 2px 2px; font-size: 11px; letter-spacing: .12em; font-weight: 800; opacity: .6; }

/* 周回5 ux: やり込み（次に取れる星、自己ベストとの差、プロの現場） */
.lv-meta .next-star { font-size: 10.5px; line-height: 1.25; font-weight: 800; color: #ffe29a; white-space: normal; overflow-wrap: anywhere; text-align: center; max-width: 100%; margin-top: 1px; }
.house-wrap { margin: 14px 0 8px; }
.house-wrap .house-head { margin: 0 0 6px; }
.house-head .hardprog { color: #ff9aa8; }
.mode-seg { display: flex; gap: 6px; }
.mode-btn { flex: 1; min-width: 0; height: 36px; padding: 0 8px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1.5px solid transparent; }
.mode-btn.on { background: rgba(62,207,142,.22); border-color: rgba(62,207,142,.7); }
.mode-btn.pro.on { background: rgba(190,52,78,.35); border-color: #ff7a8c; color: #fff0f0; }
.mode-btn.locked { opacity: .6; }
.mode-btn svg { width: 15px; height: 15px; flex: none; }
.mode-lock { margin-top: 4px; font-size: 11.5px; opacity: .75; }
.lv-card.hard { background: rgba(190,52,78,.16); outline: 1.5px solid rgba(255,122,140,.45); }
.lv-meta .marks { display: flex; gap: 4px; }
.lv-meta .mk { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.07); color: rgba(255,255,255,.3); }
.lv-meta .mk svg { width: 13px; height: 13px; }
.lv-meta .mk.on { background: var(--gold); color: #3a2a00; }
.best-line { font-size: 12.5px; line-height: 1.3; opacity: .72; }
.best-line.new { opacity: 1; font-weight: 800; color: #8ff0bd; }
.pro-pill { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 10px; background: #a43349; color: #fff3d6; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.house-note.hard-note { background: rgba(190,52,78,.22); border-color: rgba(255,122,140,.6); }
#hard-tag { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 6px; background: #d8405a; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; vertical-align: 1px; }
#hard-tag[hidden] { display: none; }
#bar.hard { background: linear-gradient(#4a2230, #2f1820); }
#deposit.hard #dep-val { color: #ffc0c8; }
#deposit.hard.low #dep-val { color: #ff6a5f; }
#deposit.hard #dep-bar i { background: #d8405a; }
.side-next { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,226,154,.12); font-size: 13px; font-weight: 800; color: #ffe29a; line-height: 1.4; }
.side-pro { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 8px; background: #a43349; color: #fff3d6; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.star-cell.fresh { position: relative; }
.star-cell.fresh::before { content: ''; position: absolute; top: -5px; left: 50%; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: radial-gradient(circle, rgba(255,244,180,.95), rgba(255,220,100,0) 70%); opacity: 0; pointer-events: none; animation: freshGlow 1.1s ease-out 1.2s 2; }
@keyframes freshGlow { 0% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(2); } }
/* 周回5 直し: 面の一覧、設定、共有の画面では、やり直しの丸いボタンを隠す（一覧の下の「返金」「プロの現場」に重ならないように）。結果のカード（.sheet）では今までどおり */
#app:has(#layer .panel) #btn-restart { display: none; }
