:root {
  color-scheme: dark;
  --ink: #f2eee1;
  --ink-soft: #c5cbb8;
  --ink-muted: #899889;
  --night: #0c211e;
  --night-2: #102b27;
  --pine: #173b34;
  --pine-light: #275348;
  --moss: #68a078;
  --moss-light: #94b88d;
  --cream: #efe6d1;
  --cream-deep: #d9c9a8;
  --amber: #dca958;
  --amber-light: #f1cb7c;
  --coral: #df795d;
  --rose: #d77c81;
  --sky: #a9c8bb;
  --line: rgba(239, 230, 209, 0.12);
  --line-strong: rgba(239, 230, 209, 0.22);
  --shadow: 0 22px 60px rgba(4, 15, 13, 0.36);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Avenir Next", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background:
    linear-gradient(115deg, rgba(108, 153, 120, 0.08) 0 1px, transparent 1px 86px),
    linear-gradient(180deg, #0c211e 0%, #102a26 52%, #0b201d 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.19'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber-light);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 46vw;
  height: 70vh;
  pointer-events: none;
  filter: blur(50px);
  opacity: 0.14;
}

.ambient-one {
  top: -20vh;
  left: 12vw;
  background: linear-gradient(130deg, #6ca682, transparent 70%);
  transform: rotate(-16deg);
}

.ambient-two {
  right: -8vw;
  bottom: -30vh;
  background: linear-gradient(150deg, #bd7e56, transparent 72%);
  transform: rotate(18deg);
}

.app-shell {
  width: min(1520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px 22px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(310px, 0.9fr) minmax(390px, 1.25fr);
  gap: 24px;
  align-items: center;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--amber-light);
  border: 1px solid rgba(220, 169, 88, 0.46);
  border-radius: 50%;
  background: rgba(220, 169, 88, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(220, 169, 88, 0.16);
  border-radius: 50%;
  content: "";
}

.brand-mark::after {
  inset: 10px;
}

.brand-mark .icon {
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-copy small {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.3em;
}

.player-progress {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 290px;
}

.level-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 54px;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  padding: 0;
  cursor: default;
  border: 1px solid rgba(220, 169, 88, 0.4);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(220, 169, 88, 0.18), transparent 70%),
    #132d28;
  box-shadow: inset 0 0 0 4px rgba(9, 29, 25, 0.55);
}

.level-badge span {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.level-badge strong {
  margin-top: -1px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.xp-wrap {
  flex: 1;
  min-width: 150px;
}

.xp-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.xp-line span:first-child {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
}

.xp-line span:last-child {
  color: var(--ink-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.meter {
  position: relative;
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(239, 230, 209, 0.08);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.24);
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.42s cubic-bezier(0.2, 0.75, 0.3, 1);
}

.xp-meter i {
  background: linear-gradient(90deg, #a8773b, var(--amber-light));
  box-shadow: 0 0 12px rgba(241, 203, 124, 0.36);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.resource-pill {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 5px 7px 5px 12px;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(8, 28, 24, 0.5);
}

.energy-pill {
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.energy-pill:hover {
  border-color: rgba(148, 184, 141, 0.34);
  background: rgba(73, 128, 111, 0.13);
}

.resource-pill strong {
  min-width: 34px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.energy-max {
  margin-left: -5px;
  color: var(--ink-muted);
  font-size: 10px;
}

.coin-glyph {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #67502e;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid #f1d18d;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4d792, #c99646);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
}

.drop-glyph {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 18px;
  border-radius: 9px 9px 10px 10px;
  background: linear-gradient(160deg, #c8eee2, #5baa98);
  box-shadow: inset -2px -2px 3px rgba(15, 80, 68, 0.25);
  transform: rotate(2deg);
}

.drop-glyph::before {
  position: absolute;
  top: -4px;
  left: 4px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 1px;
  background: #8ac9bc;
  transform: rotate(45deg);
}

.mini-add {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--night);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: var(--amber-light);
}

.icon-button,
.tool-button,
.text-button,
.reroll-button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(8, 28, 24, 0.5);
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.icon-button:hover,
.tool-button:hover,
.text-button:hover,
.reroll-button:hover {
  color: var(--amber-light);
  border-color: rgba(220, 169, 88, 0.38);
  background: rgba(220, 169, 88, 0.09);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.icon-button .icon {
  width: 17px;
  height: 17px;
}

.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-greenhouse { --icon: url("./assets/icons/greenhouse.svg"); }
.icon-sound-on { --icon: url("./assets/icons/sound-on.svg"); }
.icon-sound-off { --icon: url("./assets/icons/sound-off.svg"); }
.icon-help { --icon: url("./assets/icons/help.svg"); }
.icon-cog { --icon: url("./assets/icons/cog.svg"); }
.icon-fairy { --icon: url("./assets/icons/fairy.svg"); }
.icon-check-mark { --icon: url("./assets/icons/check-mark.svg"); }
.icon-butterfly-flower { --icon: url("./assets/icons/butterfly-flower.svg"); }
.icon-compass { --icon: url("./assets/icons/compass.svg"); }
.icon-watering-can { --icon: url("./assets/icons/watering-can.svg"); }
.icon-checklist { --icon: url("./assets/icons/checklist.svg"); }
.icon-plant-seed { --icon: url("./assets/icons/plant-seed.svg"); }
.icon-trash-can { --icon: url("./assets/icons/trash-can.svg"); }
.icon-old-lantern { --icon: url("./assets/icons/old-lantern.svg"); }
.icon-water-fountain { --icon: url("./assets/icons/water-fountain.svg"); }
.icon-trophy { --icon: url("./assets/icons/trophy.svg"); }
.icon-scroll-unfurled { --icon: url("./assets/icons/scroll-unfurled.svg"); }
.icon-gift-of-knowledge { --icon: url("./assets/icons/gift-of-knowledge.svg"); }
.icon-ribbon-medal { --icon: url("./assets/icons/ribbon-medal.svg"); }

[data-tooltip]::after {
  position: absolute;
  z-index: 100;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 190px;
  padding: 6px 9px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.4;
  pointer-events: none;
  content: attr(data-tooltip);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #132c27;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-3px);
  transition: 0.15s ease;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.main-grid {
  display: grid;
  grid-template-columns: 256px minmax(520px, 1fr) 326px;
  gap: 18px;
  align-items: start;
  padding: 22px 0 10px;
}

.left-column,
.center-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.panel-dark {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.025), transparent 38%),
    rgba(15, 42, 37, 0.86);
  box-shadow: 0 8px 30px rgba(2, 13, 11, 0.12);
  backdrop-filter: blur(14px);
}

.eyebrow {
  display: block;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.keeper-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 132px;
  padding: 16px;
  overflow: hidden;
}

.keeper-card::before {
  position: absolute;
  right: -28px;
  bottom: -58px;
  width: 140px;
  height: 140px;
  content: "";
  border: 1px solid rgba(220, 169, 88, 0.12);
  border-radius: 50%;
}

.portrait-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 92px;
  color: #dfb66f;
  border: 1px solid rgba(220, 169, 88, 0.42);
  border-radius: 42% 42% 8px 8px;
  background:
    radial-gradient(circle at 50% 30%, rgba(244, 214, 156, 0.16), transparent 55%),
    #18382f;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.28);
}

.portrait-frame::before {
  position: absolute;
  inset: 4px;
  content: "";
  border: 1px solid rgba(220, 169, 88, 0.14);
  border-radius: inherit;
}

.portrait-frame .icon {
  width: 45px;
  height: 45px;
}

.portrait-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 8px var(--amber-light);
}

.spark-a {
  top: 18px;
  right: 15px;
}

.spark-b {
  bottom: 20px;
  left: 13px;
}

.keeper-copy h2 {
  margin: 3px 0 5px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}

.keeper-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.65;
}

.weather-chip {
  position: absolute;
  right: 12px;
  bottom: 10px;
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 3px 7px;
  color: var(--ink-muted);
  font-size: 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
}

.weather-chip i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 6px var(--amber-light);
}

.daily-card {
  padding: 16px;
}

.panel-heading,
.orders-head,
.renovation-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-heading h3,
.renovation-head h3 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.small-stamp {
  padding: 4px 6px 3px;
  color: var(--amber);
  font-family: Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.15em;
  border: 1px solid rgba(220, 169, 88, 0.28);
}

.quest-line {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 17px;
}

.quest-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.quest-check.complete {
  color: var(--night);
  border-color: var(--moss-light);
  background: var(--moss-light);
}

.quest-check .icon {
  width: 12px;
  height: 12px;
  opacity: 0;
}

.quest-check.complete .icon {
  opacity: 1;
}

.quest-line strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.quest-line p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
}

.quest-reward {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--amber-light);
  font-size: 11px;
}

.quest-reward .coin-glyph {
  width: 17px;
  height: 17px;
  font-size: 8px;
}

.quest-meter {
  margin: 13px 0 12px;
}

.quest-meter i {
  background: linear-gradient(90deg, #4e8469, var(--moss-light));
}

.wide-button {
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--night);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  border: 0;
  border-radius: 5px;
  background: var(--amber-light);
}

.wide-button:disabled {
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.05);
}

.event-card {
  position: relative;
  min-height: 228px;
  padding: 18px 16px 15px;
  overflow: hidden;
  border: 1px solid rgba(215, 124, 129, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(215, 124, 129, 0.2), rgba(13, 41, 35, 0.94) 50%),
    #183c34;
  box-shadow: var(--shadow);
}

.event-orbit {
  position: absolute;
  width: 180px;
  height: 180px;
  pointer-events: none;
  border: 1px solid rgba(239, 230, 209, 0.08);
  border-radius: 50%;
}

.orbit-a {
  top: -96px;
  right: -58px;
}

.orbit-b {
  top: -72px;
  right: -34px;
  width: 132px;
  height: 132px;
}

.event-heading {
  position: relative;
}

.event-kicker {
  display: inline-block;
  padding: 3px 7px;
  color: #f3c2b4;
  font-size: 8px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(243, 194, 180, 0.24);
  border-radius: 99px;
}

.event-heading h3 {
  margin: 14px 0 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.event-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 10px;
}

.event-token {
  position: absolute;
  top: 50px;
  right: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  height: 82px;
  padding-top: 9px;
  color: #f5d4bd;
  border: 1px solid rgba(239, 230, 209, 0.18);
  border-radius: 50% 50% 46% 46%;
  background: rgba(13, 34, 29, 0.34);
}

.event-token .icon {
  width: 24px;
  height: 24px;
  color: #e7b495;
}

.event-token strong {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}

.event-token small {
  color: var(--ink-muted);
  font-size: 7px;
}

.event-progress-block {
  position: relative;
  margin-top: 28px;
}

.event-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink-muted);
  font-size: 8px;
}

.event-labels b {
  color: #efbbac;
  font-weight: 500;
}

.event-meter i {
  background: linear-gradient(90deg, #b55d68, #e8ad8e);
}

.milestones {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.milestone {
  flex: 1;
  padding: 6px 5px;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.13);
}

.milestone span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 4px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.milestone.ready {
  color: var(--ink);
  border-color: rgba(220, 169, 88, 0.5);
  background: rgba(220, 169, 88, 0.12);
}

.milestone.claimed {
  color: var(--moss-light);
  border-color: rgba(148, 184, 141, 0.2);
}

.tip-card {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 13px 14px;
}

.tip-icon {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--amber);
  border: 1px solid rgba(220, 169, 88, 0.18);
  border-radius: 50%;
}

.tip-icon .icon {
  width: 15px;
  height: 15px;
}

.tip-card p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.6;
}

