/* Night-Light Knights: felt patches, running stitches and a cosy night. */

:root {
  --night: #1a1433;
  --night-2: #261d4a;
  --ink: #2a1a44;
  --ink-soft: #4a3a6a;
  --cream: #fff8ec;
  --cream-2: #f4ead8;
  --pink: #ff9ec0;
  --pink-deep: #e5547f;
  --lav: #b69bff;
  --lav-deep: #7a5ad8;
  --gold: #ffd84a;
  --mint: #5ccf96;
  --sky: #7e9bff;
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); overflow: hidden; }
body {
  font: 700 16px/1.4 var(--body);
  color: var(--cream);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; transition: filter .45s ease; }
#scene.dim { filter: blur(3px) brightness(.55) saturate(.9); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
img { -webkit-user-drag: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; font: 600 22px var(--display); }

/* ---------- felt building blocks ---------- */

.felt {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(10, 6, 30, .55), 0 14px 30px rgba(10, 6, 30, .45);
}
.felt::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed rgba(122, 90, 216, .45);
  border-radius: 16px;
  pointer-events: none;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--pink);
  color: var(--ink);
  font: 600 20px/1.1 var(--display);
  letter-spacing: .2px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px dashed rgba(255, 255, 255, .75);
  border-radius: 13px;
  pointer-events: none;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { filter: grayscale(.8) brightness(.8); cursor: not-allowed; transform: none; }
