* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #f5c3d0;
  font-family: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #43212c;
  -webkit-tap-highlight-color: transparent;
  font-synthesis: none;
}
[hidden] { display: none !important; }

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #f5c3d0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'%3E%3Cg fill='%23ffe9e1' fill-opacity='0.62'%3E%3Crect x='44' y='30' width='5' height='5'/%3E%3Crect x='55' y='30' width='5' height='5'/%3E%3Crect x='39' y='35' width='26' height='5'/%3E%3Crect x='44' y='40' width='16' height='5'/%3E%3Crect x='49' y='45' width='6' height='5'/%3E%3Crect x='203' y='186' width='7' height='7'/%3E%3Crect x='220' y='186' width='7' height='7'/%3E%3Crect x='196' y='193' width='38' height='7'/%3E%3Crect x='203' y='200' width='24' height='7'/%3E%3Crect x='210' y='207' width='10' height='7'/%3E%3Crect x='226' y='64' width='16' height='5'/%3E%3Crect x='231' y='59' width='5' height='16'/%3E%3Crect x='72' y='220' width='16' height='5'/%3E%3Crect x='77' y='215' width='5' height='16'/%3E%3Crect x='130' y='118' width='5' height='5'/%3E%3Crect x='126' y='123' width='13' height='5'/%3E%3Crect x='130' y='128' width='5' height='5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 280px 280px;
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 44%, rgba(255, 239, 231, 0.46), rgba(245, 195, 208, 0) 66%);
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.1vh, 26px) clamp(8px, 2vw, 30px);
}

.device {
  position: relative;
  width: min(94vw, calc(94vh * 1.35), 1280px);
  aspect-ratio: 1.35;
  container-type: size;
  isolation: isolate;
}
.shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.deco {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 1;
}
.deco-heart { width: 4.6%; aspect-ratio: 1; }
.deco-plus { width: 2.3%; aspect-ratio: 1; }
.h1 { left: 3.4%; top: 39%; }
.h2 { left: 6.1%; top: 58%; }
.h3 { right: 3.4%; top: 36%; }
.h4 { right: 6.8%; top: 54%; }
.p1 { left: 5.2%; top: 25%; }
.p2 { right: 6.2%; top: 27%; }
.p3 { left: 8.2%; top: 70%; }

.chain {
  position: absolute;
  top: -6%;
  right: -26%;
  width: 38%;
  height: 58%;
  pointer-events: none;
  z-index: 4;
}
.bow {
  position: absolute;
  top: -5.5%;
  left: 37.5%;
  width: 25%;
  height: auto;
  pointer-events: none;
  z-index: 4;
}

.device-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.screen-bezel {
  position: absolute;
  left: 8.5%;
  right: 8.5%;
  top: 7.2%;
  height: 64.5%;
  padding: 2.35% 2.5% 2.6%;
  border-radius: 3.6% / 5.4%;
  background:
    linear-gradient(158deg, #f9a6ba 0%, #ef849d 30%, #df6c88 66%, #c95774 100%);
  box-shadow:
    0 0 0 0.55cqw #b7435f,
    0 0.9cqw 0 #a83a53,
    0 1.5cqw 2.6cqw rgba(92, 30, 46, 0.4),
    inset 0 0.45cqw 0 rgba(255, 255, 255, 0.3),
    inset 0 -0.7cqw 0 rgba(122, 32, 52, 0.3);
}
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2.2% / 3.6%;
  background: transparent;
  container-type: size;
}
.screen-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.screen-surface:active { cursor: grabbing; }
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 221, 202, 0.16);
  pointer-events: none;
  z-index: 5;
}
#scene {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
  z-index: 0;
}
.screen-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(20, 8, 10, 0) 54%, rgba(20, 8, 10, 0.32) 100%);
  box-shadow:
    inset 0 0 0 0.45cqw #6b2638,
    inset 0 0.7cqw 1.8cqw rgba(0, 0, 0, 0.72);
}

