/* Echo Town and your house. Everything here is scoped to .town-dialog, the rooms and the House / Town buttons. */

.town-dialog {
  width: min(94vw, 540px);
  max-height: min(var(--modal-max-h, 94dvh), 860px);
  overflow: hidden;
  padding: 0;
  border: 1px solid #2c7580;
  border-radius: 18px;
  background: radial-gradient(circle at 85% 8%, rgba(53, 231, 211, .14), transparent 30%), linear-gradient(160deg, #0a2b3b, #061623);
  color: #effffb;
}
.town-dialog::backdrop { background: rgba(1, 8, 16, .84); backdrop-filter: blur(7px); }
.town-dialog button { min-width: 0; min-height: 0; }

.town-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #1d4f61;
  background: rgba(3, 18, 28, .55);
}
.town-bar #town-back, .town-bar #town-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 2px solid #2d6672;
  border-radius: 10px;
  background: #10384a;
  color: #bff7ef;
  font-size: 22px;
  line-height: 1;
}
.town-dialog[data-view="town"] #town-close { display: none; }
.town-title { display: grid; min-width: 0; flex: 1; gap: 4px; }
.town-title strong { overflow: hidden; color: #effffb; font: 11px/1.2 "Press Start 2P", ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.town-title small { overflow: hidden; color: #7fb3b8; font: 7px/1.3 "Press Start 2P", ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.town-shards { display: flex; align-items: center; gap: 4px; padding: 4px 9px 4px 5px; border: 2px solid #285d69; border-radius: 10px; background: #0d3242; }
.town-shards .px-icon { width: 20px; height: 20px; margin: 0; }
.town-shards b { color: #f5bd45; font: 10px/1 "Press Start 2P", ui-monospace, monospace; }

.town-body { max-height: calc(min(var(--modal-max-h, 94dvh), 860px) - 64px); overflow-y: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.town-hint { margin: 10px 2px 0; color: #8fb8bd; font: 8px/1.7 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.town-hint:empty { display: none; }

/* ── The map ── */
.town-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.town-pager span { color: #bff7ef; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.town-pager button { width: 36px; height: 30px; border: 2px solid #2d6672; border-radius: 8px; background: #10384a; color: #bff7ef; font-size: 18px; line-height: 1; }
.town-pager button:disabled { opacity: .35; }
.town-map-wrap { width: fit-content; max-width: 100%; max-height: min(66dvh, 620px); margin: 0 auto; overflow-x: auto; overflow-y: auto; scrollbar-width: none; border: 3px solid #1b1330; border-radius: 12px; background: #1b1330; -webkit-overflow-scrolling: touch; }
.town-map-wrap::-webkit-scrollbar { display: none; }
.town-map { position: relative; margin: 0 auto; cursor: pointer; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.town-map img { image-rendering: pixelated; -webkit-user-drag: none; }
.town-ground { position: absolute; inset: 0; width: 100%; height: 100%; }
.town-building { position: absolute; left: calc(var(--x) * var(--tile)); top: calc(var(--y) * var(--tile)); z-index: var(--z); width: calc(var(--tile) * 3); height: calc(var(--tile) * 3); }
.town-label, .town-sign {
  position: absolute;
  left: calc(var(--x) * var(--tile));
  top: calc(var(--y) * var(--tile));
  z-index: 90;
  width: calc(var(--w) * var(--tile));
  pointer-events: none;
  text-align: center;
}
.town-label { transform: translateY(-3px); color: #fff; font: max(6px, calc(var(--tile) * .19))/1.3 "Press Start 2P", ui-monospace, monospace; text-shadow: 0 1px 0 #1b1330, 1px 0 #1b1330, -1px 0 #1b1330, 0 -1px #1b1330; }
.town-sign { display: grid; gap: 1px; justify-items: center; }
.town-sign b, .town-sign i {
  max-width: 94%;
  overflow: hidden;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(27, 19, 48, .82);
  color: #fff;
  font: 600 calc(var(--tile) * .22)/1.2 "Press Start 2P", ui-monospace, monospace;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.town-sign i { color: #ffd166; font-size: calc(var(--tile) * .2); }
.town-pet, .town-npc { position: absolute; left: 0; top: 0; z-index: var(--z); width: var(--tile); height: var(--tile); pointer-events: none; }
.town-pet { transition: transform var(--step, 0ms) linear; }
.town-npc { left: calc(var(--x) * var(--tile)); top: calc(var(--y) * var(--tile)); }
.town-pet img, .town-npc img { position: absolute; bottom: 2px; left: 50%; height: calc(var(--tile) * 1.55); width: auto; transform: translateX(-50%); filter: drop-shadow(0 2px 0 rgba(27, 19, 48, .35)); }
.town-npc img { height: calc(var(--tile) * 1.35); }

/* ── Rooms ── */
.house-view { display: grid; min-width: 0; gap: 10px; }
.room {
  --wall-color: #f1e2c4;
  --floor-color: #c79a62;
  position: relative;
  width: calc(var(--cell) * 10 + var(--pad, 0px) * 2);
  height: calc(var(--cell) * 7 + var(--pad, 0px));
  box-sizing: content-box;
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid #1b1330;
  border-radius: 10px;
  background: #1b1330;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25);
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.room-wall, .room-floor, .room-board, .room-grid { position: absolute; left: 0; width: 100%; display: block; }
.room-wall { top: 0; height: calc(var(--cell) * 2); background-color: var(--wall-color); }
.room-floor { top: calc(var(--cell) * 2); height: calc(var(--cell) * 5 + var(--pad, 0px)); background-color: var(--floor-color); }
.room-board { top: calc(var(--cell) * 2 - 4px); height: 8px; z-index: 1; background: linear-gradient(#fff6e0 0 2px, #d4b27a 2px 6px, #8c6a3c 6px 8px); }
.room-grid { top: 0; left: var(--pad, 0px); z-index: 300; width: calc(var(--cell) * 10); height: calc(var(--cell) * 7); pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px); background-size: var(--cell) var(--cell); }
.room-item { position: absolute; left: calc(var(--pad, 0px) + var(--x) * var(--cell)); top: calc(var(--y) * var(--cell)); z-index: var(--z); width: calc(var(--w) * var(--cell)); height: calc(var(--h) * var(--cell)); }
.room-item img, .room-pet img { display: block; width: 100%; height: 100%; image-rendering: pixelated; -webkit-user-drag: none; }
.room-item img { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .22)); }
.room.editing .room-item { cursor: pointer; }
.room-item.selected { z-index: 250; animation: room-select .8s ease-in-out infinite alternate; }
.room-item.selected img { filter: drop-shadow(0 0 3px #ffe066) drop-shadow(0 0 1px #ffe066) brightness(1.15); }
@keyframes room-select { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.room-pet { position: absolute; left: calc(var(--pad, 0px) + var(--x) * var(--cell)); top: calc(var(--y) * var(--cell)); z-index: var(--z); width: var(--cell); height: var(--cell); pointer-events: none; transition: left var(--step, .28s) linear, top var(--step, .28s) linear; }
.room-pet img { position: absolute; bottom: 2px; left: 50%; width: auto; height: calc(var(--cell) * 1.75); transform: translateX(-50%); filter: drop-shadow(0 2px 0 rgba(27, 19, 48, .35)); }
.room-pet.hop img { animation: room-hop .6s ease-out; }
@keyframes room-hop { 0%, 100% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(-16px); } 70% { transform: translateX(-50%) translateY(-4px); } }
.room-heart { position: absolute; left: 50%; top: -8px; z-index: 5; color: #ff6b93; font: normal 16px/1 ui-sans-serif, system-ui, sans-serif; text-shadow: 0 1px 0 #1b1330, 1px 0 #1b1330, -1px 0 #1b1330; animation: room-heart 1.2s ease-out forwards; }
@keyframes room-heart { from { opacity: 1; transform: translate(-50%, 0) scale(.7); } to { opacity: 0; transform: translate(-50%, -26px) scale(1.2); } }
.room-loading { padding: 70px 10px; color: #8fb8bd; font: 9px/1.6 "Press Start 2P", ui-monospace, monospace; text-align: center; }

/* wallpapers */
.room[data-wall="cream"], i[data-wall="cream"] { --wall-color: #f1e2c4; }
.room[data-wall="mint"], i[data-wall="mint"] { --wall-color: #bfe8d4; }
.room[data-wall="sky"], i[data-wall="sky"] { --wall-color: #bcd8f2; }
.room[data-wall="rose"], i[data-wall="rose"] { --wall-color: #f2c6d2; }
.room[data-wall="night"], i[data-wall="night"] { --wall-color: #2c3463; }
.room[data-wall="brick"], i[data-wall="brick"] { --wall-color: #b8705a; }
.room[data-wall="cream"] .room-wall, i[data-wall="cream"] { background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--cell, 32px) * 2 - 2px), rgba(120, 90, 40, .12) calc(var(--cell, 32px) * 2 - 2px) calc(var(--cell, 32px) * 2)); }
.room[data-wall="mint"] .room-wall, i[data-wall="mint"] { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 calc(var(--cell, 32px) * .5), transparent calc(var(--cell, 32px) * .5) var(--cell, 32px)); }
.room[data-wall="sky"] .room-wall, i[data-wall="sky"] { background-image: radial-gradient(ellipse at 22% 38%, #fff 0 calc(var(--cell, 32px) * .42), transparent calc(var(--cell, 32px) * .44)), radial-gradient(ellipse at 76% 62%, #fff 0 calc(var(--cell, 32px) * .34), transparent calc(var(--cell, 32px) * .36)); }
.room[data-wall="rose"] .room-wall, i[data-wall="rose"] { background-image: radial-gradient(circle, #e08aa4 0 3px, transparent 4px); background-size: calc(var(--cell, 32px) * .75) calc(var(--cell, 32px) * .75); }
.room[data-wall="night"] .room-wall, i[data-wall="night"] { background-image: radial-gradient(circle, #fff 0 1px, transparent 1.6px), radial-gradient(circle, #ffe9a8 0 1.4px, transparent 2px); background-size: calc(var(--cell, 32px) * .9) calc(var(--cell, 32px) * .7), calc(var(--cell, 32px) * 1.7) calc(var(--cell, 32px) * 1.3); background-position: 0 0, calc(var(--cell, 32px) * .5) calc(var(--cell, 32px) * .4); }
.room[data-wall="brick"] .room-wall, i[data-wall="brick"] { background-image: linear-gradient(rgba(60, 20, 10, .3) 2px, transparent 2px), linear-gradient(90deg, rgba(60, 20, 10, .3) 2px, transparent 2px); background-size: var(--cell, 32px) calc(var(--cell, 32px) * .5), var(--cell, 32px) calc(var(--cell, 32px) * 1); }

/* floors */
.room[data-floor="wood"], i[data-floor="wood"] { --floor-color: #c79a62; }
.room[data-floor="dark_wood"], i[data-floor="dark_wood"] { --floor-color: #7c5436; }
.room[data-floor="tile"], i[data-floor="tile"] { --floor-color: #d9d9e6; }
.room[data-floor="carpet"], i[data-floor="carpet"] { --floor-color: #5a78b4; }
.room[data-floor="grass"], i[data-floor="grass"] { --floor-color: #6fb86a; }
.room[data-floor="stone"], i[data-floor="stone"] { --floor-color: #9aa0ad; }
.room[data-floor="wood"] .room-floor, .room[data-floor="dark_wood"] .room-floor, i[data-floor="wood"], i[data-floor="dark_wood"] {
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px calc(var(--cell, 32px) * .5)), linear-gradient(90deg, rgba(0, 0, 0, .1) 2px, transparent 2px);
  background-size: auto, calc(var(--cell, 32px) * 2.5) calc(var(--cell, 32px) * .5);
}
.room[data-floor="tile"] .room-floor, i[data-floor="tile"] { background-image: conic-gradient(#ececf6 25%, #c9cbdc 0 50%, #ececf6 0 75%, #c9cbdc 0); background-size: var(--cell, 32px) var(--cell, 32px); }
.room[data-floor="carpet"] .room-floor, i[data-floor="carpet"] { background-image: radial-gradient(circle, rgba(255, 255, 255, .16) 0 1.5px, transparent 2px); background-size: calc(var(--cell, 32px) * .25) calc(var(--cell, 32px) * .25); }
.room[data-floor="grass"] .room-floor, i[data-floor="grass"] { background-image: radial-gradient(circle, #4f9d4f 0 1.2px, transparent 1.8px), radial-gradient(circle, #8ad07f 0 1.2px, transparent 1.8px); background-size: calc(var(--cell, 32px) * .4) calc(var(--cell, 32px) * .35), calc(var(--cell, 32px) * .55) calc(var(--cell, 32px) * .5); background-position: 0 0, 7px 5px; }
.room[data-floor="stone"] .room-floor, i[data-floor="stone"] { background-image: linear-gradient(rgba(40, 44, 60, .35) 2px, transparent 2px), linear-gradient(90deg, rgba(40, 44, 60, .35) 2px, transparent 2px); background-size: calc(var(--cell, 32px) * .7) calc(var(--cell, 32px) * .7); }

/* ── Buttons, tabs and cards ── */
.house-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.house-bar button, .house-actions button {
  min-height: 36px;
  padding: 8px 12px;
  border: 2px solid #1b1330;
  border-radius: 8px;
  background: #35e7d3;
  box-shadow: 0 3px 0 #178a85;
  color: #06303a;
  font: 8px/1 "Press Start 2P", ui-monospace, monospace;
}
.house-bar button.on { background: #ffd166; box-shadow: 0 3px 0 #b9892a; }
.house-bar button:active, .house-actions button:active { transform: translateY(2px); box-shadow: 0 1px 0 #178a85; }
.house-charm { color: #ffd166; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.house-bonus { min-width: 0; flex: 1; color: #8fe0d6; font: 6px/1.7 "Press Start 2P", ui-monospace, monospace; text-align: right; }
.house-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.house-actions button:nth-child(n + 2) { background: #12364a; box-shadow: 0 3px 0 #061623; color: #bff7ef; }
.house-banner { padding: 8px 10px; border: 2px dashed #2d6672; border-radius: 8px; background: rgba(6, 31, 46, .7); color: #bfe9e4; font: 7px/1.8 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.house-banner.alert { border-color: #ff7289; color: #ffd2da; }
.house-editor { display: grid; gap: 8px; }
.house-tabs { display: flex; gap: 6px; }
.house-tabs button { flex: 1; min-height: 34px; padding: 7px 4px; border: 2px solid #285d69; border-radius: 8px; background: #0d3242; color: #8fb8bd; font: 7px/1.3 "Press Start 2P", ui-monospace, monospace; }
.house-tabs button.active { border-color: #35e7d3; background: #154d51; color: #effffb; }
.house-chips { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.house-chips::-webkit-scrollbar { display: none; }
.house-chips button { flex: 0 0 auto; min-height: 28px; padding: 6px 8px; border: 2px solid #285d69; border-radius: 7px; background: #0b2938; color: #7fa5aa; font: 6px/1 "Press Start 2P", ui-monospace, monospace; }
.house-chips button.active { border-color: #ffd166; color: #ffd166; }
.house-panel { max-height: 240px; overflow-y: auto; padding: 2px; -webkit-overflow-scrolling: touch; }
.house-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.house-card {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 4px;
  padding: 8px 6px 8px;
  border: 2px solid #285d69;
  border-radius: 10px;
  background: #0b2938;
  color: #d8f6f1;
  text-align: center;
}
.house-card img { display: block; width: auto; max-width: 64px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.house-card b { color: #effffb; font: 600 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.house-card small { color: #7fa5aa; font: 9px/1.35 ui-sans-serif, system-ui, sans-serif; }
.house-card em { color: #9bd; font: normal 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.house-card.uncommon { border-color: #3d8f5f; }
.house-card.rare { border-color: #4a7fd6; }
.house-card.epic { border-color: #a068e0; background: #1d1a3d; }
.house-card.uncommon em { color: #6ee09a; }
.house-card.rare em { color: #7fb2ff; }
.house-card.epic em { color: #d1a6ff; }
.house-card.active { border-color: #ffe066; box-shadow: 0 0 0 2px rgba(255, 224, 102, .35); background: #153e4a; }
.house-card.shop button, .house-card.found span {
  min-height: 28px;
  margin-top: 2px;
  padding: 6px 8px;
  border: 2px solid #1b1330;
  border-radius: 7px;
  background: #ffd166;
  box-shadow: 0 2px 0 #b9892a;
  color: #3a2406;
  font: 7px/1.2 "Press Start 2P", ui-monospace, monospace;
}
.house-card.shop button { display: inline-flex; align-items: center; gap: 3px; }
.house-card.shop button .px-icon { width: 14px; height: 14px; margin: 0; }
.house-card.shop button:disabled { background: #3a4a52; box-shadow: none; color: #7c8b92; }
.house-card.found { opacity: .85; }
.house-card.found:not(.got) img { filter: brightness(0) invert(.25); }
.house-card.found span { background: #24323d; box-shadow: none; color: #7c8b92; }
.house-card.found.got span { background: #1f6a4b; color: #b9ffd9; }
.house-subhead { margin: 12px 2px 6px; color: #ffd166; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.house-empty { margin: 14px 4px; color: #8fb8bd; font: 8px/1.8 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.house-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 2px solid #285d69; border-radius: 10px; background: #0b2938; color: #d8f6f1; }
.swatch i { display: block; width: 100%; height: 34px; border: 2px solid #1b1330; border-radius: 6px; background-color: var(--wall-color, var(--floor-color)); --cell: 28px; }
.swatch b { font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.swatch small { color: #ffd166; font: 6px/1 "Press Start 2P", ui-monospace, monospace; }
.swatch.worn { border-color: #35e7d3; background: #154d51; }
.house-visitors { padding: 8px 10px; border: 2px solid #285d69; border-radius: 10px; background: rgba(6, 31, 46, .7); }
.house-visitors b { color: #ffd166; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.house-visitors span { display: block; margin-top: 6px; color: #8fb8bd; font: 9px/1.4 ui-sans-serif, system-ui, sans-serif; }
.house-visitors ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.house-visitors li { padding: 4px 8px; border-radius: 12px; background: #12364a; color: #d8f6f1; font: 600 10px/1.3 ui-sans-serif, system-ui, sans-serif; }
.house-visitors li small { margin-left: 5px; color: #7fa5aa; font-weight: 400; }

/* ── House and Town buttons on the Home screen ── */
.habitat-quick { position: absolute; left: 10px; top: 30px; z-index: 14; display: flex; gap: 6px; }
.habitat-quick .habitat-sanctum-pill { margin: 0; min-width: 0; min-height: 34px; padding: 4px 10px; }

.habitat-town-pill { border-color: rgba(125, 211, 252, .5); color: #bae6fd; }

/* ── Old Mossbeard's shop ── */
.town-dialog[data-view="shop"] { border-color: #8a5a34; background: linear-gradient(160deg, #3a2417, #20130c); }
.town-dialog[data-view="shop"] .town-bar { border-bottom-color: #5b3a22; background: rgba(32, 18, 10, .7); }
.shop-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.shop-view > * { min-width: 0; }
.shop-wall {
  position: relative;
  padding: 44px 8px 8px;
  border: 3px solid #1b1330;
  border-radius: 12px 12px 0 0;
  background:
    radial-gradient(ellipse at 18% 0, rgba(255, 214, 120, .35), transparent 55%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 46px),
    linear-gradient(#a8703f, #8f5a32);
  box-shadow: inset 0 0 40px rgba(40, 20, 8, .55);
}
.shop-sign { position: absolute; left: 50%; top: 6px; max-width: 88%; display: grid; justify-items: center; gap: 2px; padding: 5px 12px; border: 2px solid #1b1330; border-radius: 6px; background: #4a2c18; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); transform: translateX(-50%); text-align: center; }
.shop-sign span { color: #ffd166; font: 8px/1.2 "Press Start 2P", ui-monospace, monospace; white-space: nowrap; }
.shop-sign small { color: #e4c89c; font: 5px/1.3 "Press Start 2P", ui-monospace, monospace; white-space: nowrap; }
.shop-lamp { position: absolute; left: 8%; top: -3px; width: 4px; height: 20px; background: #1b1330; transform-origin: top center; animation: shop-sway 4.2s ease-in-out infinite; }
.shop-lamp::after { content: ""; position: absolute; left: -9px; top: 16px; width: 22px; height: 24px; border: 2px solid #1b1330; border-radius: 4px 4px 9px 9px; background: radial-gradient(circle, #fff6b0 0 30%, #ffc94d 70%); box-shadow: 0 0 22px 8px rgba(255, 200, 80, .55); animation: shop-flicker 3.1s ease-in-out infinite; }
.shop-window { position: absolute; right: 6%; top: 8px; width: 40px; height: 26px; border: 3px solid #1b1330; border-radius: 3px; background: linear-gradient(#bfe6ff 0 55%, #7fc27a 55%); box-shadow: 0 0 0 2px #d9a066; }
.shop-window::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 3px; background: #1b1330; }
.shop-bell { position: absolute; right: 22%; top: -2px; z-index: 3; display: block; width: 26px; height: 30px; padding: 0; border: 0; background: none; transform-origin: top center; }
.shop-bell::before { content: ""; position: absolute; left: 50%; top: -6px; width: 3px; height: 10px; background: #1b1330; transform: translateX(-50%); }
.shop-bell img { display: block; width: 26px; height: 26px; image-rendering: pixelated; margin-top: 4px; }
.shop-bell.ring { animation: shop-ring 1.1s ease-out; }
@keyframes shop-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes shop-flicker { 0%, 100% { filter: brightness(1); } 45% { filter: brightness(1.12); } 55% { filter: brightness(.92); } 70% { filter: brightness(1.08); } }
@keyframes shop-ring { 0% { transform: rotate(0); } 15% { transform: rotate(28deg); } 35% { transform: rotate(-24deg); } 55% { transform: rotate(16deg); } 75% { transform: rotate(-8deg); } 100% { transform: rotate(0); } }

.shop-tabs { display: flex; gap: 5px; margin: 0 -2px 8px; padding: 2px 2px 4px; overflow-x: auto; scrollbar-width: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs button { flex: 0 0 auto; position: relative; min-height: 28px; padding: 6px 9px; border: 2px solid #1b1330; border-radius: 4px; background: #5b3a22; color: #e4c89c; font: 6px/1.2 "Press Start 2P", ui-monospace, monospace; box-shadow: 0 3px 0 #2b190d; }
.shop-tabs button::before { content: ""; position: absolute; left: 50%; top: -7px; width: 2px; height: 6px; background: #1b1330; }
.shop-tabs button.active { background: #ffd166; color: #3a2406; transform: translateY(-2px); box-shadow: 0 5px 0 #b9892a; }

.shop-shelves { display: grid; gap: 6px; }
.shelf-row { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 4px; min-height: 84px; padding: 0 4px 10px; background: linear-gradient(rgba(30, 14, 6, .5), rgba(30, 14, 6, .22)); border-radius: 3px 3px 0 0; }
.shelf-row::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: 0; height: 10px; border: 2px solid #1b1330; border-radius: 2px; background: linear-gradient(#d29a5c 0 3px, #9b6a3a 3px 7px, #6d4524 7px); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.shelf-slot { position: relative; z-index: 1; display: grid; justify-items: center; align-content: end; gap: 3px; min-width: 0; min-height: 0; padding: 2px 0 0; border: 0; background: none; color: #fff; animation: slot-in .35s ease backwards; animation-delay: calc(var(--i) * 25ms); }
.slot-art { display: grid; width: 100%; height: 54px; place-items: end center; }
.slot-art img { display: block; max-width: 86%; max-height: 52px; width: auto; height: auto; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); transition: transform .15s ease; }
.slot-swatch { display: block; width: 78%; height: 40px; border: 2px solid #1b1330; border-radius: 5px; background-color: var(--wall-color, var(--floor-color)); --cell: 26px; }
.slot-swatch.big { width: 54px; height: 44px; }
.slot-price { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px; border-radius: 4px; background: #1b1330; color: #ffd166; font: 6px/1.2 "Press Start 2P", ui-monospace, monospace; white-space: nowrap; }
.slot-price .px-icon { width: 11px; height: 11px; margin: 0; }
.shelf-slot.pricey .slot-price { color: #ff8da1; }
.shelf-slot:active .slot-art img { transform: translateY(-3px); }
.shelf-slot.selected .slot-art { animation: slot-lift .9s ease-in-out infinite alternate; }
.shelf-slot.selected .slot-art img, .shelf-slot.selected .slot-swatch { filter: drop-shadow(0 0 4px #ffe066) drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.shelf-slot.selected .slot-price { background: #ffd166; color: #3a2406; }
.shelf-slot.rare .slot-art::after, .shelf-slot.epic .slot-art::after { content: "✦"; position: absolute; top: 2px; right: 10%; color: #fff6b0; font-size: 10px; animation: twinkle 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * 140ms); }
.shelf-slot.epic .slot-art::after { color: #e2bbff; }
.shelf-slot.unknown img { filter: brightness(0) invert(.3); }
.shelf-slot.sold .slot-art { animation: slot-sold .45s ease-in forwards; }
@keyframes slot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slot-lift { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes slot-sold { to { opacity: 0; transform: translateY(40px) scale(.5); } }
.shelf-filler { display: grid; place-items: end center; height: 54px; pointer-events: none; opacity: .38; filter: saturate(.6) brightness(.8); }
.shelf-filler img { max-width: 70%; max-height: 40px; width: auto; height: auto; image-rendering: pixelated; }
.shelf-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 2px; }
.shelf-pager span { color: #f0d7ae; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.shelf-pager button { width: 32px; height: 26px; border: 2px solid #1b1330; border-radius: 5px; background: #5b3a22; color: #ffd166; font-size: 16px; line-height: 1; }
.shelf-pager button:disabled { opacity: .35; }

.shop-front { position: relative; }
.shop-keeper-wrap { position: relative; display: flex; align-items: flex-end; gap: 6px; min-height: 100px; padding: 0 6px; margin-bottom: -26px; z-index: 1; }
.shop-keeper { flex: 0 0 auto; width: 118px; height: 118px; padding: 0; border: 0; background: none; transform-origin: bottom center; animation: keeper-breathe 3.2s ease-in-out infinite; }
.shop-keeper img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
@keyframes keeper-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.03); } }
.shop-bubble { position: relative; align-self: flex-start; flex: 1; min-height: 52px; margin-top: 6px; padding: 9px 11px; border: 3px solid #1b1330; border-radius: 12px; background: #fff7e0; color: #3a2406; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.shop-bubble::before { content: ""; position: absolute; left: -11px; bottom: 14px; width: 14px; height: 14px; border-left: 3px solid #1b1330; border-bottom: 3px solid #1b1330; background: #fff7e0; transform: rotate(45deg); }
.shop-bubble.pop { animation: bubble-pop .25s ease-out; }
@keyframes bubble-pop { from { transform: scale(.94); } to { transform: scale(1); } }
.shop-counter { position: relative; z-index: 2; padding: 10px 8px 8px; border: 3px solid #1b1330; border-radius: 0 0 12px 12px; background: linear-gradient(#c88a4f 0 6px, #9b6a3a 6px 14px, #7a4f2a 14px); box-shadow: 0 5px 0 rgba(0, 0, 0, .3); }
.counter-coins { position: absolute; right: 8px; top: -22px; width: 30px; height: 30px; image-rendering: pixelated; }
.shop-detail { margin-top: 8px; }
.detail-empty { padding: 10px; border: 2px dashed #5b3a22; border-radius: 8px; background: rgba(32, 18, 10, .35); color: #f0d7ae; font: 7px/1.8 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.detail-card { display: grid; grid-template-columns: 58px 1fr; gap: 4px 10px; align-items: center; padding: 8px; border: 2px solid #1b1330; border-radius: 8px; background: #fff3d6; color: #3a2406; box-shadow: inset 0 0 0 2px #e6c88f; }
.detail-card.uncommon { background: #e7f6dc; }
.detail-card.rare { background: #dfeafc; }
.detail-card.epic { background: #eadcfb; }
.detail-art { display: grid; width: 58px; height: 58px; place-items: center; border: 2px solid #1b1330; border-radius: 8px; background: rgba(255, 255, 255, .55); }
.detail-art img { max-width: 48px; max-height: 48px; width: auto; height: auto; object-fit: contain; image-rendering: pixelated; }
.detail-text { display: grid; gap: 3px; min-width: 0; }
.detail-text b { font: 600 8px/1.35 "Press Start 2P", ui-monospace, monospace; }
.detail-text small { font: 11px/1.35 ui-sans-serif, system-ui, sans-serif; }
.detail-text em { color: #7a5a2a; font: normal 6px/1.5 "Press Start 2P", ui-monospace, monospace; }
.detail-buy { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.detail-buy button { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 7px 12px; border: 2px solid #1b1330; border-radius: 7px; background: #ffd166; box-shadow: 0 3px 0 #b9892a; color: #3a2406; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.detail-buy button .px-icon { width: 16px; height: 16px; margin: 0; }
.detail-buy button:disabled { background: #c9bda5; box-shadow: none; color: #7c6e55; }
.detail-buy button.detail-home { background: #35e7d3; box-shadow: 0 3px 0 #178a85; color: #06303a; }
.detail-note { color: #5a3d14; font: 600 11px/1.4 ui-sans-serif, system-ui, sans-serif; text-align: right; }
.house-bar .house-shop-link { background: #ffd166; box-shadow: 0 3px 0 #b9892a; }

@media (max-width: 380px) {
  .shop-sign small { display: none; }
  .shop-sign span { font-size: 7px; }
  .shop-keeper { width: 96px; height: 96px; }
  .shop-keeper-wrap { min-height: 84px; }
  .slot-art { height: 46px; }
  .slot-art img { max-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-lamp, .shop-lamp::after, .shop-keeper, .shelf-slot, .shelf-slot.selected .slot-art, .shop-bell.ring, .shop-bubble.pop, .slot-art::after { animation: none !important; }
}
html.battery-saver .town-weather, html.battery-saver .town-glow.lamp { animation: none !important; }
html.battery-saver .shop-lamp, html.battery-saver .shop-lamp::after, html.battery-saver .shop-keeper, html.battery-saver .slot-art::after { animation: none !important; }

/* ── Live town: friends walking around, dots, emotes ── */
.town-live-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.town-live-bar span { color: #7fa5aa; font: 7px/1.4 "Press Start 2P", ui-monospace, monospace; }
.town-live-bar span.on { color: #6ee09a; }
.town-live-bar button { min-height: 26px; padding: 6px 10px; border: 2px solid #1b1330; border-radius: 7px; background: #35e7d3; box-shadow: 0 3px 0 #178a85; color: #06303a; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.town-live-bar #town-zoom { margin-left: auto; background: #0f4c6a; box-shadow: 0 3px 0 #082c40; color: #bff7ef; }
.town-live-bar button[aria-checked="false"] { background: #3a4a52; box-shadow: 0 3px 0 #1d272c; color: #aab8bd; }
.sign-dot { display: none; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; text-decoration: none; background: #6ee09a; box-shadow: 0 0 0 1px #1b1330; }
.sign-dot.recent, .sign-dot.live { display: inline-block; }
.sign-dot.live { animation: live-dot 1.2s ease-in-out infinite; }
@keyframes live-dot { 0%, 100% { box-shadow: 0 0 0 1px #1b1330, 0 0 0 1px rgba(110, 224, 154, .9); } 50% { box-shadow: 0 0 0 1px #1b1330, 0 0 0 5px rgba(110, 224, 154, 0); } }
.town-npc.away { visibility: hidden; }
.town-live { position: absolute; left: 0; top: 0; z-index: var(--z); width: var(--tile); height: var(--tile); pointer-events: none; transition: transform var(--step, 0ms) linear, opacity .45s ease; }
.town-live img { position: absolute; bottom: 2px; left: 50%; height: calc(var(--tile) * 1.55); width: auto; transform: translateX(-50%); filter: drop-shadow(0 2px 0 rgba(27, 19, 48, .35)); image-rendering: pixelated; }
.town-live.arriving { animation: live-arrive .6s ease-out; }
.town-live.leaving { opacity: 0; }
@keyframes live-arrive { from { opacity: 0; transform: translate(var(--arrive-x, 0), -10px) scale(.7); } }
.live-name { position: absolute; left: 50%; bottom: calc(var(--tile) * 1.62); max-width: calc(var(--tile) * 3); padding: 1px 4px; border-radius: 4px; background: rgba(27, 19, 48, .82); color: #fff; font: 600 calc(var(--tile) * .2)/1.3 "Press Start 2P", ui-monospace, monospace; text-overflow: ellipsis; overflow: hidden; transform: translateX(-50%); white-space: nowrap; }
.town-emote { position: absolute; left: 50%; bottom: calc(var(--tile) * 2.15); z-index: 3; padding: 2px 5px; border: 2px solid #1b1330; border-radius: 10px; background: #fff7e0; font: normal calc(var(--tile) * .55)/1 ui-sans-serif, system-ui, sans-serif; transform: translateX(-50%); animation: emote-pop 3.2s ease-out forwards; pointer-events: none; }
.town-pet .town-emote { bottom: calc(var(--tile) * 1.7); }
@keyframes emote-pop { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.5); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 18% { transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }
.town-card-slot:empty { display: none; }
.town-card { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 10px; border: 2px solid #285d69; border-radius: 10px; background: rgba(6, 31, 46, .85); color: #d8f6f1; }
.town-card > div { display: grid; flex: 1; gap: 3px; min-width: 0; }
.town-card b { color: #ffd166; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.town-card small { color: #8fb8bd; font: 10px/1.3 ui-sans-serif, system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.town-card button { min-height: 32px; padding: 6px 10px; border: 2px solid #1b1330; border-radius: 7px; background: #35e7d3; box-shadow: 0 3px 0 #178a85; color: #06303a; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.town-card button.emote { padding: 4px 8px; background: #fff7e0; box-shadow: 0 3px 0 #b99a5a; font: normal 18px/1 ui-sans-serif, system-ui, sans-serif; }
.town-card button[data-card-close] { background: #12364a; box-shadow: 0 3px 0 #061623; color: #bff7ef; }

/* ── Day, night and weather in the town and the shop ── */
.town-weather { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.town-dialog[data-time="night"] .town-weather { background: rgba(14, 20, 66, .5); mix-blend-mode: multiply; }
.town-dialog[data-season="fall"] .town-weather { box-shadow: inset 0 0 0 999px rgba(255, 150, 40, .09); }
.town-dialog[data-season="winter"] .town-weather { box-shadow: inset 0 0 0 999px rgba(170, 205, 255, .12); }
.town-dialog[data-weather="heat"] .town-weather { box-shadow: inset 0 0 0 999px rgba(255, 190, 60, .1); }
.town-dialog[data-weather="rain"] .town-weather {
  background-image: repeating-linear-gradient(105deg, rgba(190, 220, 255, .0) 0 9px, rgba(190, 220, 255, .55) 9px 10px, rgba(190, 220, 255, 0) 10px 17px);
  background-size: 34px 34px;
  animation: town-rain .45s linear infinite;
  box-shadow: inset 0 0 0 999px rgba(40, 70, 110, .14);
}
.town-dialog[data-weather="rain"][data-time="night"] .town-weather { background-color: rgba(14, 20, 66, .5); }
.town-dialog[data-weather="snow"] .town-weather {
  background-image: radial-gradient(circle, #fff 0 1.5px, transparent 2px), radial-gradient(circle, rgba(255, 255, 255, .8) 0 1px, transparent 1.6px);
  background-size: 44px 52px, 29px 37px;
  animation: town-snow 6s linear infinite;
}
.town-dialog[data-weather="wind"] .town-weather {
  background-image: repeating-linear-gradient(0deg, transparent 0 46px, rgba(255, 255, 255, .22) 46px 47px, transparent 47px 90px);
  background-size: 120px 90px;
  animation: town-wind 1.8s linear infinite;
}
@keyframes town-rain { to { background-position: -14px 34px; } }
@keyframes town-snow { to { background-position: 14px 52px, -9px 37px; } }
@keyframes town-wind { to { background-position: 120px 0; } }
.town-glow { position: absolute; z-index: 75; display: none; pointer-events: none; mix-blend-mode: screen; border-radius: 50%; }
.town-dialog[data-time="night"] .town-glow { display: block; }
.town-glow.lamp { left: calc((var(--x) - .9) * var(--tile)); top: calc((var(--y) - .7) * var(--tile)); width: calc(var(--tile) * 2.8); height: calc(var(--tile) * 2.8); background: radial-gradient(circle, rgba(255, 214, 120, .75), rgba(255, 190, 80, .22) 45%, transparent 70%); animation: lamp-flicker 3.4s ease-in-out infinite; }
.town-glow.door { left: calc((var(--x) - .35) * var(--tile)); top: calc((var(--y) - .2) * var(--tile)); width: calc(var(--tile) * 1.7); height: calc(var(--tile) * 1.7); background: radial-gradient(circle, rgba(255, 224, 150, .6), transparent 68%); }
@keyframes lamp-flicker { 0%, 100% { opacity: 1; } 50% { opacity: .82; } 70% { opacity: .95; } }
/* the shop window and lantern follow the real time of day */
.town-dialog[data-time="night"] .shop-window { background: linear-gradient(#0f1747 0 55%, #1f3a3a 55%); box-shadow: 0 0 0 2px #d9a066, inset 0 0 8px rgba(255, 255, 255, .15); }
.town-dialog[data-time="night"] .shop-window::after { content: ""; position: absolute; inset: 3px auto auto 4px; width: 3px; height: 3px; background: #fff; box-shadow: 14px 5px 0 #ffe9a8, 22px 1px 0 #fff; }
.town-dialog[data-weather="rain"] .shop-window { background: linear-gradient(#8aa0b8 0 55%, #5d8a6a 55%); }
.town-dialog[data-time="night"] .shop-wall { filter: brightness(.82) saturate(.95); }
.town-dialog[data-time="night"] .shop-lamp::after { box-shadow: 0 0 30px 12px rgba(255, 200, 80, .7); }

/* ── "NEW" badge on the Home buttons until they have been opened once ── */
.habitat-quick .hint-new { position: relative; }
.habitat-quick .hint-new::after { content: "NEW"; position: absolute; right: -6px; top: -9px; padding: 2px 5px; border: 2px solid #1b1330; border-radius: 8px; background: #ff6b93; color: #fff; font: 600 6px/1 "Press Start 2P", ui-monospace, monospace; animation: hint-bob 1.1s ease-in-out infinite; }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.town-card.welcome { border-color: #ffd166; background: rgba(46, 32, 6, .85); }
.town-card.welcome small { white-space: normal; line-height: 1.45; }

@media (max-width: 420px) {
  .town-body { padding: 8px; }
  .house-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .room-item.selected, .room-pet.hop img, .room-heart { animation: none; }
  .room-pet, .town-pet, .town-live { transition: none; }
  .sign-dot.live, .town-live.arriving { animation: none; }
  .town-weather, .town-glow.lamp, .habitat-quick .hint-new::after { animation: none; }
}
html.battery-saver .room-item.selected { animation: none; }

/* ── The Mochi Cafe and the Festival Stall: the same counter, a different room ── */
.town-dialog[data-store="cafe"] { border-color: #c77a96; background: linear-gradient(160deg, #4a2a36, #2a161e); }
.town-dialog[data-store="cafe"] .town-bar { border-bottom-color: #7a3f56; background: rgba(42, 20, 30, .7); }
.shop-view[data-store="cafe"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 220, 230, .45), transparent 55%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 46px), linear-gradient(#f4c6d4, #e8a9bd); }
.shop-view[data-store="cafe"] .shop-sign { background: #5a8f80; }
.shop-view[data-store="cafe"] .shop-sign small { color: #d6f3e7; }
.shop-view[data-store="cafe"] .shop-tabs button { background: #8a4a63; color: #ffe3ec; box-shadow: 0 3px 0 #4b2335; }
.shop-view[data-store="cafe"] .shop-tabs button.active { background: #bff1de; color: #0f3a2c; box-shadow: 0 5px 0 #5aa58a; }
.shop-view[data-store="cafe"] .shelf-row::after { background: linear-gradient(#f4ecdf 0 3px, #cfc2b0 3px 7px, #a99a84 7px); }
.shop-view[data-store="cafe"] .shop-counter { background: linear-gradient(#f4ecdf 0 6px, #d8c8b2 6px 14px, #b5a38b 14px); }
.shop-view[data-store="cafe"] .shop-lamp::after { background: radial-gradient(circle, #fff0f6 0 30%, #ffb3cc 70%); box-shadow: 0 0 22px 8px rgba(255, 170, 200, .55); }
.shop-view[data-store="cafe"] .shop-window { background: linear-gradient(#bfe6ff 0 55%, #ffd1dc 55%); box-shadow: 0 0 0 2px #fff; }

.town-dialog[data-store="festival"] { border-color: #3d8f6a; background: linear-gradient(160deg, #1f3a30, #0f2019); }
.town-dialog[data-store="festival"] .town-bar { border-bottom-color: #2c6a50; background: rgba(12, 30, 22, .7); }
.shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 240, 170, .35), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#7aa8d8, #5e86c0); }
.town-dialog[data-festival="raya"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 224, 130, .45), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#4fa878, #347f58); }
.town-dialog[data-festival="christmas"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 240, 200, .4), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#c9505a, #a23441); }
.town-dialog[data-festival="spring"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 255, 255, .5), transparent 55%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 2px, transparent 2px 46px), linear-gradient(#f6b9d3, #ea94bb); }
.town-dialog[data-festival="cny"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 226, 120, .5), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#d8453c, #a8281f); }
.town-dialog[data-festival="deepavali"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 220, 120, .55), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#8a4ab8, #5b2c8a); }
.town-dialog[data-festival="merdeka"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 255, 255, .45), transparent 55%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 2px, transparent 2px 46px), linear-gradient(#2c4ea6, #1a2f78); }
.town-dialog[data-festival="haji"] .shop-view[data-store="festival"] .shop-wall { background: radial-gradient(ellipse at 18% 0, rgba(255, 238, 170, .45), transparent 55%), repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 46px), linear-gradient(#3f9aa5, #28707e); }
.town-dialog[data-festival="cny"] .town-glow.lamp { background: radial-gradient(circle, rgba(255, 120, 90, .8), rgba(255, 200, 90, .2) 48%, transparent 70%); }
.town-dialog[data-festival="deepavali"] .town-glow.lamp { background: radial-gradient(circle, rgba(255, 176, 60, .85), rgba(255, 120, 200, .2) 48%, transparent 70%); }
.town-dialog[data-festival="cny"] .town-weather { box-shadow: inset 0 0 0 999px rgba(255, 80, 60, .05); }
.town-dialog[data-festival="deepavali"] .town-weather { box-shadow: inset 0 0 0 999px rgba(255, 170, 60, .06); }
.shop-view[data-store="festival"] .shop-sign { background: #1f4a3a; }
.shop-view[data-store="festival"] .shop-tabs button { background: #2c6a50; color: #d6f3e7; box-shadow: 0 3px 0 #123325; }
.shop-view[data-store="festival"] .shop-tabs button.active { background: #ffd166; color: #3a2406; box-shadow: 0 5px 0 #b9892a; }
.shop-view[data-store="festival"] .shop-counter { background: linear-gradient(#d9b27c 0 6px, #a9794a 6px 14px, #7d5430 14px); }
.shelf-slot.locked .slot-art img { filter: grayscale(.85) brightness(.75) drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.shelf-slot.locked .slot-price { background: #3a4a52; color: #aab8bd; }

/* your pet at the counter, so an order is something you can see */
.store-pet { position: relative; z-index: 3; flex: 0 0 auto; align-self: flex-end; display: block; width: 64px; height: 64px; margin: 0 2px 22px 0; padding: 0; border: 0; background: none; transform-origin: bottom center; }
.store-pet img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(27, 19, 48, .35)); }
.store-pet .town-emote { bottom: 100%; }
.store-pet.hop { animation: store-hop .6s ease-out; }
@keyframes store-hop { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-14px) scale(1.06, .96); } 50% { transform: translateY(0) scale(.96, 1.04); } 70% { transform: translateY(-5px); } }
.detail-buy .detail-note { flex: 1 1 100%; }

/* ── Festival dressing in the town ── */
.town-label.spot { color: #eaf7ff; }
.town-deco { position: absolute; left: calc(var(--x) * var(--tile)); top: calc(var(--y) * var(--tile)); z-index: var(--z); width: calc(var(--tile) * var(--w)); height: calc(var(--tile) * var(--h)); object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.town-deco.hung { filter: drop-shadow(0 2px 0 rgba(27, 19, 48, .3)); animation: deco-sway 3.6s ease-in-out infinite; transform-origin: top center; }
.town-deco.hung.small { width: calc(var(--tile) * .62); height: calc(var(--tile) * .62); margin: calc(var(--tile) * .05) 0 0 calc(var(--tile) * .38); }
@keyframes deco-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.town-dialog[data-festival="christmas"] .town-weather {
  background-image: radial-gradient(circle, rgba(255, 255, 255, .95) 0 1.4px, transparent 2px);
  background-size: 52px 60px;
  animation: town-snow 8s linear infinite;
}
.town-dialog[data-festival="spring"] .town-weather {
  background-image: radial-gradient(ellipse 3px 2px at 50% 50%, rgba(255, 182, 210, .95) 0 90%, transparent 100%), radial-gradient(ellipse 2px 3px at 50% 50%, rgba(255, 214, 230, .9) 0 90%, transparent 100%);
  background-size: 58px 66px, 37px 45px;
  animation: town-petals 9s linear infinite;
}
.town-dialog[data-festival="raya"] .town-glow.lamp { background: radial-gradient(circle, rgba(255, 196, 90, .8), rgba(120, 220, 140, .2) 48%, transparent 70%); }
.town-dialog[data-festival="raya"] .town-weather { box-shadow: inset 0 0 0 999px rgba(255, 190, 70, .06); }
.town-dialog[data-festival="christmas"][data-weather="rain"] .town-weather,
.town-dialog[data-festival="christmas"][data-weather="snow"] .town-weather,
.town-dialog[data-festival="spring"][data-weather="rain"] .town-weather,
.town-dialog[data-festival="spring"][data-weather="snow"] .town-weather { animation-duration: .45s; }
@keyframes town-petals { to { background-position: 40px 66px, -22px 45px; } }

/* ── Fishing on the map, and the pond dex ── */
.town-dialog[data-view="fish"] { border-color: #3d86b8; background: linear-gradient(160deg, #173a52, #0b1d2b); }
.town-dialog[data-view="fish"] .town-bar { border-bottom-color: #2a6086; background: rgba(8, 24, 38, .7); }
.pond-fish { position: absolute; left: calc(var(--x) * var(--tile)); top: calc(var(--y) * var(--tile)); z-index: 2; width: calc(var(--tile) * var(--size) * 1.6); height: calc(var(--tile) * var(--size) * .62); pointer-events: none; opacity: .6; animation: pond-swim var(--dur) linear var(--delay) infinite; }
.pond-fish::before { content: ""; position: absolute; inset: 0 24% 0 0; border-radius: 50%; background: rgba(6, 44, 104, .42); }
.pond-fish::after { content: ""; position: absolute; right: 0; top: 8%; width: 32%; height: 84%; background: rgba(6, 44, 104, .42); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
@keyframes pond-swim {
  0% { transform: translate(0, 0) scaleX(1); }
  47% { transform: translate(calc(var(--tile) * var(--swim) * -1.1), calc(var(--tile) * .1)) scaleX(1); }
  50% { transform: translate(calc(var(--tile) * var(--swim) * -1.1), calc(var(--tile) * .1)) scaleX(-1); }
  97% { transform: translate(0, 0) scaleX(-1); }
  100% { transform: translate(0, 0) scaleX(1); }
}
.town-pet.face-right img { transform: translateX(-50%) scaleX(-1); }
.fish-svg { position: absolute; left: 0; top: 0; z-index: 94; overflow: visible; pointer-events: none; }
#fish-rod { fill: none; stroke: #b27a40; stroke-width: calc(var(--tile) * .07); stroke-linecap: round; }
#fish-line { fill: none; stroke: rgba(255, 255, 255, .92); stroke-width: max(1.5px, calc(var(--tile) * .03)); }
.fish-bobber { position: absolute; z-index: 96; width: calc(var(--tile) * .3); height: calc(var(--tile) * .3); margin: calc(var(--tile) * -.15) 0 0 calc(var(--tile) * -.15); border: 2px solid #1b1330; border-radius: 50%; background: linear-gradient(#ff5a6a 0 50%, #fff 50%); pointer-events: none; }
.fish-bobber[hidden] { display: none; }
.fish-bobber s { display: none; position: absolute; bottom: 125%; left: 50%; padding: 1px 6px; border: 2px solid #1b1330; border-radius: 8px; background: #fff7a0; color: #b3202f; font: 700 calc(var(--tile) * .34)/1 "Press Start 2P", ui-monospace, monospace; text-decoration: none; transform: translateX(-50%); }
.fish-bobber.bite s { display: block; animation: bite-pop .3s ease-out; }
.fish-bobber.nibble { animation: bob-nibble .38s ease-in-out; }
.fish-bobber.bite { animation: bob-dip .22s ease-in-out infinite; }
.fish-bobber.fight { animation: bob-thrash .16s ease-in-out infinite alternate; }
@keyframes bob-nibble { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(calc(var(--tile) * .14)); } }
@keyframes bob-dip { 0%, 100% { transform: translateY(calc(var(--tile) * .06)); } 50% { transform: translateY(calc(var(--tile) * .24)); } }
@keyframes bob-thrash { from { transform: translate(calc(var(--tile) * -.05), 0) rotate(-12deg); } to { transform: translate(calc(var(--tile) * .05), calc(var(--tile) * .05)) rotate(12deg); } }
@keyframes bite-pop { from { transform: translateX(-50%) scale(.4); } to { transform: translateX(-50%) scale(1); } }
.fish-shadow { position: absolute; z-index: 3; width: calc(var(--tile) * var(--size, .42) * 1.7); height: calc(var(--tile) * var(--size, .42) * .7); margin: calc(var(--tile) * var(--size, .42) * -.35) 0 0 calc(var(--tile) * var(--size, .42) * -.85); pointer-events: none; opacity: .75; animation: shadow-circle 3s linear infinite; }
.fish-shadow[hidden] { display: none; }
.fish-shadow::before { content: ""; position: absolute; inset: 0 26% 0 0; border-radius: 50%; background: rgba(4, 36, 92, .55); }
.fish-shadow::after { content: ""; position: absolute; right: 0; top: 8%; width: 34%; height: 84%; background: rgba(4, 36, 92, .55); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
@keyframes shadow-circle {
  0% { transform: translate(calc(var(--tile) * .34), 0) scaleX(1); }
  25% { transform: translate(0, calc(var(--tile) * .22)) scaleX(1); }
  50% { transform: translate(calc(var(--tile) * -.34), 0) scaleX(-1); }
  75% { transform: translate(0, calc(var(--tile) * -.22)) scaleX(-1); }
  100% { transform: translate(calc(var(--tile) * .34), 0) scaleX(1); }
}
.fish-splash { position: absolute; z-index: 95; width: calc(var(--tile) * .9); height: calc(var(--tile) * .45); margin: calc(var(--tile) * -.22) 0 0 calc(var(--tile) * -.45); border: 2px solid rgba(255, 255, 255, .85); border-radius: 50%; opacity: 0; pointer-events: none; }
.fish-splash.go { animation: splash-ring .7s ease-out; }
@keyframes splash-ring { from { opacity: .95; transform: scale(.2); } to { opacity: 0; transform: scale(1.4); } }
.fish-jump { position: absolute; z-index: 97; width: calc(var(--tile) * .95); height: calc(var(--tile) * .95); image-rendering: pixelated; pointer-events: none; }
.fish-jump[hidden] { display: none; }

/* while fishing, the map shrinks to leave room for the panel under it */
.town-dialog[data-fishing="true"] .town-map-wrap { max-height: min(40dvh, 340px); }
.town-dialog[data-fishing="true"] .town-pager { display: none; }
.fish-hud { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 2px solid #2a6086; border-radius: 12px; background: rgba(8, 30, 48, .85); }
.fish-hud[hidden] { display: none; }
.fh-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fh-top b { flex: 1 1 100%; min-width: 0; color: #ffd166; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.fh-chip { padding: 2px 6px; border-radius: 6px; background: #12364a; color: #bff7ef; font: 6px/1.5 "Press Start 2P", ui-monospace, monospace; white-space: nowrap; }
.fh-bait { display: flex; align-items: center; gap: 5px; }
.fh-bait .bait { display: inline-block; width: 14px; height: 14px; margin-right: 4px; border: 2px solid #1b1330; border-radius: 50% 50% 50% 8px; background: #3a4a52; }
.fh-bait .bait.on { background: #ff9fb0; box-shadow: inset -3px -3px 0 #d96b86; }
.fh-bait small { margin-left: auto; color: #8fb8d8; font: 7px/1.2 "Press Start 2P", ui-monospace, monospace; }
.fh-msg { min-height: 2.5em; margin: 0; color: #d8eefa; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; }
.fish-action { display: grid; place-items: center; height: 50px; padding: 0 8px; border: 3px solid #1b1330; border-radius: 10px; background: #35e7d3; box-shadow: 0 4px 0 #178a85; color: #06303a; font: 10px/1.2 "Press Start 2P", ui-monospace, monospace; }
.fish-action:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #178a85; }
.fish-action:disabled { background: #3a4a52; box-shadow: none; color: #8a979c; }
.fish-action.wait { background: #7aa7c8; box-shadow: 0 4px 0 #3f6c8f; color: #0b2336; font-size: 8px; }
.fish-action.bite { background: #ffd166; box-shadow: 0 4px 0 #b9892a; color: #3a2406; animation: reel-pulse .3s ease-in-out infinite alternate; }
@keyframes reel-pulse { to { transform: scale(1.03); } }
.fh-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fh-row button { height: 36px; padding: 4px; border: 2px solid #285d69; border-radius: 8px; background: #0b2a3a; color: #bff7ef; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.fh-track { position: relative; height: 48px; border: 3px solid #1b1330; border-radius: 10px; background: linear-gradient(#2f78a8, #1d5280); overflow: hidden; box-shadow: inset 0 0 16px rgba(5, 25, 45, .5); touch-action: none; }
.fh-zone { position: absolute; top: 0; bottom: 0; border: 2px solid #9affc4; border-radius: 8px; background: rgba(120, 255, 170, .26); }
.fh-zone.on { background: rgba(120, 255, 170, .55); box-shadow: 0 0 10px rgba(154, 255, 196, .75); }
.fh-fish { position: absolute; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%); image-rendering: pixelated; object-fit: contain; filter: brightness(.18) drop-shadow(0 0 3px rgba(255, 255, 255, .55)); }
.fh-line { position: relative; height: 18px; border: 3px solid #1b1330; border-radius: 9px; background: #10283a; overflow: hidden; }
.fh-line i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe27a, #f0a830); }
.fh-line i.low { background: linear-gradient(#ff8a7a, #e0483a); }
.fh-line span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 6px/1 "Press Start 2P", ui-monospace, monospace; text-shadow: 0 1px 0 #1b1330; }
.fh-reel { height: 70px; border: 3px solid #1b1330; border-radius: 12px; background: #35e7d3; box-shadow: 0 5px 0 #178a85; color: #06303a; font: 11px/1.2 "Press Start 2P", ui-monospace, monospace; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fh-reel.down { background: #8ff5e8; box-shadow: 0 2px 0 #178a85; transform: translateY(3px); }
.fish-catch { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; padding: 8px; border: 2px solid #1b1330; border-radius: 8px; background: #fff3d6; color: #3a2406; animation: bubble-pop .3s ease-out; }
.fish-catch.uncommon { background: #e7f6dc; }
.fish-catch.rare { background: #dfeafc; }
.fish-catch.epic { background: #eadcfb; }
.fish-catch img { width: 56px; height: 56px; image-rendering: pixelated; object-fit: contain; }
.fish-catch div { display: grid; gap: 3px; min-width: 0; }
.fish-catch b { font: 600 8px/1.35 "Press Start 2P", ui-monospace, monospace; }
.fish-catch small { font: 11px/1.35 ui-sans-serif, system-ui, sans-serif; }
.fish-catch em { color: #7a5a2a; font: normal 6px/1.5 "Press Start 2P", ui-monospace, monospace; }
.fish-view { display: grid; gap: 8px; min-width: 0; }
.fish-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fish-stats span { display: grid; gap: 4px; padding: 7px 4px; border: 2px solid #2a6086; border-radius: 8px; background: rgba(8, 30, 48, .6); color: #8fb8d8; font: 6px/1.3 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.fish-stats b { overflow: hidden; color: #fff; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.fish-dex-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 0; color: #ffd166; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.fish-dex-head.uncommon { color: #7ee3a8; }
.fish-dex-head.rare { color: #8fb4ff; }
.fish-dex-head.epic { color: #cfa4ff; }
.fish-dex-head span { color: #8fb8d8; }
.fish-dex { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.fish-dex li { display: grid; justify-items: center; gap: 3px; padding: 6px 3px 5px; border: 2px solid #2a6086; border-radius: 8px; background: rgba(8, 30, 48, .6); text-align: center; }
.fish-dex li.uncommon { border-color: #3d8f6a; }
.fish-dex li.rare { border-color: #5a7fd8; }
.fish-dex li.epic { border-color: #a46bdc; }
.fish-dex img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.fish-dex li.unknown img { filter: brightness(0) invert(.25); }
.fish-dex b { color: #d8eefa; font: 5px/1.5 "Press Start 2P", ui-monospace, monospace; overflow-wrap: anywhere; }
.fish-dex i { color: #8fb8d8; font: normal 9px/1.2 ui-sans-serif, system-ui, sans-serif; }

/* ── The aquarium: the fish you put on show swim inside it ── */
.tank-water { position: absolute; left: 9%; top: 28%; width: 82%; height: 50%; overflow: hidden; pointer-events: none; }
.tank-fish { position: absolute; left: 0; top: calc(var(--lane) * 20%); width: calc(var(--cell) * .34); height: calc(var(--cell) * .34); animation: tank-swim var(--dur) linear var(--delay) infinite; }
.tank-fish img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.tank-fish.epic img, .tank-fish.rare img { filter: drop-shadow(0 0 3px rgba(255, 240, 160, .8)); }
@keyframes tank-swim {
  0% { transform: translateX(0) scaleX(-1); }
  47% { transform: translateX(calc(var(--cell) * 1.15)) scaleX(-1); }
  50% { transform: translateX(calc(var(--cell) * 1.15)) scaleX(1); }
  97% { transform: translateX(0) scaleX(1); }
  100% { transform: translateX(0) scaleX(-1); }
}
.tank-panel { display: grid; gap: 8px; padding: 10px; border: 2px solid #2a6086; border-radius: 12px; background: rgba(8, 30, 48, .7); }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #35e7d3; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.tp-head span { color: #ffd166; font-size: 7px; }
.tp-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tp-list button { display: grid; justify-items: center; gap: 2px; width: 100%; padding: 6px 3px 5px; border: 2px solid #2a6086; border-radius: 8px; background: rgba(8, 30, 48, .6); text-align: center; }
.tp-list button.uncommon { border-color: #3d8f6a; }
.tp-list button.rare { border-color: #5a7fd8; }
.tp-list button.epic { border-color: #a46bdc; }
.tp-list button.on { background: #0f5560; box-shadow: 0 0 0 2px rgba(53, 231, 211, .45); }
.tp-list img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.tp-list b { color: #d8eefa; font: 5px/1.5 "Press Start 2P", ui-monospace, monospace; overflow-wrap: anywhere; }
.tp-list i { color: #8fb8d8; font: normal 7px/1.2 "Press Start 2P", ui-monospace, monospace; }
.tp-list button.on i { color: #7ee3a8; }
.tp-note { margin: 0; color: #8fb8bd; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; }

/* ── The Pond Cup ── */
.town-dialog[data-view="cup"] { border-color: #d8a43a; background: linear-gradient(160deg, #2a3350, #131a30); }
.town-dialog[data-view="cup"] .town-bar { border-bottom-color: #8a6a2a; background: rgba(12, 16, 34, .7); }
.cup-view { display: grid; gap: 8px; min-width: 0; }
.cup-hero { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border: 2px solid #d8a43a; border-radius: 12px; background: rgba(60, 44, 10, .55); }
.cup-hero img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(255, 220, 120, .7)); }
.cup-hero small { color: #ffd98a; font: 6px/1.5 "Press Start 2P", ui-monospace, monospace; }
.cup-hero strong { display: block; margin: 3px 0; color: #ffd166; font: 9px/1.4 "Press Start 2P", ui-monospace, monospace; }
.cup-hero span { color: #f4e4c4; font: 600 12px/1.4 ui-sans-serif, system-ui, sans-serif; }
.cup-me { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.cup-me > div { display: grid; gap: 4px; padding: 8px 4px; border: 2px solid #3a4a7a; border-radius: 10px; background: rgba(10, 14, 32, .6); text-align: center; }
.cup-me b { color: #fff; font: 14px/1 "Press Start 2P", ui-monospace, monospace; }
.cup-score b { color: #ffd166; font-size: 20px; }
.cup-me small { color: #9fb0e0; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.cup-next { margin: 0; color: #cfe0ff; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; text-align: center; }
.cup-view .g-head { color: #ffd166; }
.cup-view .g-head span { color: #9fb0e0; }
.cup-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cup-list li { display: grid; grid-template-columns: 24px 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border: 2px solid #3a4a7a; border-radius: 10px; background: rgba(10, 14, 32, .6); }
.cup-list li.self { border-color: #35e7d3; }
.cup-list li.first { box-shadow: 0 0 0 2px rgba(255, 209, 102, .5); }
.cup-list .place { color: #ffd166; font: 10px/1 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.cup-list .who { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.cup-list strong { display: block; overflow: hidden; color: #eef3ff; font: 700 13px/1.3 ui-sans-serif, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.cup-list small { display: flex; align-items: center; gap: 4px; color: #9fb0e0; font: 600 11px/1.3 ui-sans-serif, system-ui, sans-serif; }
.cup-list small img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.cup-list span { display: grid; justify-items: end; color: #fff; font: 700 15px/1.1 ui-sans-serif, system-ui, sans-serif; }
.cup-list span small { display: block; color: #9fb0e0; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.cup-prizes { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.cup-prizes ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cup-prizes li { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; border: 2px solid #3a4a7a; border-radius: 8px; background: rgba(10, 14, 32, .5); color: #cfe0ff; font: 700 11px/1.2 ui-sans-serif, system-ui, sans-serif; }
.cup-prizes li.got { border-color: #7ee06a; color: #d9ffd0; }
.cup-prizes b { color: #ffd166; font: 7px/1.2 "Press Start 2P", ui-monospace, monospace; }
.cup-prev, .cup-waiting .cup-prev { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 8px; border: 2px solid #d8a43a; border-radius: 10px; background: rgba(60, 44, 10, .55); }
.cup-prev.done { border-color: #3a4a7a; background: rgba(10, 14, 32, .5); opacity: .8; }
.cup-prev b { color: #ffd166; font: 8px/1.4 "Press Start 2P", ui-monospace, monospace; }
.cup-prev small { display: block; margin-top: 3px; color: #cfe0ff; font: 11px/1.4 ui-sans-serif, system-ui, sans-serif; }
.cup-prev em { display: block; margin-top: 2px; color: #ffe7a8; font: normal 700 12px/1.3 ui-sans-serif, system-ui, sans-serif; }
.cup-prev button { flex: 0 0 auto; height: 40px; padding: 0 12px; border: 3px solid #1b1330; border-radius: 9px; background: #ffd166; box-shadow: 0 3px 0 #b9892a; color: #3a2406; font: 8px/1.2 "Press Start 2P", ui-monospace, monospace; }
.cup-prev button:disabled { opacity: .5; box-shadow: none; }
.fh-chip.star { background: #4a3a10; color: #ffd98a; }
.fh-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── The garden and the Mochi Cafe kitchen ── */
.town-dialog[data-view="garden"] { border-color: #5b9a4a; background: linear-gradient(160deg, #2a4a2c, #14261a); }
.town-dialog[data-view="garden"] .town-bar { border-bottom-color: #3d6e3a; background: rgba(10, 28, 14, .7); }
.town-dialog[data-view="kitchen"] { border-color: #c98a4b; background: linear-gradient(160deg, #4a2f1e, #261811); }
.town-dialog[data-view="kitchen"] .town-bar { border-bottom-color: #8a5a32; background: rgba(34, 18, 10, .7); }
.garden-view, .kitchen-view { display: grid; gap: 8px; min-width: 0; }
.g-buff { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 2px solid #ffd166; border-radius: 10px; background: rgba(60, 44, 10, .75); color: #ffeab0; }
.g-buff > span { font-size: 20px; }
.g-buff p { margin: 0; font: 600 11px/1.45 ui-sans-serif, system-ui, sans-serif; }
.g-buff b { font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; color: #ffd166; }
.g-buff em { font-style: normal; color: #fff; }
.g-buff.none { border-color: #4b6a45; background: rgba(8, 24, 12, .55); color: #b9d8b0; }
.g-field { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 8px; border: 3px solid #1b1330; border-radius: 12px; background: #7a5136; box-shadow: inset 0 0 0 3px #a06c44; }
.g-plot { position: relative; display: grid; grid-template-rows: 1fr auto auto; place-items: center; gap: 2px; aspect-ratio: 1 / 1.08; min-width: 0; padding: 4px 2px 3px; border: 2px solid #4a2f1c; border-radius: 8px; background: repeating-linear-gradient(0deg, #6b4428 0 5px, #5a3820 5px 7px); color: #fff; }
.g-plot.selected { border-color: #ffd166; box-shadow: 0 0 0 2px rgba(255, 209, 102, .5); }
.g-plot.ready { background: repeating-linear-gradient(0deg, #6b4428 0 5px, #5a3820 5px 7px), radial-gradient(circle at 50% 40%, rgba(255, 230, 120, .35), transparent 70%); background-blend-mode: normal; }
.g-sprout { color: rgba(255, 255, 255, .35); font: 18px/1 "Press Start 2P", ui-monospace, monospace; }
.g-crop { display: block; font-size: 26px; line-height: 1; transform: scale(var(--grow, 1)); transform-origin: bottom center; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.g-crop.ready { animation: g-bob .9s ease-in-out infinite alternate; }
@keyframes g-bob { to { transform: scale(1.08) translateY(-3px); } }
.g-bar { display: block; width: 86%; height: 5px; border: 1px solid #1b1330; border-radius: 3px; background: #3a2414; overflow: hidden; }
.g-bar b { display: block; height: 100%; background: #7ee06a; }
.g-plot.ready .g-bar b { background: #ffd166; }
.g-plot small { color: #f4e0c4; font: 5px/1.2 "Press Start 2P", ui-monospace, monospace; }
.g-plot.ready small { color: #ffd166; }
.g-drops { position: absolute; top: 2px; right: 3px; font-style: normal; font-size: 8px; line-height: 1; }
.g-tools { display: flex; gap: 6px; }
.g-tool { flex: 1 1 0; min-height: 40px; padding: 6px 8px; border: 3px solid #1b1330; border-radius: 9px; background: #3d6e3a; box-shadow: 0 3px 0 #1d3f1c; color: #eaffdf; font: 7px/1.3 "Press Start 2P", ui-monospace, monospace; }
.g-tool.pick { background: #ffd166; box-shadow: 0 3px 0 #b9892a; color: #3a2406; }
.g-tool:disabled, .g-big:disabled, .k-cook:disabled, .g-seed:disabled { opacity: .5; box-shadow: none; }
.g-tool .px-icon, .g-seed .px-icon { display: inline-block; width: 12px; height: 12px; margin: 0 0 0 2px; vertical-align: -2px; }
.g-note { min-height: 1.5em; margin: 0; color: #d8f6c8; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; }
.g-note[data-ok="false"] { color: #ffb4a8; }
.g-panel { display: grid; gap: 8px; padding: 10px; border: 2px solid #3d6e3a; border-radius: 10px; background: rgba(8, 24, 12, .7); }
.g-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #ffd166; font: 8px/1.4 "Press Start 2P", ui-monospace, monospace; }
.g-panel-head small { color: #a8d49a; font: 600 11px/1.3 ui-sans-serif, system-ui, sans-serif; }
.g-panel-head em { font-style: normal; color: #fff; }
.g-hint { margin: 0; padding: 4px 2px; color: #a8d49a; font: 600 12px/1.5 ui-sans-serif, system-ui, sans-serif; text-align: center; }
.g-big { min-height: 44px; border: 3px solid #1b1330; border-radius: 10px; background: #ffd166; box-shadow: 0 4px 0 #b9892a; color: #3a2406; font: 9px/1.3 "Press Start 2P", ui-monospace, monospace; }
.g-big.water { background: #6cc4f0; box-shadow: 0 4px 0 #2c7fa8; color: #06303a; }
.g-big:active:not(:disabled) { transform: translateY(2px); }
.g-seeds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 0; list-style: none; }
.g-seed { display: grid; grid-template-columns: 26px 1fr; grid-template-areas: "i n" "i t" "i p"; column-gap: 6px; align-items: center; width: 100%; min-height: 54px; padding: 5px 7px; border: 2px solid #3d6e3a; border-radius: 8px; background: #0f2a16; color: #d8f6c8; text-align: left; }
.g-seed span { grid-area: i; font-size: 22px; }
.g-seed b { grid-area: n; font: 600 11px/1.2 ui-sans-serif, system-ui, sans-serif; }
.g-seed small { grid-area: t; color: #9cc48e; font: 10px/1.2 ui-sans-serif, system-ui, sans-serif; }
.g-seed em { grid-area: p; color: #ffd166; font: normal 700 10px/1.2 ui-sans-serif, system-ui, sans-serif; }
.g-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0; color: #ffd166; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.g-head span { color: #a8d49a; font: 600 10px/1 ui-sans-serif, system-ui, sans-serif; }
.g-pantry, .k-counter, .k-recipes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.g-pantry li, .k-counter li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 8px; border: 2px solid #3d6e3a; border-radius: 8px; background: rgba(8, 24, 12, .6); color: #d8f6c8; }
.g-pantry li > span, .k-counter li > span { font-size: 20px; }
.g-pantry b, .k-counter b { flex: 1 1 auto; min-width: 0; font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif; }
.g-pantry i, .k-counter i { font-style: normal; font-weight: 700; color: #fff; }
.g-pantry button, .k-counter button { flex: 0 0 auto; min-height: 30px; padding: 4px 8px; border: 2px solid #1b1330; border-radius: 7px; background: #2d5a30; color: #eaffdf; font: 6px/1.2 "Press Start 2P", ui-monospace, monospace; }
.g-pantry button small { color: #ffd166; font: inherit; }
.k-top { display: flex; align-items: flex-end; gap: 10px; padding: 8px 10px; border: 2px solid #8a5a32; border-radius: 12px; background: rgba(34, 18, 10, .7); }
.k-pet { position: relative; flex: 0 0 auto; width: 64px; height: 64px; padding: 0; border: 0; background: none; transform-origin: bottom center; }
.k-pet img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(27, 19, 48, .35)); }
.k-pet .town-emote { bottom: 100%; }
.k-pet.hop { animation: store-hop .6s ease-out; }
.k-chef { min-width: 0; }
.k-chef b { color: #ffd166; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.k-chef p { margin: 4px 0 0; color: #f4e0c4; font: 600 12px/1.45 ui-sans-serif, system-ui, sans-serif; }
.kitchen-view .g-note { color: #ffe7c4; }
.kitchen-view .g-head { color: #ffd166; }
.kitchen-view .g-head span { color: #d9b48a; }
.kitchen-view .g-hint { color: #d9b48a; }
.kitchen-view .k-counter li { border-color: #8a5a32; background: rgba(34, 18, 10, .6); color: #f4e0c4; }
.kitchen-view .k-counter button { background: #c98a4b; color: #2a1608; }
.k-recipe { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; padding: 8px; border: 2px solid #6d4627; border-radius: 10px; background: rgba(34, 18, 10, .55); color: #f4e0c4; }
.k-recipe.can { border-color: #c98a4b; background: rgba(60, 36, 16, .7); }
.k-recipe.special { border-color: #ffd166; box-shadow: 0 0 0 2px rgba(255, 209, 102, .25); }
.k-icon { font-size: 30px; line-height: 1; text-align: center; }
.k-info { display: grid; gap: 3px; min-width: 0; }
.k-info b { font: 700 12px/1.3 ui-sans-serif, system-ui, sans-serif; color: #fff; }
.k-info u { margin-left: 4px; padding: 1px 5px; border-radius: 6px; background: #ffd166; color: #3a2406; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; text-decoration: none; white-space: nowrap; }
.k-info u.new { background: #7ee06a; }
.k-needs { display: flex; flex-wrap: wrap; gap: 4px; }
.k-needs span { padding: 1px 6px; border: 1px solid #6d4627; border-radius: 6px; background: rgba(0, 0, 0, .25); font: 700 11px/1.4 ui-sans-serif, system-ui, sans-serif; }
.k-needs span.ok { border-color: #7ee06a; color: #c9f5b8; }
.k-needs span.short { color: #ff9c8c; }
.k-info small { color: #d9b48a; font: 11px/1.35 ui-sans-serif, system-ui, sans-serif; }
.k-info small.k-buff { color: #ffd166; }
.k-cook { min-width: 58px; min-height: 40px; padding: 4px 8px; border: 3px solid #1b1330; border-radius: 9px; background: #ffd166; box-shadow: 0 3px 0 #b9892a; color: #3a2406; font: 7px/1.2 "Press Start 2P", ui-monospace, monospace; }
.town-label.spot.garden { color: #eaffdf; }

@media (prefers-reduced-motion: reduce) {
  .town-deco.hung, .store-pet.hop, .fish-bobber, .fish-shadow, .pond-fish, .tank-fish, .fish-splash.go, .fish-action, .g-crop.ready, .k-pet.hop, .raid-boss { animation: none !important; }
  .town-dialog[data-festival] .town-weather { animation: none; }
}
html.battery-saver .town-deco.hung, html.battery-saver .pond-fish, html.battery-saver .fish-shadow { animation: none !important; }
html.battery-saver .town-dialog[data-festival] .town-weather { animation: none; }

/* ── Friend duels (inside Friends & Visit) ── */
.duel-intro { display: flex; align-items: center; gap: 10px; padding: 10px; border: 2px solid #285d69; border-radius: 12px; background: rgba(6, 31, 46, .6); }
.duel-intro p { margin: 3px 0 0; color: #9fc4c9; font-size: 12px; line-height: 1.45; }
.duel-intro strong { color: #ffd166; }
.duel-status { display: block; min-height: 1.2em; margin: 6px 2px; color: #ffb4a8; font-size: 12px; }
.duel-new, .duel-list-wrap { display: grid; gap: 10px; margin-top: 8px; padding: 10px; border: 2px solid #285d69; border-radius: 12px; background: rgba(6, 31, 46, .5); }
.duel-new > header, .duel-list-wrap > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #35e7d3; font: 8px/1.2 "Press Start 2P", ui-monospace, monospace; }
.duel-new > header strong { color: #8fb8bd; font-size: 7px; }
.duel-list-wrap > header button { min-height: 28px; padding: 6px 9px; border: 2px solid #1b1330; border-radius: 7px; background: #12364a; color: #bff7ef; font: 7px/1 "Press Start 2P", ui-monospace, monospace; }
.duel-step { display: grid; gap: 5px; }
.duel-step > small { color: #8fb8bd; font: 7px/1.2 "Press Start 2P", ui-monospace, monospace; }
.duel-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.duel-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; max-width: 170px; padding: 5px 10px 5px 6px; border: 2px solid #285d69; border-radius: 10px; background: #0b2a3a; color: #d8f6f1; font: 600 12px/1.2 ui-sans-serif, system-ui, sans-serif; }
.duel-chip img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.duel-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-chip.on { border-color: #ffd166; background: #3a2d0a; box-shadow: 0 0 0 2px rgba(255, 209, 102, .25); }
.duel-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.duel-modes button { min-height: 38px; border: 2px solid #285d69; border-radius: 9px; background: #0b2a3a; color: #bff7ef; font: 8px/1.2 "Press Start 2P", ui-monospace, monospace; }
.duel-modes button.on { border-color: #35e7d3; background: #0f5560; color: #fff; }
.duel-mode-note { margin: 2px 0 0; color: #9fc4c9; font-size: 12px; line-height: 1.45; }
.duel-send { min-height: 44px; border: 3px solid #1b1330; border-radius: 10px; background: #ffd166; box-shadow: 0 4px 0 #b9892a; color: #3a2406; font: 10px/1 "Press Start 2P", ui-monospace, monospace; }
.duel-send:disabled { background: #3a4a52; box-shadow: none; color: #8a979c; }
.duel-empty { margin: 4px 0; color: #8fb8bd; font-size: 12px; line-height: 1.5; }
.duel-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin-top: 6px; padding: 8px; border: 2px solid #285d69; border-radius: 10px; background: #0b2a3a; }
.duel-card > img { grid-row: span 2; width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.duel-card strong { display: flex; align-items: center; gap: 4px; color: #ffd166; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.duel-card strong img { width: 16px; height: 16px; margin: 0; }
.duel-card small { display: block; margin-top: 3px; color: #b6d6d9; font-size: 11px; line-height: 1.4; }
.duel-badge { align-self: start; padding: 3px 6px; border-radius: 6px; background: #12364a; color: #bff7ef; font: 6px/1.2 "Press Start 2P", ui-monospace, monospace; white-space: nowrap; }
.duel-card.go { border-color: #35e7d3; }
.duel-card.go .duel-badge { background: #35e7d3; color: #06303a; }
.duel-card.win { border-color: #ffd166; }
.duel-card.win .duel-badge { background: #ffd166; color: #3a2406; }
.duel-card.lose .duel-badge { background: #5a2a3a; color: #ffd1da; }
.duel-card.muted { opacity: .65; }
.duel-actions { grid-column: 2 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.duel-actions:empty { display: none; }
.duel-go { min-height: 34px; padding: 7px 14px; border: 2px solid #1b1330; border-radius: 8px; background: #35e7d3; box-shadow: 0 3px 0 #178a85; color: #06303a; font: 8px/1 "Press Start 2P", ui-monospace, monospace; }
.duel-go:disabled { background: #3a4a52; box-shadow: none; color: #8a979c; }
.duel-off { width: 34px; min-height: 34px; border: 2px solid #1b1330; border-radius: 8px; background: #12364a; color: #ffb4a8; font-size: 16px; line-height: 1; }
/* ── Weekly raids (inside Friends & Visit) ── */
.raid-hero { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border: 2px solid #8a4b2a; border-radius: 12px; background: linear-gradient(160deg, rgba(58, 28, 16, .85), rgba(20, 12, 30, .85)); }
.raid-boss { width: 104px; height: 104px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .4)); animation: raid-bob 2.4s ease-in-out infinite alternate; }
@keyframes raid-bob { to { transform: translateY(-4px) scale(1.02); } }
.raid-boss-text { display: grid; gap: 3px; min-width: 0; }
.raid-boss-text small { color: #ffb48a; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.raid-boss-text strong { color: #ffd166; font: 10px/1.3 "Press Start 2P", ui-monospace, monospace; }
.raid-boss-text span { color: #f4d8c4; font: 700 12px/1.3 ui-sans-serif, system-ui, sans-serif; }
.raid-boss-text p { margin: 0; color: #cdb3a4; font-size: 12px; line-height: 1.4; }
.raid-hp { position: relative; height: 18px; margin-top: 4px; border: 3px solid #1b1330; border-radius: 9px; background: #3a1a1a; overflow: hidden; }
.raid-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff7a6a, #d23a3a); transition: width .6s ease-out; }
.raid-hp b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 6px/1 "Press Start 2P", ui-monospace, monospace; text-shadow: 0 1px 0 #1b1330; }
.raid-body { display: grid; gap: 8px; margin-top: 4px; }
.raid-panel, .raid-new, .raid-party-wrap, .raid-old { display: grid; gap: 8px; padding: 10px; border: 2px solid #285d69; border-radius: 12px; background: rgba(6, 31, 46, .5); }
.raid-panel.go { border-color: #35e7d3; }
.raid-panel.win { border-color: #ffd166; }
.raid-panel > header, .raid-new > header, .raid-party-wrap > header, .raid-old > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #35e7d3; font: 8px/1.2 "Press Start 2P", ui-monospace, monospace; }
.raid-panel > header strong, .raid-new > header strong, .raid-party-wrap > header strong { color: #ffd166; font-size: 7px; }
.raid-panel > p, .raid-note { margin: 0; color: #b6d6d9; font-size: 12px; line-height: 1.5; }
.raid-mine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.raid-mine span { display: grid; gap: 3px; padding: 6px 4px; border: 2px solid #1d4a58; border-radius: 8px; background: #0b2a3a; color: #8fb8bd; font: 6px/1.3 "Press Start 2P", ui-monospace, monospace; text-align: center; }
.raid-mine b { color: #fff; font-size: 11px; }
.raid-go { min-height: 48px; border: 3px solid #1b1330; border-radius: 10px; background: #ff7a5a; box-shadow: 0 4px 0 #a43a22; color: #2a0c04; font: 10px/1.2 "Press Start 2P", ui-monospace, monospace; }
.raid-go.claim { background: #ffd166; box-shadow: 0 4px 0 #b9892a; color: #3a2406; }
.raid-go:disabled { background: #3a4a52; box-shadow: none; color: #8a979c; }
.raid-go:active:not(:disabled) { transform: translateY(2px); }
.raid-party { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.raid-party li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border: 2px solid #1d4a58; border-radius: 9px; background: #0b2a3a; }
.raid-party li.you { border-color: #35e7d3; }
.raid-party li.invited, .raid-party li.lapsed { opacity: .6; }
.raid-party img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
.raid-party strong { display: block; overflow: hidden; color: #e8fbf7; font: 700 12px/1.3 ui-sans-serif, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.raid-party i { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: #123446; overflow: hidden; }
.raid-party u { display: block; height: 100%; background: #ff9a6a; text-decoration: none; }
.raid-party span { display: grid; justify-items: end; color: #fff; font: 700 13px/1.1 ui-sans-serif, system-ui, sans-serif; }
.raid-party small { color: #8fb8bd; font: 6px/1.4 "Press Start 2P", ui-monospace, monospace; }
.raid-how { margin-top: 10px; padding: 8px 10px; border: 1px solid #285d69; border-radius: 10px; background: rgba(6, 31, 46, .4); color: #9fc4c9; font-size: 12px; line-height: 1.5; }
.raid-how summary { color: #8fb8bd; font: 7px/1.4 "Press Start 2P", ui-monospace, monospace; cursor: pointer; }
.raid-how p { margin: 8px 0 0; }
@media (max-width: 380px) { .raid-hero { grid-template-columns: 80px minmax(0, 1fr); } .raid-boss { width: 80px; height: 80px; } }

/* the house and duel buttons on a friend's card: the same size and shape as the other full-width buttons */
.friend-card > .friend-house-button, .friend-card > .friend-duel-button { grid-column: 1 / -1; min-height: 36px; padding: 0 10px; border: 1px solid #2f8aa3; border-radius: 8px; background: #0f5a73; color: #effffb; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.friend-card > .friend-duel-button { border-color: #35e7d3; background: #167f79; }
.social-dialog .social-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 520px) {
  .social-dialog .social-tabs button { gap: 3px; padding: 0 2px; font-size: 9px; letter-spacing: .04em; }
  .social-dialog .social-tabs button .px-icon { display: none; }
}
.social-pane.duel-first:not([hidden]) { display: flex; flex-direction: column; }
.social-pane.duel-first .duel-list-wrap { order: -1; margin-top: 12px; }
.social-pane.duel-first .duel-intro, .social-pane.duel-first .duel-status { order: -2; }

/* ── The wardrobe: hats and auras ── */
/* a .wear box has the same size and place as the pet picture it sits beside, so a hat is placed as a share of that picture */
.wear { position: absolute; z-index: 4; pointer-events: none; }
.wear[hidden] { display: none; }
.wear-hat { position: absolute; display: block; image-rendering: pixelated; }
.town-pet .wear, .town-live .wear, .town-npc .wear { bottom: 2px; left: 50%; height: calc(var(--tile) * 1.55); aspect-ratio: 1 / 1; transform: translateX(-50%); }
.town-pet.face-right .wear { transform: translateX(-50%) scaleX(-1); }
.room-pet .wear { bottom: 2px; left: 50%; height: calc(var(--cell) * 1.75); aspect-ratio: 1 / 1; transform: translateX(-50%); }
.room-pet.hop .wear { animation: room-hop .6s ease-out; }
.wear-home { z-index: 4; }
.wear-aura { position: absolute; inset: 0; }
.wear-aura b { position: absolute; width: 11%; aspect-ratio: 1 / 1; background: center / contain no-repeat; image-rendering: pixelated; opacity: 0; animation: aura-rise 3.4s ease-in-out infinite; animation-delay: var(--wd, 0s); }
.wear-aura[data-aura="sparkles"] b { background-image: url(assets/wear/p-sparkle.png); animation-name: aura-twinkle; animation-duration: 2.2s; }
.wear-aura[data-aura="bubbles"] b { background-image: url(assets/wear/p-bubble.png); animation-name: aura-rise; }
.wear-aura[data-aura="petals"] b { background-image: url(assets/wear/p-petal.png); animation-name: aura-fall; animation-duration: 4s; }
.wear-aura[data-aura="hearts"] b { background-image: url(assets/wear/p-heart.png); animation-name: aura-rise; animation-duration: 3s; }
.wear-aura[data-aura="lanterns"] b { background-image: url(assets/wear/p-lantern.png); animation-name: aura-rise; animation-duration: 5s; width: 9%; }
.wear-aura[data-aura="fireflies"] b { background-image: url(assets/wear/p-firefly.png); animation-name: aura-drift; animation-duration: 5s; }
.wear-aura[data-aura="fireworks"] b { background-image: url(assets/wear/p-firework.png); animation-name: aura-twinkle; animation-duration: 1.8s; }
.wear-aura[data-aura="resonance"] b { background-image: url(assets/wear/p-core.png); animation-name: aura-drift; animation-duration: 4.2s; }
@keyframes aura-twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }
@keyframes aura-rise { 0% { opacity: 0; transform: translateY(10%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-90%); } }
@keyframes aura-fall { 0% { opacity: 0; transform: translate(0, -70%) rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(50%, 80%) rotate(140deg); } }
@keyframes aura-drift { 0%, 100% { opacity: .25; transform: translate(0, 0); } 25% { opacity: 1; transform: translate(45%, -30%); } 50% { opacity: .4; transform: translate(10%, -70%); } 75% { opacity: 1; transform: translate(-45%, -25%); } }
html.reduced-motion .wear-aura b { animation: none; opacity: .85; }
html.battery-saver .wear-aura { display: none; }

.town-dialog[data-view="wardrobe"] { border-color: #e58fb4; background: linear-gradient(160deg, #3a2a52, #1b1534); }
.wardrobe-view { display: grid; gap: 10px; min-width: 0; }
.wd-stage { display: grid; place-items: center; padding: 10px; border: 2px solid #6b4a8c; border-radius: 14px; background: radial-gradient(circle at 50% 72%, rgba(255, 214, 235, .24), rgba(20, 14, 40, .6)); }
.wd-pet { position: relative; display: block; width: min(46vw, 190px); aspect-ratio: 1 / 1; }
.wd-pet > img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); }
.wd-pet .wear { inset: 0; }
.wd-wearing { margin: 0; color: #cdb8e6; font: 600 12px/1.4 ui-sans-serif, system-ui, sans-serif; text-align: center; }
.wd-wearing b { color: #ffd6eb; }
.wd-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0; color: #ffb3d4; font: 8px/1.3 "Press Start 2P", ui-monospace, monospace; }
.wd-head span { color: #cdb8e6; font-size: 7px; }
.wd-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.wd-item { position: relative; display: grid; justify-items: center; align-content: start; gap: 3px; width: 100%; min-height: 98px; padding: 8px 3px 6px; border: 2px solid #6b4a8c; border-radius: 8px; background: rgba(30, 18, 52, .72); text-align: center; }
.wd-item img { height: 34px; max-width: 80%; object-fit: contain; image-rendering: pixelated; }
.wd-item.aura img { height: 22px; margin: 6px 0; }
.wd-item b { color: #f1e4ff; font: 5px/1.5 "Press Start 2P", ui-monospace, monospace; overflow-wrap: anywhere; }
.wd-item i { color: #b9a3d6; font: normal 6px/1.3 "Press Start 2P", ui-monospace, monospace; }
.wd-item small { color: #9b86b8; font: 600 10px/1.3 ui-sans-serif, system-ui, sans-serif; }
.wd-item.on { border-color: #ffb3d4; background: #5a2f6e; box-shadow: 0 0 0 2px rgba(255, 179, 212, .4); }
.wd-item.on i { color: #7ee3a8; }
.wd-item.locked img { filter: grayscale(1) brightness(.6); opacity: .7; }
.wd-item.locked b { color: #a898c0; }
.wd-item.for-sale { border-color: #d8a43a; }
.wd-item.for-sale i { color: #ffd166; }
.wd-item.can-buy { box-shadow: 0 0 0 2px rgba(255, 209, 102, .35); }
.wd-item s { position: absolute; top: -6px; right: -4px; padding: 2px 4px; border: 2px solid #1b1330; border-radius: 6px; background: #ff7aa8; color: #fff; font: 5px/1 "Press Start 2P", ui-monospace, monospace; text-decoration: none; }

/* ── Festival fish (the Pond Dex and the fishing panel) ── */
.fish-dex-head.festival { color: #ff9fc8; margin-top: 4px; }
.fest-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0; color: #ffd166; font: 7px/1.3 "Press Start 2P", ui-monospace, monospace; }
.fest-head span { color: #8fb8d8; font-size: 6px; }
.fest-head.on { color: #7ee3a8; }
.fest-head.on span { color: #7ee3a8; }
.fest-note { margin: 0; color: #9fc4c9; font: 600 11px/1.4 ui-sans-serif, system-ui, sans-serif; }
.fest-note.all { color: #ffd6eb; }
.fh-chip.fest { background: #4a1c3a; color: #ffd6eb; }