.scene-banner {
  position: relative;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid rgba(241, 203, 124, 0.18);
  border-radius: 8px;
  background: #29483d;
  box-shadow: var(--shadow);
}

.scene-banner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 47%;
  transform: scale(1.02);
}

.scene-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 31, 26, 0.84) 0%, rgba(9, 31, 26, 0.52) 36%, rgba(9, 31, 26, 0.05) 68%),
    linear-gradient(0deg, rgba(9, 31, 26, 0.3), transparent 50%);
}

.scene-copy {
  position: absolute;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
}

.scene-copy .eyebrow {
  color: rgba(245, 237, 216, 0.66);
}

.scene-copy h1 {
  margin: 7px 0 7px;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.scene-copy p {
  margin: 0;
  color: rgba(245, 237, 216, 0.76);
  font-family: var(--serif);
  font-size: 10px;
}

.scene-badge {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 166px;
  padding: 7px 10px 7px 7px;
  border: 1px solid rgba(239, 230, 209, 0.22);
  border-radius: 6px;
  background: rgba(13, 35, 29, 0.7);
  backdrop-filter: blur(8px);
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--amber-light);
  border-radius: 50%;
  background: rgba(220, 169, 88, 0.12);
}

.badge-icon .icon {
  width: 17px;
  height: 17px;
}

