:root {
  --ink: #42384f;
  --paper: #fff3da;
  --gold: #ffcd62;
  --mint: #68b9ac;
  --berry: #ba7198;
  --focus: #3f6f8f;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(ellipse at 30% 10%, #c3e5e9 0, #8fa7bf 50%, #5f6d8b 100%);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  transition: transform .13s, filter .13s;
}

button:hover:not(:disabled) { filter: brightness(1.04); }
button:active:not(:disabled) { transform: translateY(2px) scale(.98); }
button:disabled { cursor: not-allowed; opacity: .6; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.desktop-wordmark {
  position: fixed;
  left: max(22px, calc(50% - 580px));
  top: 43%;
  font-size: 38px;
  font-weight: 1000;
  line-height: 1.1;
  color: #f7edd49c;
  transform: rotate(-5deg);
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
}

#app {
  position: relative;
  width: min(100vw, calc(var(--vh, 1vh) * 58));
  height: calc(var(--vh, 1vh) * 100);
  margin: 0 auto;
  overflow: hidden;
  background: #b9dce1;
  box-shadow: 0 0 100px #31465c5c;
  isolation: isolate;
}

#world {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- Visibility per view ---------- */
#app:not([data-view="game"]) .top,
#app:not([data-view="game"]) .zone-hud,
#app:not([data-view="game"]) .bottom-left,
#app:not([data-view="game"]) .controls { display: none; }

#app:not([data-view="menu"]) .home-screen { display: none; }

[hidden] { display: none !important; }

/* ---------- In-game HUD ---------- */
.top, .zone-hud, .bottom-left, .controls { position: absolute; z-index: 5; }

