:root {
  color-scheme: light;
  --ink: #173229;
  --muted: #617067;
  --forest: #123729;
  --forest-2: #1f563d;
  --leaf: #4e8653;
  --leaf-soft: #dce7d2;
  --cream: #f4edda;
  --paper: #fffaf0;
  --paper-2: #f8f1df;
  --sun: #e5b64d;
  --sun-soft: #f8e5a8;
  --coral: #c85f45;
  --berry: #8b3d50;
  --line: rgba(23, 50, 41, 0.14);
  --shadow: 0 24px 70px rgba(38, 56, 42, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% -5%, rgba(242, 203, 109, 0.38), transparent 28rem),
    linear-gradient(145deg, #f8f1de 0%, #f0ead6 50%, #f7efd9 100%);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #7a281b;
  outline-offset: 3px;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--forest);
  border-radius: 10px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.page-atmosphere {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sun-glow {
  position: absolute;
  width: 380px;
  height: 380px;
  top: -180px;
  right: -120px;
  border: 1px solid rgba(222, 173, 66, 0.2);
  border-radius: 50%;
  background: rgba(246, 218, 139, 0.28);
  box-shadow: 0 0 0 52px rgba(246, 218, 139, 0.07), 0 0 0 104px rgba(246, 218, 139, 0.04);
}

.leaf-shadow {
  position: absolute;
  width: 260px;
  height: 520px;
  border-radius: 100% 0 100% 0;
  background: rgba(27, 73, 52, 0.045);
  transform: rotate(24deg);
}

.leaf-shadow-one {
  left: -130px;
  bottom: -200px;
}

.leaf-shadow-two {
  right: -150px;
  top: 32%;
  transform: rotate(202deg);
}

.paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--sun-soft);
  background: var(--forest);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px 14px 14px 4px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 23px;
  box-shadow: 0 10px 24px rgba(18, 55, 41, 0.18);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-family: STKaiti, KaiTi, "Noto Serif SC", serif;
  font-size: 23px;
  letter-spacing: 0.16em;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-chip,
.metric-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--forest);
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.ghost-button,
.secondary-button,
.primary-button,
.text-button,
.icon-button,
.fruit-choice,
.step-button,
.tab-button,
.order-remove,
.order-side-button {
  border: 0;
}

.ghost-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--forest);
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 750;
}

.ghost-button:hover,
.secondary-button:hover {
  background: white;
  border-color: rgba(23, 50, 41, 0.27);
}

.compact {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
}