.scene-badge div {
  display: flex;
  flex-direction: column;
}

.scene-badge small {
  color: var(--ink-muted);
  font-size: 7px;
}

.scene-badge strong {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 500;
}

.board-panel {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(241, 203, 124, 0.035), transparent 36%),
    rgba(13, 37, 32, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.board-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.board-heading h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.board-tools {
  display: flex;
  gap: 7px;
}

.tool-button {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--ink-soft);
  font-size: 9px;
  border-radius: 5px;
}

.tool-button .icon {
  width: 14px;
  height: 14px;
}

.tool-button .drop-glyph {
  width: 10px;
  height: 13px;
}

.tool-button .drop-glyph::before {
  top: -3px;
  left: 3px;
  width: 6px;
  height: 6px;
}

.board-frame {
  position: relative;
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(220, 169, 88, 0.22);
  border-radius: 8px;
  background: #0a211d;
  box-shadow:
    inset 0 0 0 4px rgba(7, 27, 23, 0.86),
    inset 0 0 48px rgba(0, 0, 0, 0.33);
}

.board-frame::before,
.board-frame::after {
  position: absolute;
  z-index: 4;
  width: 24px;
  height: 24px;
  pointer-events: none;
  content: "";
  border-color: rgba(220, 169, 88, 0.48);
}