.btn.lav { background: var(--lav); }
.btn.gold { background: var(--gold); }
.btn.mint { background: var(--mint); }
.btn.sky { background: var(--sky); }
.btn.cream { background: var(--cream); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 16px; border-radius: 14px; }
.btn.small::after { border-radius: 9px; }
.btn img { width: 26px; height: 26px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 5px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: 600 17px/1.2 var(--display);
  box-shadow: 0 3px 0 rgba(10, 6, 30, .5);
}
.chip img { width: 22px; height: 22px; }

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 0 3px 0 rgba(10, 6, 30, .5);
  padding: 0;
}
.icon-btn span, .icon-btn span::before, .icon-btn span::after {
  display: block; width: 18px; height: 3px; border-radius: 2px; background: var(--ink); position: relative; content: "";
}
.icon-btn span::before { position: absolute; top: -6px; }
.icon-btn span::after { position: absolute; top: 6px; }

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) 6px calc(10px + var(--safe-l));
  pointer-events: none;
}
.hud[hidden] { display: none; }
.hud > * { pointer-events: auto; }
.hud-pip { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hud-pip img { width: 54px; height: 54px; flex: none; filter: drop-shadow(0 3px 0 rgba(10, 6, 30, .5)); }
.hud-pip.bump { animation: bump .35s ease; }
@keyframes bump { 30% { transform: translateX(-4px) rotate(-3deg); } 60% { transform: translateX(4px) rotate(2deg); } }
.hud-sleep { min-width: 0; flex: 1; max-width: 220px; }
.sleep-label { display: flex; gap: 6px; align-items: center; font: 600 13px var(--display); text-shadow: 0 2px 0 var(--ink); }
.blanket { font: 600 12px var(--display); color: var(--ink); background: #cfe2ff; border: 2px solid var(--ink); border-radius: 999px; padding: 0 7px; text-shadow: none; }
.sleep-bar { position: relative; height: 20px; border: 2.5px solid var(--ink); border-radius: 999px; background: #3a2d62; overflow: hidden; box-shadow: 0 3px 0 rgba(10, 6, 30, .5); }
.sleep-bar i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(#c8f7a8, #5ccf96); border-radius: 999px; transition: width .35s ease, background .35s; }
.sleep-bar i.low { background: linear-gradient(#ffc4b0, #ff7a7a); }
.sleep-bar b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px var(--display); color: #fff; text-shadow: 0 1px 0 var(--ink), 0 -1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.hud-hour { font: 600 15px var(--display); text-align: center; text-shadow: 0 2px 0 var(--ink); white-space: nowrap; padding: 4px 12px; border-radius: 999px; background: rgba(26, 20, 51, .55); }
.hud-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.hud-stories { display: flex; gap: 4px; }
.story-btn { width: 44px; height: 44px; padding: 0; border: none; background: none; filter: drop-shadow(0 3px 0 rgba(10, 6, 30, .5)); transition: transform .15s; }
.story-btn img { width: 44px; height: 44px; }
.story-btn:hover { transform: translateY(-2px) rotate(-4deg); }
.story-btn[disabled] { opacity: .55; cursor: default; transform: none; }
.float-note { position: fixed; z-index: 40; font: 700 20px var(--display); pointer-events: none; text-shadow: 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink); animation: floatup 1s ease-out forwards; }
@keyframes floatup { from { transform: translateY(0) scale(.7); opacity: 0; } 15% { transform: translateY(-6px) scale(1.15); opacity: 1; } to { transform: translateY(-46px) scale(1); opacity: 0; } }

@media (max-width: 560px) {
  .hud-hour { display: none; }
  .hud { grid-template-columns: minmax(0, 1fr) auto; }
  .hud-pip img { width: 46px; height: 46px; }
  .story-btn, .story-btn img { width: 38px; height: 38px; }
  .chip { font-size: 15px; padding: 2px 8px 2px 4px; }
}

/* ---------- screens ---------- */

#ui { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#ui > * { pointer-events: auto; }
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(18px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l));
  animation: screenin .35s ease;
}
.screen.passthrough { pointer-events: none; }
.screen.passthrough > * { pointer-events: auto; }
@keyframes screenin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wrap { width: min(100%, 760px); margin: 0 auto; }
.wrap.narrow { width: min(100%, 520px); }
.wrap.wide { width: min(100%, 1040px); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.1; }
.title-h { font-size: clamp(30px, 7vw, 44px); text-align: center; text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(255, 210, 140, .35); }
.sub { text-align: center; color: #e8dcff; margin: 6px auto 18px; max-width: 520px; text-shadow: 0 2px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stack { display: grid; gap: 12px; }
.center { text-align: center; }
.muted { color: #6a5a88; }
.felt .muted { color: #7a6a98; }

/* title */
.title-screen { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: calc(32px + var(--safe-b)); }
.logo { text-align: center; margin: 0 0 auto; padding-top: clamp(6px, 4vh, 40px); }
.logo h1 {
  font-size: clamp(46px, 13vw, 92px);
  line-height: .92;
  color: #fff6d8;
  text-shadow: 0 5px 0 var(--ink), 0 0 30px rgba(255, 214, 120, .6);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  transform: rotate(-3deg);
}
.logo h1 span { display: block; color: var(--pink); font-size: .78em; }
.logo p { margin: 12px 0 0; font: 600 18px var(--display); color: #f2e8ff; text-shadow: 0 2px 0 var(--ink); }
.title-menu { display: grid; gap: 12px; width: min(100%, 360px); }
.title-menu .btn { width: 100%; }
.title-foot { margin-top: 14px; font-size: 13px; color: #cfc4ec; text-align: center; }
.title-foot a { color: inherit; }

/* cards (leaders, rewards, shop) */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 16px 14px 14px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 rgba(10, 6, 30, .6);
  transition: transform .15s ease;
}
.card::after { content: ""; position: absolute; inset: 5px; border: 2px dashed rgba(122, 90, 216, .4); border-radius: 15px; pointer-events: none; }
button.card:hover { transform: translateY(-3px) rotate(-.5deg); }
button.card:active { transform: translateY(2px); }
.card.selected { background: #fff3c4; box-shadow: 0 0 0 4px var(--gold), 0 5px 0 rgba(10, 6, 30, .6); }
.card.locked { background: #d8d0ec; color: #5a4a7a; }
.card.sold { opacity: .45; }
.card img.portrait { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 4px 2px rgba(42, 26, 68, .3)); }
.card img.icon { width: 76px; height: 76px; }
.card h3 { font-size: 20px; }
.card .kind { font: 600 12px var(--display); text-transform: uppercase; letter-spacing: .8px; color: #fff; background: var(--lav-deep); border-radius: 999px; padding: 2px 10px; }
.card .kind.toy { background: var(--pink-deep); }
.card .kind.treasure { background: #c9901a; }
.card .kind.patch { background: #2a9a64; }
.card .kind.sticker { background: #4b66d1; }
.card .kind.story { background: #8463d9; }
.card .kind.stitch { background: #a86a3a; }
.card .kind.night { background: #2a1a44; color: var(--gold); }
.card p { margin: 0; font-size: 14px; line-height: 1.35; }
.card .small { font-size: 13px; color: #6a5a88; }
.card .price { margin-top: 6px; }
.card .lvl { color: #c9901a; letter-spacing: 1px; }
.swatches { display: flex; gap: 2px; justify-content: center; }
.swatches img { width: 26px; height: 26px; }

/* panels */
.panel { padding: 20px 18px 18px; }
.panel h2 { font-size: 28px; text-align: center; margin-bottom: 8px; }
.panel p { margin: 0 0 10px; }
.panel .lede { font-size: 17px; line-height: 1.5; }
.dropcap { float: left; width: 120px; height: 120px; margin: 0 12px 6px 0; }
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice { text-align: left; justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 18px; }
.choice small { font: 700 14px var(--body); opacity: .82; }
.notes { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.notes li { background: #f0e6ff; border-radius: 12px; padding: 6px 12px; }

/* map */
.map-screen { padding-top: calc(76px + var(--safe-t)); }
.map-wrap { position: relative; width: min(100%, 560px); margin: 0 auto; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 8px 0 rgba(10, 6, 30, .55); overflow: hidden; background: var(--cream); }
.map-wrap canvas { display: block; width: 100%; }
.map-node { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 0; border: none; background: none; transition: transform .15s; }
.map-node img { width: 64px; height: 64px; filter: drop-shadow(0 3px 0 rgba(42, 26, 68, .45)); }
.map-node.boss { width: 96px; height: 96px; margin: -48px 0 0 -48px; }
.map-node.boss img { width: 96px; height: 96px; }
.map-node:disabled { cursor: default; }
.map-node.done img { filter: grayscale(.85) opacity(.55); }
.map-node.locked img { filter: saturate(.5) opacity(.75); }
.map-node.open { animation: wobble 1.4s ease-in-out infinite; }
.map-node.open::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px dashed var(--pink-deep); animation: spin 8s linear infinite; }
.map-node:hover:not(:disabled) { transform: scale(1.1); }
.map-node .here { position: absolute; left: 50%; top: -34px; width: 50px; height: 50px; transform: translateX(-50%); animation: hop 1.2s ease-in-out infinite; pointer-events: none; }
.map-label { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font: 600 12px var(--display); color: var(--ink); background: rgba(255, 248, 236, .9); border-radius: 999px; padding: 0 6px; margin-top: -4px; pointer-events: none; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hop { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: min(100%, 560px); margin: 0 auto 10px; }
.map-head h2 { font-size: 22px; text-shadow: 0 2px 0 var(--ink); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 12px auto 0; width: min(100%, 560px); font: 600 13px var(--display); }
.legend span { display: inline-flex; align-items: center; gap: 3px; }
.legend img { width: 26px; height: 26px; }

/* squad strip */
.squad { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.squad button { position: relative; width: 74px; padding: 4px 2px 6px; background: rgba(255, 248, 236, .92); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 16px; font: 600 12px var(--display); box-shadow: 0 3px 0 rgba(10, 6, 30, .5); }
.squad img { width: 58px; height: 58px; display: block; margin: 0 auto; }
.squad .patches { position: absolute; top: 2px; right: 2px; display: flex; flex-direction: column; gap: 1px; }
.squad .patches img { width: 18px; height: 18px; }

/* shop */
.shelf-title { font: 600 18px var(--display); margin: 18px 0 8px; text-shadow: 0 2px 0 var(--ink); }
.services { display: grid; gap: 10px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.service { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 rgba(10, 6, 30, .55); }
.service img { width: 46px; height: 46px; flex: none; }
.service b { display: block; font: 600 16px var(--display); }
.service small { display: block; font-size: 13px; color: #6a5a88; }
.service[disabled] { opacity: .5; cursor: not-allowed; }
.price-tag { display: inline-flex; align-items: center; gap: 3px; font: 600 16px var(--display); background: #fff3c4; border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px 0 3px; }
.price-tag img { width: 20px; height: 20px; }
.price-tag.poor { background: #ffd6d6; }
.colour-pick { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.colour-pick button { position: relative; width: 42px; height: 42px; padding: 0; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
.colour-pick button[disabled] { opacity: .4; cursor: not-allowed; }
.colour-pick img { width: 34px; height: 34px; }
.colour-pick .count { position: absolute; right: -6px; bottom: -6px; min-width: 18px; padding: 0 3px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 11px/16px var(--display); }
.chest-label { margin-top: 6px; font-weight: 800; color: var(--ink-soft) !important; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); background: rgba(14, 10, 34, .62); animation: fadein .2s ease; overflow-y: auto; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(100%, 560px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 18px 18px; animation: popin .25s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes popin { from { transform: scale(.85); opacity: 0; } }
.modal h2 { font-size: 26px; text-align: center; margin-bottom: 10px; }
.modal .row { margin-top: 14px; }
.list { display: grid; gap: 8px; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: #f6efff; border-radius: 14px; }
.list-item img { width: 48px; height: 48px; flex: none; }
.list-item b { display: block; font: 600 16px var(--display); }
.list-item small { display: block; font-size: 13px; color: #5a4a7a; line-height: 1.3; }
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 14px; background: #efe6ff; color: var(--ink); font: 600 15px var(--display); }
.tabs button[aria-selected="true"] { background: var(--gold); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 2px dashed rgba(122, 90, 216, .25); }
.setting:last-of-type { border-bottom: none; }
.setting input[type="range"] { width: 150px; accent-color: var(--pink-deep); }
.toggle { position: relative; width: 52px; height: 30px; border: 2.5px solid var(--ink); border-radius: 999px; background: #d8d0ec; padding: 0; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .15s; }
.toggle[aria-pressed="true"] { background: var(--mint); }
.toggle[aria-pressed="true"]::after { left: 23px; }
select { font: 600 15px var(--display); border: 2.5px solid var(--ink); border-radius: 10px; padding: 4px 8px; background: #fff; color: var(--ink); }

/* sticker book */
.book-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sticker { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: #f6efff; border: 2px dashed rgba(122, 90, 216, .4); font: 600 12px var(--display); color: var(--ink); text-align: center; }
.sticker img { width: 72px; height: 72px; }
.sticker.unseen { background: #e4ddf2; color: #8a7aa8; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: #f6efff; border-radius: 12px; padding: 8px 10px; text-align: center; }
.stat b { display: block; font: 600 22px var(--display); }
.stat small { font-size: 12px; color: #6a5a88; }

/* fort */
.fort-screen { display: flex; flex-direction: column; justify-content: flex-end; }
.fort-top { position: absolute; top: calc(12px + var(--safe-t)); left: 0; right: 0; display: flex; justify-content: center; }
.fort-panel { width: min(100%, 760px); margin: 0 auto; padding: 16px; max-height: 50vh; overflow-y: auto; }
@media (min-aspect-ratio: 21/20) {
  .fort-screen { justify-content: center; }
  .fort-panel { width: min(46vw, 560px); max-height: calc(100vh - 40px); margin: 0 0 0 auto; }
}
.fort-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.fort-head h2 { font-size: 26px; }
.upgrades { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.upgrade { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 16px; border: 2.5px solid var(--ink); background: #fffaf2; color: var(--ink); }
.upgrade > img { width: 52px; height: 52px; flex: none; }
.upgrade b { display: block; font: 600 16px var(--display); }
.upgrade small { display: block; font-size: 13px; color: #5a4a7a; line-height: 1.3; }
.upgrade .pips { display: flex; gap: 3px; margin-top: 3px; }
.upgrade .pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); }
.upgrade .pips i.on { background: var(--gold); }
.upgrade.maxed { background: #eafbe8; }
.upgrade:disabled { opacity: .62; cursor: not-allowed; }

/* night report */
.report h2 { font-size: 34px; }
.report .big { font: 600 54px var(--display); text-align: center; margin: 4px 0; }
.unlock { display: flex; gap: 10px; align-items: center; padding: 10px; background: #fff3c4; border-radius: 14px; margin-top: 10px; }
.unlock img { width: 64px; height: 64px; }

/* bedtime picker */
.bedtime { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0; }
.bedtime b { min-width: 170px; text-align: center; font: 600 18px var(--display); text-shadow: 0 2px 0 var(--ink); }
.bedtime small { display: block; font: 700 13px var(--body); color: #e8dcff; text-shadow: none; }

/* tips */
.tip { position: fixed; z-index: 45; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(calc(100% - 24px), 480px); display: flex; gap: 10px; align-items: center; padding: 12px 14px; animation: popin .3s cubic-bezier(.3, 1.5, .5, 1); }
.tip.top { bottom: auto; top: calc(76px + var(--safe-t)); }
.tip img { width: 64px; height: 64px; flex: none; }
.tip p { margin: 0; font-size: 15px; line-height: 1.4; }
.tip button { flex: none; }

/* help */
.help h3 { font-size: 18px; margin: 14px 0 4px; }
.help p { margin: 0 0 6px; font-size: 15px; line-height: 1.45; }
.help .row { justify-content: flex-start; margin: 4px 0; }
.help img { width: 40px; height: 40px; }

/* ending */
.ending { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.ending .felt { width: min(100%, 560px); padding: 18px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
