:root {
  --ink: #173746;
  --paper: #fff8df;
  --sun: #f2c84b;
  --coral: #e9504e;
  --forest: #24664a;
  --sky: #a8dcf0;
  --blue: #2877bf;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #102b27;
}

html.pan-enabled,
body.pan-enabled {
  overflow: auto;
  cursor: grab;
}

body.pan-enabled.dragging-page {
  cursor: grabbing;
}

body.pan-enabled .game {
  position: relative;
  width: max(100vw, 1180px);
  height: max(100vh, 340px);
}

body,
button {
  font-family: "YouYuan", "STKaiti", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button {
  color: inherit;
}

.game {
  position: fixed;
  inset: 0;
  min-width: 320px;
  min-height: 320px;
  overflow: hidden;
  color: var(--paper);
  background: var(--sky);
  user-select: none;
  -webkit-user-select: none;
}

.developer-access {
  position: absolute;
  z-index: 24;
  top: max(78px, calc(env(safe-area-inset-top) + 68px));
  right: max(18px, env(safe-area-inset-right));
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid rgba(255, 245, 198, 0.72);
  border-radius: 4px;
  color: #fff4c1;
  background: rgba(17, 57, 56, 0.82);
  box-shadow: 0 6px 14px rgba(5, 28, 27, 0.25);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.developer-mode .developer-access {
  border-color: #ffe37a;
  color: #173746;
  background: #ffe37a;
}

.world,
.world canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world canvas {
  display: block;
  touch-action: none;
}

.loading {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--ink);
  background: var(--sky);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.loading.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading span {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(23, 55, 70, 0.18);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: loading-spin 760ms linear infinite;
}

.loading strong {
  font-size: 16px;
}

.loading small {
  max-width: 340px;
  text-align: center;
}

.entrance {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff7d5;
  background: transparent;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.entrance[hidden] {
  display: none;
}

.barn-facade {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: transparent;
}

.barn-door {
  position: relative;
  overflow: hidden;
  border-top: 18px solid #39271f;
  border-bottom: 18px solid #39271f;
  background:
    repeating-linear-gradient(90deg, transparent 0 13%, rgba(42, 25, 20, 0.5) 13% 15%),
    linear-gradient(180deg, #8c4e33, #633824);
  box-shadow: inset 0 0 0 8px #4c2e23, inset 0 0 45px rgba(27, 17, 14, 0.4);
  transition: transform 920ms cubic-bezier(0.65, 0, 0.35, 1);
}

.barn-door-left {
  border-right: 5px solid #2f211b;
  transform-origin: left center;
}

.barn-door-right {
  border-left: 5px solid #2f211b;
  transform-origin: right center;
}

.barn-door i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 128%;
  height: 22px;
  background: #402a21;
  box-shadow: 0 4px 10px rgba(20, 12, 10, 0.28);
}

.barn-door i:first-child {
  transform: translate(-50%, -50%) rotate(32deg);
}

.barn-door i:last-child {
  transform: translate(-50%, -50%) rotate(-32deg);
}

.entrance-title {
  position: absolute;
  z-index: 2;
  top: max(24px, env(safe-area-inset-top));
  left: 50%;
  text-align: center;
  text-shadow: 0 4px 14px rgba(22, 12, 9, 0.55);
  transform: translateX(-50%);
  transition: opacity 180ms ease;
}

.entrance-title small {
  color: #ffdc6c;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 900;
}

.entrance-title h1 {
  margin: 3px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 42px;
  line-height: 1;
}

.character-settings-button {
  position: absolute;
  z-index: 12;
  min-height: 38px;
  padding: 7px 13px;
  border: 2px solid rgba(255, 244, 189, 0.76);
  border-radius: 4px;
  color: #fff4bd;
  background: rgba(17, 57, 56, 0.84);
  box-shadow: 0 5px 12px rgba(5, 28, 27, 0.24);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.entrance-character-button {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.lobby-character-button {
  top: max(18px, env(safe-area-inset-top));
  left: calc(50% + 116px);
}

.history-button {
  position: absolute;
  z-index: 12;
  top: max(18px, env(safe-area-inset-top));
  right: calc(50% + 116px);
  min-height: 38px;
  padding: 7px 13px;
  border: 2px solid rgba(255, 244, 189, 0.76);
  border-radius: 4px;
  color: #fff4bd;
  background: rgba(17, 57, 56, 0.84);
  box-shadow: 0 5px 12px rgba(5, 28, 27, 0.24);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.rule-board {
  position: relative;
  z-index: 2;
  width: min(500px, calc(100% - 36px));
  margin-bottom: 54px;
  padding: 18px 24px 20px;
  border: 5px solid #ddb75c;
  border-radius: 4px;
  color: #f7edce;
  background: #173e38;
  box-shadow: 0 12px 0 #39271f, 0 26px 60px rgba(16, 9, 7, 0.4);
  transition: opacity 170ms ease, transform 260ms ease;
}

.rule-board > small {
  color: #ffda62;
  font-size: 10px;
  font-weight: 900;
}

.rule-board h2 {
  margin: 3px 0 12px;
  font-size: 25px;
}

.rule-board ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rule-board li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.rule-board li b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid #ffdc6c;
  border-radius: 50%;
  color: #ffdc6c;
  font-family: Georgia, serif;
}

.enter-game-button {
  position: absolute;
  z-index: 3;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  min-width: 240px;
  min-height: 72px;
  grid-template-columns: 1fr 34px;
  grid-template-rows: auto auto;
  align-content: center;
  padding: 10px 16px 10px 20px;
  border: 3px solid #fff0a8;
  border-radius: 5px;
  color: #fffdf0;
  background: var(--coral);
  box-shadow: 0 7px 0 #a52f34, 0 15px 28px rgba(22, 12, 9, 0.36);
  cursor: pointer;
  text-align: left;
  transform: translateX(-50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.enter-game-button small {
  grid-column: 1;
  font-size: 9px;
  font-weight: 800;
}

.enter-game-button strong {
  grid-column: 1;
  font-size: 22px;
}

.enter-game-button span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 28px;
}

.entrance.opening .barn-door-left {
  transform: translateX(-101%);
}

.entrance.opening .barn-door-right {
  transform: translateX(101%);
}

.entrance.opening .entrance-title,
.entrance.opening .rule-board,
.entrance.opening .enter-game-button {
  opacity: 0;
  pointer-events: none;
}

.entrance.opening .rule-board {
  transform: scale(0.96);
}

.entrance.opening .enter-game-button {
  transform: translate(-50%, 8px);
}

.game[data-phase="entrance"] .developer-access,
.game[data-phase="opening"] .developer-access {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.lobby {
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: 1;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.lobby::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(10, 49, 43, 0.42) 0%, transparent 27%, transparent 68%, rgba(10, 49, 43, 0.32) 100%),
    linear-gradient(90deg, rgba(10, 49, 43, 0.22) 0%, transparent 34%);
  pointer-events: none;
}

.lobby.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.lobby-title {
  position: absolute;
  top: max(26px, env(safe-area-inset-top));
  left: max(34px, env(safe-area-inset-left));
  text-shadow: 0 3px 14px rgba(4, 35, 31, 0.38);
}

.lobby-title span {
  display: block;
  margin-bottom: 4px;
  color: #ffdc6c;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 900;
}

.lobby-title h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 52px;
  line-height: 1;
}

.lobby-title p {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 900;
}

.home-button {
  position: absolute;
  z-index: 8;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 2px solid rgba(255, 244, 189, 0.72);
  border-radius: 4px;
  color: #fff4bd;
  background: rgba(17, 57, 56, 0.8);
  box-shadow: 0 5px 12px rgba(5, 28, 27, 0.2);
  cursor: pointer;
  transform: translateX(-50%);
}

.home-button strong {
  font-size: 11px;
}

.nickname-button {
  display: inline-grid;
  min-width: 104px;
  min-height: 38px;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 5px 9px;
  border: 2px solid rgba(255, 244, 189, 0.72);
  border-radius: 4px;
  color: #fff4bd;
  background: rgba(17, 57, 56, 0.76);
  box-shadow: 0 5px 12px rgba(5, 28, 27, 0.2);
  cursor: pointer;
}

.nickname-button small {
  color: #cce8d8;
  font-size: 9px;
  font-weight: 900;
}

.nickname-button strong {
  max-width: 96px;
  overflow: hidden;
  color: #ffdc6c;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-status {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
}

.developer-mode .lobby-status::before {
  display: grid;
  height: 34px;
  place-items: center;
  padding: 0 9px;
  border: 2px solid #ffe37a;
  border-radius: 4px;
  color: #173746;
  background: #ffe37a;
  content: "DEV \221E";
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 900;
}

.lobby-status > span {
  display: flex;
  min-width: 70px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 2px solid rgba(255, 248, 218, 0.58);
  border-radius: 4px;
  color: #fff7d2;
  background: rgba(13, 48, 51, 0.76);
  box-shadow: 0 8px 20px rgba(5, 25, 28, 0.24);
  backdrop-filter: blur(8px);
}

.lobby-status i {
  color: #ffda62;
  font-style: normal;
}

.lobby-status button {
  width: 42px;
  height: 42px;
  border: 2px solid #fff0a8;
  border-radius: 50%;
  color: #fff8df;
  background: var(--coral);
  box-shadow: 0 5px 0 #a52f34;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.horse-select {
  position: absolute;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(24px, env(safe-area-inset-left));
}

.stall-hotspots {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.stall-hotspots button {
  position: absolute;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.stall-door-hotspot {
  z-index: 1;
  width: 11%;
  height: 24%;
  pointer-events: auto;
}

.stall-name-hotspot {
  z-index: 2;
  width: 12%;
  height: 10%;
  pointer-events: auto;
}

.stall-hotspots button:hover,
.stall-hotspots button:focus-visible {
  border: 2px solid #ffe37a;
  outline: 0;
  background: rgba(255, 227, 122, 0.12);
}

.horse-select-heading {
  display: flex;
  width: min(650px, 66%);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.horse-select-heading p {
  margin: 0 0 8px;
  color: #fff4bd;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(10, 38, 33, 0.45);
}

.horse-select-heading p {
  margin: 0;
}

.horse-select-heading button {
  flex: none;
  min-height: 28px;
  padding: 4px 9px;
  border: 2px solid rgba(255, 244, 189, 0.66);
  border-radius: 4px;
  color: #fff4bd;
  background: rgba(17, 57, 56, 0.76);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.horse-tabs {
  display: grid;
  width: min(650px, 66%);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stable-care {
  position: absolute;
  z-index: 9;
  right: 0;
  bottom: 108px;
  left: auto;
  display: grid;
  width: 276px;
  grid-template-columns: 118px 150px;
  gap: 8px;
}

.select-race-horse-button {
  position: absolute;
  z-index: 9;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  min-width: 210px;
  min-height: 72px;
  grid-template-columns: 1fr 28px;
  grid-template-rows: auto auto;
  align-content: center;
  padding: 10px 15px 10px 18px;
  border: 3px solid #fff1ad;
  border-radius: 5px;
  color: #fffdf0;
  background: #2f8a68;
  box-shadow: 0 7px 0 #1b5945, 0 14px 24px rgba(20, 34, 28, 0.3);
  cursor: pointer;
  text-align: left;
  transform: translateX(-50%);
}

.select-race-horse-button small,
.select-race-horse-button strong {
  grid-column: 1;
}

.select-race-horse-button strong {
  font-size: 20px;
}

.select-race-horse-button span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 25px;
}

.select-race-horse-button[hidden] {
  display: none;
}

.cancel-race-selection-button {
  position: absolute;
  z-index: 10;
  top: max(126px, calc(env(safe-area-inset-top) + 112px));
  right: max(22px, env(safe-area-inset-right));
  min-height: 38px;
  padding: 7px 12px;
  border: 2px solid #fff0ad;
  border-radius: 4px;
  color: #fff8dc;
  background: #a44445;
  box-shadow: 0 5px 0 #6f2b2d;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.cancel-race-selection-button[hidden] {
  display: none;
}

.grooming-hud {
  position: absolute;
  z-index: 20;
  top: auto;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: grid;
  width: min(300px, calc(100% - 36px));
  grid-template-columns: 1fr auto;
  gap: 9px 12px;
  padding: 14px 46px 14px 16px;
  border: 3px solid #ffe37a;
  border-radius: 5px;
  color: #fff8dc;
  background: rgba(17, 57, 56, 0.9);
  box-shadow: 0 14px 35px rgba(5, 28, 27, 0.34);
  transform: none;
}

.grooming-hud[hidden] {
  display: none;
}

.grooming-copy {
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
}

.grooming-copy small {
  color: #cce8d8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.grooming-tool-card {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 240, 173, 0.5);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.grooming-tool-art,
.grooming-brush {
  width: 52px;
  height: 24px;
  border: 2px solid #56331f;
  border-radius: 12px 5px 5px 12px;
  background: linear-gradient(#a96e43, #75452b);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.18), 0 3px 5px rgba(0, 0, 0, 0.22);
}

.grooming-tool-art {
  position: relative;
  flex: none;
}

.grooming-tool-art::after,
.grooming-brush::after {
  position: absolute;
  right: 5px;
  bottom: -10px;
  left: 10px;
  height: 11px;
  content: "";
  background: repeating-linear-gradient(90deg, #e8c887 0 3px, #9a7444 3px 5px);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 4% 100%);
}

.grooming-tool-art[data-tool="sponge"],
.grooming-brush[data-tool="sponge"] {
  border-color: #8b6c2b;
  border-radius: 7px;
  background: #f0c94f;
}

.grooming-tool-art[data-tool="shampoo"] {
  position: relative;
  width: 30px;
  height: 48px;
  border-color: #2e6170;
  border-radius: 6px 6px 10px 10px;
  background: linear-gradient(90deg, #58aec1, #a8e2e8 52%, #5db3c4);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.25), 0 3px 5px rgba(0, 0, 0, 0.22);
}

.grooming-tool-art[data-tool="shampoo"]::before {
  position: absolute;
  top: -10px;
  left: 7px;
  width: 12px;
  height: 9px;
  border: 2px solid #2e6170;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
  background: #e7f1eb;
}

.grooming-tool-art[data-tool="shampoo"]::after {
  position: absolute;
  top: 17px;
  right: 4px;
  bottom: 7px;
  left: 4px;
  display: block;
  height: auto;
  content: "";
  border: 1px solid rgba(46, 97, 112, 0.75);
  border-radius: 5px;
  background: radial-gradient(circle at 65% 35%, #ffffff 0 3px, transparent 4px), #f8f3d7;
  clip-path: none;
}

.grooming-brush[data-tool="shampoo"] {
  width: 72px;
  height: 48px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 17% 64%, #ffffff 0 10px, #bcebf3 11px 13px, transparent 14px),
    radial-gradient(circle at 38% 42%, #ffffff 0 14px, #c9f1f5 15px 17px, transparent 18px),
    radial-gradient(circle at 62% 61%, #ffffff 0 13px, #bcebf3 14px 16px, transparent 17px),
    radial-gradient(circle at 84% 43%, #ffffff 0 9px, #d7f4f6 10px 12px, transparent 13px);
  box-shadow: none;
  filter: drop-shadow(0 4px 4px rgba(32, 91, 103, 0.28));
}

.grooming-brush[data-tool="shampoo"]::before,
.grooming-brush[data-tool="shampoo"]::after {
  position: absolute;
  display: block;
  content: "";
  border: 2px solid rgba(207, 244, 248, 0.95);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.grooming-brush[data-tool="shampoo"]::before {
  top: -5px;
  left: 9px;
  width: 15px;
  height: 15px;
}

.grooming-brush[data-tool="shampoo"]::after {
  top: 0;
  right: 6px;
  bottom: auto;
  left: auto;
  width: 10px;
  height: 10px;
  clip-path: none;
}

.grooming-tool-art[data-tool="hoofpick"],
.grooming-brush[data-tool="hoofpick"] {
  width: 54px;
  height: 13px;
  border-color: #3f4547;
  border-radius: 8px;
  background: #788486;
}

.grooming-tool-art[data-tool="sponge"]::after,
.grooming-tool-art[data-tool="hoofpick"]::after,
.grooming-brush[data-tool="sponge"]::after,
.grooming-brush[data-tool="hoofpick"]::after {
  display: none;
}

.grooming-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.grooming-progress-track b {
  display: block;
  width: 0;
  height: 100%;
  background: #79d99f;
}

.grooming-hud button {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 2px solid #fff0ad;
  border-radius: 50%;
  color: #fff8dc;
  background: transparent;
  cursor: pointer;
}

.grooming-brush {
  position: absolute;
  z-index: 21;
  pointer-events: none;
  transform: translate(-16%, -72%) rotate(-12deg);
  transition: filter 120ms ease, transform 120ms ease;
}

.grooming-brush[hidden] {
  display: none;
}

.grooming-target {
  position: absolute;
  z-index: 19;
  width: clamp(132px, 18vw, 210px);
  aspect-ratio: 1.45;
  border: 3px dashed rgba(255, 227, 122, 0.78);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 7px rgba(255, 227, 122, 0.1), inset 0 0 26px rgba(255, 227, 122, 0.08);
  animation: grooming-target-pulse 1.2s ease-in-out infinite;
}

.grooming-target[hidden] {
  display: none;
}

body.grooming-contact .grooming-target {
  border-color: #83e1a5;
  box-shadow: 0 0 0 9px rgba(131, 225, 165, 0.18), inset 0 0 32px rgba(131, 225, 165, 0.18);
}

body.grooming-contact .grooming-brush {
  filter: drop-shadow(0 0 7px rgba(131, 225, 165, 0.95));
  transform: translate(-16%, -72%) rotate(-18deg) scale(1.08);
}

@keyframes grooming-target-pulse {
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.05); }
}

.feeding-target {
  position: absolute;
  z-index: 19;
  width: clamp(76px, 10vw, 112px);
  aspect-ratio: 1;
  border: 3px dashed rgba(255, 227, 122, 0.9);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(255, 227, 122, 0.12);
  animation: grooming-target-pulse 1.1s ease-in-out infinite;
}

.feeding-item {
  position: absolute;
  z-index: 22;
  display: block;
  width: 82px;
  padding: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.feeding-target[hidden],
.feeding-item[hidden] {
  display: none;
}

.feeding-item button {
  display: grid;
  width: 82px;
  min-height: 82px;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 3px;
  padding: 8px;
  border: 3px solid #ffe37a;
  border-radius: 50%;
  color: #173e38;
  background: #fff9dc;
  box-shadow: 0 7px 0 #9a7331, 0 12px 20px rgba(23, 62, 56, 0.28);
  cursor: grab;
  user-select: none;
}

.feeding-item button > i {
  display: block;
  transform: scale(0.88);
}

.feeding-item button > strong {
  max-width: 68px;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feeding-item.dragging {
  z-index: 26;
  filter: drop-shadow(0 0 10px rgba(255, 227, 122, 0.9));
  transform: translate(-50%, -50%) scale(1.08);
}

.feeding-item.dragging button {
  cursor: grabbing;
}

.game[data-phase="lobby"] .world canvas,
.game[data-phase="lobby"] .lobby {
  cursor: grab;
  touch-action: none;
}

body.stable-dragging .world canvas,
body.stable-dragging .lobby {
  cursor: grabbing;
}

body.grooming-active .world canvas {
  cursor: none;
}

body.grooming-active .game {
  touch-action: none;
  user-select: none;
}

body.grooming-active .stall-hotspots,
body.grooming-active .stall-hotspots *,
body.grooming-active .horse-select,
body.grooming-active .horse-select *,
body.grooming-active .select-race-horse-button,
body.grooming-active .cancel-race-selection-button,
body.grooming-active .start-button {
  pointer-events: none !important;
}

.stable-care > span,
.stable-care > button {
  min-height: 66px;
  border: 2px solid rgba(255, 248, 223, 0.62);
  border-radius: 5px;
  color: var(--paper);
  background: rgba(16, 57, 55, 0.82);
  box-shadow: 0 8px 18px rgba(10, 38, 33, 0.2);
  backdrop-filter: blur(8px);
}

.stable-care > span {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 3px 6px;
  padding: 8px 10px;
}

.stable-care span small {
  color: #cce8d8;
  font-size: 10px;
  font-weight: 900;
}

.stable-care span strong {
  color: #ffdf62;
  font-family: Georgia, serif;
  font-size: 19px;
}

.stable-care span i {
  grid-column: 1 / 3;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(5, 29, 29, 0.52);
}

.stable-care span i b {
  display: block;
  width: 60%;
  height: 100%;
  background: #75d39b;
  transition: width 180ms ease;
}

.stable-care > button {
  display: grid;
  align-content: center;
  padding: 7px 11px;
  cursor: pointer;
  text-align: left;
}

.stable-care > button strong {
  font-size: 15px;
}

.stable-care > button small {
  margin-top: 3px;
  color: #ffdf62;
  font-size: 10px;
  font-weight: 900;
}

.stable-care > button.needs-brush small {
  color: #ffaaa2;
}

.horse-tab {
  display: grid;
  min-width: 0;
  min-height: 66px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 2px solid rgba(255, 248, 223, 0.52);
  border-radius: 5px;
  color: var(--paper);
  background: rgba(16, 57, 55, 0.72);
  box-shadow: 0 8px 18px rgba(10, 38, 33, 0.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.horse-tab:hover,
.horse-tab.selected {
  border-color: #ffe582;
  background: rgba(28, 83, 67, 0.94);
  transform: translateY(-4px);
}

.horse-tab:focus-visible,
.start-button:focus-visible,
.race-actions button:focus-visible,
.result button:focus-visible {
  outline: 3px solid #fff7c9;
  outline-offset: 3px;
}

.horse-tab > span {
  display: grid;
  min-width: 0;
  text-align: left;
}

.horse-tab strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horse-tab small {
  margin-top: 2px;
  color: #cce8d8;
  font-size: 11px;
  font-weight: 800;
}

.horse-tab em {
  margin-top: 2px;
  overflow: hidden;
  color: #ffdf62;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horse-tab.locked {
  border-style: dashed;
  filter: saturate(0.55);
}

.horse-tab.locked::after {
  color: #ffdf62;
  content: "\9501";
  font-size: 13px;
  font-weight: 900;
}

.coat {
  display: block;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  box-shadow: inset 9px -9px 14px rgba(5, 20, 23, 0.28), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.coat-chestnut {
  background: #8f4527;
}

.coat-black {
  background: #15181d;
}

.coat-bay {
  background: #b9652f;
}

.coat-grey {
  background: #c9d0d1;
}

.start-button {
  position: absolute;
  right: max(34px, env(safe-area-inset-right));
  bottom: max(34px, env(safe-area-inset-bottom));
  display: grid;
  width: 245px;
  min-height: 92px;
  grid-template-columns: 1fr 40px;
  grid-template-rows: auto auto;
  align-content: center;
  padding: 15px 16px 15px 20px;
  border: 3px solid #fff1ad;
  border-radius: 6px;
  color: #fffdf0;
  background: var(--coral);
  box-shadow: 0 8px 0 #a52f34, 0 16px 30px rgba(27, 35, 31, 0.34);
  cursor: pointer;
  text-align: left;
}

.start-button:disabled {
  cursor: wait;
  filter: grayscale(0.7);
}

.start-button small {
  grid-column: 1;
  font-size: 11px;
  font-weight: 800;
}

.start-button strong {
  grid-column: 1;
  font-size: 26px;
}

.start-button span {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-family: Georgia, serif;
  font-size: 38px;
}

.start-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #a52f34, 0 9px 18px rgba(27, 35, 31, 0.3);
}

.stable-message {
  position: absolute;
  top: 29%;
  left: 50%;
  padding: 8px 14px;
  border: 2px solid rgba(255, 245, 194, 0.72);
  border-radius: 4px;
  color: #fff7ce;
  background: rgba(17, 57, 56, 0.88);
  box-shadow: 0 8px 18px rgba(4, 28, 25, 0.25);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.stable-message.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.race-ui {
  position: absolute;
  z-index: 8;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.race-ui.active {
  visibility: visible;
  opacity: 1;
}

.quit-race-button {
  position: absolute;
  z-index: 15;
  top: max(96px, calc(env(safe-area-inset-top) + 86px));
  left: max(18px, env(safe-area-inset-left));
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  align-content: center;
  border: 3px solid rgba(255, 247, 210, 0.82);
  border-radius: 50%;
  color: #fff9db;
  background: rgba(91, 55, 50, 0.88);
  box-shadow: 0 6px 0 rgba(54, 36, 32, 0.9), 0 12px 22px rgba(7, 30, 28, 0.28);
  cursor: pointer;
  pointer-events: auto;
}

.quit-race-button span {
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 0.85;
}

.quit-race-button small {
  font-size: 9px;
  font-weight: 900;
}

.quit-race-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(54, 36, 32, 0.9), 0 7px 14px rgba(7, 30, 28, 0.25);
}

.race-hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 108px minmax(270px, 560px) 92px;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  pointer-events: none;
}

.rank,
.race-clock,
.progress-panel {
  border: 2px solid rgba(255, 248, 218, 0.58);
  color: var(--paper);
  background: rgba(13, 48, 51, 0.76);
  box-shadow: 0 8px 20px rgba(5, 25, 28, 0.24);
  backdrop-filter: blur(8px);
}

.rank {
  display: grid;
  min-height: 74px;
  align-content: center;
  padding: 7px 12px;
  border-radius: 5px;
}

.rank small,
.race-clock small {
  color: #bce8d2;
  font-size: 10px;
  font-weight: 900;
}

.rank strong {
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 0.92;
}

.rank i {
  margin-left: 4px;
  color: #ffda62;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-style: normal;
}

.race-clock {
  display: grid;
  min-height: 61px;
  align-content: center;
  padding: 8px 12px;
  border-radius: 5px;
}

.race-clock strong {
  color: #ffdf6d;
  font-family: Georgia, serif;
  font-size: 24px;
}

.progress-panel {
  padding: 8px 12px 11px;
  border-radius: 5px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 900;
}

.progress-meta b {
  color: #ffdf6d;
}

.progress-track {
  position: relative;
  height: 10px;
  margin: 0 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  background: rgba(8, 30, 34, 0.55);
}

.progress-track::before {
  position: absolute;
  inset: 2px;
  content: "";
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 3%, transparent 3% 6%);
}

.finish-mark {
  position: absolute;
  top: -5px;
  right: -3px;
  width: 4px;
  height: 16px;
  background: #fff4c6;
}

.race-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid #fff8de;
  border-radius: 50%;
  background: #477d8c;
  transform: translate(-50%, -50%);
  transition: left 100ms linear;
}

.race-marker.player {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink);
  background: #ffdf62;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.rival-a {
  background: #e44c4f;
}

.rival-b {
  background: #3c7ed8;
}

.rival-c {
  background: #e0aa32;
}

.rival-d {
  background: #8b5ac4;
}

.rival-e {
  background: #3ca873;
}

.countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  color: #fff8df;
  font-family: Georgia, serif;
  font-size: 104px;
  font-weight: 900;
  text-shadow: 0 8px 0 rgba(21, 67, 60, 0.66), 0 14px 34px rgba(4, 28, 25, 0.42);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  pointer-events: none;
}

.countdown.pop {
  animation: countdown-pop 700ms ease-out both;
}

.countdown.go {
  color: #ffdf62;
  font-size: 86px;
}

@keyframes countdown-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }

  22% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.92);
  }

  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
}

.race-message {
  position: absolute;
  top: 31%;
  left: 50%;
  padding: 8px 14px;
  border: 2px solid rgba(255, 245, 194, 0.68);
  border-radius: 4px;
  color: #fff7ce;
  background: rgba(17, 57, 56, 0.82);
  box-shadow: 0 8px 18px rgba(4, 28, 25, 0.25);
  font-size: 14px;
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.race-message.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.steer-zone {
  position: absolute;
  z-index: 2;
  top: 24%;
  right: 30%;
  bottom: 0;
  left: 0;
  touch-action: none;
  pointer-events: auto;
}

.steer-cursor {
  position: absolute;
  bottom: 44px;
  left: 50%;
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 248, 214, 0.86);
  border-radius: 50%;
  background: rgba(31, 91, 76, 0.34);
  opacity: 0;
  transform: translateX(-50%) scale(0.75);
  transition: opacity 100ms ease, transform 100ms ease;
  pointer-events: none;
}

.steer-cursor.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.race-actions {
  position: absolute;
  z-index: 4;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 62px auto 110px;
  align-items: end;
  gap: 10px;
  pointer-events: none;
}

.race-actions > button,
.race-actions > .item-button {
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 247, 210, 0.84);
  color: #fff9db;
  background: rgba(25, 85, 71, 0.9);
  box-shadow: 0 7px 0 rgba(10, 48, 43, 0.9), 0 13px 22px rgba(7, 30, 28, 0.28);
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}

.view-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.view-button span {
  font-size: 23px;
  line-height: 1;
}

.view-button small,
.item-button small {
  font-size: 9px;
  font-weight: 900;
}

.view-button.active {
  color: var(--ink);
  background: #ffdf62;
  transform: translateY(5px);
}

.item-button {
  width: 70px;
  height: 70px;
  align-content: center;
  border-radius: 5px;
  transition: width 180ms ease, transform 140ms ease;
}

.item-button[data-count="2"] {
  width: 108px;
}

.item-button[data-count="3"] {
  width: 146px;
}

.item-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.item-slot,
.item-slots > i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(255, 248, 218, 0.72);
  border-radius: 50%;
  color: #ffdf62;
  background: rgba(8, 47, 43, 0.56);
  font-size: 27px;
  font-style: normal;
  line-height: 1;
}

.item-slot {
  padding: 0;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.item-slot:active {
  transform: translateY(2px) scale(0.96);
}

.item-button.disabled {
  filter: grayscale(1);
  opacity: 0.6;
}

.sprint-button {
  position: relative;
  width: 106px;
  height: 106px;
  align-content: center;
  border-radius: 50%;
  background: var(--coral) !important;
  box-shadow: 0 9px 0 #a52f34, 0 16px 26px rgba(42, 25, 22, 0.34) !important;
  overflow: hidden;
}

.sprint-button span {
  font-size: 21px;
  font-weight: 900;
}

.sprint-button i {
  position: absolute;
  right: 15px;
  bottom: 17px;
  left: 15px;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(77, 24, 24, 0.42);
}

.sprint-button i b {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffe16b;
  transition: width 90ms linear;
}

.sprint-button.active {
  transform: translateY(6px) scale(0.98);
  box-shadow: 0 3px 0 #a52f34, 0 9px 16px rgba(42, 25, 22, 0.3) !important;
}

.game.final-stretch::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(100deg, transparent 0 48px, rgba(255, 255, 255, 0.15) 49px 51px, transparent 52px 90px);
  animation: speed-lines 320ms linear infinite;
  pointer-events: none;
}

@keyframes speed-lines {
  from {
    transform: translateX(-8%);
  }

  to {
    transform: translateX(8%);
  }
}

.finish-flash {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: #fff9dc;
  opacity: 0;
  pointer-events: none;
}

.finish-flash.show {
  animation: finish-flash 720ms ease-out both;
}

@keyframes finish-flash {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 0.94;
  }

  100% {
    opacity: 0;
  }
}

.result {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(360px, calc(100% - 36px));
  justify-items: center;
  padding: 24px 28px 28px;
  border: 5px solid #fff0ad;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 24px 80px rgba(7, 33, 30, 0.48);
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -44%) scale(0.92);
  transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

.result.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.result p {
  margin: 0 0 4px;
  color: #2d8060;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 900;
}

.result strong {
  color: var(--coral);
  font-size: 48px;
}

.result > span {
  margin-top: 3px;
  color: #416170;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 900;
}

.result > small {
  margin-top: 7px;
  color: #416170;
  font-size: 12px;
  font-weight: 900;
}

.result-record {
  width: 100%;
  margin-top: 11px;
  padding: 9px 10px;
  border: 2px solid #e0ad41;
  border-radius: 4px;
  color: #7a461d;
  background: #ffe9a8;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.result-record[hidden] {
  display: none;
}

.result-actions {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 20px;
}

.result button {
  min-width: 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 4px;
  color: #fff9df;
  background: var(--forest);
  box-shadow: 0 6px 0 #174636;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.result-feed-button,
#resultFeedButton {
  color: var(--ink) !important;
  background: #ffdf62 !important;
  box-shadow: 0 6px 0 #bb8f25 !important;
}

.food-shop {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 5px solid #fff0ad;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.food-shop::backdrop {
  background: rgba(8, 35, 32, 0.68);
  backdrop-filter: blur(4px);
}

.food-shop header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  color: #fff8dd;
  background: var(--forest);
}

.food-shop header small {
  color: #ffdf6b;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.food-shop h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.food-shop header button {
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  color: #fff8dd;
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 25px;
}

.shop-balance {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin: 0;
  padding: 12px 20px;
  color: #365766;
  background: #e8f0da;
  font-size: 12px;
  font-weight: 900;
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px 20px 0;
}

.shop-tabs button {
  min-height: 36px;
  border: 2px solid #bed0b8;
  border-radius: 4px;
  color: #456557;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.shop-tabs button.selected {
  border-color: var(--forest);
  color: #fff8dd;
  background: var(--forest);
}

.shop-page[hidden] {
  display: none;
}

.food-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 20px 8px;
}

.food-options button {
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 2px solid #bed0b8;
  border-radius: 5px;
  color: var(--ink);
  background: #f2f4de;
  cursor: pointer;
  text-align: left;
}

.food-options button:hover {
  border-color: #e1b63a;
  background: #fff2bd;
}

.food-options button.owned {
  border-color: #62a77a;
  background: #e4f1dc;
}

.coat-pinto {
  background: radial-gradient(circle at 28% 32%, #f3eee2 0 22%, transparent 23%), radial-gradient(circle at 72% 68%, #f3eee2 0 18%, transparent 19%), #7a432c;
}

.coat-dapple {
  background: radial-gradient(circle at 30% 35%, #dce1df 0 9%, transparent 10%), radial-gradient(circle at 68% 38%, #dce1df 0 8%, transparent 9%), radial-gradient(circle at 54% 72%, #dce1df 0 10%, transparent 11%), #858b8c;
}

.coat-palomino {
  background: linear-gradient(120deg, #f1dfae 0 25%, #c9954d 26% 100%);
}

.coat-roan {
  background: repeating-linear-gradient(45deg, #8c514a 0 5px, #bda9a0 5px 7px);
}

.coin-recharge-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 7px;
  margin: 9px 20px 12px;
  padding: 10px;
  border: 2px solid #d4b355;
  border-radius: 5px;
  color: #365766;
  background: #fff0bd;
}

.coin-recharge-panel div {
  display: grid;
}

.coin-recharge-panel small {
  font-size: 9px;
  font-weight: 800;
}

.coin-recharge-panel button {
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  color: #fff8dd;
  background: var(--coral);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

.food-options button.equipped {
  border-color: #e1b63a;
  background: #fff0af;
}

.food-options i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff8df;
  background: var(--coral);
  font-style: normal;
  font-weight: 900;
}

.race-item-options .race-item-art {
  position: relative;
  border: 0;
  color: transparent;
  background: transparent;
}

.race-item-art.stopwatch {
  width: 38px;
  height: 38px;
  border: 4px solid #245c68;
  background:
    linear-gradient(32deg, transparent 47%, #e9504e 48% 53%, transparent 54%),
    linear-gradient(90deg, transparent 47%, #173746 48% 53%, transparent 54%),
    #fff8df;
  box-shadow: inset 0 0 0 3px #9ccbd0;
}

.race-item-art.stopwatch::before {
  position: absolute;
  top: -9px;
  left: 11px;
  width: 10px;
  height: 7px;
  border: 3px solid #245c68;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
}

.race-item-art.mud-puddle {
  width: 42px;
  height: 27px;
  border-radius: 50% 45% 48% 42%;
  background:
    radial-gradient(circle at 26% 30%, #c39a63 0 8%, transparent 9%),
    radial-gradient(circle at 68% 60%, #6d4a31 0 12%, transparent 13%),
    #8b6240;
  box-shadow: 8px 3px 0 -3px #6d4a31, -7px 4px 0 -4px #a5774a;
}

.race-item-art.shield-art {
  width: 38px;
  height: 42px;
  border-radius: 4px 4px 16px 16px;
  background: #4ca8bd;
  box-shadow: inset 0 0 0 5px #d8f2ec, inset 0 -10px 0 rgba(24, 69, 78, 0.22);
  clip-path: polygon(50% 0, 96% 14%, 88% 66%, 50% 100%, 12% 66%, 4% 14%);
}

.race-item-art.crate-art {
  width: 40px;
  height: 36px;
  border: 4px solid #68452e;
  border-radius: 3px;
  background:
    linear-gradient(35deg, transparent 43%, #68452e 44% 54%, transparent 55%),
    linear-gradient(-35deg, transparent 43%, #68452e 44% 54%, transparent 55%),
    #bd8651;
}

.race-item-art.mixed-art {
  width: 42px;
  height: 42px;
  border: 4px solid #fff3c7;
  background: conic-gradient(#e9504e 0 33%, #4ca8bd 33% 66%, #8b6240 66%);
  box-shadow: 0 0 0 2px #49695e;
}

.food-options span {
  display: grid;
  min-width: 0;
}

.food-options strong {
  font-size: 15px;
}

.food-options small {
  margin-top: 3px;
  color: #52705c;
  font-size: 10px;
  font-weight: 900;
}

.shop-message {
  min-height: 35px;
  margin: 0;
  padding: 8px 20px 16px;
  color: #546d64;
  font-size: 11px;
  font-weight: 900;
}

.recharge-panel {
  margin: 7px 20px 0;
  padding: 10px;
  border: 2px solid #e1b63a;
  border-radius: 5px;
  background: #fff0bd;
}

.recharge-panel[hidden] {
  display: none;
}

.recharge-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #684c1d;
}

.recharge-heading strong {
  font-size: 13px;
}

.recharge-heading small {
  font-size: 9px;
  font-weight: 900;
}

.recharge-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.recharge-options button {
  display: grid;
  min-height: 45px;
  align-content: center;
  border: 2px solid #d69a2f;
  border-radius: 4px;
  color: #5b421c;
  background: #fff9df;
  cursor: pointer;
}

.recharge-options strong {
  font-size: 12px;
}

.recharge-options small {
  color: #b34b38;
  font-size: 10px;
  font-weight: 900;
}

.recharge-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(114, 77, 22, 0.25);
}

.recharge-confirm[hidden] {
  display: none;
}

.recharge-confirm span {
  min-width: 0;
  color: #60451c;
  font-size: 10px;
  font-weight: 900;
}

.recharge-confirm button {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 3px;
  color: #fff8dd;
  background: #7d7564;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}

#confirmRechargeButton {
  background: var(--coral);
}

.developer-dialog {
  width: min(390px, calc(100% - 28px));
  padding: 24px;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.developer-dialog::backdrop {
  background: rgba(8, 35, 32, 0.72);
  backdrop-filter: blur(4px);
}

.developer-dialog > small {
  color: #b78022;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.developer-dialog h2 {
  margin: 3px 0 8px;
  font-size: 27px;
}

.developer-dialog p {
  margin: 0 0 15px;
  color: #547063;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.developer-dialog label {
  display: block;
  margin-bottom: 5px;
  color: #426252;
  font-size: 11px;
  font-weight: 900;
}

.developer-dialog input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 2px solid #a8bea9;
  border-radius: 4px;
  color: var(--ink);
  background: #fffef3;
  font-family: Georgia, serif;
  font-size: 24px;
}

.developer-dialog input:focus {
  border-color: var(--forest);
  outline: 2px solid rgba(36, 102, 74, 0.2);
}

.developer-error {
  display: block;
  min-height: 20px;
  padding-top: 5px;
  color: #c4423f;
  font-size: 11px;
  font-weight: 900;
}

.developer-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.developer-dialog-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  color: #fff8dd;
  background: #7b7464;
  cursor: pointer;
  font-weight: 900;
}

#confirmDeveloperButton {
  grid-column: 2;
  background: var(--forest);
}

.developer-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid #95aa98;
  border-radius: 50%;
  color: #55705e;
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 22px;
}

.exit-dialog {
  width: min(390px, calc(100% - 28px));
  padding: 24px;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.exit-dialog::backdrop {
  background: rgba(8, 35, 32, 0.74);
  backdrop-filter: blur(4px);
}

.exit-dialog > small {
  color: #b78022;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.exit-dialog h2 {
  margin: 3px 0 8px;
  color: #9e3437;
  font-size: 27px;
}

.exit-dialog p {
  margin: 0 0 14px;
  color: #547063;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.exit-dialog > strong {
  display: block;
  padding: 10px 12px;
  border-left: 4px solid var(--coral);
  color: #793c37;
  background: #f5e6c9;
  font-size: 13px;
}

.exit-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.exit-dialog-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  color: #fff8dd;
  background: var(--forest);
  cursor: pointer;
  font-weight: 900;
}

.nickname-dialog {
  width: min(390px, calc(100% - 28px));
  padding: 24px;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.nickname-dialog::backdrop {
  background: rgba(8, 35, 32, 0.72);
  backdrop-filter: blur(4px);
}

.nickname-dialog > small {
  color: #b78022;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.nickname-dialog h2 {
  margin: 3px 0 7px;
  font-size: 25px;
}

.nickname-dialog p {
  margin: 0 0 14px;
  color: #547063;
  font-size: 12px;
  font-weight: 800;
}

.nickname-dialog label {
  display: block;
  margin-bottom: 5px;
  color: #426252;
  font-size: 11px;
  font-weight: 900;
}

.nickname-dialog input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 2px solid #a8bea9;
  border-radius: 4px;
  color: var(--ink);
  background: #fffef3;
  font-size: 18px;
  font-weight: 900;
}

.nickname-dialog input + label {
  margin-top: 10px;
}

.nickname-error {
  display: block;
  min-height: 20px;
  padding-top: 5px;
  color: #c4423f;
  font-size: 11px;
  font-weight: 900;
}

.save-nickname-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  color: #fff8dd;
  background: var(--forest);
  cursor: pointer;
  font-weight: 900;
}

.nickname-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid #95aa98;
  border-radius: 50%;
  color: #55705e;
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 22px;
}

#confirmExitButton {
  background: var(--coral);
}

.purchase-horse-dialog {
  width: min(380px, calc(100% - 28px));
  padding: 24px;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.purchase-horse-dialog::backdrop {
  background: rgba(8, 35, 32, 0.72);
  backdrop-filter: blur(4px);
}

.purchase-horse-dialog > small {
  color: #b78022;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.purchase-horse-dialog h2 {
  margin: 3px 0 8px;
  font-size: 25px;
}

.purchase-horse-dialog p {
  color: #547063;
  font-size: 12px;
  font-weight: 800;
}

.purchase-horse-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.purchase-horse-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  color: #fff8dd;
  background: #7b7464;
  cursor: pointer;
  font-weight: 900;
}

#confirmHorsePurchaseButton {
  background: var(--forest);
}

.equipment-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(90vh, 650px);
  padding: 0;
  overflow: auto;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.equipment-dialog::backdrop {
  background: rgba(8, 35, 32, 0.74);
  backdrop-filter: blur(4px);
}

.equipment-dialog > header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  color: #fff8dc;
  background: #173e38;
}

.equipment-dialog > header small {
  color: #ffda62;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.equipment-dialog > header h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.equipment-dialog > header button {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 244, 189, 0.72);
  border-radius: 50%;
  color: #fff4bd;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.equipment-dialog > p:not(.equipment-message) {
  margin: 14px 18px 10px;
  color: #547063;
  font-size: 12px;
  font-weight: 800;
}

.equipment-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 0 18px 12px;
}

.equipment-levels button {
  min-height: 34px;
  border: 2px solid #9bb4a2;
  border-radius: 4px;
  color: #426252;
  background: #fffef3;
  cursor: pointer;
  font-weight: 900;
}

.equipment-levels button.selected {
  border-color: #1f6a50;
  color: #fff8dc;
  background: #2f8a68;
}

.equipment-kind {
  padding: 0 18px 13px;
}

.equipment-kind h3 {
  margin: 0 0 7px;
  color: #355b4a;
  font-size: 13px;
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.equipment-grid button {
  display: grid;
  min-height: 72px;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 2px solid #a9bba9;
  border-radius: 4px;
  color: #355b4a;
  background: #fffef3;
  cursor: pointer;
  text-align: left;
}

.equipment-grid button.selected {
  border-color: #d2a52f;
  outline: 2px solid #ffe37a;
  background: #fff7cf;
}

.equipment-grid button.unowned {
  border-style: dashed;
  color: #725c47;
  background: #f3ead7;
}

.equipment-grid button.borrowed {
  border-style: dashed;
  border-color: #d2a933;
  color: #315b4a;
  background: #fff3bd;
}

.equipment-grid i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff7d8;
  background: #77503a;
  font-style: normal;
  font-weight: 900;
}

.equipment-grid span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.equipment-grid strong {
  font-size: 12px;
}

.equipment-grid small {
  color: #88704e;
  font-size: 9px;
  font-weight: 900;
}

.equipment-empty {
  grid-column: 1 / -1;
  padding: 14px;
  color: #75877a;
  background: #eee8d7;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.equipment-message {
  min-height: 22px;
  margin: 0 18px 8px;
  color: #b74440;
  font-size: 11px;
  font-weight: 900;
}

.equipment-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(83, 111, 96, 0.22);
  background: #fff9e8;
}

.equipment-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  color: #fff8dc;
  background: #746d5f;
  cursor: pointer;
  font-weight: 900;
}

#confirmRaceEquipmentButton {
  background: #2f8a68;
}

#groomFromEquipmentButton {
  color: #274c42;
  background: #d8e9d8;
}

#confirmRaceEquipmentButton:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.groom-tool-dialog {
  width: min(560px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.groom-tool-dialog::backdrop {
  background: rgba(8, 35, 32, 0.74);
  backdrop-filter: blur(4px);
}

.groom-tool-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 12px;
  color: #fff8dc;
  background: #173e38;
}

.groom-tool-dialog > header small {
  color: #ffda62;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.groom-tool-dialog > header h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.groom-tool-dialog > header button {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 244, 189, 0.72);
  border-radius: 50%;
  color: #fff4bd;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.groom-tool-dialog > p:not(.groom-tool-message) {
  margin: 13px 18px 9px;
  color: #547063;
  font-size: 12px;
  font-weight: 800;
}

.groom-tool-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 10px;
}

.groom-tool-options button {
  display: grid;
  min-height: 62px;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 2px solid #a9bba9;
  border-radius: 4px;
  color: #355b4a;
  background: #fffef3;
  cursor: pointer;
  text-align: left;
}

.groom-tool-options i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff8dc;
  background: #2f8a68;
  font-style: normal;
  font-weight: 900;
}