.board-frame::before {
  top: 3px;
  left: 3px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.board-frame::after {
  right: 3px;
  bottom: 3px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.board-glow {
  position: absolute;
  top: -20%;
  left: 15%;
  width: 70%;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(241, 203, 124, 0.1), transparent);
  transform: rotate(-6deg);
  filter: blur(16px);
}

.merge-board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(239, 230, 209, 0.055);
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 60%),
    #13312b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.cell::after {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(239, 230, 209, 0.035);
  border-radius: 6px;
}

.cell:nth-child(7n + 1),
.cell:nth-child(7n) {
  background-color: #112c27;
}

.cell.drop-target {
  border-color: var(--amber-light);
  background: rgba(220, 169, 88, 0.14);
  transform: scale(0.97);
}

.cell.merge-target {
  border-color: var(--moss-light);
  background: rgba(148, 184, 141, 0.13);
}

.cell.selected {
  z-index: 3;
  border-color: var(--amber-light);
  background: rgba(220, 169, 88, 0.12);
  box-shadow:
    inset 0 0 0 2px rgba(241, 203, 124, 0.12),
    0 0 20px rgba(220, 169, 88, 0.11);
}

.cell.selected::before {
  position: absolute;
  z-index: 5;
  inset: 4px;
  pointer-events: none;
  content: "";
  border: 1px dashed rgba(241, 203, 124, 0.58);
  border-radius: 5px;
  animation: rotate-dash 5s linear infinite;
}

.item-token {
  position: absolute;
  inset: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--item-ink, #f2e8d4);
  cursor: grab;
  border-radius: 6px;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.12), transparent 35%),
    linear-gradient(150deg, var(--item-bg-a), var(--item-bg-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 4px 10px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
  touch-action: manipulation;
  user-select: none;
}

.cell:hover .item-token:not(.producer-token) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.item-token:active {
  cursor: grabbing;
}

.item-art {
  display: block;
  width: min(62%, 42px);
  aspect-ratio: 1;
  background: var(--item-ink, #f2e8d4);
  -webkit-mask: var(--item-icon) center / contain no-repeat;
  mask: var(--item-icon) center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

.item-name {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(6px, 0.8vw, 8px);
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-level {
  position: absolute;
  top: 3px;
  right: 3px;
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  color: #f6edd9;
  font-family: Georgia, serif;
  font-size: 8px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  background: rgba(7, 23, 20, 0.56);
}

.chain-flower {
  --item-bg-a: #9c4e5b;
  --item-bg-b: #693943;
}

.chain-tea {
  --item-bg-a: #9c7440;
  --item-bg-b: #6b522f;
}

.chain-honey {
  --item-bg-a: #b06145;
  --item-bg-b: #784232;
}

.producer-token {
  inset: 3px;
  color: #f8ebc8;
  cursor: pointer;
  border: 1px solid rgba(241, 203, 124, 0.48);
  background:
    radial-gradient(circle at 50% 30%, rgba(241, 203, 124, 0.24), transparent 44%),
    linear-gradient(150deg, #355b49, #1c3b32);
}

.producer-token::after {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #4c371d;
  font-size: 8px;
  font-weight: 900;
  content: "采";
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 8px rgba(241, 203, 124, 0.28);
}

.producer-token .item-art {
  width: min(55%, 42px);
}

.producer-token .producer-label {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  font-size: clamp(6px, 0.75vw, 8px);
  text-align: center;
}

.producer-token.ready {
  animation: producer-breathe 3.4s ease-in-out infinite;
}

.item-token.spawned {
  animation: item-spawn 0.34s cubic-bezier(0.17, 0.9, 0.32, 1.35);
}

.item-token.merged {
  animation: item-merge 0.45s cubic-bezier(0.17, 0.9, 0.32, 1.35);
}

.board-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 30% 70%, rgba(0, 0, 0, 0.1));
}

.selection-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 22, 18, 0.24);
}

.selected-copy {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.selected-swatch {
  display: grid;
  flex: 0 0 35px;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--amber-light);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(220, 169, 88, 0.08);
}

.selected-swatch .icon {
  width: 20px;
  height: 20px;
}

.selected-copy div {
  min-width: 0;
}

.selected-copy small {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-muted);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.selected-copy strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.text-button {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ink-soft);
  font-size: 8px;
  border-radius: 4px;
}