.primary-button {
  min-height: 50px;
  padding: 13px 22px;
  color: #fff9e9;
  background: var(--forest);
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 28px rgba(18, 55, 41, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button:hover:not(:disabled) {
  background: #1a4c37;
  box-shadow: 0 18px 34px rgba(18, 55, 41, 0.25);
  transform: translateY(-2px);
}

.primary-button.wide,
.secondary-button.wide {
  width: 100%;
}

.text-button {
  padding: 3px;
  color: var(--forest-2);
  background: transparent;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 160px);
  margin: 0 auto;
}

.loading-card {
  min-height: 58vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.loading-mark {
  color: var(--sun);
  font-size: 38px;
  animation: pulse 1.4s ease-in-out infinite;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.eyebrow {
  display: inline-block;
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.home-view {
  padding: 38px 0 58px;
}

.hero-grid {
  min-height: 550px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.72fr);
  gap: clamp(38px, 7vw, 90px);
  align-items: center;
}

.hero-grid > *,
.hero-copy,
.setup-panel {
  min-width: 0;
  max-width: 100%;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 16px 0 20px;
  font-family: STKaiti, KaiTi, "Noto Serif SC", serif;
  font-size: clamp(54px, 8vw, 94px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-copy h1 span {
  display: block;
  color: var(--forest);
}

.hero-copy h1 em {
  display: block;
  margin-top: 12px;
  color: var(--coral);
  font-size: 0.43em;
  font-style: normal;
  letter-spacing: 0.28em;
}

.hero-lede {
  max-width: 630px;
  margin: 0;
  color: #445a4e;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.85;
}

.orchard-ribbon {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ribbon-fruit {
  min-height: 86px;
  padding: 13px 10px;
  display: grid;
  place-items: center;
  gap: 3px;
  background: rgba(255, 250, 240, 0.64);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.ribbon-fruit span {
  font-size: 25px;
}

.ribbon-fruit strong {
  font-size: 13px;
}

.ribbon-fruit small {
  color: var(--muted);
  font-size: 10px;
}

.setup-panel,
.stage-card,
.summary-card,
.final-card,
.score-panel,
.market-panel,
.progress-card {
  background: rgba(255, 250, 240, 0.86);
  border: 1px solid rgba(23, 50, 41, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.setup-panel {
  position: relative;
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) 8px;
  overflow: hidden;
}

.setup-panel::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -65px;
  top: -75px;
  border-radius: 50%;
  background: var(--sun-soft);
  opacity: 0.52;
}

.setup-panel h2 {
  position: relative;
  margin: 10px 0 8px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 31px;
}

.setup-panel > p {
  position: relative;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.65;
}

.field-label,
.choice-title {
  display: block;
  margin-bottom: 9px;
  color: #3d5147;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.text-input,
.number-input,
.select-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 50, 41, 0.16);
  border-radius: var(--radius-sm);
  outline: 0;
}

.text-input:focus,
.number-input:focus,
.select-input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(78, 134, 83, 0.12);
}

.fruit-choice-grid {
  margin: 9px 0 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.fruit-choice {
  position: relative;
  min-width: 0;
  padding: 10px 5px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.fruit-choice:focus-within,
.fruit-choice:has(.choice-input:focus-visible) {
  outline: 3px solid #7a281b;
  outline-offset: 3px;
}

.fruit-choice span {
  font-size: 22px;
}

.fruit-choice small {
  overflow: hidden;
  max-width: 100%;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fruit-choice.selected {
  color: #fff9e9;
  background: var(--forest);
  border-color: var(--forest);
  box-shadow: 0 8px 18px rgba(18, 55, 41, 0.2);
}

.resume-button {
  width: 100%;
  margin-top: 10px;
}

.progress-card {
  margin: 8px 0 18px;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: center;
  border-radius: var(--radius-lg);
}

.day-meta {
  display: flex;
  align-items: center;
  gap: 13px;
}

.day-emblem {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--sun-soft);
  border-radius: 18px 18px 18px 5px;
  font-family: STKaiti, KaiTi, serif;
  font-size: 24px;
  font-weight: 800;
}

.day-meta span:last-child {
  display: grid;
  gap: 3px;
}

.day-meta strong {
  font-size: 16px;
}

.day-meta small {
  color: var(--muted);
}

.day-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.day-step {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #89938d;
  font-size: 10px;
}

.day-step::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #d9d8cb;
}

.day-step:first-child::before {
  display: none;
}

.day-step i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: inherit;
  background: #ebe8db;
  border: 2px solid var(--paper);
  border-radius: 50%;
  font-style: normal;
  font-weight: 850;
}

.day-step.done,
.day-step.current {
  color: var(--forest);
}

.day-step.done::before,
.day-step.current::before {
  background: var(--leaf);
}

.day-step.done i {
  color: white;
  background: var(--leaf);
}

.day-step.current i {
  color: var(--forest);
  background: var(--sun-soft);
  box-shadow: 0 0 0 4px rgba(229, 182, 77, 0.18);
}

.game-layout {
  padding-bottom: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.game-layout > *,
.stage-card,
.summary-card,
.action-section,
.public-board,
.orderbook-board,
.orderbook-grid,
.orderbook-card,
.table-scroll {
  min-width: 0;
  max-width: 100%;
}

.stage-card,
.summary-card,
.final-card {
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-xl);
}

.stage-heading,
.section-heading,
.result-hero,
.final-hero,
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.stage-heading h2,
.result-hero h2,
.final-hero h2 {
  margin: 7px 0 7px;
  font-family: STKaiti, KaiTi, serif;
  font-size: clamp(28px, 4vw, 39px);
  line-height: 1.2;
}

.stage-heading p,
.result-hero p,
.final-hero p,
.section-heading p {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.stage-number {
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.cash-badge,
.round-gain {
  flex: 0 0 auto;
  min-width: 124px;
  padding: 14px 16px;
  display: grid;
  gap: 2px;
  background: var(--forest);
  border-radius: 18px 18px 18px 6px;
  color: #fff9e9;
  text-align: right;
}

.cash-badge small,
.round-gain small {
  color: rgba(255, 249, 233, 0.66);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.cash-badge strong,
.round-gain strong {
  color: var(--sun-soft);
  font-size: 23px;
}

.notice-strip {
  margin: 22px 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #314c3d;
  background: var(--leaf-soft);
  border-left: 5px solid var(--leaf);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
  font-size: 13px;
}

.notice-strip.warning {
  background: #f5e4ca;
  border-color: var(--coral);
}

.action-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.action-section:first-of-type {
  border-top: 0;
}

.section-heading {
  margin-bottom: 16px;
  align-items: flex-end;
}

.section-heading h3,
.panel-heading h3 {
  margin: 0;
  font-size: 18px;
}

.section-heading p,
.panel-heading p {
  font-size: 12px;
}

.inventory-grid,
.market-rate-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.inventory-card,
.rate-card {
  min-width: 0;
  padding: 13px 10px;
  display: grid;
  gap: 4px;
  background: #f8f4e9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.inventory-card .fruit-icon,
.rate-card .fruit-icon {
  font-size: 22px;
}

.inventory-card strong,
.rate-card strong {
  font-size: 12px;
  white-space: nowrap;
}

.inventory-card b {
  color: var(--forest);
  font-size: 24px;
}

.inventory-card small,
.rate-card small {
  color: var(--muted);
  font-size: 10px;
}

.rate-card b {
  font-size: 19px;
}

.rate-card.up b {
  color: var(--coral);
}

.rate-card.down b {
  color: #36745b;
}

.crop-switch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.crop-option {
  position: relative;
  padding: 13px 8px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--ink);
  background: #fbf7ec;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.crop-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.crop-option.selected,
.crop-option:has(input:checked) {
  color: #fff9e9;
  background: var(--forest);
  border-color: var(--forest);
}

.crop-option:focus-within {
  outline: 3px solid #7a281b;
  outline-offset: 3px;
}

.crop-option span {
  font-size: 22px;
}

.crop-option small {
  color: inherit;
  opacity: 0.72;
  font-size: 10px;
}

.economy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.economy-card {
  padding: 17px;
  background: #f8f4e8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.economy-card h4 {
  margin: 0 0 5px;
  font-size: 15px;
}

.economy-card > p {
  min-height: 36px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.stepper-row,
.compact-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 19px;
  font-weight: 800;
}

.step-value {
  min-width: 52px;
  color: var(--forest);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.redemption-list {
  display: grid;
  gap: 8px;
}

.redemption-row {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) 84px 70px;
  gap: 8px;
  align-items: center;
}

.redemption-row label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
}

.redemption-row .number-input {
  min-height: 44px;
  padding: 7px 9px;
}

.redemption-row output {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.tab-row {
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}

.tab-button {
  min-height: 44px;
  padding: 8px 14px;
  color: var(--muted);
  background: #f0ecdf;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tab-button.active {
  color: white;
  background: var(--forest);
}

.order-builder {
  padding: 16px;
  background: #f8f4e8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.order-form-grid {
  display: grid;
  grid-template-columns: 112px minmax(95px, 1fr) minmax(95px, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.order-side-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.order-side-button {
  min-height: 44px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.order-side-button.active.buy {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
}

.order-side-button.active.sell {
  color: white;
  background: var(--leaf);
  border-color: var(--leaf);
}

.mini-field {
  display: grid;
  gap: 5px;
}

.mini-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.order-list {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.order-row {
  min-height: 46px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
}

.order-row .order-side {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  color: white;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}

.order-side.buy {
  background: var(--coral);
}

.order-side.sell {
  background: var(--leaf);
}

.order-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row small {
  color: var(--muted);
}

.order-remove {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--berry);
  background: #f6e9e4;
  border-radius: 9px;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  border: 1px dashed rgba(23, 50, 41, 0.2);
  border-radius: var(--radius-md);
  font-size: 12px;
  text-align: center;
}

.selection-dock {
  position: sticky;
  z-index: 5;
  bottom: 12px;
  margin-top: 12px;
  padding: 12px 12px 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  color: white;
  background: rgba(18, 55, 41, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(18, 55, 41, 0.27);
  backdrop-filter: blur(12px);
}

.dock-copy {
  display: grid;
  gap: 2px;
}

.dock-copy strong {
  color: var(--sun-soft);
  font-size: 13px;
}

.dock-copy small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
}

.selection-dock .primary-button {
  color: var(--forest);
  background: var(--sun-soft);
  box-shadow: none;
}

.score-panel,
.market-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.game-layout > aside {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 14px;
}

.score-panel h3,
.market-panel h3 {
  margin: 0 0 15px;
  font-size: 15px;
}

.player-summary {
  padding-bottom: 15px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.player-id-badge {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--sun-soft);
  background: var(--forest);
  border-radius: 15px 15px 15px 5px;
  font-weight: 900;
}

.player-summary span:last-child {
  display: grid;
  gap: 2px;
}

.player-summary small {
  color: var(--muted);
  font-size: 10px;
}

.player-summary strong {
  font-size: 19px;
}

.side-inventory {
  display: grid;
  gap: 7px;
}

.side-inventory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.side-inventory-row span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.side-inventory-row b {
  font-size: 14px;
}

.side-note {
  margin: 14px 0 0;
  padding-top: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.6;
}

.result-view,
.final-view {
  padding: 8px 0 56px;
}

.result-hero,
.final-hero {
  align-items: center;
}

.public-board,
.orderbook-board,
.transaction-board,
.coefficient-board,
.ranking-board {
  margin-top: 24px;
}

.board-title {
  margin-bottom: 11px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.board-title h3 {
  margin: 0;
  font-size: 17px;
}

.board-title p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  min-width: 670px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f6f0e1;
  text-align: left;
}

.data-table thead th {
  color: #fff9e9;
  background: var(--forest);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.data-table thead th:first-child {
  background: var(--forest);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr.human td {
  background-color: rgba(229, 182, 77, 0.12);
  font-weight: 800;
}

.orderbook-grid {
  display: grid;
  gap: 12px;
}

.orderbook-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.orderbook-card > header {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: #fff9e9;
  background: var(--forest);
}

.orderbook-card > header > span {
  font-size: 19px;
}

.orderbook-card > header small {
  color: rgba(255, 249, 233, 0.7);
}

.quote-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-columns > section {
  min-width: 0;
  padding: 13px;
}

.quote-columns > section + section {
  border-left: 1px solid var(--line);
}

.quote-columns h4 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.quote-list {
  display: grid;
  gap: 6px;
}

.quote-row {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  background: #f8f4e8;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
}

.quote-row > span {
  min-width: 0;
  display: grid;
}

.quote-row strong,
.quote-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.quote-row b {
  color: var(--forest);
  white-space: nowrap;
}

.quote-row em {
  color: var(--coral);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.quote-row.matched {
  background: rgba(229, 182, 77, 0.12);
}

.quote-row:not(.matched) {
  opacity: 0.72;
}

.quote-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  background: #f8f4e8;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11px;
  text-align: center;
}

.transaction-list {
  display: grid;
  gap: 8px;
}

.transaction-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #f8f4e8;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 12px;
}

.transaction-row strong {
  color: var(--forest);
}

.transaction-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.transaction-row b {
  color: var(--coral);
}

.result-actions,
.final-actions {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.final-card {
  max-width: 860px;
  margin: 14px auto 0;
}

.winner-emblem {
  flex: 0 0 auto;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--sun-soft);
  border-radius: 34px 34px 34px 9px;
  font-size: 44px;
}

.final-ranking {
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.ranking-row {
  min-height: 66px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 40px 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: #f8f4e8;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.ranking-row:first-child {
  background: linear-gradient(110deg, #f7e6a9, #fff9e8);
  border-color: rgba(192, 143, 37, 0.35);
}

.ranking-row.human {
  box-shadow: inset 4px 0 var(--coral);
}

.rank-number {
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.ranking-crop {
  font-size: 27px;
  text-align: center;
}

.ranking-name {
  display: grid;
  gap: 2px;
}

.ranking-name small,
.ranking-money small {
  color: var(--muted);
  font-size: 10px;
}

.ranking-money {
  display: grid;
  gap: 2px;
  text-align: right;
}

.ranking-money strong {
  color: var(--coral);
  font-size: 20px;
}

.rules-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 920px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-xl);
}

.rules-dialog::backdrop {
  background: rgba(8, 26, 19, 0.68);
  backdrop-filter: blur(8px);
}

.dialog-card {
  max-height: min(88vh, 920px);
  padding: 26px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 90px rgba(7, 28, 20, 0.32);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.dialog-heading h2 {
  margin: 6px 0 0;
  font-family: STKaiti, KaiTi, serif;
  font-size: 29px;
}

.icon-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #eee9dc;
  border-radius: 50%;
  font-size: 24px;
}

.rule-flow {
  margin: 22px 0;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  background: var(--forest);
  border-radius: var(--radius-md);
  color: white;
  font-size: 12px;
}

.rule-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rule-flow b {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  color: var(--forest);
  background: var(--sun-soft);
  border-radius: 50%;
}

.rule-flow i {
  color: rgba(255, 255, 255, 0.5);
  font-style: normal;
}

.rules-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 26px;
}

.rules-content section {
  min-width: 0;
}

.rules-content h3 {
  margin: 0 0 7px;
  color: var(--forest);
  font-size: 15px;
}

.rules-content p,
.rules-content li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.rules-content p {
  margin: 0;
}

.fruit-rule-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  list-style: none;
}

.fruit-rule-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.fruit-rule-list b {
  color: var(--ink);
}

.fruit-rule-list em {
  min-width: 76px;
  color: var(--coral);
  font-style: normal;
  text-align: right;
}

.adaptation-note {
  grid-column: 1 / -1;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.dialog-card > .primary-button {
  margin-top: 24px;
}

.toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 17px;
  color: #fff9e9;
  background: rgba(18, 55, 41, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(13, 41, 30, 0.32);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: 180ms ease;
}

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

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9) rotate(0); }
  50% { opacity: 1; transform: scale(1.08) rotate(20deg); }
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .hero-copy {
    max-width: 780px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-layout > aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: -1;
  }

  .order-form-grid {
    grid-template-columns: 112px 1fr 1fr;
  }

  .order-form-grid > .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-header,
  .app-shell,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 72px;
  }

  .brand-seal {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

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

  .brand-copy small {
    display: none;
  }

  .day-chip {
    display: none;
  }

  .home-view {
    padding-top: 20px;
  }

  .hero-grid {
    min-height: auto;
  }

  .hero-copy h1 {
    margin-top: 12px;
    font-size: clamp(51px, 18vw, 76px);
  }

  .hero-copy h1 em {
    margin-top: 9px;
    font-size: 0.38em;
  }

  .hero-lede {
    font-size: 16px;
    line-height: 1.75;
  }

  .orchard-ribbon {
    margin-top: 26px;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, 86px);
    overflow-x: auto;
    padding-bottom: 5px;
    scroll-snap-type: x mandatory;
  }

  .ribbon-fruit {
    scroll-snap-align: start;
  }

  .setup-panel {
    padding: 23px 18px;
    border-radius: 24px 24px 24px 7px;
  }

  .fruit-choice-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, 70px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .progress-card {
    padding: 15px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .day-meta {
    justify-content: space-between;
  }

  .day-meta span:last-child {
    flex: 1;
  }

  .day-track {
    gap: 1px;
  }

  .day-step span {
    display: none;
  }

  .stage-card,
  .summary-card,
  .final-card {
    padding: 20px 15px;
    border-radius: 24px;
  }

  .stage-heading,
  .result-hero,
  .final-hero {
    display: grid;
  }

  .cash-badge,
  .round-gain {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
  }

  .cash-badge strong,
  .round-gain strong {
    text-align: right;
  }

  .notice-strip {
    align-items: flex-start;
  }

  .inventory-grid,
  .market-rate-grid,
  .crop-switch-grid {
    grid-template-columns: repeat(5, 82px);
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .economy-grid {
    grid-template-columns: 1fr;
  }

  .order-form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .order-side-picker {
    grid-column: 1 / -1;
  }

  .order-form-grid > .primary-button {
    grid-column: 1 / -1;
  }

  .order-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .order-row small {
    grid-column: 2;
    display: block;
  }

  .order-row .order-side {
    grid-row: 1 / span 2;
  }

  .order-row .order-remove {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .selection-dock {
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 10px;
  }

  .dock-copy small {
    display: none;
  }

  .selection-dock .primary-button {
    min-height: 44px;
    padding: 10px 16px;
  }

  .game-layout > aside {
    grid-template-columns: 1fr;
    order: 0;
  }

  .transaction-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .transaction-row b {
    grid-column: 2;
  }

  .quote-columns {
    grid-template-columns: 1fr;
  }

  .quote-columns > section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .quote-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .quote-row em {
    grid-column: 2;
  }

  .rules-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .dialog-card {
    max-height: calc(100vh - 16px);
    padding: 21px 16px;
    border-radius: 22px;
  }

  .dialog-heading h2 {
    font-size: 25px;
  }

  .rule-flow {
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }

  .rules-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .adaptation-note {
    grid-column: auto;
  }

  .site-footer {
    min-height: 76px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  }

  .site-footer > span {
    display: none;
  }
}

@media (max-width: 420px) {
  .header-actions {
    gap: 6px;
  }

  .ghost-button.compact {
    min-height: 34px;
    padding: 7px 11px;
  }

  .stage-heading h2,
  .result-hero h2,
  .final-hero h2 {
    font-size: 28px;
  }

  .section-heading {
    display: grid;
  }

  .redemption-row {
    grid-template-columns: minmax(70px, 1fr) 72px 58px;
  }

  .ranking-row {
    grid-template-columns: 34px 40px minmax(0, 1fr) auto;
    padding-inline: 10px;
  }

  .ranking-money strong {
    font-size: 16px;
  }
}

@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;
  }
}