.groom-tool-options button[data-groom-tool="shampoo"] > i,
.food-options button[data-shop-item="shampoo"] > i {
  position: relative;
  width: 26px;
  height: 36px;
  justify-self: center;
  overflow: visible;
  border: 2px solid #2e6170;
  border-radius: 5px 5px 8px 8px;
  color: transparent;
  background: linear-gradient(90deg, #58aec1, #a8e2e8 52%, #5db3c4);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.28), 0 3px 5px rgba(27, 72, 79, 0.25);
  font-size: 0;
}

.groom-tool-options button[data-groom-tool="shampoo"] > i::before,
.food-options button[data-shop-item="shampoo"] > i::before {
  position: absolute;
  top: -9px;
  left: 6px;
  width: 10px;
  height: 8px;
  border: 2px solid #2e6170;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
  background: #eff7f2;
}

.groom-tool-options button[data-groom-tool="shampoo"] > i::after,
.food-options button[data-shop-item="shampoo"] > i::after {
  position: absolute;
  top: 13px;
  right: 4px;
  bottom: 5px;
  left: 4px;
  content: "";
  border: 1px solid rgba(46, 97, 112, 0.7);
  border-radius: 4px;
  background: radial-gradient(circle at 66% 34%, #ffffff 0 2px, transparent 3px), #fff4cb;
}

.groom-tool-options span {
  display: grid;
  gap: 2px;
}

.groom-tool-options strong {
  font-size: 12px;
}

.groom-tool-options small {
  color: #708477;
  font-size: 9px;
  font-weight: 900;
}

.groom-tool-message {
  min-height: 20px;
  margin: 0 18px 8px;
  color: #b74440;
  font-size: 11px;
  font-weight: 900;
}

.groom-tool-shop {
  width: calc(100% - 36px);
  min-height: 40px;
  margin: 0 18px 16px;
  border: 0;
  border-radius: 4px;
  color: #fff8dc;
  background: #746d5f;
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 620px) {
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .equipment-levels {
    grid-template-columns: repeat(2, 1fr);
  }

  .groom-tool-options {
    grid-template-columns: 1fr;
  }
}

.character-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 24px;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.character-dialog::backdrop {
  background: rgba(8, 35, 32, 0.72);
  backdrop-filter: blur(4px);
}

.character-dialog > small {
  color: #b78022;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.character-dialog h2 {
  margin: 3px 0 16px;
  font-size: 25px;
}

.character-dialog label {
  display: block;
  margin: 12px 0 6px;
  color: #426252;
  font-size: 11px;
  font-weight: 900;
}

.character-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.character-segments button {
  min-height: 44px;
  border: 2px solid #a8bea9;
  border-radius: 4px;
  color: #426252;
  background: #fffef3;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

.character-segments button.selected {
  border-color: #1f6a50;
  color: #fff8dd;
  background: #2f8a68;
}

.outfit-swatches {
  display: grid;
  grid-template-columns: repeat(8, minmax(32px, 1fr));
  gap: 7px;
  margin-bottom: 18px;
}

.outfit-swatches button {
  aspect-ratio: 1;
  min-width: 0;
  border: 3px solid #fff9e8;
  border-radius: 50%;
  outline: 2px solid #a8bea9;
  cursor: pointer;
  box-shadow: inset 0 -7px 12px rgba(18, 42, 36, 0.18);
}

.outfit-swatches button.selected {
  outline: 4px solid #173746;
  outline-offset: 2px;
}

.outfit-swatches [data-outfit="red"] { background: #e84f5f; }
.outfit-swatches [data-outfit="green"] { background: #42a47a; }
.outfit-swatches [data-outfit="blue"] { background: #2a74dc; }
.outfit-swatches [data-outfit="yellow"] { background: #f0b93b; }
.outfit-swatches [data-outfit="purple"] { background: #8056b2; }
.outfit-swatches [data-outfit="black"] { background: #27313a; }
.outfit-swatches [data-outfit="white"] { background: #e9e5d8; }
.outfit-swatches [data-outfit="pink"] { background: #e58aad; }

.history-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 660px);
  padding: 0;
  overflow: hidden;
  border: 5px solid #ffe37a;
  border-radius: 6px;
  color: var(--ink);
  background: #fff9e8;
  box-shadow: 0 26px 90px rgba(5, 30, 28, 0.52);
}

.history-dialog::backdrop {
  background: rgba(8, 35, 32, 0.72);
  backdrop-filter: blur(4px);
}

.history-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  color: #fff7d5;
  background: #173e38;
}

.history-dialog > header small {
  color: #ffda62;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 900;
}

.history-dialog > header h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.history-dialog > header button {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 244, 189, 0.72);
  border-radius: 50%;
  color: #fff4bd;
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 22px;
}

.history-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 128px;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-bottom: 2px solid #e4d6af;
  color: #426252;
  background: #f3e8c9;
  font-size: 11px;
  font-weight: 900;
}

.history-toolbar select {
  height: 34px;
  padding: 0 8px;
  border: 2px solid #9bb39d;
  border-radius: 4px;
  color: #234b40;
  background: #fffef3;
  font-weight: 900;
}

.history-list {
  display: grid;
  max-height: min(62vh, 500px);
  gap: 9px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 20px;
  color: #587264;
  font-weight: 900;
  text-align: center;
}

.history-list article {
  padding: 12px;
  border: 2px solid #d8c99f;
  border-left: 5px solid #2f8a68;
  border-radius: 5px;
  background: #fffef3;
}

.history-list article > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-list article > header div {
  display: grid;
  gap: 2px;
}

.history-list article > header small {
  color: #718679;
  font-size: 9px;
  font-weight: 800;
}

.history-list article > header strong {
  font-size: 17px;
}

.history-list article > header b {
  color: #b04443;
  font-size: 20px;
}

.history-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.history-metrics span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 7px 8px;
  border-left: 3px solid #e0ad41;
  background: #f5ecd2;
}

.history-metrics small {
  color: #718679;
  font-size: 9px;
  font-weight: 900;
}

.history-metrics strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list details {
  margin-top: 8px;
  color: #426252;
  font-size: 11px;
  font-weight: 900;
}

.history-list summary {
  cursor: pointer;
}

.history-list ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  overflow: hidden;
  padding: 5px 7px;
  background: #edf0df;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list li.player {
  color: #7b3b35;
  background: #ffe9ad;
}

@media (max-height: 560px) {
  .entrance-title {
    top: max(8px, env(safe-area-inset-top));
  }

  .entrance-title h1 {
    font-size: 30px;
  }

  .rule-board {
    position: absolute;
    top: max(66px, calc(env(safe-area-inset-top) + 58px));
    margin: 0;
    padding: 10px 20px 12px;
  }

  .rule-board h2 {
    margin-bottom: 7px;
    font-size: 21px;
  }

  .rule-board ol {
    gap: 4px;
  }

  .enter-game-button {
    bottom: max(17px, env(safe-area-inset-bottom));
    min-height: 64px;
  }

  .lobby-title {
    top: max(16px, env(safe-area-inset-top));
  }

  .lobby-title h1 {
    font-size: 42px;
  }

  .lobby-status {
    top: max(12px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
  }

  .food-shop {
    max-height: calc(100% - 16px);
    overflow-y: auto;
  }

  .developer-access {
    top: max(62px, calc(env(safe-area-inset-top) + 52px));
  }

  .recharge-panel {
    margin: 4px 16px 0;
    padding: 7px;
  }

  .recharge-heading small {
    display: none;
  }

  .food-shop header {
    padding: 10px 16px;
  }

  .food-shop h2 {
    font-size: 20px;
  }

  .shop-balance {
    padding: 8px 16px;
  }

  .food-options {
    padding: 10px 16px 5px;
  }

  .shop-tabs {
    padding: 7px 16px 0;
  }

  .food-options button {
    min-height: 72px;
  }

  .stable-care {
    right: 0;
    bottom: 112px;
    left: auto;
    width: 218px;
    grid-template-columns: 84px 126px;
  }

  .stable-care > span,
  .stable-care > button {
    min-height: 58px;
  }

  .horse-select {
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .horse-select-heading,
  .horse-tabs {
    width: calc(100% - 270px);
  }

  .start-button {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    width: 218px;
    min-height: 80px;
  }

  .start-button strong {
    font-size: 22px;
  }

  .race-hud {
    top: max(7px, env(safe-area-inset-top));
  }

  .quit-race-button {
    top: max(76px, calc(env(safe-area-inset-top) + 68px));
    width: 50px;
    height: 50px;
  }

  .race-actions {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(11px, env(safe-area-inset-bottom));
    grid-template-columns: 54px auto 92px;
    gap: 8px;
  }

  .view-button {
    width: 52px;
    height: 52px;
  }

  .item-button {
    width: 60px;
    height: 60px;
  }

  .sprint-button {
    width: 88px;
    height: 88px;
  }
}

@media (orientation: portrait) and (max-width: 700px) {
  .home-button {
    top: max(10px, env(safe-area-inset-top));
    min-height: 34px;
    padding: 5px 10px;
  }

  .history-button,
  .lobby-character-button {
    top: max(10px, env(safe-area-inset-top));
    width: 82px;
    min-height: 34px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .history-button {
    right: auto;
    left: 8px;
  }

  .lobby-character-button {
    right: 8px;
    left: auto;
  }

  .grooming-hud {
    top: auto;
    bottom: 108px;
    left: 12px;
    width: min(270px, calc(100% - 24px));
    transform: none;
  }

  .lobby-title {
    top: 104px;
    left: 12px;
  }

  .lobby-title h1 {
    font-size: 32px;
  }

  .lobby-status {
    top: 56px;
    right: 8px;
    gap: 4px;
  }

  .lobby-status > span {
    min-width: 48px;
    height: 34px;
    gap: 4px;
    padding: 0 5px;
    font-size: 10px;
  }

  .lobby-status button {
    width: 34px;
    height: 34px;
  }

  .developer-mode .lobby-status::before {
    height: 30px;
    padding: 0 6px;
  }

  .developer-access {
    top: 105px;
    right: 8px;
    max-width: 128px;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .food-options {
    grid-template-columns: 1fr;
  }

  .horse-select {
    right: 14px;
    bottom: 122px;
    left: 14px;
  }

  .horse-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stable-care {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    margin-top: 7px;
    grid-template-columns: 1fr 1fr;
  }

  .start-button {
    right: 14px;
    bottom: 18px;
    left: 14px;
    width: auto;
    min-height: 82px;
  }

  .race-hud {
    right: 8px;
    left: 8px;
    grid-template-columns: 82px minmax(150px, 1fr) 70px;
    gap: 6px;
  }

  .rank {
    min-height: 62px;
    padding: 6px 8px;
  }

  .rank strong {
    font-size: 31px;
  }

  .race-clock {
    padding: 6px 7px;
  }

  .race-clock strong {
    font-size: 18px;
  }

  .progress-panel {
    padding: 7px 7px 10px;
  }

  .quit-race-button {
    top: 82px;
    left: 10px;
    width: 48px;
    height: 48px;
  }

  .steer-zone {
    right: 38%;
  }

  .race-actions {
    grid-template-columns: 52px auto 88px;
    gap: 6px;
  }

  .view-button {
    width: 50px;
    height: 50px;
  }

  .item-button {
    width: 56px;
    height: 56px;
  }

  .sprint-button {
    width: 86px;
    height: 86px;
  }
}

/* Product illustrations use the same compact silhouette language as the in-hand tools. */
[data-shop-page="food"] button[data-food-price] > i,
[data-shop-page="tools"] button[data-shop-item] > i,
[data-shop-page="decor"] button[data-decoration] > i,
[data-shop-page="tack"] button[data-tack-item] > i,
.groom-tool-options button > i {
  position: relative;
  justify-self: center;
  overflow: visible;
  color: transparent;
  box-shadow: none;
}

/* Food: fruit, carrot, drinks, forage, grain and treats. */
[data-shop-page="food"] button[data-food-price] > i {
  width: 38px;
  height: 25px;
  border: 3px solid #8b6337;
  border-radius: 5px 5px 15px 15px;
  background: radial-gradient(circle at 35% 48%, #f4d077 0 3px, transparent 4px), #c99446;
}

[data-shop-page="food"] button[data-food-price] > i::after {
  position: absolute;
  top: -7px;
  left: 4px;
  width: 26px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: #e9c76b;
}

[data-shop-page="food"] button[data-food-price="20"] > i,
[data-shop-page="food"] button[data-food-price="8"] > i,
[data-shop-page="food"] button[data-food-price="18"] > i,
[data-shop-page="food"] button[data-food-price="45"] > i {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 46% 48% 52% 50%;
  background: radial-gradient(circle at 34% 28%, #ffaaa0 0 4px, transparent 5px), #dc554b;
}

[data-shop-page="food"] button[data-food-price="20"] > i::before,
[data-shop-page="food"] button[data-food-price="8"] > i::before,
[data-shop-page="food"] button[data-food-price="18"] > i::before,
[data-shop-page="food"] button[data-food-price="45"] > i::before {
  position: absolute;
  top: -8px;
  left: 17px;
  width: 12px;
  height: 8px;
  content: "";
  border-radius: 100% 0;
  background: #4e8a4f;
  transform: rotate(-24deg);
}

[data-shop-page="food"] button[data-food-price="20"] > i::after,
[data-shop-page="food"] button[data-food-price="8"] > i::after,
[data-shop-page="food"] button[data-food-price="18"] > i::after,
[data-shop-page="food"] button[data-food-price="45"] > i::after {
  display: none;
}

[data-shop-page="food"] button[data-food-price="50"] > i {
  width: 22px;
  height: 38px;
  border: 0;
  border-radius: 45% 45% 60% 60%;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(161, 76, 24, 0.35) 8px 9px), #ef8a32;
  clip-path: polygon(5% 0, 95% 0, 68% 100%, 32% 100%);
}

[data-shop-page="food"] button[data-food-price="50"] > i::after {
  top: -10px;
  left: -3px;
  width: 28px;
  height: 14px;
  background: repeating-linear-gradient(90deg, #438757 0 5px, transparent 5px 8px);
  clip-path: polygon(0 100%, 18% 0, 40% 100%, 58% 0, 72% 100%, 100% 0, 88% 100%);
}

[data-shop-page="food"] button[data-food-price="10"] > i,
[data-shop-page="food"] button[data-food-price="40"] > i,
[data-shop-page="food"] button[data-food-price="55"] > i {
  width: 24px;
  height: 36px;
  border: 2px solid #39728a;
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(90deg, #75c3d1, #d5f2ee 52%, #68b5c7);
}

[data-shop-page="food"] button[data-food-price="10"] > i::after,
[data-shop-page="food"] button[data-food-price="40"] > i::after,
[data-shop-page="food"] button[data-food-price="55"] > i::after {
  top: 14px;
  left: 3px;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  background: #fff0a8;
}

[data-shop-page="food"] button[data-food-price="5"] > i,
[data-shop-page="food"] button[data-food-price="12"] > i,
[data-shop-page="food"] button[data-food-price="25"] > i {
  width: 38px;
  height: 36px;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(75deg, #477e42 0 3px, #79a856 3px 6px, transparent 6px 9px);
  clip-path: polygon(0 100%, 8% 25%, 22% 100%, 35% 5%, 48% 100%, 62% 18%, 73% 100%, 88% 0, 100% 100%);
}

[data-shop-page="food"] button[data-food-price="5"] > i::after,
[data-shop-page="food"] button[data-food-price="12"] > i::after,
[data-shop-page="food"] button[data-food-price="25"] > i::after {
  display: none;
}

[data-shop-page="food"] button[data-food-price="58"] > i {
  width: 38px;
  height: 31px;
  border: 0;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, #f3a23d 0 7px, #ce782c 8px 10px);
}

/* Grooming tools: brush families. */
[data-shop-item="brush"] > i,
[data-shop-item="softBrush"] > i,
[data-shop-item="bodyBrush"] > i,
[data-shop-item="faceBrush"] > i,
[data-shop-item="hoofBrush"] > i,
[data-groom-tool="brush"] > i,
[data-groom-tool="softBrush"] > i,
[data-groom-tool="bodyBrush"] > i,
[data-groom-tool="faceBrush"] > i,
[data-groom-tool="hoofBrush"] > i {
  width: 38px;
  height: 20px;
  border: 2px solid #5b3824;
  border-radius: 12px 5px 5px 12px;
  background: linear-gradient(#b8794a, #7e4c2f);
}

[data-shop-item="brush"] > i::after,
[data-shop-item="softBrush"] > i::after,
[data-shop-item="bodyBrush"] > i::after,
[data-shop-item="faceBrush"] > i::after,
[data-shop-item="hoofBrush"] > i::after,
[data-groom-tool="brush"] > i::after,
[data-groom-tool="softBrush"] > i::after,
[data-groom-tool="bodyBrush"] > i::after,
[data-groom-tool="faceBrush"] > i::after,
[data-groom-tool="hoofBrush"] > i::after {
  position: absolute;
  right: 3px;
  bottom: -10px;
  left: 8px;
  height: 10px;
  content: "";
  background: repeating-linear-gradient(90deg, #e5c487 0 2px, #8b683f 2px 4px);
}

[data-shop-item="softBrush"] > i,
[data-groom-tool="softBrush"] > i { width: 32px; background: #d6a373; }
[data-shop-item="bodyBrush"] > i,
[data-groom-tool="bodyBrush"] > i { width: 42px; background: #8a5939; }
[data-shop-item="faceBrush"] > i,
[data-groom-tool="faceBrush"] > i { width: 27px; height: 16px; background: #d5b08a; }
[data-shop-item="hoofBrush"] > i,
[data-groom-tool="hoofBrush"] > i { background: #456d75; }

[data-shop-item="sponge"] > i,
[data-groom-tool="sponge"] > i {
  width: 36px;
  height: 28px;
  border: 2px solid #9a7726;
  border-radius: 7px;
  background: radial-gradient(circle at 25% 32%, #fff0a2 0 2px, transparent 3px), radial-gradient(circle at 70% 65%, #fff0a2 0 3px, transparent 4px), #efc64b;
}

[data-shop-item="curryComb"] > i,
[data-groom-tool="curryComb"] > i {
  width: 35px;
  height: 30px;
  border: 3px solid #305f65;
  border-radius: 50%;
  background: radial-gradient(circle, #bdd9cc 0 2px, transparent 3px) 0 0 / 9px 9px, #4e9184;
}

[data-shop-item="maneComb"] > i,
[data-groom-tool="maneComb"] > i {
  width: 39px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #4b6574 0 3px, transparent 3px 6px), linear-gradient(#4b6574 0 8px, transparent 8px);
}

[data-shop-item="towel"] > i,
[data-shop-item="shineCloth"] > i,
[data-groom-tool="towel"] > i,
[data-groom-tool="shineCloth"] > i {
  width: 37px;
  height: 31px;
  border: 2px solid #4f8595;
  border-radius: 4px;
  background: repeating-linear-gradient(135deg, #8dcad2 0 7px, #bfe5df 7px 12px);
  clip-path: polygon(4% 0, 100% 7%, 94% 100%, 0 91%);
}

[data-shop-item="shineCloth"] > i,
[data-groom-tool="shineCloth"] > i { border-color: #a06e82; background: repeating-linear-gradient(135deg, #e2a5b5 0 7px, #f3d3d3 7px 12px); }

[data-shop-item="rubberScraper"] > i,
[data-shop-item="sweatScraper"] > i,
[data-groom-tool="rubberScraper"] > i,
[data-groom-tool="sweatScraper"] > i {
  width: 38px;
  height: 28px;
  border: 6px solid #4a8277;
  border-top: 0;
  border-radius: 0 0 24px 24px;
  background: transparent;
}

[data-shop-item="sweatScraper"] > i,
[data-groom-tool="sweatScraper"] > i { border-color: #bf6d42; }

[data-shop-item="hoofpick"] > i,
[data-groom-tool="hoofpick"] > i {
  width: 39px;
  height: 13px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #457a75 0 65%, #899597 66%);
  transform: rotate(-18deg);
}

[data-shop-item="hoofpick"] > i::after,
[data-groom-tool="hoofpick"] > i::after {
  position: absolute;
  right: -5px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  content: "";
  border-right: 4px solid #899597;
  border-bottom: 4px solid #899597;
  border-radius: 0 0 10px;
}

[data-shop-item="coatSpray"] > i,
[data-shop-item="detangler"] > i,
[data-groom-tool="coatSpray"] > i,
[data-groom-tool="detangler"] > i {
  width: 24px;
  height: 35px;
  border: 2px solid #4c6171;
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(90deg, #739cb0, #d0e4e2 55%, #668da5);
}

[data-shop-item="coatSpray"] > i::before,
[data-shop-item="detangler"] > i::before,
[data-groom-tool="coatSpray"] > i::before,
[data-groom-tool="detangler"] > i::before {
  position: absolute;
  top: -7px;
  left: 10px;
  width: 18px;
  height: 8px;
  content: "";
  border-radius: 2px;
  background: #3e555f;
  clip-path: polygon(0 0, 100% 0, 100% 55%, 40% 55%, 40% 100%, 0 100%);
}

[data-shop-item="detangler"] > i,
[data-groom-tool="detangler"] > i { border-color: #775a83; background: linear-gradient(90deg, #a47aaa, #ead5e8 55%, #936a9b); }

/* Stable decoration thumbnails. */
:where([data-shop-page="decor"] button[data-decoration]) > i {
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

[data-decoration="flowers"] > i,
[data-decoration="flowerGarland"] > i { background: radial-gradient(circle at 20% 55%, #e05a70 0 6px, transparent 7px), radial-gradient(circle at 50% 30%, #f2c84d 0 7px, transparent 8px), radial-gradient(circle at 80% 58%, #dd728b 0 6px, transparent 7px), linear-gradient(80deg, transparent 45%, #4f8b55 46% 53%, transparent 54%); }
[data-decoration="nameplate"] > i,
[data-decoration="pastureSign"] > i { height: 25px; border: 3px solid #a8763d; background: #59402d; box-shadow: 0 8px 0 -5px #59402d; }
[data-decoration="windbell"] > i,
[data-decoration="wallLantern"] > i { width: 27px; height: 34px; border: 3px solid #394641; border-radius: 5px 5px 10px 10px; background: radial-gradient(circle, #fff3a1 0 7px, #e3a940 8px 11px, #43514c 12px); }
[data-decoration="trophy"] > i { width: 34px; height: 34px; background: linear-gradient(90deg, transparent 0 20%, #dfb23a 21% 79%, transparent 80%); clip-path: polygon(0 0, 100% 0, 82% 52%, 60% 65%, 60% 82%, 82% 88%, 82% 100%, 18% 100%, 18% 88%, 40% 82%, 40% 65%, 18% 52%); }
[data-decoration="ribbons"] > i { border-radius: 50%; background: radial-gradient(circle, #f5d46b 0 6px, #cf4f64 7px 15px, transparent 16px), linear-gradient(65deg, transparent 35%, #cf4f64 36% 47%, transparent 48%), linear-gradient(-65deg, transparent 35%, #cf4f64 36% 47%, transparent 48%); }
[data-decoration="blanketRack"] > i,
[data-decoration="woodenBench"] > i { border: 4px solid #684731; border-top-width: 12px; background: repeating-linear-gradient(90deg, transparent 0 9px, #684731 10px 13px); }
[data-decoration="waterTrough"] > i,
[data-decoration="feedBucket"] > i { height: 29px; border: 3px solid #4f6d71; border-radius: 5px 5px 12px 12px; background: linear-gradient(#65bdd0 0 35%, #6d7774 36%); }
[data-decoration="hayRack"] > i { background: repeating-linear-gradient(75deg, #d8ad4a 0 4px, #9a7235 4px 6px); clip-path: polygon(8% 18%, 92% 0, 100% 82%, 0 100%); }
[data-decoration="saddleStand"] > i { border-bottom: 8px solid #67442e; border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #6c3d2b 0 45%, transparent 47%); }
[data-decoration="stableClock"] > i { border: 4px solid #72503a; border-radius: 50%; background: linear-gradient(90deg, transparent 47%, #31564f 48% 53%, transparent 54%), linear-gradient(25deg, transparent 47%, #31564f 48% 53%, transparent 54%), #f4e7bc; }
[data-decoration="groomingBox"] > i { height: 28px; border: 3px solid #315f50; background: linear-gradient(#6fa18b 0 32%, #3f755f 33%); box-shadow: inset 0 5px 0 #b4d1bd; }
[data-decoration="photoFrame"] > i { border: 5px solid #72482f; background: linear-gradient(145deg, #8ec4bc, #d9e4cc); }
[data-decoration="luckyHorseshoe"] > i { width: 34px; height: 35px; border: 7px solid #c99b3e; border-top-color: transparent; border-radius: 50%; background: transparent; }

/* Tack thumbnails follow real English saddle and bridle silhouettes. */
[data-tack-kind="saddle"] > i {
  width: 40px;
  height: 30px;
  border: 0;
  border-radius: 55% 48% 35% 45%;
  background: radial-gradient(ellipse at 55% 38%, #a46d4b 0 42%, #563527 44% 63%, transparent 65%);
  transform: rotate(-7deg);
}

[data-tack-kind="saddle"] > i::after {
  position: absolute;
  right: 2px;
  bottom: -7px;
  width: 18px;
  height: 17px;
  content: "";
  border: 3px solid #b7bec0;
  border-top: 0;
  border-radius: 0 0 5px 5px;
}

[data-tack-kind="reins"] > i {
  width: 38px;
  height: 27px;
  border: 4px double #65402d;
  border-radius: 50%;
  background: transparent;
  transform: rotate(-18deg);
}

/* In-hand grooming tool silhouettes. */
.grooming-tool-art[data-tool="towel"],
.grooming-brush[data-tool="towel"],
.grooming-tool-art[data-tool="shineCloth"],
.grooming-brush[data-tool="shineCloth"] {
  width: 68px;
  height: 44px;
  border: 3px solid #4f8595;
  border-radius: 5px;
  background: repeating-linear-gradient(135deg, #8dcad2 0 10px, #c5e7e1 10px 17px);
  clip-path: polygon(3% 0, 100% 7%, 94% 100%, 0 91%);
}

.grooming-tool-art[data-tool="towel"]::after,
.grooming-brush[data-tool="towel"]::after,
.grooming-tool-art[data-tool="shineCloth"]::after,
.grooming-brush[data-tool="shineCloth"]::after { display: none; }

.grooming-tool-art[data-tool="curryComb"],
.grooming-brush[data-tool="curryComb"] {
  width: 58px;
  height: 44px;
  border: 4px solid #305f65;
  border-radius: 50%;
  background: radial-gradient(circle, #bdd9cc 0 3px, transparent 4px) 0 0 / 13px 13px, #4e9184;
}

.grooming-tool-art[data-tool="curryComb"]::after,
.grooming-brush[data-tool="curryComb"]::after { display: none; }

.grooming-tool-art[data-tool="maneComb"],
.grooming-brush[data-tool="maneComb"] {
  width: 70px;
  height: 42px;
  border: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #4b6574 0 5px, transparent 5px 10px), linear-gradient(#4b6574 0 12px, transparent 12px);
}

.grooming-tool-art[data-tool="maneComb"]::after,
.grooming-brush[data-tool="maneComb"]::after { display: none; }

.grooming-tool-art[data-tool="rubberScraper"],
.grooming-brush[data-tool="rubberScraper"],
.grooming-tool-art[data-tool="sweatScraper"],
.grooming-brush[data-tool="sweatScraper"] {
  width: 66px;
  height: 42px;
  border: 9px solid #4a8277;
  border-top: 0;
  border-radius: 0 0 36px 36px;
  background: transparent;
}

.grooming-tool-art[data-tool="rubberScraper"]::after,
.grooming-brush[data-tool="rubberScraper"]::after,
.grooming-tool-art[data-tool="sweatScraper"]::after,
.grooming-brush[data-tool="sweatScraper"]::after { display: none; }

.grooming-tool-art[data-tool="coatSpray"],
.grooming-brush[data-tool="coatSpray"],
.grooming-tool-art[data-tool="detangler"],
.grooming-brush[data-tool="detangler"] {
  width: 34px;
  height: 52px;
  border: 3px solid #4c6171;
  border-radius: 6px 6px 11px 11px;
  background: linear-gradient(90deg, #739cb0, #d0e4e2 55%, #668da5);
}

.grooming-tool-art[data-tool="coatSpray"]::before,
.grooming-brush[data-tool="coatSpray"]::before,
.grooming-tool-art[data-tool="detangler"]::before,
.grooming-brush[data-tool="detangler"]::before {
  position: absolute;
  top: -10px;
  left: 14px;
  width: 27px;
  height: 11px;
  content: "";
  background: #3e555f;
  clip-path: polygon(0 0, 100% 0, 100% 55%, 38% 55%, 38% 100%, 0 100%);
}

.grooming-tool-art[data-tool="coatSpray"]::after,
.grooming-brush[data-tool="coatSpray"]::after,
.grooming-tool-art[data-tool="detangler"]::after,
.grooming-brush[data-tool="detangler"]::after { display: none; }

/* Every food keeps its own silhouette so the shop can be read without labels. */
[data-shop-page="food"] button[data-food-price] > i::before,
[data-shop-page="food"] button[data-food-price] > i::after {
  position: absolute;
  display: none;
  content: "";
}

[data-shop-page="food"] button[data-food-price="20"] > i {
  width: 32px; height: 32px; border: 0; border-radius: 46% 48% 52% 50%;
  background: radial-gradient(circle at 34% 28%, #ffaaa0 0 4px, transparent 5px), #dc554b; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="20"] > i::before {
  top: -8px; left: 17px; display: block; width: 12px; height: 8px; border-radius: 100% 0; background: #4e8a4f; transform: rotate(-24deg);
}

[data-shop-page="food"] button[data-food-price="50"] > i {
  width: 22px; height: 38px; border: 0; border-radius: 45% 45% 60% 60%;
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(161, 76, 24, 0.35) 8px 9px), #ef8a32;
  clip-path: polygon(5% 0, 95% 0, 68% 100%, 32% 100%);
}
[data-shop-page="food"] button[data-food-price="50"] > i::before {
  top: -10px; left: -3px; display: block; width: 28px; height: 14px;
  background: repeating-linear-gradient(90deg, #438757 0 5px, transparent 5px 8px);
  clip-path: polygon(0 100%, 18% 0, 40% 100%, 58% 0, 72% 100%, 100% 0, 88% 100%);
}

[data-shop-page="food"] button[data-food-price="100"] > i {
  width: 40px; height: 27px; border: 3px solid #7c542d; border-radius: 6px 6px 18px 18px;
  background: radial-gradient(circle at 28% 34%, #70a75a 0 3px, transparent 4px), radial-gradient(circle at 62% 28%, #e48745 0 4px, transparent 5px), #e3bd68; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="100"] > i::before {
  top: -6px; left: 2px; display: block; width: 30px; height: 8px; border-radius: 50%; background: #f0d681;
}

[data-shop-page="food"] button[data-food-price="10"] > i {
  width: 23px; height: 38px; border: 3px solid #39728a; border-radius: 5px 5px 10px 10px;
  background: linear-gradient(90deg, #6fc4dc, #dff7f2 52%, #64aec8); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="10"] > i::before {
  top: -7px; left: 5px; display: block; width: 9px; height: 7px; border-radius: 3px 3px 0 0; background: #377080;
}

[data-shop-page="food"] button[data-food-price="15"] > i {
  width: 31px; height: 31px; border: 3px solid #d7c9a2; border-radius: 5px;
  background: linear-gradient(135deg, #fffef1 0 46%, #ded6ba 47% 54%, #f4efd8 55%); clip-path: none; transform: rotate(-5deg);
}
[data-shop-page="food"] button[data-food-price="15"] > i::after {
  top: 4px; left: 4px; display: block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.9);
}

[data-shop-page="food"] button[data-food-price="70"] > i {
  width: 34px; height: 35px; border: 3px solid #73502e; border-radius: 4px 4px 10px 10px;
  background: repeating-linear-gradient(90deg, #a56d37 0 6px, #ce934b 6px 12px); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="70"] > i::before {
  top: -5px; left: 2px; display: block; width: 24px; height: 9px; border-radius: 50%; background: #e4c06a;
}

[data-shop-page="food"] button[data-food-price="40"] > i {
  width: 25px; height: 37px; border: 2px solid #89722d; border-radius: 5px 5px 9px 9px;
  background: radial-gradient(circle at 50% 58%, #fff7a7 0 6px, #e8c944 7px 9px, transparent 10px), linear-gradient(90deg, #e8c94b, #fff0a0 52%, #cda931); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="40"] > i::before {
  top: -7px; left: 6px; display: block; width: 9px; height: 7px; border-radius: 2px; background: #4f9457;
}

[data-shop-page="food"] button[data-food-price="25"] > i {
  width: 38px; height: 36px; border: 0; border-radius: 0;
  background: repeating-linear-gradient(75deg, #477e42 0 3px, #79a856 3px 6px, transparent 6px 9px);
  clip-path: polygon(0 100%, 8% 25%, 22% 100%, 35% 5%, 48% 100%, 62% 18%, 73% 100%, 88% 0, 100% 100%);
}
[data-shop-page="food"] button[data-food-price="25"] > i::after {
  bottom: 2px; left: 4px; display: block; width: 31px; height: 5px; border-radius: 4px; background: #c49644;
}

[data-shop-page="food"] button[data-food-price="60"] > i {
  width: 39px; height: 27px; border: 3px solid #66564a; border-radius: 5px 5px 18px 18px;
  background: radial-gradient(ellipse, #b88441 0 2px, transparent 3px) 0 0 / 9px 7px, #e1c389; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="60"] > i::before {
  top: -12px; left: 9px; display: block; width: 16px; height: 12px; border-left: 2px solid #d7e0d4; border-right: 2px solid #d7e0d4; background: transparent; transform: skewX(-12deg);
}

[data-shop-page="food"] button[data-food-price="30"] > i {
  width: 37px; height: 27px; border: 3px solid #8e7770; border-radius: 3px;
  background: repeating-linear-gradient(0deg, #d89891 0 6px, #efb1a8 6px 11px); clip-path: polygon(4% 5%, 96% 0, 100% 90%, 0 100%);
}
[data-shop-page="food"] button[data-food-price="30"] > i::after {
  top: 5px; left: 7px; display: block; width: 4px; height: 4px; border-radius: 50%; background: #fff1de; box-shadow: 10px 6px 0 #fff1de, 20px -1px 0 #fff1de;
}

[data-shop-page="food"] button[data-food-price="80"] > i {
  width: 39px; height: 27px; border: 3px solid #694338; border-radius: 5px 5px 18px 18px;
  background: radial-gradient(circle, #963f4e 0 3px, transparent 4px) 0 0 / 10px 9px, #d2926e; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="80"] > i::before {
  top: -5px; left: 3px; display: block; width: 27px; height: 7px; border-radius: 50%; background: #a84454;
}

[data-shop-page="food"] button[data-food-price="90"] > i {
  width: 40px; height: 28px; border: 3px solid #805433; border-radius: 6px 6px 18px 18px;
  background: radial-gradient(circle at 25% 25%, #df5549 0 4px, transparent 5px), radial-gradient(circle at 68% 35%, #d29f4b 0 3px, transparent 4px), #e0c47f; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="90"] > i::after {
  top: -8px; left: 6px; display: block; width: 10px; height: 8px; border-radius: 100% 0; background: #4a8550; transform: rotate(-22deg);
}

[data-shop-page="food"] button[data-food-price="55"] > i {
  width: 24px; height: 39px; border: 2px solid #506b95; border-radius: 8px 8px 6px 6px;
  background: linear-gradient(90deg, #688bd7, #c7d9ff 48%, #597fc7 49% 67%, #89abea 68%); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="55"] > i::before {
  top: -6px; left: 6px; display: block; width: 9px; height: 6px; border-radius: 2px; background: #345179;
}

[data-shop-page="food"] button[data-food-price="5"] > i {
  width: 38px; height: 34px; border: 0; border-radius: 0;
  background: repeating-linear-gradient(82deg, #2e7940 0 3px, #70a94d 3px 5px, transparent 5px 9px);
  clip-path: polygon(0 100%, 10% 42%, 20% 100%, 35% 6%, 48% 100%, 62% 32%, 76% 100%, 91% 13%, 100% 100%);
}

[data-shop-page="food"] button[data-food-price="8"] > i {
  width: 38px; height: 30px; border: 0; border-radius: 0;
  background: radial-gradient(circle at 15% 58%, #fff0d3 0 3px, transparent 4px), linear-gradient(140deg, #f2d3a4 0 44%, #d94f46 45% 59%, transparent 60%), linear-gradient(35deg, transparent 0 40%, #ecb588 41% 67%, #ca403b 68%); clip-path: none;
}

[data-shop-page="food"] button[data-food-price="12"] > i {
  width: 39px; height: 35px; border: 0; border-radius: 0;
  background: radial-gradient(ellipse at 28% 45%, #69a557 0 6px, transparent 7px), radial-gradient(ellipse at 55% 24%, #7cb760 0 7px, transparent 8px), radial-gradient(ellipse at 73% 60%, #4d8b48 0 7px, transparent 8px), linear-gradient(75deg, transparent 45%, #8d693f 46% 53%, transparent 54%); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="12"] > i::after {
  bottom: 1px; left: 6px; display: block; width: 27px; height: 5px; border-radius: 4px; background: #d4a852;
}

[data-shop-page="food"] button[data-food-price="18"] > i {
  width: 38px; height: 31px; border: 0; border-radius: 0;
  background: radial-gradient(circle at 56% 52%, #866534 0 3px, transparent 4px), radial-gradient(ellipse at 52% 55%, #f4ecb5 0 11px, #9bbb52 12px 15px, transparent 16px), linear-gradient(145deg, transparent 0 35%, #c8dd75 36% 74%, transparent 75%); clip-path: none;
}

[data-shop-page="food"] button[data-food-price="22"] > i {
  width: 34px; height: 36px; border: 0; border-radius: 48%;
  background: radial-gradient(ellipse, #fff0a2 0 3px, transparent 4px) 0 0 / 9px 8px, #e4a92f; clip-path: polygon(16% 0, 84% 4%, 100% 80%, 50% 100%, 0 80%);
}
[data-shop-page="food"] button[data-food-price="22"] > i::before {
  top: -3px; left: -5px; display: block; width: 14px; height: 36px; border-radius: 100% 0; background: #5c944b; transform: rotate(-14deg);
}

[data-shop-page="food"] button[data-food-price="35"] > i {
  width: 34px; height: 37px; border: 3px solid #8a6b45; border-radius: 4px 4px 8px 8px;
  background: radial-gradient(circle, #a7773e 0 2px, transparent 3px) 0 0 / 8px 8px, #d7bd83; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}
[data-shop-page="food"] button[data-food-price="35"] > i::before {
  top: 7px; left: 5px; display: block; width: 18px; height: 3px; background: #845f3c; box-shadow: 0 6px 0 #845f3c;
}

[data-shop-page="food"] button[data-food-price="45"] > i {
  width: 34px; height: 36px; border: 3px solid #814d47; border-radius: 5px 5px 10px 10px;
  background: radial-gradient(circle at 28% 27%, #f3e6a5 0 2px, transparent 3px), radial-gradient(circle at 65% 30%, #e85a61 0 5px, transparent 6px), repeating-linear-gradient(0deg, #e6be74 0 5px, #f0d793 5px 9px); clip-path: none;
}
[data-shop-page="food"] button[data-food-price="45"] > i::before {
  top: -7px; left: 12px; display: block; width: 11px; height: 8px; border-radius: 50% 0; background: #4d9553; transform: rotate(25deg);
}

[data-shop-page="food"] button[data-food-price="58"] > i {
  width: 38px; height: 31px; border: 0; border-radius: 50%;
  background: repeating-linear-gradient(90deg, #f3a23d 0 7px, #ce782c 8px 10px); clip-path: polygon(0 25%, 50% 0, 100% 25%, 92% 100%, 8% 100%);
}
[data-shop-page="food"] button[data-food-price="58"] > i::before {
  top: -5px; left: 16px; display: block; width: 6px; height: 8px; border-radius: 2px; background: #4f8443;
}

[data-shop-page="food"] button[data-food-price="65"] > i {
  width: 40px; height: 27px; border: 3px solid #69513c; border-radius: 5px 5px 18px 18px;
  background: radial-gradient(ellipse, #6f4e34 0 2px, transparent 3px) 0 0 / 7px 6px, #d0ad6f; clip-path: none;
}
[data-shop-page="food"] button[data-food-price="65"] > i::after {
  top: 5px; right: 2px; display: block; width: 10px; height: 10px; border-radius: 50%; background: #b8874e;
}

[data-shop-page="food"] button[data-food-price="75"] > i {
  width: 42px; height: 18px; border: 2px solid #6e4b37; border-radius: 4px;
  background: repeating-linear-gradient(135deg, #d6554f 0 7px, #f2ce5b 7px 13px, #5f9672 13px 19px); clip-path: polygon(0 15%, 10% 0, 90% 0, 100% 15%, 94% 100%, 6% 100%);
}
[data-shop-page="food"] button[data-food-price="75"] > i::after {
  top: 4px; left: 14px; display: block; width: 12px; height: 6px; border-radius: 3px; background: #fff0b4;
}

[data-shop-page="food"] button[data-food-price="95"] > i {
  width: 36px; height: 40px; border: 3px solid #4b6c59; border-radius: 4px 4px 7px 7px;
  background: linear-gradient(140deg, transparent 0 43%, rgba(255,255,255,.2) 44% 54%, transparent 55%), #5d9471; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%);
}
[data-shop-page="food"] button[data-food-price="95"] > i::before {
  top: 11px; left: 5px; display: block; width: 20px; height: 14px; border-radius: 3px; background: radial-gradient(circle, #e5c95e 0 2px, transparent 3px) 0 0 / 7px 7px, #f0e6bf;
}

/* Similar products still get a distinct material or construction. */
[data-shop-page="tools"] button[data-shop-item="sweatScraper"] > i {
  background: linear-gradient(180deg, transparent 0 58%, rgba(191, 109, 66, 0.18) 59% 100%);
}

[data-shop-page="decor"] button[data-decoration="flowerGarland"] > i {
  background: radial-gradient(circle at 16% 44%, #f4b8c5 0 5px, transparent 6px), radial-gradient(circle at 40% 65%, #f2d36b 0 5px, transparent 6px), radial-gradient(circle at 66% 38%, #d96d92 0 6px, transparent 7px), radial-gradient(circle at 88% 62%, #fff0b1 0 5px, transparent 6px), linear-gradient(12deg, transparent 43%, #4e8c5a 44% 54%, transparent 55%);
}
[data-shop-page="decor"] button[data-decoration="pastureSign"] > i {
  height: 27px; border: 3px solid #8b6636; border-radius: 3px;
  background: linear-gradient(155deg, transparent 0 44%, rgba(255,255,255,.15) 45% 52%, transparent 53%), #315f4b;
}
[data-shop-page="decor"] button[data-decoration="wallLantern"] > i {
  width: 25px; height: 36px; border: 3px solid #4e3f35; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(90deg, #5f4b3c 0 10%, transparent 11% 89%, #5f4b3c 90%), radial-gradient(circle, #fff2a0 0 8px, #d68835 9px 13px, #4e3f35 14px);
}
[data-shop-page="decor"] button[data-decoration="woodenBench"] > i {
  height: 31px; border: 0; border-radius: 2px;
  background: linear-gradient(#7a5033 0 10px, transparent 11px 18px, #67442e 19px 24px, transparent 25px), linear-gradient(90deg, transparent 0 5px, #523621 6px 10px, transparent 11px 30px, #523621 31px 35px, transparent 36px);
}
[data-shop-page="decor"] button[data-decoration="feedBucket"] > i {
  height: 30px; border: 3px solid #685040; border-radius: 4px 4px 13px 13px;
  background: radial-gradient(circle at 28% 30%, #e6c363 0 3px, transparent 4px), radial-gradient(circle at 67% 45%, #ac7738 0 3px, transparent 4px), linear-gradient(#d9a84e 0 38%, #b75c43 39%);
}

[data-tack-kind="saddle"] > i {
  background: radial-gradient(ellipse at 55% 38%, var(--tack-main, #a46d4b) 0 42%, var(--tack-dark, #563527) 44% 63%, transparent 65%);
}
[data-tack-kind="reins"] > i {
  border-color: var(--tack-main, #65402d);
  background: radial-gradient(ellipse, transparent 0 51%, var(--tack-main, #65402d) 52% 61%, transparent 62%);
}
[data-tack-item="trainingSaddle"] { --tack-main: #a46d4b; --tack-dark: #563527; }
[data-tack-item="ponySaddle"] { --tack-main: #bd835b; --tack-dark: #71462f; }
[data-tack-item="starterSaddle"] { --tack-main: #79503a; --tack-dark: #38251d; }
[data-tack-item="forestSaddle"] { --tack-main: #3f755b; --tack-dark: #243f32; }
[data-tack-item="enduranceSaddle"] { --tack-main: #856345; --tack-dark: #413326; }
[data-tack-item="featherSaddle"] { --tack-main: #d19b58; --tack-dark: #724827; }
[data-tack-item="velvetSaddle"] { --tack-main: #8f4962; --tack-dark: #4e2938; }
[data-tack-item="royalSaddle"] { --tack-main: #365d85; --tack-dark: #23374d; }
[data-tack-item="championSaddle"] { --tack-main: #4a3229; --tack-dark: #1e1714; }
[data-tack-item="starSaddle"] { --tack-main: #d1ad42; --tack-dark: #71551d; }
[data-tack-item="hempReins"] { --tack-main: #b18b55; }
[data-tack-item="starterReins"] { --tack-main: #5e3c2d; }
[data-tack-item="trainingReins"] { --tack-main: #7b5137; }
[data-tack-item="cottonReins"] { --tack-main: #dad0b7; }
[data-tack-item="rubberReins"] { --tack-main: #30363a; }
[data-tack-item="softLeatherReins"] { --tack-main: #9f6845; }
[data-tack-item="braidedReins"] { --tack-main: #477363; }
[data-tack-item="racingReins"] { --tack-main: #b24645; }
[data-tack-item="silkReins"] { --tack-main: #4778a0; }
[data-tack-item="goldReins"] { --tack-main: #c6a438; }