.text-button .icon {
  width: 12px;
  height: 12px;
}

.text-button:disabled {
  color: rgba(197, 203, 184, 0.25);
  border-color: rgba(239, 230, 209, 0.05);
  background: transparent;
}

.danger-text:not(:disabled):hover {
  color: #f2b1a2;
  border-color: rgba(223, 121, 93, 0.35);
  background: rgba(223, 121, 93, 0.08);
}

.board-footer {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 2px 0;
  color: var(--ink-muted);
  font-size: 8px;
}

.board-footer p {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.chain-legend {
  display: flex;
  gap: 10px;
}

.legend-chain {
  display: flex;
  gap: 4px;
  align-items: center;
}

.legend-chain i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d77c81;
}

.legend-chain.chain-tea i {
  background: #d2a853;
}

.legend-chain.chain-honey i {
  background: #d9795b;
}

.mouse-dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 13px;
  border: 1px solid var(--ink-muted);
  border-radius: 6px;
}

.mouse-dot::before {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 1px;
  height: 3px;
  content: "";
  background: var(--ink-muted);
}

.orders-panel {
  padding: 16px 13px 13px;
}

.orders-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.order-head-right {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: flex-end;
}

.order-stat {
  color: var(--ink-muted);
  font-size: 8px;
}

.order-stat b {
  color: var(--amber-light);
  font-size: 11px;
}

.reroll-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink-soft);
  border-radius: 50%;
}

.reroll-button .icon {
  width: 13px;
  height: 13px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.order-card {
  position: relative;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.025), transparent 44%),
    rgba(4, 25, 21, 0.3);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.order-card.ready {
  border-color: rgba(148, 184, 141, 0.32);
  background:
    linear-gradient(120deg, rgba(148, 184, 141, 0.07), transparent 52%),
    rgba(4, 25, 21, 0.3);
}

.order-card.delivered {
  animation: order-delivered 0.5s ease;
}

.order-top {
  display: grid;
  grid-template-columns: 35px 1fr auto;
  gap: 8px;
  align-items: center;
}

.customer-face {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--face, #e0b875);
  border: 1px solid color-mix(in srgb, var(--face, #e0b875) 35%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--face, #e0b875) 9%, transparent);
}

.customer-face .icon {
  width: 19px;
  height: 19px;
}

.customer-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.customer-copy small {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 8px;
}

.order-reward-line {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--amber-light);
  font-size: 9px;
}

.order-reward-line .coin-glyph {
  width: 16px;
  height: 16px;
  font-size: 7px;
}

.order-wants {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 9px 0 9px;
}

.want-pill {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
  padding: 3px 7px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.025);
}

.want-medallion {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--want-ink, #f3e7cf);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--want-a), var(--want-b));
}

.want-medallion .icon {
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.want-pill span:last-child {
  color: var(--ink-soft);
  font-size: 8px;
}

.order-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-note {
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 8px;
}

.deliver-button {
  min-width: 74px;
  min-height: 29px;
  padding: 5px 10px;
  color: var(--night);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--amber-light);
  transition: 0.18s ease;
}

.deliver-button:hover:not(:disabled) {
  background: #f8da94;
  transform: translateY(-1px);
}

.deliver-button:disabled {
  color: var(--ink-muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.renovation-card {
  padding: 15px;
}

.renovation-count {
  color: var(--ink-muted);
  font-size: 9px;
  white-space: nowrap;
}

.renovation-count b {
  color: var(--amber-light);
  font-family: var(--serif);
  font-size: 17px;
}

.renovation-scene {
  position: relative;
  height: 112px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1d3b2f;
}

.renovation-scene > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.68);
}