.loading, .fallback {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  background: #2b1812;
  color: #ffe0d1;
  font-family: Silkscreen, monospace;
  font-size: clamp(9px, 2.1cqw, 16px);
  text-align: center;
  padding: 1em;
  transition: opacity 0.45s ease;
}
.loading svg { width: 2.6em; height: 2.6em; animation: heartPulse 2.2s ease-in-out infinite; }
.loading p { margin: 0; opacity: 0.85; }
.fallback p { margin: 0; max-width: 22em; line-height: 1.5; }
.fallback-small { opacity: 0.65; font-size: 0.8em; }
@keyframes heartPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 3;
  font-family: Silkscreen, monospace;
  font-size: var(--su, 14px);
  line-height: 1;
  color: #fff6ea;
  pointer-events: none;
}

.vitals {
  position: absolute;
  top: 0.62em;
  left: 0.62em;
  width: 13.1em;
  padding: 0.55em 0.68em 0.58em;
  display: grid;
  gap: 0.3em;
  background: #182037;
  border: 1px solid rgba(255, 219, 206, 0.18);
  border-radius: 0.34em;
  box-shadow:
    0 0.16em 0.4em rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}
.vital {
  display: grid;
  grid-template-columns: 1.1em 6.15em 1fr;
  align-items: center;
  gap: 0.42em;
  height: 1.25em;
}
.v-ico { width: 1.1em; height: 1.1em; display: block; }
.v-ico svg { display: block; width: 100%; height: 100%; }
.v-name {
  font-size: 0.94em;
  letter-spacing: 0.01em;
  color: #fdf2e8;
  white-space: nowrap;
  overflow: hidden;
}
.v-track {
  position: relative;
  height: 0.58em;
  min-width: 2.6em;
  border-radius: 0.14em;
  background: #090e1c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.v-fill {
  display: block;
  height: 100%;
  border-radius: 0.1em;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: width 0.5s ease;
}

.statusbar {
  position: absolute;
  left: 0.62em;
  right: 0.62em;
  bottom: calc(11% + 0.3em);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55em;
  padding: 0.4em 0.6em;
  background: #182037;
  border: 1px solid rgba(255, 219, 206, 0.18);
  border-radius: 0.34em;
  box-shadow:
    0 0.16em 0.4em rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}
.sb-item { display: flex; align-items: center; gap: 0.3em; flex: 1 1 0; min-width: 0; }
.sb-name { font-size: 0.68em; color: #fdf2e8; white-space: nowrap; overflow: hidden; }
.sb-ico { width: 0.92em; height: 0.92em; display: block; flex: none; }
.sb-ico svg { display: block; width: 100%; height: 100%; }
.sb-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 1.8em;
  width: auto;
  height: 0.52em;
  border-radius: 0.12em;
  background: #090e1c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.sb-track .v-fill {
  display: block;
  height: 100%;
  border-radius: 0.1em;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  transition: width 0.5s ease;
}
@container (max-width: 470px) {
  .sb-name { display: none; }
  .statusbar { gap: 0.35em; }
  .sb-track { min-width: 1.2em; }
}

.clock {
  position: absolute;
  top: 0.62em;
  right: 0.62em;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.34em 0.56em 0.38em;
  background: #182037;
  border: 1px solid rgba(255, 219, 206, 0.18);
  border-radius: 0.34em;
  box-shadow:
    0 0.16em 0.4em rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.24);
}
.clock-text { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15em; }
.clock-day { font-size: 0.8em; color: #ccd4e6; }
.clock-time { font-size: 1.34em; color: #fff8ec; letter-spacing: 0.02em; }
.clock-sun { width: 1.55em; height: 1.55em; display: block; }
.clock-sun svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 0.22em rgba(255, 205, 92, 0.4)); }

