/* Gaming Room Rescue. A bright toy look: chunky yellow lettering with a dark outline, white
   rounded panels with thick navy edges, fat green buttons. Sizes are in rem; src/core.js sets the
   size of one rem from the screen, so the same rules serve a phone held either way and a desktop. */
:root { --ink: #23264a; --yellow: #ffd23a; --green: #3fcf6e; --pink: #ff5c8a; --teal: #35e0c2; }

/* Luckiest Guy by Astigmatic, Apache License 2.0 (see fonts/LuckiestGuy-LICENSE.txt). */
@font-face {
  font-family: 'Luckiest Guy';
  src: url('fonts/LuckiestGuy.woff2') format('woff2');
  font-display: swap;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #8fd3ff;
  font-family: 'Luckiest Guy', 'Arial Black', Impact, system-ui, sans-serif; letter-spacing: .03em;
  color: #fff; user-select: none; -webkit-user-select: none; touch-action: none;
}
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
body.hostMute #btnMute, body.hostMute #btnSound { display: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
h1, h2, p { margin: 0; }
.coin { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a8, #ffc21a 60%, #d98a00); border: .12em solid var(--ink); vertical-align: -.18em; }

/* ---------- Buttons ---------- */
.big {
  padding: .7rem 1.6rem .55rem; font-size: 1.5rem; border-radius: 1rem; background: var(--green); color: #fff;
  border: .2rem solid var(--ink); box-shadow: 0 .35rem 0 var(--ink); text-shadow: 0 .12rem 0 rgba(0,0,0,.35);
}
.big:active { transform: translateY(.2rem); box-shadow: 0 .15rem 0 var(--ink); }
.big:disabled { background: #aab1c4; opacity: .7; }
.big.ad { background: var(--pink); }
.big small { display: block; font: 700 .65rem system-ui, sans-serif; letter-spacing: 0; opacity: .9; }
.small { padding: .58rem .8rem .48rem; font-size: .75rem; border-radius: .6rem; background: rgba(35,38,74,.75); border: .12rem solid var(--ink); }

/* ---------- The top of the screen ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#coinBox { position: absolute; left: .6rem; top: .6rem; padding: .3rem .7rem .2rem .45rem; font-size: 1.15rem; background: #fff; color: var(--ink); border: .16rem solid var(--ink); border-radius: 2rem; box-shadow: 0 .2rem 0 var(--ink); }
#coinBox.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.2); } }
#btnMute { position: absolute; right: .6rem; top: .6rem; pointer-events: auto; padding: .66rem .6rem .56rem; font-size: .62rem; border-radius: .6rem; background: rgba(35,38,74,.75); border: .12rem solid var(--ink); }
#steps { position: absolute; left: 50%; top: .65rem; transform: translateX(-50%); display: flex; gap: .25rem; }
#steps span { padding: .32rem .5rem .2rem; font-size: .68rem; border-radius: .5rem; background: rgba(35,38,74,.55); color: rgba(255,255,255,.75); border: .12rem solid var(--ink); }
#steps span.on { background: var(--yellow); color: var(--ink); transform: scale(1.12); }
#steps span.done { background: var(--green); color: #fff; }
#steps.five { gap: .18rem; }
#steps.five span { padding: .32rem .3rem .2rem; font-size: .6rem; }
#progress { position: absolute; left: 50%; top: 2.75rem; transform: translateX(-50%); display: flex; gap: .3rem; white-space: nowrap; }
#progress span { padding: .25rem .5rem .15rem; font-size: .62rem; background: #fff; color: var(--ink); border-radius: .5rem; border: .12rem solid var(--ink); }
#progress b { color: #e2452c; font-weight: normal; }
#pStarBox i { font: 1.1em/1 system-ui, sans-serif; color: #b9bfdc; -webkit-text-stroke: .05rem var(--ink); }
#progress #pStarBox.got { background: var(--yellow); }
#pStarBox.got i { color: #fff; }
#pStarBox.got b { color: var(--ink); }
#paintBar { position: fixed; left: 50%; bottom: .8rem; transform: translateX(-50%); width: min(22rem, calc(100vw - 1rem)); padding: .5rem .4rem .6rem; background: #fff; color: var(--ink); border: .16rem solid var(--ink); border-radius: 1rem; box-shadow: 0 .25rem 0 var(--ink); text-align: center; }
#paintBar b { display: block; margin-bottom: .35rem; font-size: .8rem; font-weight: normal; }
#paintPct { color: #e2452c; }
#paintColours { display: flex; justify-content: center; gap: .15rem; }
#paintColours .swatch { flex: 1 1 0; min-width: 0; width: auto; height: auto; max-width: 2.3rem; aspect-ratio: 1; }
#paintBar.nudge .swatch { animation: pulse 1s ease-in-out infinite; }
#paintColours.floors { gap: .4rem; }
#paintColours.floors .swatch { max-width: 3.1rem; border-radius: .6rem; }
#rWish { margin: -.2rem 0 .45rem; font: 800 .72rem system-ui, sans-serif; letter-spacing: 0; color: #7a4fd6; }
#rWish:empty { display: none; }
#btnNext.quiet { font-size: 1rem; padding: .55rem 1rem .4rem; background: #8f95b5; box-shadow: 0 .25rem 0 var(--ink); }
#live { position: absolute; left: .6rem; top: 2.9rem; padding: .25rem .6rem .15rem; font-size: .7rem; background: var(--ink); border-radius: .5rem; }
#live i { display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border-radius: 50%; background: #ff3b4e; animation: blink 1s infinite; }
#live b { color: var(--yellow); font-weight: normal; }
@keyframes blink { 50% { opacity: .3; } }
#hint { position: absolute; left: 50%; top: 4.75rem; transform: translateX(-50%); width: max-content; max-width: 94vw; padding: .45rem .9rem; font: 800 .9rem/1.2 system-ui, 'Segoe UI', sans-serif; letter-spacing: 0; text-align: center; background: rgba(35,38,74,.92); border: .14rem solid #fff; border-radius: .9rem; }
#hint.in { animation: hintIn .3s cubic-bezier(.2, 1.5, .3, 1); }
@keyframes hintIn { 0% { opacity: 0; transform: translateX(-50%) scale(.8); } }

/* ---------- Things that follow the world ---------- */
#tags, #popups { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; padding: .25rem .5rem .2rem; background: #fff; color: var(--ink); border: .12rem solid var(--ink); border-radius: .5rem; text-align: center; white-space: nowrap; box-shadow: 0 .15rem 0 var(--ink); }
.tag b { display: block; font-size: .68rem; font-weight: normal; }
.tag i { display: block; font: 700 .6rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
.popup { position: absolute; margin: -1rem 0 0 -1rem; font-size: 1.2rem; color: #fff; text-shadow: 0 .1rem 0 var(--ink), 0 0 .3rem var(--ink); animation: floatUp .9s ease-out forwards; }
.popup.coin { color: var(--yellow); }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { transform: translateY(-.6rem) scale(1.15); opacity: 1; } 100% { transform: translateY(-3rem) scale(1); opacity: 0; } }
#hand { position: fixed; left: 0; top: 0; width: 2.6rem; height: 2.6rem; margin: -1.3rem 0 0 -1.3rem; border-radius: 50%; border: .22rem solid #fff; background: rgba(255,255,255,.35); box-shadow: 0 0 0 .14rem var(--ink), 0 0 1rem rgba(255,255,255,.8); pointer-events: none; }

#toast { position: fixed; left: 50%; top: 7.4rem; transform: translateX(-50%); width: max-content; max-width: 92vw; padding: .6rem 1.1rem .45rem; font-size: 1.05rem; text-align: center; border: .18rem solid var(--ink); border-radius: 1rem; box-shadow: 0 .3rem 0 var(--ink); pointer-events: none; }
#toast.bad { background: #ff5a4e; }
#toast.good { background: var(--green); }
#toast.in { animation: toastIn .35s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes toastIn { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } }
#banner { position: fixed; left: 0; right: 0; top: 36%; text-align: center; pointer-events: none; }
#banner.in { animation: bannerIn .45s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(.4) rotate(-6deg); } }
#bannerTitle { font-size: 2.9rem; line-height: 1; color: var(--yellow); -webkit-text-stroke: .12rem var(--ink); paint-order: stroke fill; text-shadow: 0 .3rem 0 var(--ink); }
#bannerSub { margin-top: .5rem; font-size: 1.1rem; text-shadow: 0 .15rem 0 var(--ink), 0 0 .4rem var(--ink); }
#btnNext { position: fixed; left: 50%; bottom: .9rem; transform: translateX(-50%); white-space: nowrap; animation: nextIn .4s cubic-bezier(.2, 1.6, .3, 1); }
#btnNext:active { transform: translateX(-50%) translateY(.2rem); }
@keyframes nextIn { 0% { opacity: 0; transform: translateX(-50%) scale(.5); } }

/* ---------- Bottom sheets: the gear panel and the results ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; padding: .8rem .7rem .9rem; background: #fff; color: var(--ink); border-top: .22rem solid var(--ink); border-radius: 1.4rem 1.4rem 0 0; box-shadow: 0 -.4rem 1.2rem rgba(35,38,74,.25); animation: sheetIn .35s ease-out; }
@keyframes sheetIn { 0% { transform: translateY(100%); } }
body.wide .sheet { left: auto; top: 0; width: 18.5rem; border-top: 0; border-left: .22rem solid var(--ink); border-radius: 1.4rem 0 0 1.4rem; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; touch-action: pan-y; animation-name: sheetSide; }
body.wide .sheet::-webkit-scrollbar { display: none; }
body.wide #panel { padding-top: .5rem; padding-bottom: .6rem; }
body.wide #panel > :first-child, body.wide #results > :first-child { margin-top: auto; }
body.wide #panel > :last-child, body.wide #results > :last-child { margin-bottom: auto; }
@keyframes sheetSide { 0% { transform: translateX(100%); } }
.sheet h2 { font-size: 1.5rem; font-weight: normal; }

#panel { height: 17.7rem; }
body.wide #panel { height: auto; }
#panelTop { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
#panelTitle { flex: none; }
#tabs { position: relative; flex: 1; min-width: 0; display: flex; gap: .3rem; overflow-x: auto; padding: .3rem .25rem; scrollbar-width: none; touch-action: pan-x; }
#tabs::-webkit-scrollbar { display: none; }
#tabs .tab:first-child { margin-left: auto; }
body.wide #panelTop { flex-wrap: wrap; row-gap: 0; }
body.wide #tabs { flex-basis: 100%; }
body.wide #tabs .tab:first-child { margin-left: 0; }
.tab { flex: none; width: 2.2rem; height: 2.2rem; padding: .15rem 0 0; font-size: .95rem; border-radius: 50%; background: #e6e9f5; color: #8b90b3; border: .14rem solid #b9bfdc; }
.tab.got { background: var(--green); color: #fff; border-color: var(--ink); }
.tab.on { background: var(--yellow); color: var(--ink); border-color: var(--ink); transform: scale(1.1); }
.tab:disabled { opacity: .5; }
#cards { display: flex; gap: .45rem; }
body.wide #cards { flex-direction: column; }
.card { flex: 1; min-width: 0; padding: .5rem .3rem .45rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; background: #f1f3fb; color: var(--ink); border: .18rem solid var(--ink); border-radius: .9rem; box-shadow: 0 .25rem 0 var(--ink); }
body.wide .card { flex: none; flex-direction: row; flex-wrap: wrap; justify-content: space-between; padding: .32rem .7rem .22rem; }
body.wide #cards { gap: .38rem; }
.card:active { transform: translateY(.15rem); box-shadow: 0 .1rem 0 var(--ink); }
.card .stars { font: 1rem system-ui, sans-serif; color: #f5a800; }
.card b { font-size: .82rem; font-weight: normal; line-height: 1.05; text-align: center; min-height: 1.75rem; display: flex; align-items: center; }
body.wide .card b { min-height: 0; order: -1; flex-basis: 60%; text-align: left; }
.card i { font: 700 .66rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
.card em { font-style: normal; font-size: .82rem; padding: .2rem .55rem .1rem; border-radius: .5rem; background: #dfe3f4; }
.card em.price { background: var(--yellow); }
.card em.price::before { content: ''; display: inline-block; width: .8em; height: .8em; margin-right: .25em; border-radius: 50%; background: #ffb000; border: .1em solid var(--ink); vertical-align: -.08em; }
.card.t1 { background: #e8f6ff; }
.card.t2 { background: #fff1fb; }
.card.t3 { background: #fff6c9; }
#cards.four .card b { font-size: .62rem; }
#cards.four .card .stars { font-size: .8rem; letter-spacing: -.05em; }
.card.on { background: #c9f7d7; outline: .2rem solid var(--green); }
.card.on em { background: var(--green); color: #fff; }
.card.poor { opacity: .55; }
.card.shake, #scoreBox.shake { animation: shakeX .35s; }
/* The card to tap (gearup.js): it glows, and the one on the way to the room's star says so. */
.card { position: relative; }
.card.tip { outline: .22rem solid var(--yellow); outline-offset: .05rem; animation: pulse 1s ease-in-out infinite; z-index: 1; }
.card .tag { position: absolute; left: 50%; top: -.68rem; transform: translateX(-50%); padding: .16rem .4rem .06rem; font-size: .56rem; text-decoration: none; white-space: nowrap; background: var(--yellow); color: var(--ink); border: .12rem solid var(--ink); border-radius: .5rem; }
body.wide .card .tag { position: static; transform: none; align-self: center; } /* (beside the price: a wide card is two rows) */
#cards { margin-top: .35rem; } /* (room for the mark above a card) */
body.wide #cards { margin-top: 0; }
.tab.tip { box-shadow: 0 0 0 .17rem var(--yellow); animation: pulse 1s ease-in-out infinite; } /* (a spot the star still needs something from) */
#panelNext.waiting { visibility: hidden; }
#panelNext.pop { animation: nextPop .45s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes nextPop { 0% { transform: scale(.5); opacity: 0; } }
#toast.tip { background: var(--yellow); color: var(--ink); }
/* While the host (YouTube) has the game paused: a sheet over everything, and nothing moves. */
#hostBlock { display: none; position: fixed; inset: 0; z-index: 1000; }
body.hostPaused #hostBlock { display: block; }
body.hostPaused *, body.hostPaused *::before, body.hostPaused *::after { animation-play-state: paused !important; }
@keyframes shakeX { 20% { transform: translateX(-.35rem); } 40% { transform: translateX(.35rem); } 60% { transform: translateX(-.2rem); } 80% { transform: translateX(.2rem); } }
#panelFoot { display: flex; align-items: center; gap: .7rem; margin-top: .75rem; }
body.wide #panelFoot { flex-direction: column; align-items: stretch; gap: .45rem; margin-top: .55rem; }
body.wide #panelNext { padding: .5rem 1.1rem .35rem; }
#scoreBox { flex: 1; min-width: 0; }
#scoreLabel { font-size: .72rem; white-space: nowrap; }
#scoreLabel b { font-size: 1.1rem; font-weight: normal; color: #e2452c; }
#scoreLabel > span { font: 700 .62rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
#scoreBox.hit #scoreLabel b { color: #1f9d4c; }
#scoreBar { position: relative; height: .8rem; margin-top: .2rem; background: #dfe3f4; border: .14rem solid var(--ink); border-radius: .5rem; overflow: hidden; }
#scoreFill { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--green)); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
#scoreBar u { position: absolute; left: 80%; top: 0; bottom: 0; width: .16rem; background: var(--ink); }
#panelNext { font-size: 1.2rem; padding: .6rem 1.1rem .45rem; white-space: nowrap; }

/* ---------- The reveal ---------- */
#slider { position: fixed; left: 0; top: 0; bottom: 0; width: 0; pointer-events: none; }
#slider i { position: absolute; left: -.14rem; top: 0; bottom: 0; width: .28rem; background: #fff; box-shadow: 0 0 0 .1rem var(--ink); }
#slider u { position: absolute; left: -1.3rem; top: 42%; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #fff; border: .2rem solid var(--ink); box-shadow: 0 .25rem 0 var(--ink); }
#slider u::before, #slider u::after { content: ''; position: absolute; top: 50%; border: .4rem solid transparent; margin-top: -.4rem; }
#slider u::before { left: .2rem; border-right-color: var(--ink); }
#slider u::after { right: .2rem; border-left-color: var(--ink); }
#slider b { position: absolute; top: 5.2rem; padding: .3rem .6rem .2rem; font-size: .8rem; font-weight: normal; border-radius: .5rem; border: .12rem solid var(--ink); white-space: nowrap; }
#slider .was { right: .6rem; background: #8d94a6; }
#slider .now { left: .6rem; background: var(--pink); }
#slider.closed .was { display: none; }

#results { text-align: center; }
#results h2 { color: #e2452c; margin-bottom: .45rem; }
#results .row { display: flex; align-items: center; gap: .6rem; padding: .22rem .3rem; text-align: left; opacity: 0; }
#results .row.in { opacity: 1; animation: rowIn .35s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes rowIn { 0% { opacity: 0; transform: scale(.7); } }
#results .star { font: 2rem/1 system-ui, sans-serif; color: #cfd4e8; -webkit-text-stroke: .08rem var(--ink); }
#results .row.got .star { color: var(--yellow); animation: starPop .45s cubic-bezier(.2, 1.8, .3, 1); }
@keyframes starPop { 0% { transform: scale(0) rotate(-90deg); } }
#results .row b { font-size: 1rem; font-weight: normal; flex: none; }
#results .row i { font: 700 .72rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; margin-left: auto; text-align: right; }
#rCoinLine { margin: .35rem 0 .5rem; font-size: 1.5rem; color: #d98a00; }
#results .buttons { display: flex; justify-content: center; gap: .6rem; min-height: 3.4rem; }
#results .big { font-size: 1.2rem; padding: .55rem 1.1rem .4rem; }

/* ---------- Whole-screen layers ---------- */
.overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 2.2rem 1rem 1.6rem; text-align: center; pointer-events: none; }
.overlay > * { pointer-events: auto; }
.overlay h1 { font-size: 3.1rem; line-height: .95; font-weight: normal; color: var(--yellow); -webkit-text-stroke: .14rem var(--ink); paint-order: stroke fill; text-shadow: 0 .32rem 0 var(--ink); transform: rotate(-3deg); }
.overlay .sub { margin-top: .9rem; font-size: 1rem; text-shadow: 0 .12rem 0 var(--ink), 0 0 .4rem var(--ink); }
.overlay .spacer { flex: 1; pointer-events: none; }
#loading { background: #8fd3ff; justify-content: center; }
#loadBar { width: 12rem; height: .9rem; margin-top: 1.6rem; background: rgba(35,38,74,.3); border: .16rem solid var(--ink); border-radius: .6rem; overflow: hidden; }
#loadBar i { display: block; height: 100%; width: 40%; background: var(--yellow); animation: load 1s ease-in-out infinite alternate; }
@keyframes load { 0% { transform: translateX(-60%); } 100% { transform: translateX(210%); } }
#menuStats { display: flex; gap: 1.2rem; align-items: center; margin-bottom: .8rem; font-size: 1.3rem; text-shadow: 0 .12rem 0 var(--ink), 0 0 .4rem var(--ink); }
#menuStars { font-family: system-ui, sans-serif; color: var(--yellow); letter-spacing: .1em; }
#menuStats b { font-weight: normal; margin-left: .3rem; }
#btnPlay { font-size: 2.1rem; padding: .8rem 2.6rem .6rem; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#btnSound { margin-top: .9rem; }
body.wide #menu { align-items: flex-start; padding-left: 2.2rem; }
body.wide #menu h1 { font-size: 2.6rem; text-align: left; }
/* <not-youtube> */
#adStandIn { background: rgba(20,22,40,.94); justify-content: center; pointer-events: auto; }
#adStandIn h2 { font-size: 1.8rem; font-weight: normal; }
/* </not-youtube> */

/* ---------- A wide screen: keep the middle of the top clear, and the big button to one side ---------- */
body.wide #progress { left: .6rem; top: 3.1rem; transform: none; flex-direction: column; align-items: flex-start; }
body.wide #hint { top: 2.9rem; max-width: 60vw; }
body.wide #toast { top: 5.4rem; }
body.wide #live { top: 3.1rem; }
body.wide #btnNext { left: auto; right: 1rem; transform: none; animation-name: nextSide; }
body.wide #btnNext:active { transform: translateY(.2rem); }
@keyframes nextSide { 0% { opacity: 0; transform: scale(.5); } }

/* ---------- The home screen once a room is done, and the shops ---------- */
.big.alt { background: #4d8dff; font-size: 1rem; padding: .55rem .8rem .4rem; }
#btnPlay:disabled { animation: none; }
#menu.hub h1 { font-size: 2.1rem; }
#menu.hub .sub { margin-top: .5rem; font-size: .85rem; }
#menu.hub #btnPlay { font-size: 1.45rem; padding: .7rem 1.4rem .5rem; }
#menu.hub #menuStats { font-size: 1.05rem; gap: .9rem; }
#hubRow { display: flex; gap: .5rem; margin-top: .8rem; }
#btnMess { background: #ff5a4e; }
#btnGame { margin-top: .6rem; font-size: 1.05rem; padding: .6rem 1.1rem .45rem; background: #ff5c8a; }
#playQuit { position: fixed; right: .6rem; bottom: .8rem; }
#playEnd { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .7rem 1.1rem .8rem; width: max-content; max-width: 94vw; background: #fff; color: var(--ink); border: .18rem solid var(--ink); border-radius: 1.2rem; box-shadow: 0 .3rem 0 var(--ink); text-align: center; }
#playScore { font-size: 1.5rem; font-weight: normal; }
#playCoins { font: 800 .8rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
#playEnd div { display: flex; gap: .6rem; margin-top: .3rem; }
#playEnd .big { font-size: 1.2rem; padding: .55rem 1.3rem .4rem; }
#btnPlay.locked { animation: none; background: #8f95b5; }
#menu .nudge { animation: pulse 1s ease-in-out infinite; outline: .18rem solid var(--yellow); outline-offset: .12rem; }
#menu.hub .sub { max-width: 21rem; }
#roomName i { font: normal .8rem system-ui, sans-serif; color: #e0a400; letter-spacing: .05em; margin-left: .25rem; }
#roomName { pointer-events: auto; }
#roomNav { width: max-content; max-width: 100vw; }
#roomNav button { flex: none; }
#roomName small { display: block; max-width: 9.5rem; margin: .1rem auto 0; font: 800 .62rem/1.2 system-ui, sans-serif; letter-spacing: 0; white-space: normal; color: #7a4fd6; cursor: pointer; }
#roomName small u { text-decoration: none; color: #d98a00; }
#decoScore { margin-top: .3rem; font: 800 .72rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; text-align: left; }
#decoScore.hit { color: #1f9d55; }
#decoWish { margin-top: .15rem; font: 800 .72rem system-ui, sans-serif; letter-spacing: 0; color: #7a4fd6; text-align: left; }
#decoWish.hit { color: #1f9d55; }

#shop { display: flex; flex-direction: column; max-height: 21rem; }
body.wide #shop { max-height: none; justify-content: flex-start; padding-top: 1rem; }
#shopTop { display: flex; align-items: baseline; justify-content: space-between; }
#shopFps { font-size: .8rem; color: #5b6088; }
#shopFps b { font-size: 1.6rem; font-weight: normal; color: #1f9d4c; }
#shopTabs { display: flex; gap: .25rem; margin: .4rem 0; }
#shopTabs:empty { margin: .2rem 0; }
#shop.gate { max-height: min(25rem, 72vh); }
.gateLine { font: 800 .8rem/1.25 system-ui, sans-serif; letter-spacing: 0; color: var(--ink); text-align: left; }
.tab2 { flex: 1; padding: .7rem .05rem .59rem; font-size: .56rem; border-radius: .5rem; background: #e6e9f5; color: #5b6088; border: .12rem solid #b9bfdc; }
.tab2.on { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
#shopCards { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .1rem .15rem .35rem; touch-action: pan-y; }
.pcard { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: .5rem; padding: .4rem .6rem .3rem; text-align: left; background: #f1f3fb; color: var(--ink); border: .16rem solid var(--ink); border-radius: .8rem; box-shadow: 0 .2rem 0 var(--ink); }
.pcard:active { transform: translateY(.12rem); box-shadow: 0 .08rem 0 var(--ink); }
.pcard b { font-size: .85rem; font-weight: normal; }
.pcard i { grid-column: 1; font: 700 .65rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
.pcard u { grid-column: 1; font: 800 .65rem system-ui, sans-serif; letter-spacing: 0; text-decoration: none; color: #1f9d4c; }
.pcard u:empty { display: none; }
.pcard u.snag, .pcard u.less { color: #e2452c; }
.pcard em { grid-column: 2; grid-row: 1 / span 3; font-style: normal; font-size: .8rem; padding: .25rem .6rem .15rem; border-radius: .5rem; background: #dfe3f4; white-space: nowrap; }
.pcard em.price { background: var(--yellow); }
.pcard em.price::before { content: ''; display: inline-block; width: .8em; height: .8em; margin-right: .25em; border-radius: 50%; background: #ffb000; border: .1em solid var(--ink); vertical-align: -.08em; }
.pcard.on { background: #c9f7d7; }
.pcard.on em { background: var(--green); color: #fff; }
.pcard.poor em { opacity: .55; }
.pcard.shake { animation: shakeX .35s; }
#shopFoot { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
#shopNote { flex: 1; font: 700 .7rem/1.2 system-ui, sans-serif; letter-spacing: 0; color: #5b6088; text-align: left; }
#shopNote.bad { color: #e2452c; }
#shopDone { font-size: 1.1rem; padding: .5rem 1rem .35rem; }

/* ---------- Decorating ---------- */
#hubRow { flex-wrap: wrap; justify-content: center; max-width: 21rem; }
body.wide #hubRow { justify-content: flex-start; }
#deco { display: flex; flex-direction: column; height: min(23rem, 52vh); }
body.wide #deco { height: auto; justify-content: flex-start; padding-top: 1rem; }
#decoTop { display: flex; align-items: center; gap: .5rem; }
#decoTop h2 { flex: 1; }
#decoDone { font-size: 1.05rem; padding: .45rem .9rem .3rem; }
#decoAd { background: var(--pink); font-size: .7rem; }
#decoTabs { display: flex; gap: .25rem; margin: .45rem 0; }
#decoCards { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; align-content: start; padding: .1rem .15rem .3rem; touch-action: pan-y; }
body.wide #decoCards { grid-template-columns: repeat(3, 1fr); }
.dcard { display: flex; flex-direction: column; align-items: center; padding: .25rem .15rem .3rem; background: #f1f3fb; color: var(--ink); border: .14rem solid var(--ink); border-radius: .7rem; box-shadow: 0 .18rem 0 var(--ink); }
.dcard:active { transform: translateY(.1rem); box-shadow: 0 .06rem 0 var(--ink); }
.dcard img { width: 3.6rem; height: 3.6rem; }
.dcard b { font-size: .58rem; font-weight: normal; line-height: 1.05; text-align: center; min-height: 1.25rem; display: flex; align-items: center; }
.dcard em { font-style: normal; font-size: .68rem; padding: .12rem .45rem .05rem; border-radius: .4rem; background: var(--yellow); margin-top: .1rem; }
.dcard em::before { content: ''; display: inline-block; width: .75em; height: .75em; margin-right: .2em; border-radius: 50%; background: #ffb000; border: .1em solid var(--ink); vertical-align: -.06em; }
.dcard.poor { opacity: .55; }
.dcard.on { background: #fff6c9; }
.dcard img.flat { border-radius: .5rem; border: .1rem solid var(--ink); width: 3.2rem; height: 3.2rem; margin: .2rem; }
.dcard em.got { background: #dfe3f3; }
.dcard.on em.got { background: var(--green); color: #fff; }
.dcard em.got::before { display: none; }
#decoRoom { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .4rem; }
#decoRoomName { font-size: .72rem; font-weight: normal; text-align: left; }
#decoRoomColours { display: flex; gap: .2rem; }
#decoRoomColours .swatch, body:not(.wide) #decoColours .swatch { flex: 1 1 0; min-width: 0; width: auto; height: auto; max-width: 2.1rem; aspect-ratio: 1; }
.dcard.shake { animation: shakeX .35s; }
#decoNote { margin-top: .35rem; font: 700 .65rem system-ui, sans-serif; letter-spacing: 0; color: #5b6088; }
#decoBar { position: fixed; left: 50%; bottom: calc(min(23rem, 52vh) + .7rem); transform: translateX(-50%); display: flex; align-items: center; gap: .45rem; padding: .35rem .6rem; background: #fff; color: var(--ink); border: .16rem solid var(--ink); border-radius: 1rem; box-shadow: 0 .25rem 0 var(--ink); white-space: nowrap; width: max-content; max-width: 96vw; flex-wrap: wrap; justify-content: center; row-gap: .3rem; }
body.wide #decoBar { bottom: .8rem; left: calc((100vw - 18.5rem) / 2); max-width: calc(100vw - 18.5rem - 1.2rem); }
#decoName { font-size: .78rem; font-weight: normal; }
#camBar { position: fixed; display: flex; flex-direction: column; gap: .4rem; }
#camBar button { width: 2.4rem; height: 2.4rem; padding: .1rem 0 0; font-size: 1.5rem; line-height: 1; border-radius: 50%; background: #fff; color: var(--ink); border: .16rem solid var(--ink); box-shadow: 0 .2rem 0 var(--ink); }
#camBar button:active { transform: translateY(.1rem); box-shadow: 0 .08rem 0 var(--ink); }
#camBar button:disabled { opacity: .45; }
#roomNav { position: fixed; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; }
#roomNav button { width: 2.6rem; height: 2.6rem; padding: 0; font-size: 1.1rem; line-height: 1; border-radius: 50%; background: var(--yellow); color: var(--ink); border: .16rem solid var(--ink); box-shadow: 0 .2rem 0 var(--ink); }
#roomNav button:active { transform: translateY(.1rem); box-shadow: 0 .08rem 0 var(--ink); }
#roomNav button:disabled { opacity: .4; }
#roomName { min-width: 6.5rem; padding: .45rem .8rem .3rem; font-size: .85rem; font-weight: normal; text-align: center; white-space: nowrap; background: #fff; color: var(--ink); border: .16rem solid var(--ink); border-radius: 1rem; box-shadow: 0 .2rem 0 var(--ink); }
#decoBar .small { background: #4d8dff; color: #fff; font-size: .68rem; padding: .62rem .6rem .52rem; }
#decoBar #decoSell { background: var(--green); }
#decoBar .move { background: var(--yellow); color: var(--ink); }
#decoColours { display: flex; gap: .2rem; }
.swatch { flex: none; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; border: .12rem solid var(--ink); }
.swatch.plain { background: repeating-conic-gradient(#fff 0 25%, #cfd4e8 0 50%) 50% / .6rem .6rem; }
.swatch.on { outline: .16rem solid var(--yellow); outline-offset: .08rem; }

/* ---------- A sheet is up on a wide screen: the top of the screen keeps to what is left ---------- */
body.wide.sheetUp #btnMute { right: 19.1rem; }
body.wide.sheetUp #steps, body.wide.sheetUp #hint, body.wide.sheetUp #toast { left: calc((100vw - 18.5rem) / 2); }
body.wide.sheetUp #hint, body.wide.sheetUp #toast { max-width: calc(100vw - 18.5rem - 2rem); }
body.wide.sheetUp #banner { right: 18.5rem; }
/* The home screen: messages come up clear of the title, the room's name and the zoom buttons;
   on a wide screen the sound button goes to the top corner, out of the column of buttons. */
body.atHome #toast { top: 16rem; }
body.wide.atHome #toast { top: 11rem; left: calc(17rem + (100vw - 17rem) / 2); max-width: calc(100vw - 19rem); }
body.wide #btnSound { position: fixed; right: .6rem; top: .6rem; margin: 0; }
/* The bar for a chosen piece on a tall screen: two rows. Its name, the turns, the moves to the
   next room and SELL; then the colours. */
body:not(.wide) #decoBar { width: 96vw; flex-wrap: wrap; gap: .3rem .35rem; }
body:not(.wide) #decoName { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
body:not(.wide) #decoBar .move { padding-left: .7rem; padding-right: .7rem; }
body:not(.wide) #decoSell { order: 1; }
body:not(.wide) #decoColours { order: 2; flex: 1 1 100%; justify-content: center; gap: .25rem; }
/* (On a wide screen the sheet is narrow: the room's colours take two rows at full size.) */
body.wide #decoRoomColours { flex-wrap: wrap; }
body.wide #decoRoomColours .swatch { flex: none; width: 2.1rem; }