.decor-object {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #f6dc9d;
  opacity: 0.14;
  filter: grayscale(1);
  transition:
    opacity 0.3s ease,
    filter 0.3s ease,
    transform 0.3s ease;
}

.decor-object .icon {
  width: 100%;
  height: 100%;
}

.decor-lantern {
  top: 8px;
  left: 18px;
  width: 24px;
  height: 31px;
}

.decor-fountain {
  right: 18px;
  bottom: 11px;
  width: 34px;
  height: 37px;
}

.decor-butterfly {
  top: 18px;
  right: 34px;
  width: 19px;
  height: 19px;
}

.renovation-scene[data-stage="1"] .decor-lantern,
.renovation-scene[data-stage="2"] .decor-lantern,
.renovation-scene[data-stage="3"] .decor-lantern,
.renovation-scene[data-stage="2"] .decor-fountain,
.renovation-scene[data-stage="3"] .decor-fountain,
.renovation-scene[data-stage="3"] .decor-butterfly {
  opacity: 1;
  filter: none;
}

.renovation-scene[data-stage="1"] .decor-lantern,
.renovation-scene[data-stage="2"] .decor-fountain {
  animation: decor-glow 3s ease-in-out infinite;
}

.decor-overlay {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 4px;
  background: rgba(7, 25, 21, 0.72);
  backdrop-filter: blur(5px);
}

.decor-overlay span {
  font-family: var(--serif);
  font-size: 8px;
}

.decor-overlay b {
  color: var(--ink-muted);
  font-size: 7px;
  font-weight: 400;
}

.decor-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.decor-step {
  display: flex;
  gap: 4px;
  align-items: center;
  color: var(--ink-muted);
  font-size: 8px;
}

.decor-step i {
  width: 5px;
  height: 5px;
  border: 1px solid var(--ink-muted);
  border-radius: 50%;
}

.decor-step.active {
  color: var(--ink-soft);
}

.decor-step.active i {
  border-color: var(--amber-light);
  background: var(--amber-light);
  box-shadow: 0 0 6px rgba(241, 203, 124, 0.4);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0 0;
  color: rgba(137, 152, 137, 0.66);
  font-size: 8px;
  letter-spacing: 0.08em;
  border-top: 1px solid rgba(239, 230, 209, 0.06);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-layer.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 16, 13, 0.72);
  backdrop-filter: blur(7px);
  animation: fade-in 0.2s ease;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  padding: 22px;
  overflow: auto;
  border: 1px solid rgba(239, 230, 209, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(241, 203, 124, 0.055), transparent 38%),
    #102d27;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-card::before {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(239, 230, 209, 0.04);
  border-radius: 5px;
}

.modal-head {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
}

.modal-head p {
  margin: 7px 0 0;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
}

.modal-close {
  display: grid;
  flex: 0 0 31px;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 18px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.modal-close:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.shop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 169, 88, 0.18);
  border-radius: 6px;
  background: rgba(220, 169, 88, 0.05);
}

.shop-balance span {
  color: var(--ink-muted);
  font-size: 9px;
}

.shop-balance strong {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--amber-light);
  font-family: var(--serif);
  font-size: 18px;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(3, 20, 16, 0.18);
}

.shop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--shop-color, var(--amber-light));
  border: 1px solid color-mix(in srgb, var(--shop-color, var(--amber-light)) 26%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--shop-color, var(--amber-light)) 7%, transparent);
}

.shop-icon .icon {
  width: 24px;
  height: 24px;
}

.shop-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.shop-copy p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.45;
}

.shop-buy {
  min-width: 68px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--night);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  border-radius: 4px;
  background: var(--amber-light);
}

.shop-buy:disabled {
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.06);
}

.producer-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 13px;
}

.producer-choice {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 9px 11px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.025), transparent 52%),
    rgba(3, 20, 16, 0.2);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.producer-choice:hover {
  border-color: rgba(220, 169, 88, 0.36);
  background-color: rgba(220, 169, 88, 0.06);
  transform: translateX(2px);
}

.producer-choice-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--item-bg-a, var(--amber-light));
  border: 1px solid rgba(239, 230, 209, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
}

.producer-choice-icon .icon {
  width: 23px;
  height: 23px;
}