.top {
  top: 3%;
  left: 3%;
  right: 3%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pause-button {
  flex: 0 0 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(#b3d8ce, #78a9aa);
  border: 2px solid #e9f0de;
  border-radius: 11px;
  box-shadow: 0 3px 0 #4d77786b;
}

.pause-button span { width: 5px; height: 16px; border-radius: 2px; background: #fffbeb; }

.top-score, .coin-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  height: 42px;
  padding: 0 12px;
  align-items: center;
  background: linear-gradient(#5c788ace, #43566bdb);
  border: 2px solid #dbede591;
  border-radius: 14px;
  color: #fffbeb;
  font-weight: 900;
  box-shadow: 0 3px 10px #1d2b3a33;
}

.top-score { flex: 1; }
.top-score strong { font-size: 22px; font-style: italic; letter-spacing: 1px; }
.top-score small { font-size: 11px; opacity: .85; }
.top-score span { margin-left: auto; font-size: 13px; opacity: .9; letter-spacing: 1px; }

.coin-stat b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #7a4d18;
  font-size: 12px;
}

.coin-stat strong { font-size: 18px; }
.multiplier { color: #ffe19a; font-size: 12px; }

.zone-hud {
  top: 11%;
  left: 3%;
  width: 52%;
  padding: 6px 10px;
  border-radius: 12px;
  background: #43566ba8;
  color: #fffbeb;
  font-size: 11px;
  font-weight: 900;
}

.track {
  position: relative;
  height: 5px;
  margin-top: 5px;
  border-radius: 5px;
  background: #ffffff40;
  overflow: hidden;
}

.track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #e6c184;
  transition: width .2s;
}

.bottom-left {
  left: 4%;
  bottom: 13%;
  color: #fffbeb;
  text-shadow: 0 2px 4px #2b3a4a99;
  font-weight: 900;
}

.bottom-left strong { font-size: 30px; font-style: italic; }
.bottom-left small { margin-left: 3px; font-size: 12px; }
.bottom-left .track { width: 145px; background: #ffffff38; }
.bottom-left .track i { background: #9bd3c2; }

.controls {
  bottom: 1.5%;
  left: 16%;
  width: 68%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.controls button {
  height: calc(var(--vh, 1vh) * 6.4);
  min-height: 44px;
  background: #f6e8ccbf;
  border: 2px solid #fff7e6;
  border-radius: 16px;
  color: #664c65;
  font-size: 22px;
  font-weight: 900;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 0 #8e7e7855;
}

/* ---------- Home menu ---------- */
.home-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.home-screen button,
.home-screen .wallet-pill,
.home-screen .journey { pointer-events: auto; }

.wallet {
  position: absolute;
  top: 2.3%;
  left: 4%;
  width: 92%;
  height: 5.4%;
  display: flex;
  gap: 8px;
}

.wallet > * {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  background: linear-gradient(#fff9e9, #edd7b7);
  border: 2px solid #fff7e6;
  border-radius: 17px;
  box-shadow: 0 4px 0 #8e7e7866, inset 0 -2px #d6bfa1;
  color: #605064;
  font-weight: 900;
}

.wallet > :first-child, .wallet > :last-child { flex: 0 0 12%; }
.wallet .wallet-pill { flex: 1; }
.wallet .crown { font-size: 20px; color: #c68f3c; }
.wallet em { color: #7faa8a; font-style: normal; font-size: 18px; }
.wallet small { font-size: 11px; }

.wallet-pill b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #7a4d18;
  font-size: 12px;
}

.wallet-pill strong { font-size: 16px; }

.music-button { font-size: 18px; }
.music-button .music-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.music-button[aria-pressed="true"] { color: #4e8f82; }

.journey {
  position: absolute;
  top: 9%;
  left: 19%;
  width: 62%;
  height: 5.7%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 8px;
  padding: 0 14px;
  background: linear-gradient(#fff2bd, #eecf96);
  border: 2px solid #f9e0aa;
  border-bottom: 3px solid #a88c67;
  border-radius: 16px;
  color: #6d5364;
  font-size: 12px;
  font-weight: 900;
}

.journey-title { grid-column: 1; }
#journeyLabel { grid-column: 2; grid-row: 1; font-size: 10px; align-self: center; }

.journey-track {
  grid-column: 1 / -1;
  position: relative;
  height: 5px;
  margin-top: 4px;
  border-radius: 5px;
  background: #d2b293;
  overflow: hidden;
}

.journey-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #9bb596;
  border-radius: inherit;
  transition: width .3s;
}

.graffiti-title {
  position: absolute;
  top: 17%;
  left: 13%;
  width: 74%;
  text-align: center;
  transform: rotate(-4deg);
  user-select: none;
}

.season-label {
  display: inline-block;
  padding: 3px 14px;
  background: linear-gradient(#b991be, #99719e);
  border: 2px solid #fff1d6;
  border-radius: 16px;
  color: #fff8ea;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
}

.graffiti-title h1 {
  position: relative;
  margin: 2px 0 0;
  font-size: clamp(43px, calc(var(--vh, 1vh) * 7.5), 73px);
  font-weight: 1000;
  line-height: 1.08;
  letter-spacing: -4px;
  color: #fff0ae;
  -webkit-text-stroke: 1px #b08059;
  text-shadow: 1px 3px #d99553, 2px 5px #916464, 0 -2px #fffadb;
}

.graffiti-title h1::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  -webkit-text-stroke: 8px #fff7e5;
  color: #fff7e5;
  text-shadow: none;
}

.logo-sub {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 12px;
  background: linear-gradient(#72b9aa, #518e8a);
  border-radius: 8px;
  color: #fffbeb;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 4px;
  box-shadow: 0 3px 0 #3c6c6a88;
}

.logo-splash {
  position: absolute;
  top: 18%;
  right: 2%;
  color: #ffe5a1;
  font-size: 30px;
  text-shadow: 0 2px #c08b4e;
  animation: twinkle 2.6s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { transform: rotate(0) scale(1); }
  50% { transform: rotate(18deg) scale(1.15); }
}

.side-rail {
  position: absolute;
  top: 33%;
  width: 15%;
  display: flex;
  flex-direction: column;
  gap: calc(var(--vh, 1vh) * 2.6);
}

.left-rail { left: 3%; }
.right-rail { right: 3%; }

.side-rail button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 5px;
  background: linear-gradient(145deg, #fff8e6ed, #e5ccb8ed);
  border: 2px solid #fff5df;
  border-bottom: 4px solid #a68b856b;
  border-radius: 20px;
  color: #664c65;
}

.rail-icon {
  display: grid;
  place-items: center;
  height: calc(var(--vh, 1vh) * 5.6);
  font-size: calc(var(--vh, 1vh) * 3.4);
  line-height: 1;
}

.side-rail small {
  font-size: clamp(8px, calc(var(--vh, 1vh) * 1.3), 13px);
  font-weight: 900;
  white-space: nowrap;
}

.badge {
  position: absolute;
  right: -4px;
  top: 1px;
  min-width: 18px;
  padding: 1px 4px;
  background: #d9939a;
  border: 2px solid #fff0d6;
  border-radius: 7px;
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
}

/* Stacked in the clear column between the side rails, above the runner's head. */
.status-flags {
  position: absolute;
  top: 34.5%;
  left: 20%;
  width: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--vh, 1vh) * 0.9);
  pointer-events: none;
}

.wardrobe-pill,
.mode-ribbon {
  display: block;
  max-width: 100%;
  padding: 0 14px;
  height: calc(var(--vh, 1vh) * 3.8);
  border-radius: 30px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.wardrobe-pill {
  background: #fff5dee8;
  color: #7e6071;
  box-shadow: 0 3px 0 #8e7e7855;
}

.start-dock {
  position: absolute;
  bottom: 8.1%;
  left: 10%;
  width: 80%;
  text-align: center;
}

.mode-ribbon {
  background: linear-gradient(#98b6cc, #7f9caf);
  border: 2px solid #d2e8e5;
  border-radius: 30px;
  color: #fffbeb;
  letter-spacing: 1px;
}

.start-button {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(var(--vh, 1vh) * 4.6);
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background: linear-gradient(#fff29e, #ffd575 55%, #edb856);
  border: 3px solid #fff4be;
  border-bottom: 5px solid #bc8850;
  border-radius: 18px;
  color: #765348;
  font-weight: 1000;
  box-shadow: 0 6px 16px #6a4a2a44;
  animation: breathe 2.2s ease-in-out infinite;
}

.start-button::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 8%;
  width: 84%;
  height: 34%;
  border-radius: 12px;
  background: linear-gradient(#ffffffa8, #ffffff00);
  pointer-events: none;
}

.start-button span { font-size: clamp(16px, calc(var(--vh, 1vh) * 2.6), 26px); letter-spacing: 3px; }
.start-button b { font-size: 15px; }

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.difficulty-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 3px;
  padding: 2px;
  background: #fff5dec7;
  border-radius: 12px;
}

.difficulty-switch button {
  padding: 2px 10px;
  border-radius: 9px;
  color: #7e6071;
  font-size: 10px;
  font-weight: 900;
}

.difficulty-switch .is-active {
  background: linear-gradient(#a98fbd, #8e76a4);
  color: #fff;
}

.start-dock p {
  display: table;
  margin: 2px auto 0;
  padding: 1px 8px;
  background: #fff5dec7;
  border-radius: 10px;
  color: #4d6977;
  font-size: 8px;
  font-weight: 800;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8.1%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 4px 8px 7px;
  background: linear-gradient(#fdf5e2f5, #e9d9bfe8);
  border-top: 3px solid #fff8e5;
  pointer-events: auto;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid transparent;
  border-radius: 17px;
  color: #8b6d7c;
}

.bottom-nav span { font-size: 18px; line-height: 1; }
.bottom-nav small { font-size: 11px; font-weight: 900; }

.bottom-nav .selected {
  background: linear-gradient(#f6dfad, #eabf82);
  border-color: #fff0c3;
  color: #765348;
  transform: translateY(-4px);
  box-shadow: 0 4px 0 #bc885077;
}

/* ---------- Shared buttons ---------- */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 900;
}

.primary {
  background: linear-gradient(#ffe99e, #efc274);
  border: 2px solid #fff4be;
  border-bottom: 4px solid #bc8850;
  color: #765348;
}

.secondary {
  background: linear-gradient(#a6cfc5, #6ca89d);
  border: 2px solid #d6ece5;
  border-bottom: 4px solid #4c7f76;
  color: #fffbeb;
}

/* ---------- Dialog overlays ---------- */
.dialog, .message-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88%;
  max-height: 82%;
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: 0 16px 16px;
  background: linear-gradient(135deg, #fff8e9, #f1dfc6);
  border: 3px solid #fff5df;
  border-radius: 25px;
  box-shadow: 0 0 0 100vmax #354b697d, 0 16px 40px #2a3a4c66;
  color: #5d4a5c;
  animation: pop .22s ease-out;
}

.dialog { z-index: 20; }

@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.dialog-cap {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -16px 12px;
  padding: 12px 16px;
  background: linear-gradient(#92b1b9, #6a949d);
  color: #fffbeb;
}

.dialog-cap h2 { margin: 0; font-size: 18px; font-weight: 1000; letter-spacing: 1px; }

.close-button {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff5df;
  color: #6a949d;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

/* Launch notice: a gate before the home menu, so it gets the strongest backdrop */
.notice-dialog { z-index: 40; width: min(88%, 420px); box-shadow: 0 0 0 100vmax #2b3b55b3, 0 16px 40px #2a3a4c66; }
.notice-tag {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: #765348;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
}
.notice-body p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.75; color: #6d5a68; }
.notice-body p:last-child { margin-bottom: 0; }
.notice-body b { color: var(--berry); }

.dialog-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: #6d5a68; }

.dialog > .primary, .dialog > .secondary { width: 100%; margin-top: 14px; }

.map-list, .mission-list, .record-list, .settings-list, .contact-list {
  display: grid;
  gap: 8px;
}

.map-card, .mission-row, .record-row, .setting-row, .contact-list > *, .obstacle-card, .about-card {
  background: #fff8e8;
  border: 2px solid #dcc8ab;
  border-radius: 16px;
}

.map-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.map-card.is-active { border-color: #e9b85f; background: #fff3cf; }
.map-card strong { display: block; font-size: 14px; }
.map-card small { display: block; margin-top: 2px; font-size: 11px; color: #806f78; }
.map-card b { color: #a26b33; font-size: 12px; }
.map-card em { font-style: normal; font-size: 11px; color: #9b8b92; }

.map-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d59aa6, #a8627a);
  color: #fff5df;
  font-size: 22px;
}

.obstacle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.obstacle-card {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 12px 6px;
  text-align: center;
}

.obstacle-card span { font-size: 26px; color: var(--berry); }
.obstacle-card strong { font-size: 14px; }
.obstacle-card small { font-size: 11px; color: #806f78; }

.mission-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.medal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(#ffe99e, #efc274);
  color: #8a5a2c;
  font-size: 18px;
}

.mission-row strong { font-size: 14px; }
.mission-row small { display: block; font-size: 11px; color: #806f78; }
.mission-row b { color: #4e8f82; }
.mission-row .track, .record-list .track { background: #e6d6bd; }
.mission-row .track i { background: #7fb593; }

.nickname-form { margin-bottom: 12px; }
.nickname-form label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 900; }
.nickname-form div { display: flex; gap: 8px; }

.nickname-form input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  background: #fffdf6;
  border: 2px solid #dcc8ab;
  border-radius: 12px;
}

.nickname-form input:focus-visible { border-color: var(--focus); }

.record-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.record-row span { font-weight: 1000; color: #a26b33; }
.record-row b { font-variant-numeric: tabular-nums; }
.record-row.is-you { background: #fff3cf; border-color: #e9b85f; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.setting-row .secondary { min-height: 36px; font-size: 12px; }

.control-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #e7f1ec;
  border: 2px solid #c6ddd3;
  font-size: 12px;
}

.control-note p { margin: 4px 0 0; line-height: 1.7; }

.about-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 16px 12px;
  text-align: center;
}

.about-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(#72b9aa, #518e8a);
  color: #fffbeb;
  font-size: 24px;
}

.about-card small { font-size: 12px; line-height: 1.6; color: #806f78; }

.contact-list > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  color: #5d4a5c;
  text-decoration: none;
}

.contact-list b { color: #4e8f82; font-size: 12px; }

/* ---------- Game message ---------- */
.game-message { position: absolute; inset: 0; z-index: 30; }
.game-message.is-hidden { display: none; }

.message-card { text-align: center; }
.message-card .dialog-cap { flex-direction: column; gap: 2px; }
.message-kicker { font-size: 11px; font-weight: 800; letter-spacing: 1px; opacity: .9; }
.message-title { margin: 0; font-size: 22px; font-weight: 1000; }
.message-copy { margin: 0 0 12px; font-size: 13px; line-height: 1.7; }

.message-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.message-stats:empty { display: none; }

.message-stats span {
  display: grid;
  padding: 8px 4px;
  background: #fff8e8;
  border: 2px solid #dcc8ab;
  border-radius: 12px;
}

.message-stats small { font-size: 10px; color: #806f78; }
.message-stats b { font-size: 17px; color: #765348; }

.message-actions { display: grid; gap: 8px; }

/* ---------- Shop overlay ---------- */
.shop-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#b9dce1cc 0, #b9dce100 22%);
}

.shop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--vh, 1vh) * 2.3) 4% 0;
}

.back-button {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(#fff9e9, #edd7b7);
  border: 2px solid #fff7e6;
  box-shadow: 0 4px 0 #8e7e7866;
  color: #605064;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.shop-header h2 {
  flex: 1;
  margin: 0;
  color: #fffbeb;
  font-size: 20px;
  font-weight: 1000;
  letter-spacing: 1px;
  text-shadow: 0 2px 0 #6a949d, 0 3px 8px #354b6977;
}

.shop-header .wallet-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  background: linear-gradient(#fff9e9, #edd7b7);
  border: 2px solid #fff7e6;
  border-radius: 17px;
  color: #605064;
  font-weight: 900;
}

.shop-name {
  align-self: center;
  flex-shrink: 0;
  max-width: 92%;
  margin-top: 10px;
  padding: 6px 18px;
  border-radius: 16px;
  background: #fff5dee8;
  text-align: center;
  box-shadow: 0 3px 0 #8e7e7855;
}

.shop-name strong { display: block; font-size: 15px; color: #6d5364; }
.shop-name small { font-size: 11px; color: #806f78; }

.shop-showcase { flex: 1; min-height: 72px; margin: 8px 0 0; }

.shop-drawer {
  position: relative;
  flex: 0 0 54%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 4% 12px;
  background: linear-gradient(#fff8e9, #f1dfc6);
  border-top: 3px solid #fff5df;
  border-radius: 27px 27px 0 0;
  box-shadow: 0 -8px 24px #354b6944;
}

.shop-filters { display: flex; flex-shrink: 0; gap: 6px; margin-bottom: 8px; }

.shop-filters button {
  padding: 6px 14px;
  border-radius: 14px;
  background: #efe0c8;
  color: #7e6071;
  font-size: 12px;
  font-weight: 900;
}

.shop-filters .active { background: linear-gradient(#a98fbd, #8e76a4); color: #fff; }

.outfit-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 3px 6px;
  overscroll-behavior: contain;
}

.outfit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 140px;
  padding: 8px 4px;
  background: #fff8e8;
  border: 2px solid #dcc8ab;
  border-radius: 17px;
  text-align: center;
}

.outfit-card canvas { width: 100%; max-width: 106px; height: 88px; object-fit: contain; }
.outfit-card.is-selected { outline: 2px solid var(--focus); outline-offset: 0; }
.outfit-card.is-locked canvas { opacity: .8; }
.outfit-card.is-locked small { color: #756879; }
.outfit-card small { line-height: 1.4; }
.outfit-summary { flex-shrink: 0; margin: 0 0 6px; font-size: 10px; color: #71616c; line-height: 1.5; }
.outfit-actions { flex-shrink: 0; padding-top: 8px; text-align: center; border-top: 1px solid #d8c4a7; }
.outfit-actions p { min-height: 16px; margin: 0 0 6px; font-size: 11px; line-height: 1.5; color: #685464; }
.outfit-actions .primary { width: 100%; min-height: 40px; }
.outfit-actions > small { display: block; margin-top: 6px; font-size: 10px; color: #756471; }

.outfit-card span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e7c6cf, #c797a8);
  color: #fff8ea;
  font-size: 26px;
}

.outfit-card strong { font-size: 13px; color: #5d4a5c; }
.outfit-card small { font-size: 10px; color: #806f78; }

.outfit-card.is-equipped {
  background: #fff3cf;
  border-color: #e9b85f;
  box-shadow: inset 0 0 0 2px #ffe19a;
}

.outfit-card.is-equipped span { background: linear-gradient(#ffe99e, #efc274); color: #8a5a2c; }

/* ---------- Toast ---------- */
#toast {
  position: absolute;
  top: 19%;
  left: 50%;
  z-index: 40;
  max-width: 80%;
  padding: 8px 18px;
  transform: translate(-50%, -8px);
  background: linear-gradient(#fff2bd, #eecf96);
  border: 2px solid #fff7e6;
  border-radius: 16px;
  box-shadow: 0 4px 0 #a88c6788;
  color: #6d5364;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s, transform .2s, visibility .2s;
}

#toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 650px) {
  .desktop-wordmark { display: none; }
  #app { width: 100vw; box-shadow: none; }
}

@media (max-height: 700px) {
  .side-rail { gap: calc(var(--vh, 1vh) * 1.6); }
  .side-rail small { font-size: 9px; }
  .wardrobe-pill { font-size: 11px; }
  .difficulty-switch { margin-top: 5px; }
  .start-dock p { display: none; }
  .outfit-card { min-height: 118px; }
  .outfit-card canvas { height: 64px; }
  .outfit-actions { padding-top: 5px; }
  .outfit-actions > small { display: none; }
  .shop-name { margin-top: 6px; padding: 4px 10px; }
  .shop-drawer { padding-top: 10px; }
  .outfit-card span { width: 42px; height: 42px; font-size: 20px; }
  .bottom-nav small { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
