/*
 * Elevator Jam — visual system
 *  WORLD : bright, clean 2.5D cross-section. Cream walls, warm wood floors, cool blue-grey shaft,
 *          soft contact shadows. Depth from slab thickness, recessed doors, ambient corners.
 *  UI    : matte white cards, one soft shadow, generous radius. Numbers big, labels tiny.
 *  Signal colors only where they mean something: floor plates, destination bubbles, hint, current floor.
 */
:root {
  --ico-timer: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Crect%20x%3D%229%22%20y%3D%220.8%22%20width%3D%226%22%20height%3D%223.2%22%20rx%3D%221.3%22/%3E%3Crect%20x%3D%2211%22%20y%3D%223%22%20width%3D%222%22%20height%3D%223%22/%3E%3Cpath%20d%3D%22M18.2%205.2l1.9-1.9%201.6%201.6-1.9%201.9z%22/%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M12%205.2a8.9%208.9%200%201%201%200%2017.8a8.9%208.9%200%200%201%200-17.8zm0%202.8a6.1%206.1%200%201%200%200%2012.2a6.1%206.1%200%200%200%200-12.2z%22/%3E%3Cpath%20d%3D%22M11%2014.1V9.6h2v4.5z%22/%3E%3Cpath%20d%3D%22M12.6%2013.1l3.4-2.2%201%201.6-3.4%202.2z%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2214.1%22%20r%3D%221.6%22/%3E%3C/svg%3E");
  --ink: #263047;
  --ink-2: #7b859a;
  --ink-3: #aab2c2;
  --accent: #3b7cf6;
  --amber: #ffb728;
  --amber-d: #e29a12;
  --danger: #e2434b;
  --ok: #2fbf76;

  --wood: #8f6f55;
  --wood-d: #74563f;
  --header: #4b3b30;
  --wall: #f8f1e4;
  --wall-2: #f0e5d2;
  --floor-top: #d4b48e;
  --floor-face: #a98563;
  --glass-1: #e2eef7;
  --glass-2: #b3cbdf;
  --steel: #5c6b82;
  --steel-d: #46536a;

  --platew: 50px;
  --shaftw: 112px;
  --slabh: 8px;
  --shadow: 0 8px 22px rgba(38, 48, 71, .14), 0 1px 2px rgba(38, 48, 71, .08);

  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Noto Sans JP', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(#9bd0f2, #d3ebf9 55%, #eef7fc);
  display: flex; justify-content: center;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { display: block; }

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.city { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; opacity: .55;
  --win: repeating-linear-gradient(90deg, transparent 0 6px, rgba(255,255,255,.55) 6px 12px), repeating-linear-gradient(transparent 0 9px, rgba(255,255,255,0) 9px 16px);
  background:
    linear-gradient(#cfe1ee, #cfe1ee) 0 100% / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.6) 7px 13px) 4% 92% / 46px 58% no-repeat,
    linear-gradient(#a9c8e0, #a9c8e0) 3% 100% / 64px 70% no-repeat,
    linear-gradient(#bcd5ea, #bcd5ea) 12% 100% / 40px 48% no-repeat,
    repeating-linear-gradient(90deg, transparent 0 7px, rgba(255,255,255,.6) 7px 13px) 88% 92% / 42px 62% no-repeat,
    linear-gradient(#a9c8e0, #a9c8e0) 88% 100% / 60px 76% no-repeat,
    linear-gradient(#bcd5ea, #bcd5ea) 98% 100% / 44px 54% no-repeat,
    linear-gradient(#9fbfd8, #9fbfd8) 88.6% 25% / 8px 16px no-repeat; }
.tree, .bush { position: absolute; border-radius: 50%; }
.tree { width: 150px; height: 150px;
  background: radial-gradient(circle at 30% 40%, #9be08a 0 22%, transparent 23%), radial-gradient(circle at 68% 35%, #8bd27a 0 26%, transparent 27%),
    radial-gradient(circle at 50% 62%, #6fbf63 0 34%, transparent 35%); }
.tree.t1 { left: -60px; top: -30px; opacity: .9; }
.tree.t2 { right: -70px; top: 30%; width: 120px; height: 120px; opacity: .7; }
.bush { width: 140px; height: 90px; bottom: -30px; background: radial-gradient(circle at 30% 40%, #9be08a 0 26%, transparent 27%), radial-gradient(circle at 66% 45%, #7ccb6c 0 30%, transparent 31%), radial-gradient(circle at 48% 70%, #5aa853 0 36%, transparent 37%); }
.bush.b1 { left: -40px; } .bush.b2 { right: -30px; bottom: -20px; }

#app {
  position: relative;
  width: 100%; max-width: 460px; height: 100dvh;
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 10px calc(env(safe-area-inset-bottom) + 10px);
}

/* ---------- UI cards (matte) ---------- */
.card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); }
.k { font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--ink-3); }

/* ---------- HUD ---------- */
.hud { flex: none; height: 40px; display: grid; grid-template-columns: 44px 1fr 1fr 44px 44px; gap: 8px; }
.hud .card { border-radius: 13px; }
.hud b { font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.hud-stage { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; justify-content: center; }
.hud-stage .k { grid-column: 1 / -1; text-align: center; margin-bottom: -4px; }
.hud-stage b { font-size: 26px; color: var(--ink); }
.hud-stage .caret { width: 0; height: 0; border: 5px solid transparent; border-top: 6px solid var(--ink-3); border-bottom: 0; }
.hud-energy { display: flex; align-items: center; justify-content: center; gap: 6px; }
.timer-ico { display: block; fill: currentColor; }
.hud-energy .hud-timer { width: 20px; height: 20px; color: var(--accent); }
.hud-energy.low .hud-timer { color: var(--danger); }
.hud-energy b { font-size: 22px; color: var(--ink); }
.hud-energy.low b { color: var(--danger); }
.hud-energy.bump b { animation: bump .25s; }
.hud-deliver { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hud-deliver .goal { width: 20px; height: 20px; }
.hud-deliver b { font-size: 17px; }
.hud-deliver .bar { position: absolute; left: 18px; right: 18px; bottom: 4px; height: 3px; background: #edf0f5; border-radius: 2px; overflow: hidden; }
.hud-deliver .bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }

/* ---------- Building (WORLD) ---------- */
.building {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  position: relative;
  background: var(--wood);
  border-radius: 16px 16px 8px 8px;
  padding: 6px 5px 0;
  /* light from the upper right: lit right side face, shaded left side face, drop shadow to the lower left */
  box-shadow: -6px 14px 28px rgba(38, 48, 71, .24), inset 0 2px 0 rgba(255,255,255,.18),
    inset -5px 0 0 rgba(255, 236, 205, .16), inset 5px 0 0 rgba(40, 24, 10, .22);
}
.roof {
  flex: none; height: 34px; margin: 5px 0 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--header); border-radius: 10px;
  padding: 0 4px 0 12px;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.sign { font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 15px; line-height: 1; letter-spacing: .08em; color: #c9b9a6; }
.sign em { font-style: normal; color: #e7c46a; }
.roof-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stage-name { font-size: 11px; font-weight: 700; color: #cbbba8; white-space: nowrap; }
.stage-name:empty { display: none; }
.gear { width: 30px; height: 30px; color: #b9a893; display: grid; place-items: center; border-radius: 8px; }
.gear:hover { background: rgba(255,255,255,.08); }
.gear svg { width: 18px; height: 18px; }
.ground { flex: none; height: 8px; }

.floors {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--wood-d);
  overflow: hidden;
}
.shaft-bg {
  position: absolute; top: 0; bottom: 0; left: var(--platew); width: var(--shaftw);
  background: linear-gradient(90deg, var(--steel-d), var(--steel) 12%, var(--steel) 88%, var(--steel-d));
  pointer-events: none; z-index: 0;
}

.row {
  flex: 1 1 0; min-height: 0; position: relative; cursor: pointer;
  display: grid; grid-template-columns: var(--platew) var(--shaftw) 1fr;
  border-bottom: var(--slabh) solid var(--floor-face);
  box-shadow: inset 0 calc(-1 * var(--slabh) - 2px) 0 -2px #d9bd99; /* light top edge of the slab */
}
.row:last-child { border-bottom-width: 0; box-shadow: none; }

/* floor plate: the tap target (color = destination color) */
.plate {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: linear-gradient(90deg, var(--wood-d), var(--wood) 60%);
}
.plate .num {
  width: 42px; padding: 5px 0 3px; text-align: center;
  background: var(--c); color: #fff; border-radius: 11px;
  font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-size: 19px; font-weight: 800; line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.14), 0 2px 4px rgba(0,0,0,.22);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.plate .cost { display: flex; align-items: center; gap: 2px; font-family: 'Baloo 2', sans-serif; font-size: 14px; font-weight: 800; color: #f3e9dc; line-height: 1; font-variant-numeric: tabular-nums; }
.plate .cost:not(:empty)::before { content: ''; width: 11px; height: 11px; background: #cfe0ff; -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
.row.current .plate .num { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c), 0 3px 8px rgba(0,0,0,.25); transform: scale(1.04); }
.row.current .plate::after { /* arrow toward the car */
  content: ''; position: absolute; right: -1px; top: 50%; margin-top: -7px;
  border: 7px solid transparent; border-right-color: #fff; border-left: 0;
}
.row.previewing:not(.current) .plate .num { transform: translateX(3px) scale(1.06); box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,0,.25); }
.row.queued .plate .num { outline: 2.5px dashed #fff; outline-offset: 2px; }
.row.queued .plate::before { content: '次'; position: absolute; right: 2px; top: 10%; z-index: 3; background: var(--amber); color: #3a2a00;
  font-size: 10px; font-weight: 900; line-height: 1; padding: 3px 4px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.row.unreachable .plate .num { filter: saturate(.25); opacity: .45; }
.row.unreachable .plate .cost { opacity: .4; }
.row.hint .plate .num { animation: hintGlow 1s ease-in-out infinite; }
.row:active:not(.current) .plate .num { transform: scale(.96); }

/* shaft cell: glass landing doors with a warm light strip */
.shaft-cell { position: relative; z-index: 1; }
.shaft-cell::before {
  content: ''; position: absolute; left: 8px; right: 8px; top: 13%; bottom: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 2px), var(--steel-d) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 20% 28%, transparent 28% 60%, rgba(255,255,255,.3) 60% 64%, transparent 64%),
    linear-gradient(var(--glass-1), var(--glass-2));
  box-shadow: 0 0 0 4px var(--steel-d), inset 0 0 0 2px rgba(255,255,255,.3);
}
.shaft-cell::after {
  content: ''; position: absolute; left: 50%; top: 3%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px;
  background: #ffe7a3; box-shadow: 0 0 10px 3px rgba(255,220,130,.6);
}

/* corridor */
.lobby {
  position: relative; min-width: 0;
  display: flex; align-items: flex-end;
  background:
    linear-gradient(rgba(120,90,50,.08), transparent 12px),
    linear-gradient(transparent calc(100% - 12px), var(--floor-top) calc(100% - 12px)),
    linear-gradient(var(--wall) 0 76%, var(--wall-2) 76%);
  box-shadow: inset 6px 0 8px -6px rgba(60,40,20,.22), inset -6px 0 8px -6px rgba(60,40,20,.12);
}
.row:hover .lobby, .row.previewing .lobby { filter: brightness(1.03); }
.row.unreachable .lobby { filter: saturate(.85) brightness(.98); }

.decor { position: absolute; top: 0; left: 0; right: 40px; bottom: 12px; pointer-events: none; overflow: hidden; }
.decor > * { position: absolute; }
.decor .apt { bottom: 0; width: 30px; height: 56%; background: var(--d); border-radius: 2px 2px 0 0;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.1), inset -4px 0 0 rgba(0,0,0,.07), 0 0 0 3px #e6d6bd; }
.decor .apt::after { content: ''; position: absolute; right: 5px; top: 48%; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.decor .apt::before { content: attr(data-no); position: absolute; left: 50%; top: -17px; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; color: #6a5a4a; background: #fcf7ee; padding: 0 3px; border-radius: 3px; box-shadow: 0 0 0 1px #dccbb0; }
.decor .win { top: 20%; width: 38px; height: 9px; background: linear-gradient(#d8ecf8, #b7d7ee); border-radius: 2px; box-shadow: 0 0 0 3px #e7d7be; }
.decor .frame { top: 22%; width: 30px; height: 22px; background: linear-gradient(#cfe8f6 55%, #9fcf8f 55%); box-shadow: 0 0 0 3px #cfab82, 0 2px 3px rgba(0,0,0,.12); }
.decor .lamp { top: 0; width: 26px; height: 5px; border-radius: 0 0 6px 6px; background: #fff0c0; box-shadow: 0 2px 10px 4px rgba(255,226,150,.55); }
.decor .sconce { top: 26%; width: 8px; height: 14px; border-radius: 4px; background: #fff3cf; box-shadow: 0 0 10px 4px rgba(255,220,140,.5); }
.decor .plant { bottom: 0; width: 22px; height: 30px; }
.decor .plant svg { width: 100%; height: 100%; }

.queue { flex: 1; min-width: 0; height: 100%; }

/* entrance (arrivals come in / delivered leave) + arrival board */
.entry { position: relative; flex: none; width: 40px; height: 100%; }
.entry .door {
  position: absolute; right: 5px; bottom: 12px; width: 22px; height: 62%;
  background: linear-gradient(#332e2a, #443d36); border-radius: 2px 2px 0 0;
  box-shadow: 0 0 0 3px #ddcbae;
}
.entry .door::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 4px; height: 8px; border-radius: 2px; background: #ffd27a; box-shadow: 0 0 6px 2px rgba(255,200,110,.6); }
.upcoming {
  position: absolute; right: calc(100% + 2px); top: 8px; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
  padding: 3px 4px; background: #2b3448; border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.upcoming:empty { display: none; }
.chip { display: flex; align-items: center; gap: 3px; font-family: 'Baloo 2', sans-serif; font-size: 13px; font-weight: 800; line-height: 1.2; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip .t { min-width: 20px; }
.chip.soon .t { color: var(--amber); }
.chip.more { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 11px; color: #e3e8f1; }
.dot { min-width: 24px; padding: 1px 2px 0; border-radius: 5px; text-align: center; background: var(--c); color: #fff; font-size: 12px; font-weight: 800; }

/* ---------- Car (WORLD) ---------- */
.car {
  position: absolute; left: calc(var(--platew) + 3px); width: calc(var(--shaftw) - 6px);
  top: 0; height: calc(100% / var(--floors));
  will-change: transform; /* translateY set every frame by world3d.js (display position) */
  z-index: 3; pointer-events: none;
  padding: 3px 0 calc(var(--slabh) + 1px);
}
.car-box {
  position: relative; height: 100%;
  background:
    repeating-linear-gradient(90deg, #d3d7de 0 8px, #bfc4cd 8px 16px) bottom / 100% 9px no-repeat,
    radial-gradient(ellipse at 50% 0%, #fff5dc, transparent 70%),
    linear-gradient(#fcefd3, #f2dcb0);
  border: 4px solid #9db0c8; border-top-width: 6px; border-radius: 7px;
  box-shadow: 0 0 0 2px var(--steel-d), 0 6px 12px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.4);
}
.car-cap {
  position: absolute; top: -4px; right: 6px; transform: translateY(-50%);
  background: #2b3448; color: #fff; border-radius: 7px; padding: 0 7px;
  font-family: 'Baloo 2', sans-serif; font-size: 13px; font-weight: 800; white-space: nowrap; line-height: 1.5; font-variant-numeric: tabular-nums;
  z-index: 2;
}
.car-cap .n { color: #7ee2a8; }
.car.full .car-cap .n { color: #ff8a8f; }
.car-door { position: absolute; right: -4px; top: 0; bottom: 0; width: 4px; background: #9db0c8; }
.car.arrive .car-door { animation: doorOpen .5s; }
.car.arrive .car-box { animation: carBounce .25s; }

/* ---------- 3D set active (set3d.js draws corridors, shaft, doors and the cabin) ---------- */
.floors.set3d .shaft-bg, .floors.set3d .decor, .floors.set3d .entry .door,
.floors.set3d .shaft-cell::before, .floors.set3d .shaft-cell::after, .floors.set3d .car-door { display: none; }
.floors.set3d .lobby { background: none; box-shadow: none; filter: none; }
.floors.set3d .car-box { background: none; border-color: transparent; box-shadow: none; }
.floors.set3d .car { z-index: 6; }
.floors.set3d .car-cap { top: 2px; right: 50%; transform: translate(50%, -50%); }   /* top of the cabin: destination labels are at the feet */
.floors.set3d .upcoming { z-index: 6; }

/* ---------- 3D layer ---------- */
.world3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.bubbles { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.bubble {   /* destination label worn on the character's chest (placed by World.layoutBubbles) */
  position: absolute; left: 0; top: 0;
  background: var(--c); color: #fff;
  font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-size: 10px; font-weight: 800; line-height: 1;
  padding: 2px 4px 1px; border-radius: 5px; border: 1px solid #fff;
  box-shadow: 0 1px 3px rgba(38,48,71,.25);
  white-space: nowrap; will-change: transform;
}
.bubble.done { background: var(--ok); --c: var(--ok); }
.bubble.will-exit { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ok), 0 0 10px 3px var(--ok); transform-origin: center; }
.bubble.will-board { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent), 0 0 10px 3px var(--accent); }

.fx { position: absolute; left: 42%; top: 26%; z-index: 6; pointer-events: none;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 18px; color: #1f9d57; text-shadow: 0 1px 0 #fff, 0 0 6px #fff; animation: floatUp .9s forwards; white-space: nowrap; }

/* ---------- Footer ---------- */
.controls { flex: none; height: 58px; display: grid; grid-template-columns: 54px 54px 1fr 54px; gap: 10px; align-items: stretch; }
.icon-btn { display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active, .hint-btn:active { transform: translateY(2px); }
.icon-btn:disabled { color: var(--ink-3); pointer-events: none; }
.guide { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; min-width: 0; overflow: hidden; }
.guide-face { width: 40px; height: 40px; flex: none; }
.info { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 4px; }
.itag {
  display: inline-block; min-width: 36px; padding: 5px 7px 3px; border-radius: 8px; text-align: center;
  background: var(--c); color: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 15px; line-height: 1; font-style: normal;
}
.st { display: inline-flex; align-items: center; gap: 3px; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 17px; color: var(--ink); line-height: 1; }
.st svg { width: 16px; height: 16px; fill: var(--ink-2); color: var(--ink-2); }
.st.ng, .st.ng svg { color: var(--danger); fill: var(--danger); }
.st.new, .st.new svg { color: var(--accent); fill: var(--accent); }
.hint-btn { display: grid; place-items: center; border-radius: 18px; background: var(--amber); box-shadow: var(--shadow), inset 0 -3px 0 rgba(0,0,0,.12); }
.hint-btn svg { width: 26px; height: 26px; }
.hint-btn:disabled { opacity: .6; }

/* ---------- Toast & modal ---------- */
.toast {   /* bottom of the screen: never over the HUD numbers or the top floor's car */
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 18px); transform: translate(-50%, 8px);
  background: rgba(43,52,72,.82); color: #fff; padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 13px;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 20; width: max-content; max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(30,40,60,.58); display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card {
  width: min(400px, 100%); max-height: 88dvh; overflow: auto;
  background: #fff; border-radius: 22px; padding: 22px 20px 18px;
  box-shadow: 0 24px 48px rgba(20,30,50,.28); animation: popIn .25s ease-out;
}
.modal-card h2 { margin: 0 0 8px; font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-size: 28px; font-weight: 800; text-align: center; }
.clear-title span { display: inline-block; }
.modal-card p { margin: 6px 0; font-size: 14px; line-height: 1.6; }
.modal-card .row-btns { display: flex; gap: 8px; margin-top: 14px; }
.modal-card .row-btns .btn { flex: 1; }
.btn { border-radius: 14px; padding: 12px 6px; font-weight: 800; font-size: 15px; }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-blue { background: var(--accent); color: #fff; }
.btn-white { background: #f1f3f7; }
.btn-yellow { background: var(--amber); color: #3b2800; }
.stars { text-align: center; font-size: 40px; letter-spacing: 4px; color: var(--amber); }
.stars .off { color: #e4e6ec; }
.result { text-align: center; font-weight: 700; }
.rules { padding-left: 0; list-style: none; margin: 8px 0; }
.rules li { padding: 7px 0 7px 30px; position: relative; font-size: 13.5px; line-height: 1.55; border-bottom: 1px solid #eef0f4; }
.rules li::before { content: attr(data-i); position: absolute; left: 0; top: 7px; font-size: 17px; }
.stage-list { display: grid; gap: 6px; margin: 8px 0; }
.stage-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 12px; background: #f6f7fa; }
.stage-item.active { box-shadow: 0 0 0 2px var(--accent); background: #fff; }
.stage-item .no { font-family: 'Baloo 2', sans-serif; font-size: 22px; font-weight: 800; width: 30px; text-align: center; color: var(--accent); }
.stage-item .meta { flex: 1; font-size: 12px; color: var(--ink-2); }
.stage-item .meta b { display: block; font-size: 14px; color: var(--ink); }
.stage-item .best { font-size: 14px; color: var(--amber); }
.course-heading { font-size: 12px; margin: 14px 0 2px; color: var(--ink-2); letter-spacing: .08em; }
.lab h3 { font-size: 14px; margin: 16px 0 4px; }
.lab p { font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.lab-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lab-btn { border-radius: 12px; padding: 6px 2px; background: #f6f7fa; font-size: 12px; line-height: 1.3; }
.lab-btn b { display: block; font-size: 15px; }
.lab-btn.ok { background: #e9f8ef; } .lab-btn.ng { background: #fdeef0; color: #a4414e; }
.lab-btn.sel { box-shadow: 0 0 0 2px var(--accent); }

@keyframes doorOpen { 30%, 70% { transform: scaleY(.15); transform-origin: top; } }
@keyframes popIn { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px); } }
@keyframes carBounce { 40% { transform: translateY(1px); } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes hintGlow { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--amber), 0 0 14px 6px var(--amber); } }

@media (max-height: 740px) {
  .hud { height: 40px; }
  .hud-energy b { font-size: 21px; } .hud-stage b { font-size: 22px; }
  .roof { height: 30px; }
  .controls { height: 50px; grid-template-columns: 48px 48px 1fr 48px; }
  .plate .num { font-size: 17px; width: 40px; }
}
@media (max-width: 370px) {
  :root { --platew: 46px; --shaftw: 104px; }
  .guide-face { display: none; }
}

/* ---------- Home screen ---------- */
.home { position: fixed; inset: 0; z-index: 25; background: linear-gradient(#9bd0f2, #d3ebf9 55%, #eef7fc); display: grid; place-items: start center; overflow: auto; padding: calc(env(safe-area-inset-top) + 28px) 14px 30px; }
.home[hidden] { display: none; }
.home-inner { width: 100%; max-width: 420px; }
.logo { text-align: center; font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-weight: 800; line-height: .95; color: #fff; text-shadow: 0 4px 0 rgba(38,48,71,.18); }
.logo span { display: block; font-size: 30px; letter-spacing: .2em; opacity: .92; }
.logo em { display: block; font-style: normal; font-size: 78px; color: var(--amber); text-shadow: 0 5px 0 var(--amber-d), 0 10px 20px rgba(38,48,71,.2); }
.tagline { text-align: center; font-size: 12px; font-weight: 700; color: #4f6a86; margin: 10px 0 18px; }
.home-heading { font-size: 11px; letter-spacing: .18em; color: #5d7590; margin: 12px 4px 6px; }
.home-list { display: grid; gap: 8px; }
.home-stage { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.home-stage:active { transform: translateY(2px); }
.home-stage.active { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
.home-stage .no { font-family: 'Baloo 2', sans-serif; font-size: 26px; font-weight: 800; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.home-stage.course .no { background: #6c7a93; font-size: 18px; }
.home-stage .meta { flex: 1; min-width: 0; }
.home-stage .meta b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-stage .meta span { font-size: 11px; color: var(--ink-2); }
.home-stage .best { font-size: 14px; color: var(--amber); white-space: nowrap; }
.home-stage .best .off { color: #c7cdd8; }
.home-course { margin-top: 10px; }
.home-course summary { cursor: pointer; font-size: 11px; letter-spacing: .18em; color: #5d7590; font-weight: 800; padding: 6px 4px; list-style: none; }
.home-course summary::before { content: '▸ '; }
.home-course[open] summary::before { content: '▾ '; }
.home-course summary small { font-weight: 700; letter-spacing: 0; margin-left: 6px; opacity: .8; }
.home-course .home-list { margin-top: 6px; }
.home-actions { display: flex; gap: 8px; margin-top: 18px; }
.home-actions .btn { flex: 1; background: #fff; box-shadow: var(--shadow); }

/* ---------- urgent passengers (deadline) ---------- */
.bubble.urgent { z-index: 2; display: inline-flex; align-items: center; gap: 2px; padding-right: 2px;
  box-shadow: 0 0 0 1.5px var(--danger), 0 1px 3px rgba(38,48,71,.25); } /* timer inside the label: its width counts in the layout */
.bubble.urgent .tm { font-size: 10px; padding: 1px 3px 0 2px; line-height: 1.1; background: var(--danger); color: #fff; }
.tm {
  display: inline-flex; align-items: center; gap: 2px; font-style: normal;
  background: #2b3448; color: #ffd36b; border-radius: 6px; padding: 1px 4px 0 3px;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 11px; line-height: 1.2;
}
.tm::before { content: ''; width: 9px; height: 9px; background: currentColor; -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
.bubble.hurry .tm { background: var(--danger); color: #fff; animation: pulse .8s ease-in-out infinite; }
.chip .tm { margin-left: 2px; font-size: 10px; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- UX round 1 ---------- */
.modal-x { position: sticky; top: -8px; float: right; margin: -10px -8px 0 0; width: 34px; height: 34px; border-radius: 50%;
  background: #eef1f6; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1; z-index: 1; }
.icon-btn.nudge { color: var(--accent); box-shadow: 0 0 0 3px var(--accent), var(--shadow); animation: pulse .9s ease-in-out 3; }
@media (max-height: 700px) {
  .upcoming { padding: 2px 3px; gap: 1px; }
  .chip { font-size: 11px; }
  .dot { font-size: 10px; min-width: 20px; }
}
.modal-card::after { content: ''; position: sticky; bottom: -18px; display: block; height: 26px; margin: 0 -20px -18px;
  background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.pc-only { display: none; }
@media (hover: hover) and (pointer: fine) { .rules li.pc-only { display: block; } }
body.modal-open .home-actions { visibility: hidden; }   /* don't let home buttons show through under a long modal */
.toast.at-top { bottom: auto; top: calc(env(safe-area-inset-top) + 58px); }   /* used when the bottom floor is busy */
/* custom timer icon in the how-to list (instead of an emoji) */
.rules li.ico-timer::before { content: ''; top: 9px; left: 2px; width: 18px; height: 18px; background: var(--accent);
  -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
.rules li.ico-timer.urgent::before { background: var(--danger); }
.stage-item .meta .u, .home-stage .meta .u { color: var(--danger); font-weight: 800; }

/* ---------- level button (HUD) + level select ---------- */
.lv-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1; }
.lv-btn .lv-k { font-size: 9px; font-weight: 800; color: var(--ink-2); letter-spacing: .05em; }
.lv-btn b { font-size: 17px; }
.stage-item.locked { opacity: .45; cursor: default; }
.course-heading small { font-weight: 700; color: var(--ink-2); margin-left: 6px; font-size: 12px; }
details.lab > summary { cursor: pointer; font-weight: 800; padding: 10px 0 4px; }
.btn small { font-size: 11px; opacity: .8; margin-left: 4px; }

/* ---------- identity pass: building-made UI instead of UI-kit defaults ---------- */
:root { --brand: #f08a24; --brand-d: #c2620b; --frame: #8f6f55; --frame-d: #6e523c; }
.ic-star, .ic-lock, .ic-bulb, .ic-mini { display: inline-block; vertical-align: -0.15em; }
.ic-lock { width: 14px; height: 14px; fill: var(--ink-3); color: var(--ink-3); margin-right: 4px; }
.ic-bulb { width: 16px; height: 16px; fill: #ffd36b; margin-right: 4px; }
.star-row { display: inline-flex; gap: 2px; }
.star-row i { display: inline-block; width: 15px; height: 15px; }
.star-row svg { width: 100%; height: 100%; }
.star-row .on svg { fill: #ffbe2e; stroke: #e89400; stroke-width: 1.2; }
.star-row .off svg { fill: #dfe3ea; stroke: #cfd5de; stroke-width: 1.2; }
.stars .star-row { gap: 8px; }
.stars .star-row i { width: 44px; height: 44px; }
.stars .star-row.pop i { animation: starPop .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(var(--k) * .18s + .1s); }
@keyframes starPop { 0% { transform: scale(0) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
/* modal = a sign hung in the building: wood frame, ribbon heading */
.modal-card { border: 5px solid var(--frame); box-shadow: inset 0 0 0 2px #f6e9d6, 0 10px 0 var(--frame-d), 0 24px 48px rgba(20,30,50,.3); border-radius: 20px; position: relative; overflow: visible; }
.modal-card:has(.stage-list), .modal-card:has(.rules) { overflow: auto; }
.ribbon { width: max-content; margin: -38px auto 6px; padding: 6px 18px 4px; border-radius: 12px; color: #fff; font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 6px rgba(0,0,0,.2); }
.ribbon.ok { background: #2fbf76; } .ribbon.ng { background: #e2434b; }
.modal-card h2 { font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 26px; }
/* buttons share the floor plates' chunky look */
.btn { border-radius: 14px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.16); padding-bottom: 14px; font-family: 'M PLUS Rounded 1c', sans-serif; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.16); }
.btn-blue { background: var(--brand); color: #fff; }
.btn-white { background: #efe6da; color: #5a4636; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid #ffd36b; outline-offset: 2px; }
/* toast = a small dark plate with a brand edge */
.toast { font-family: 'M PLUS Rounded 1c', sans-serif; border-bottom: 3px solid var(--brand); display: inline-flex; align-items: center; justify-content: center; }
/* level list line: icons + numbers */
.sum { display: inline-flex; gap: 10px; color: var(--ink-2); font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 13px; }
.sum .k { display: inline-flex; align-items: center; gap: 3px; }
.sum .ic-mini { width: 12px; height: 12px; fill: currentColor; }
.sum .ic-t { display: inline-block; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
.sum .u { color: var(--danger); }
.stage-item .meta { display: flex; flex-direction: column; gap: 3px; }
.stage-item .meta b { display: flex; align-items: center; }
.modal-card:not(:has(.stage-list))::after { display: none; }
.stage-item.active { box-shadow: 0 0 0 2px var(--brand); }
.stage-item .no { color: var(--brand-d); }
.course-heading { color: var(--frame-d); }
/* building: soft vignette so the car / middle floors read first */
.floors::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 40px rgba(40,26,12,.22); }
.stage-item .meta .sum, .stage-item .meta .sum .k { font-size: 13px; line-height: 1; }
.stage-item .meta .sum .ic-mini, .stage-item .meta .sum .ic-t { width: 13px; height: 13px; }

/* ---------- identity pass 2 ---------- */
:root { --brand: #8a5a34; --brand-d: #6b4426; }          /* primary = varnished wood (no clash with floor colours) */
.btn-blue { background: linear-gradient(#9b6a40, #7d4f2c); color: #fff6e8; }
.icon-btn.nudge { color: var(--brand); box-shadow: 0 0 0 3px #ffbe2e, var(--shadow); }
/* HUD = the lift's control panel: cream enamel buttons with a thick edge, brass level plate, dark counter windows */
.hud .card { background: #fffaf2; box-shadow: inset 0 -3px 0 #e4d6c2, 0 3px 8px rgba(70,45,20,.18); }
.hud .icon-btn { color: var(--brand); }
.hud .icon-btn svg { stroke-width: 2.8; }
.lv-btn { background: linear-gradient(#f3d78b, #d9ae52) !important; box-shadow: inset 0 -3px 0 #b88a34, inset 0 0 0 1.5px #fff1c4, 0 3px 8px rgba(70,45,20,.2) !important; }
.lv-btn .lv-k { color: #7a5416; } .lv-btn b { color: #4a3208; }
.hud-energy, .hud-deliver { gap: 8px; }
.hud-energy b, .hud-deliver b { background: #2b3448; color: #ffd36b; padding: 4px 8px 2px; border-radius: 7px; box-shadow: inset 0 2px 3px rgba(0,0,0,.45); min-width: 34px; text-align: center; }
.hud-deliver b { color: #9ff0c0; }
.hud-energy.low b { color: #ff8a8f; }
.hud-energy .hud-timer { color: var(--brand); }
/* logo plate on the building's top edge */
.brand-plate { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 8; white-space: nowrap;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 11px; letter-spacing: .12em; line-height: 1;
  color: #fff3dc; background: var(--frame-d); padding: 4px 10px 3px; border-radius: 8px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.2); }
.brand-plate em { font-style: normal; color: #ffbe2e; }
.brand-plate .ar { font-size: 7px; color: #ffbe2e; margin: 0 5px; vertical-align: 1px; }
/* arrival board = a small signboard hanging over the entrance door */
.floors.set3d .upcoming { right: 2px; top: 3px; padding: 3px 5px 2px; border-radius: 5px; background: #2b3448;
  border: 2px solid #c9a86e; box-shadow: 0 2px 0 #8f6f55, 0 3px 6px rgba(0,0,0,.25); }
.floors.set3d .upcoming::before { content: ''; position: absolute; left: 25%; right: 25%; top: -5px; height: 3px; border-left: 2px solid #8f6f55; border-right: 2px solid #8f6f55; }
.floors.set3d .chip + .chip { opacity: .72; font-size: 11px; }
.floors.set3d .chip + .chip .dot { font-size: 10px; }
/* plates: a touch less candy, the current floor stays vivid */
.plate .num { filter: saturate(.86) brightness(.98); }
.row.current .plate .num, .row.hint .plate .num { filter: none; }
/* level list rows: number badge + icons (no duplicated "Lv.N") */
.stage-item .meta { flex-direction: row; align-items: center; gap: 8px; }
.stage-item .meta .lk { display: inline-flex; }
.stage-item .no { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #f3e6d4; color: var(--brand-d); box-shadow: inset 0 -3px 0 #e1cdb2; }
.stage-item.active .no { background: var(--brand); color: #fff6e8; box-shadow: inset 0 -3px 0 var(--brand-d); }
.stage-item { background: #fbf6ef; }

/* ---------- identity pass 3 ---------- */
/* dark pills (toast, coach tip, car counter) share the signboard's brass rim */
.toast { background: #2b3448; border: 2px solid #c9a86e; border-bottom-width: 3px; box-shadow: 0 3px 0 #8f6f55, 0 6px 14px rgba(0,0,0,.25); }
.car-cap { border: 1.5px solid #c9a86e; }
/* logo plate: a small car mark + heavier lettering */
.brand-plate { font-size: 12px; letter-spacing: .1em; padding: 3px 10px 2px 4px; display: inline-flex; align-items: center; gap: 6px; }
.brand-plate .mark { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px;
  background: #ffbe2e; color: var(--frame-d); font-style: normal; line-height: .55; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.brand-plate .mark b { font-size: 7px; }
@media (max-height: 700px) { .brand-plate { display: none; } }
/* level list: locked rows readable, wooden close button */
.stage-item.locked { opacity: .78; filter: grayscale(.6); }
.modal-x { background: #f3e6d4; color: var(--brand-d); box-shadow: inset 0 -3px 0 #e1cdb2; }
.modal-card p { line-break: strict; }
/* identity pass 4: toast never over the floor plates; logo plate on the building's bottom edge (clear of the car counter) */
.toast { left: calc(50% + 28px); max-width: calc(100vw - 84px); }
.brand-plate { top: auto; bottom: -10px; }
/* arrival sign: timer mark before "+N" (the people coming next) */
.chip .t { display: inline-flex; align-items: center; gap: 2px; }
.chip .t .ic-t { display: inline-block; width: 11px; height: 11px; background: currentColor; -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
/* in the sign, an urgent person's limit is the red timer (same as on their label), not another plain timer */
.chip .tm { background: var(--danger); color: #fff; border-radius: 5px; padding: 1px 4px 0 3px; margin-left: 4px; }

/* ---------- tutorial ---------- */
.row.tut-lock .plate .num { filter: grayscale(1) opacity(.45); }
.tut { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.tut.block { pointer-events: auto; }
.tut-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(25,18,10,.5), 0 0 0 3px #ffd36b, 0 0 18px 4px rgba(255,211,107,.7); transition: all .25s; }
.tut-hand { position: fixed; width: 44px; height: 30px; margin-top: -15px; animation: tutPoint 1s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.tut-hand.wiggle { animation: tutWiggle .4s ease-in-out 2, tutPoint 1s ease-in-out .8s infinite; }
@keyframes tutPoint { 50% { margin-left: 8px; } }
@keyframes tutWiggle { 25% { margin-left: -6px; } 75% { margin-left: 10px; } }
.tut-bubble { position: fixed; width: 280px; background: #fffaf2; color: var(--ink); border: 3px solid var(--frame); border-radius: 14px;
  padding: 12px 14px; font-size: 14px; line-height: 1.6; text-align: center; box-shadow: 0 6px 0 var(--frame-d), 0 10px 24px rgba(0,0,0,.3); pointer-events: auto; }
.tut-bubble::before { content: ''; position: absolute; left: var(--ax, 50%); margin-left: -9px; border: 9px solid transparent; }
.tut-bubble.below::before { top: -18px; border-bottom-color: var(--frame); }
.tut-bubble.above::before { bottom: -18px; border-top-color: var(--frame); }
.tut-bubble small { color: var(--ink-2); font-size: 12px; }
.tut-bubble .tut-ok { display: block; width: 100%; margin-top: 10px; }
.tut-ex { margin: 4px 0 2px; display: inline-flex; align-items: center; gap: 3px; background: #2b3448; color: #fff; border-radius: 6px; padding: 1px 6px; font-family: 'Baloo 2', sans-serif; font-weight: 800; }
.tut-ex .ic-t { display: inline-block; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--ico-timer) center / contain no-repeat; mask: var(--ico-timer) center / contain no-repeat; }
.tut-ex .dot { font-size: 12px; }

/* ---------- bottom action bar (thumb reach): undo / hint / restart ---------- */
.hud { grid-template-columns: 52px 1fr 1fr; }
.actions { flex: none; display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; height: 46px; }
.act { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 13px; background: #fffaf2; color: var(--brand);
  font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 13px;
  box-shadow: inset 0 -3px 0 #e4d6c2, 0 3px 8px rgba(70,45,20,.18); }
.act svg { width: 20px; height: 20px; flex: none; }
.act:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #e4d6c2, 0 2px 4px rgba(70,45,20,.18); }
.act:disabled { opacity: .45; pointer-events: none; }
.act-hint { background: linear-gradient(#ffd77a, #f2b33c); color: #5a3a08; box-shadow: inset 0 -3px 0 #c98a1c, 0 3px 8px rgba(70,45,20,.22); }
.act.nudge { box-shadow: 0 0 0 3px #ffbe2e, inset 0 -3px 0 #e4d6c2; animation: pulse .9s ease-in-out 3; }
@media (max-height: 700px) { .actions { height: 40px; } .act span { font-size: 12px; } }
/* toasts sit just above the action bar */
.toast { bottom: calc(env(safe-area-inset-bottom) + 66px); }
body.tutorial .actions { opacity: .35; pointer-events: none; }   /* only the guided floor during the tutorial */

/* ---------- coins ---------- */
.hud { grid-template-columns: 52px 1fr 1fr 1fr; }
.hud-coin { display: flex; align-items: center; justify-content: center; gap: 6px; }
.hud-coin .ic-coin { width: 20px; height: 20px; }
.hud-coin b { background: #2b3448; color: #ffd36b; padding: 4px 8px 2px; border-radius: 7px; box-shadow: inset 0 2px 3px rgba(0,0,0,.45); min-width: 40px; text-align: center; }
.hud-coin.bump b { animation: bump .3s; }
.ic-coin { display: inline-block; width: 14px; height: 14px; vertical-align: -0.2em; }
.act .cost { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-family: 'Baloo 2', sans-serif; font-size: 12px; color: #a8680e;
  background: #fff1cf; border-radius: 6px; padding: 1px 4px 0 2px; }
.act .cost .ic-coin { width: 12px; height: 12px; }
.act.poor .cost { color: var(--danger); background: #ffe1e1; }
.act.poor { opacity: .7; }
.coin-line { text-align: center; margin: 6px 0 0; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; }
.coin-line.got { color: #a8680e; font-size: 16px; font-weight: 800; }
.coin-line.got .ic-coin { width: 20px; height: 20px; animation: starPop .45s cubic-bezier(.2,1.6,.4,1) both; animation-delay: .6s; }
.btn small .ic-coin { width: 12px; height: 12px; }
@media (max-width: 380px) { .hud { gap: 6px; } .hud-energy b, .hud-deliver b, .hud-coin b { padding: 3px 6px 1px; min-width: 30px; } .hud-coin .ic-coin, .hud-energy .hud-timer { width: 17px; height: 17px; } }
.actions { grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.act { white-space: nowrap; gap: 4px; padding: 0 4px; }
/* coins back in the HUD row, at the right end and a little smaller than the play counters */
.hud { grid-template-columns: 52px 1fr 1fr .78fr; }
.hud-coin { gap: 4px; }
.hud-coin .ic-coin { width: 16px; height: 16px; }
.hud-coin b { font-size: 15px; padding: 3px 6px 1px; min-width: 32px; }
.floors.set3d .row:first-child .upcoming { top: 3px; }