.producer-choice strong,
.producer-choice small {
  display: block;
}

.producer-choice strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.producer-choice small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 8px;
}

.producer-choice b {
  padding: 5px 8px;
  color: var(--night);
  font-size: 8px;
  border-radius: 4px;
  background: var(--amber-light);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.setting-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.setting-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.setting-row span {
  display: block;
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 8px;
}

.toggle {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 21px;
  padding: 0;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  content: "";
  border-radius: 50%;
  background: var(--ink-muted);
  transition: 0.2s ease;
}

.toggle.on {
  border-color: rgba(148, 184, 141, 0.4);
  background: rgba(148, 184, 141, 0.14);
}

.toggle.on::after {
  left: 20px;
  background: var(--moss-light);
}

.modal-action-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-action-row button {
  flex: 1;
}

.danger-button {
  min-height: 36px;
  color: #f0b1a3;
  font-size: 9px;
  cursor: pointer;
  border: 1px solid rgba(223, 121, 93, 0.24);
  border-radius: 5px;
  background: rgba(223, 121, 93, 0.06);
}

.danger-button:hover {
  background: rgba(223, 121, 93, 0.12);
}

.rule-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.rule-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rule-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--amber-light);
  font-family: Georgia, serif;
  font-size: 12px;
  border: 1px solid rgba(220, 169, 88, 0.22);
  border-radius: 50%;
}

.rule-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 500;
}

.rule-row p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.6;
}

.reward-modal {
  text-align: center;
}

.reward-emblem {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 8px auto 18px;
  color: var(--amber-light);
  border: 1px solid rgba(220, 169, 88, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 169, 88, 0.16), transparent 68%);
}

.reward-emblem .icon {
  width: 42px;
  height: 42px;
}

.reward-modal h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.reward-modal p {
  margin: 8px auto 0;
  max-width: 260px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
}

.reward-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
  color: var(--amber-light);
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  z-index: 300;
  top: 96px;
  left: 50%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 180px;
  max-width: 100%;
  padding: 9px 13px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.5;
  border: 1px solid rgba(239, 230, 209, 0.18);
  border-radius: 5px;
  background: rgba(13, 39, 33, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  animation: toast-in 0.25s ease both;
  backdrop-filter: blur(10px);
}

.toast::before {
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 8px rgba(241, 203, 124, 0.5);
}

.toast.error::before {
  background: var(--coral);
  box-shadow: 0 0 8px rgba(223, 121, 93, 0.5);
}

.toast.success::before {
  background: var(--moss-light);
  box-shadow: 0 0 8px rgba(148, 184, 141, 0.5);
}

.toast.out {
  animation: toast-out 0.22s ease both;
}

.confetti-layer,
.merge-burst-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  width: 5px;
  height: 11px;
  border-radius: 1px;
  animation: confetti-fall 0.9s cubic-bezier(0.1, 0.65, 0.3, 1) forwards;
}

.burst-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  animation: burst-out 0.55s ease-out forwards;
}

.empty-order {
  padding: 28px 16px;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

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

@keyframes producer-breathe {
  0%, 100% { box-shadow: inset 0 0 0 rgba(241, 203, 124, 0), 0 4px 10px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: inset 0 0 16px rgba(241, 203, 124, 0.08), 0 4px 13px rgba(0, 0, 0, 0.26); }
}

@keyframes item-spawn {
  0% { opacity: 0; transform: scale(0.45) rotate(-5deg); }
  65% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes item-merge {
  0% { transform: scale(0.8); filter: brightness(1.5); }
  55% { transform: scale(1.13); filter: brightness(1.25); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes order-delivered {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); border-color: rgba(148, 184, 141, 0.6); }
  50% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes decor-glow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(241, 203, 124, 0.24)); }
  50% { filter: drop-shadow(0 0 10px rgba(241, 203, 124, 0.58)); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-7px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-5px) scale(0.98); }
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); }
  100% { opacity: 0; transform: translate3d(var(--drift), 170px, 0) rotate(var(--spin)); }
}