.caption {
  position: absolute;
  left: 0.62em;
  bottom: calc(11% + 2.75em);
  max-width: 60%;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.4em 0.62em;
  background: rgba(11, 15, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.3em;
  box-shadow: 0 0.12em 0.3em rgba(0, 0, 0, 0.3);
  font-size: 0.9em;
  line-height: 1.15;
  color: #fff6ea;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.caption.is-fading { opacity: 0; }
.c-heart { width: 1em; height: 1em; flex: none; display: block; }
#captionText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rooms {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 11%;
  display: flex;
  gap: 0.25em;
  padding: 0.3em 0.36em;
  background: linear-gradient(180deg, rgba(13, 17, 31, 0.82), rgba(8, 11, 21, 0.95));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: auto;
}
.room {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  padding: 0 0.2em;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.3em;
  background: #1d253a;
  color: #aeb6c8;
  font-family: Silkscreen, monospace;
  font-size: 0.94em;
  line-height: 1;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
}
.room svg { width: 1.05em; height: 1.05em; flex: none; display: block; }
.room span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room.active {
  background: linear-gradient(180deg, #f490a5, #e26882);
  border-color: #ffc2ce;
  color: #fff8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
  cursor: default;
}
.room.locked { color: #9099ad; }
.room.locked:hover { background: #242d46; color: #c2c9d8; }
.room:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.room.active:focus-visible { outline-color: #fff; }

.help-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(8, 10, 18, 0.26);
  pointer-events: auto;
}
.help {
  position: absolute;
  z-index: 21;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(78%, 350px);
  max-height: 88%;
  overflow: auto;
  padding: 1em 1.1em 1.05em;
  background: #151c30;
  border: 2px solid #f4a3b6;
  border-radius: 0.55em;
  box-shadow: 0 0.8em 2.4em rgba(0, 0, 0, 0.55), inset 0 0 0 2px #2a3350;
  color: #f7efe6;
  font-family: Figtree, sans-serif;
  font-size: max(11px, 1.08em);
  line-height: 1.4;
  pointer-events: auto;
}
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
.help h2 {
  margin: 0;
  font-family: Silkscreen, monospace;
  font-size: 1.12em;
  font-weight: 700;
  color: #ffd0da;
  letter-spacing: 0.02em;
}
.help-close {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  padding: 0;
  border: 1px solid #f4a3b6;
  border-radius: 0.3em;
  background: #26304a;
  color: #ffe3ea;
  font-family: Silkscreen, monospace;
  font-size: 0.9em;
  cursor: pointer;
}
.help-close:hover { background: #33405f; }
.help-close:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.help-lead { margin: 0.75em 0 0.7em; color: #ded8d1; }
.help-list { list-style: none; margin: 0 0 0.75em; padding: 0; display: grid; gap: 0.42em; }
.help-list li {
  display: grid;
  grid-template-columns: 1.7em 4.6em 1fr;
  align-items: center;
  gap: 0.45em;
  font-size: 0.95em;
}
.help-list b {
  font-family: Silkscreen, monospace;
  font-weight: 700;
  text-align: center;
  padding: 0.22em 0;
  border-radius: 0.25em;
  background: #e26882;
  color: #fff;
  font-size: 0.82em;
}
.help-list span { font-family: Silkscreen, monospace; font-size: 0.78em; color: #ffc2ce; }
.help-list em { font-style: normal; color: #ddd6cf; }
.help-foot {
  margin: 0;
  padding-top: 0.65em;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #b9c1d4;
  font-size: 0.92em;
}

.controls {
  position: absolute;
  left: 8.5%;
  right: 8.5%;
  top: 74.3%;
  height: 18.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.6cqw;
  z-index: 3;
}
.round-btn {
  flex: none;
  width: 8.4cqw;
  height: 8.4cqw;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 0.35cqw solid #b8415c;
  background: radial-gradient(circle at 34% 25%, #ffa4b6 0%, #f07e96 42%, #da5d79 76%, #bd4965 100%);
  box-shadow:
    0 0.55cqw 0 #a83a53,
    0 0.85cqw 1.3cqw rgba(90, 30, 45, 0.35),
    inset 0 0.24cqw 0.28cqw rgba(255, 255, 255, 0.36),
    inset 0 -0.4cqw 0.5cqw rgba(120, 30, 50, 0.35);
  color: #fff7f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: Silkscreen, monospace;
  text-shadow: 0 1px 0 rgba(120, 30, 50, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}
.round-btn .key { font-size: max(13px, 2.75cqw); font-weight: 700; line-height: 0.95; }
.round-btn .sub { font-size: max(7px, 1.32cqw); line-height: 1; margin-top: 0.2em; letter-spacing: 0.02em; }
.round-btn:hover { filter: brightness(1.05); }
.round-btn:active {
  transform: translateY(0.34cqw);
  box-shadow:
    0 0.2cqw 0 #a83a53,
    0 0.35cqw 0.7cqw rgba(90, 30, 45, 0.3),
    inset 0 0.2cqw 0.3cqw rgba(255, 255, 255, 0.28),
    inset 0 -0.3cqw 0.45cqw rgba(120, 30, 50, 0.4);
}
.round-btn:focus-visible, .menu-btn:focus-visible {
  outline: 0.32cqw solid #fff1df;
  outline-offset: 0.32cqw;
}
.menu-btn {
  flex: none;
  width: 22.5cqw;
  height: 7.4cqw;
  min-width: 112px;
  min-height: 40px;
  padding: 0 0.6em;
  border-radius: 999px;
  border: 0.35cqw solid #b8415c;
  background: linear-gradient(180deg, #ff9db1 0%, #ef7b94 52%, #d45a77 100%);
  box-shadow:
    0 0.55cqw 0 #a83a53,
    0 0.9cqw 1.4cqw rgba(90, 30, 45, 0.32),
    inset 0 0.24cqw 0.28cqw rgba(255, 255, 255, 0.4),
    inset 0 -0.42cqw 0.5cqw rgba(120, 30, 50, 0.28);
  color: #fff8f0;
  font-family: Silkscreen, monospace;
  font-size: max(11px, 2.15cqw);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(120, 30, 50, 0.55);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}
.menu-btn:hover { filter: brightness(1.05); }
.menu-btn:active {
  transform: translateY(0.34cqw);
  box-shadow:
    0 0.2cqw 0 #a83a53,
    0 0.4cqw 0.8cqw rgba(90, 30, 45, 0.28),
    inset 0 0.2cqw 0.3cqw rgba(255, 255, 255, 0.3),
    inset 0 -0.3cqw 0.45cqw rgba(120, 30, 50, 0.34);
}
.speaker {
  flex: none;
  position: relative;
  width: 5.2cqw;
  height: 7.2cqw;
  min-width: 26px;
  min-height: 32px;
  display: block;
}
.speaker i {
  position: absolute;
  width: 1.15cqw;
  height: 1.15cqw;
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  background: #4c9c8b;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.35);
}
.speaker i:nth-child(1) { left: 50%; top: 4%; transform: translateX(-50%); }
.speaker i:nth-child(2) { left: 8%; bottom: 8%; }
.speaker i:nth-child(3) { right: 8%; bottom: 8%; }

@media (max-aspect-ratio: 1/1) {
  .device {
    width: min(96vw, calc(94vh * 0.72));
    aspect-ratio: 0.72;
  }
  .chain { display: none; }
  .screen-bezel {
    left: 6.5%;
    right: 6.5%;
    top: 6%;
    height: 56%;
    padding: 3.2% 3.5% 3.7%;
    border-radius: 4.4% / 3.6%;
  }
  .controls {
    left: 4%;
    right: 4%;
    top: 66.5%;
    height: 25%;
    gap: 1.35cqw;
  }
  .round-btn { width: 12cqw; height: 12cqw; border-width: 0.5cqw; }
  .round-btn .key { font-size: max(13px, 3.5cqw); }
  .round-btn .sub { font-size: max(7px, 1.65cqw); }
  .menu-btn { width: 26cqw; height: 12cqw; min-width: 88px; font-size: max(11px, 2.9cqw); }
  .speaker { width: 6cqw; height: 10cqw; }
  .speaker i { width: 1.6cqw; height: 1.6cqw; }
  .bow { width: 32%; left: 34%; top: -4.2%; }
  .chain { display: none; }
  .deco-heart { width: 7%; }
  .deco-plus { width: 3.1%; }
  .h1 { left: 2.2%; top: 31%; }
  .h2 { left: 3.6%; top: 49%; }
  .h3 { right: 2.2%; top: 30%; }
  .h4 { right: 3.6%; top: 48%; }
  .p1 { left: 3.6%; top: 21%; }
  .p2 { right: 4.6%; top: 22%; }
  .p3 { left: 5%; top: 64%; }
  .caption { max-width: 82%; bottom: calc(11% + 2.75em); }
  .vitals { width: 13.6em; }
  .room { font-size: 0.9em; }
  .help { width: min(86%, 340px); }
}

@media (max-aspect-ratio: 1/1) and (max-height: 640px) {
  .device { width: min(94vw, calc(96vh * 0.86)); aspect-ratio: 0.86; }
  .screen-bezel { top: 5.5%; height: 55%; }
  .controls { top: 65.5%; height: 26%; }
  .round-btn { width: 11.4cqw; height: 11.4cqw; }
  .menu-btn { width: 25cqw; height: 11.4cqw; }
}

@media (prefers-reduced-motion: reduce) {
  .loading svg { animation: none; }
  .v-fill { transition: none; }
}

/* shop wallet, menu and panels */
.coin-badge {
  position: absolute;
  top: 4.05em;
  right: 0.62em;
  display: flex;
  align-items: center;
  gap: 0.34em;
  padding: 0.3em 0.5em 0.34em;
  background: #182037;
  border: 1px solid rgba(255, 219, 206, 0.2);
  border-radius: 0.34em;
  box-shadow: 0 0.14em 0.36em rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #fff6ea;
  font-family: Silkscreen, monospace;
  font-size: 0.92em;
  cursor: pointer;
  pointer-events: auto;
  line-height: 1;
  touch-action: manipulation;
}
.coin-badge:hover { background: #202a47; }
.coin-badge:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.coin-ico { width: 1.18em; height: 1.18em; display: block; flex: none; }
.coin-ico svg { display: block; width: 100%; height: 100%; }
.coin-num { color: #ffd76a; font-size: 1.02em; }
.coin-word { color: #ffb3c2; font-size: 0.76em; margin-left: 0.1em; }

.panel {
  position: absolute;
  z-index: 21;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(82%, 390px);
  max-height: 94%;
  overflow: auto;
  padding: 0.85em 1em 0.9em;
  background: #151c30;
  border: 2px solid #f4a3b6;
  border-radius: 0.55em;
  box-shadow: 0 0.8em 2.4em rgba(0, 0, 0, 0.55), inset 0 0 0 2px #2a3350;
  color: #f7efe6;
  font-family: Figtree, sans-serif;
  font-size: max(11px, 1.06em);
  line-height: 1.4;
  pointer-events: auto;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6em; }
.panel h2 {
  margin: 0;
  font-family: Silkscreen, monospace;
  font-size: 1.12em;
  font-weight: 700;
  color: #ffd0da;
  letter-spacing: 0.02em;
}
.panel-close {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  padding: 0;
  border: 1px solid #f4a3b6;
  border-radius: 0.3em;
  background: #26304a;
  color: #ffe3ea;
  font-family: Silkscreen, monospace;
  font-size: 0.9em;
  cursor: pointer;
}
.panel-close:hover { background: #33405f; }
.panel-close:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.panel-lead { margin: 0.5em 0 0.55em; color: #ded8d1; font-size: 0.9em; }
.panel-foot { margin: 0.55em 0 0; padding-top: 0.5em; border-top: 1px solid rgba(255, 255, 255, 0.1); color: #b9c1d4; font-size: 0.8em; }
.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4em;
  margin-bottom: 0.7em;
}
.menu-actions button {
  border: 1px solid rgba(244, 163, 182, 0.4);
  border-radius: 0.35em;
  background: #1d253a;
  color: #ffe9dd;
  font-family: Silkscreen, monospace;
  font-size: 0.8em;
  padding: 0.54em 0.3em;
  cursor: pointer;
  touch-action: manipulation;
}
.menu-actions button:hover { background: #2a3552; border-color: #f4a3b6; }
.menu-actions button:active { background: #3a4568; }
.menu-actions button:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.shop-open {
  width: 100%;
  border: 1px solid #ffd76a;
  border-radius: 0.4em;
  background: linear-gradient(180deg, #ffd463, #e5a62e);
  color: #512b15;
  font-family: Silkscreen, monospace;
  font-size: 0.88em;
  font-weight: 700;
  padding: 0.56em 0.5em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.shop-open:hover { filter: brightness(1.05); }
.shop-open:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.shop {
  left: auto;
  right: 2.5%;
  top: 50%;
  transform: translateY(-50%);
  width: min(54%, 342px);
  max-height: 94%;
  padding: 0.66em 0.78em 0.7em;
}
.shop h2 { font-size: 1.02em; }
.shop-wallet {
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin: 0.42em 0 0.48em;
  padding: 0.32em 0.5em;
  background: #1d253a;
  border: 1px solid rgba(255, 215, 106, 0.35);
  border-radius: 0.35em;
  color: #ffd76a;
  font-family: Silkscreen, monospace;
  font-size: 0.8em;
}
.shop-wallet #shopCoins { font-size: 1.05em; }
.shop-list { display: grid; gap: 0.28em; margin-bottom: 0.48em; }
.shop-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.35em;
  padding: 0.27em 0.4em;
  background: #1d253a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.35em;
}
.shop-item-name { font-family: Silkscreen, monospace; font-size: 0.7em; color: #ffe9dd; }
.shop-item-price { font-family: Silkscreen, monospace; font-size: 0.66em; color: #ffd76a; white-space: nowrap; }
.shop-item button {
  min-width: 4em;
  padding: 0.28em 0.35em;
  border: 1px solid #f4a3b6;
  border-radius: 0.3em;
  background: #e26882;
  color: #fff;
  font-family: Silkscreen, monospace;
  font-size: 0.62em;
  cursor: pointer;
}
.shop-item button:hover { background: #ef8298; }
.shop-item button:disabled { background: #2b3550; border-color: #4a5674; color: #b9c1d4; cursor: default; }
.shop-item button.base { background: #8b5a3c; border-color: #c58a5c; }
.shop-back {
  width: 100%;
  border: 1px solid #f4a3b6;
  border-radius: 0.4em;
  background: #26304a;
  color: #ffe3ea;
  font-family: Silkscreen, monospace;
  font-size: 0.76em;
  padding: 0.42em;
  cursor: pointer;
}
.shop-back:hover { background: #33405f; }
.shop-back:focus-visible, .shop-item button:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }

.use-panel { width: min(84%, 420px); }
.use-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4em;
  margin-bottom: 0.65em;
}
.use-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.16em;
  padding: 0.46em 0.56em 0.5em;
  border: 1px solid rgba(244, 163, 182, 0.36);
  border-radius: 0.4em;
  background: #1d253a;
  color: #ffe9dd;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.use-item b {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: Silkscreen, monospace;
  font-size: 0.8em;
  font-weight: 700;
  color: #ffe9dd;
}
.use-item b::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  flex: none;
  border-radius: 0.12em;
  background: linear-gradient(180deg, #ffd463, #e5a62e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.use-item span {
  font-family: Figtree, sans-serif;
  font-size: 0.76em;
  line-height: 1.25;
  color: #bcc5d8;
}
.use-item:hover { background: #2a3552; border-color: #f4a3b6; }
.use-item:active { background: #3a4568; }
.use-item:focus-visible { outline: 2px solid #fff1df; outline-offset: 1px; }
.use-item.active {
  background: linear-gradient(180deg, #e26882, #c95470);
  border-color: #ffc2ce;
}
.use-item.active span { color: #ffe6ec; }

@media (max-aspect-ratio: 1/1) {
  .panel { width: min(88%, 360px); max-height: 94%; }
  .panel.shop { left: 50%; right: auto; transform: translate(-50%, -50%); width: min(92%, 360px); }
  .coin-badge { top: 3.9em; }
}