@keyframes burst-out {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.2); }
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: 240px 1fr auto;
  }

  .main-grid {
    grid-template-columns: 230px minmax(490px, 1fr) 300px;
  }

  .resource-pill {
    padding-left: 9px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .topbar {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .player-progress {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(440px, 100%);
    padding-bottom: 12px;
  }

  .main-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .right-column {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.22fr 0.78fr;
    align-items: stretch;
  }

  .orders-panel,
  .renovation-card {
    min-height: 100%;
  }

  .order-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-top {
    grid-template-columns: 35px 1fr;
  }

  .order-reward-line {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 10px 18px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    gap: 8px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand-mark .icon {
    width: 20px;
    height: 20px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy small {
    display: none;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 5px;
  }

  .player-progress {
    min-width: 0;
    padding-bottom: 10px;
  }

  .level-badge {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .xp-wrap {
    min-width: 0;
  }

  .resource-pill {
    min-height: 34px;
    padding: 4px 6px;
  }

  .resource-pill strong {
    font-size: 11px;
  }

  .coin-pill .mini-add {
    display: none;
  }

  .energy-max {
    display: none;
  }

  .top-actions .icon-button {
    display: none;
  }

  .top-actions #soundButton,
  .top-actions #settingsButton {
    display: grid;
    width: 34px;
    height: 34px;
  }

  .main-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 13px;
  }

  .center-column {
    order: 1;
    width: 100%;
  }

  .right-column {
    order: 2;
    display: flex;
    width: 100%;
  }

  .left-column {
    order: 3;
    width: 100%;
  }

  .scene-banner {
    min-height: 128px;
  }

  .scene-copy {
    left: 16px;
  }

  .scene-copy h1 {
    font-size: 26px;
  }

  .scene-badge {
    right: 9px;
    bottom: 9px;
    min-width: 145px;
  }

  .board-panel {
    padding: 10px;
  }

  .board-heading {
    margin-bottom: 9px;
  }

  .board-heading h2 {
    font-size: 18px;
  }

  .tool-button {
    padding: 5px 7px;
  }

  .tool-button span:last-child {
    display: none;
  }

  .merge-board {
    gap: 3px;
  }

  .cell {
    border-radius: 5px;
  }

  .item-token {
    inset: 3px;
    border-radius: 4px;
  }

  .item-art {
    width: min(67%, 34px);
  }

  .item-name {
    display: none;
  }

  .producer-token .producer-label {
    display: none;
  }

  .item-level {
    top: 2px;
    right: 2px;
    min-width: 13px;
    height: 13px;
    font-size: 7px;
  }

  .producer-token::after {
    width: 13px;
    height: 13px;
    font-size: 7px;
  }

  .board-footer {
    align-items: flex-start;
    font-size: 7px;
  }

  .board-footer p {
    display: none;
  }

  .selection-bar {
    align-items: flex-start;
    padding: 7px;
  }

  .selected-swatch {
    display: none;
  }

  .selection-actions {
    flex-direction: column;
  }

  .text-button {
    min-height: 24px;
  }

  .orders-panel,
  .renovation-card {
    padding: 13px;
  }

  .order-list {
    display: flex;
  }

  .order-top {
    grid-template-columns: 35px 1fr auto;
  }

  .order-reward-line {
    grid-column: auto;
  }

  .renovation-scene {
    height: 142px;
  }

  .keeper-card {
    grid-template-columns: 76px 1fr;
  }

  .daily-card {
    display: grid;
    grid-template-columns: 1fr 136px;
    gap: 10px 16px;
  }

  .daily-card .panel-heading {
    grid-column: 1;
  }

  .daily-card .quest-line {
    grid-column: 1;
    margin-top: 3px;
  }

  .daily-card .quest-meter {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0 0 8px;
  }

  .daily-card .wide-button {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  .site-footer {
    font-size: 7px;
  }

  .modal-card {
    padding: 18px;
  }

  .toast-stack {
    top: 78px;
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    letter-spacing: 0.08em;
  }

  .coin-pill {
    display: none;
  }

  .scene-copy p,
  .scene-badge {
    display: none;
  }

  .scene-banner {
    min-height: 111px;
  }

  .scene-shade {
    background: linear-gradient(90deg, rgba(9, 31, 26, 0.88), rgba(9, 31, 26, 0.24));
  }

  .daily-card {
    display: block;
  }

  .daily-card .quest-line,
  .daily-card .quest-meter {
    margin-top: 12px;
  }

  .daily-card .wide-button {
    margin-top: 10px;
  }

  .order-top {
    grid-template-columns: 35px 1fr;
  }

  .order-reward-line {
    grid-column: 2;
  }

  .shop-item {
    grid-template-columns: 38px 1fr;
  }

  .shop-icon {
    width: 38px;
    height: 38px;
  }

  .shop-buy {
    grid-column: 2;
    justify-self: start;
  }
}

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