:root {
  --ink: #17362b;
  --ink-soft: #426454;
  --cream: #fff8e8;
  --paper: #f7edce;
  --gold: #eebf55;
  --gold-deep: #bd7d25;
  --leaf: #4f8b42;
  --leaf-deep: #275d3d;
  --mint: #cce8b7;
  --danger: #e66b54;
  --shadow: 0 22px 60px rgba(17, 55, 38, 0.22);
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(151, 205, 127, 0.28), transparent 38%),
    linear-gradient(145deg, #10291f, #1f4a31 55%, #102b22);
  color: var(--ink);
  font-family: var(--font);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid #fff4a8;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

#viewport {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  transform-origin: center center;
  background: #b6dca0;
  box-shadow: 0 40px 110px rgba(4, 20, 14, 0.52);
  isolation: isolate;
  user-select: none;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#gameCanvas.planting {
  cursor: crosshair;
}

#gameCanvas.shoveling {
  cursor: grab;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
}

.start-screen {
  z-index: 25;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(247, 241, 213, 0.98) 0%, rgba(247, 241, 213, 0.95) 43%, rgba(242, 235, 201, 0.32) 70%, rgba(29, 72, 48, 0.05) 100%),
    radial-gradient(circle at 78% 38%, #f4d87c 0 9%, transparent 9.4%),
    linear-gradient(155deg, #d8efbf 0%, #7eb66a 56%, #346b49 100%);
}

.start-screen::before {
  content: "";
  position: absolute;
  width: 900px;
  height: 900px;
  right: -265px;
  bottom: -580px;
  border-radius: 50%;
  background: #2f6844;
  box-shadow: 0 -18px 0 rgba(255, 255, 255, 0.12) inset;
}

.start-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: radial-gradient(rgba(39, 76, 48, 0.7) 0.8px, transparent 0.8px);
  background-size: 8px 8px;
  mix-blend-mode: multiply;
}

.start-glow {
  position: absolute;
  width: 650px;
  height: 650px;
  right: 40px;
  top: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 250, 213, 0.45);
  box-shadow:
    0 0 0 54px rgba(255, 249, 214, 0.08),
    0 0 0 116px rgba(255, 249, 214, 0.06);
}

.start-copy {
  position: absolute;
  left: 82px;
  top: 104px;
  z-index: 4;
  width: 560px;
}

.eyebrow {
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.start-copy h1 {
  margin: 20px 0 19px;
  color: #143726;
  font-size: 92px;
  font-weight: 1000;
  letter-spacing: -0.09em;
  line-height: 0.9;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.6);
}

.start-copy h1 span {
  display: inline-block;
  margin-left: 56px;
  color: #b9781f;
  font-size: 74px;
  letter-spacing: -0.08em;
}

.start-lead {
  margin: 0 0 32px;
  color: #43644e;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.start-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.primary-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  min-height: 66px;
  padding: 12px 27px;
  border: 1px solid #f8d985;
  border-radius: 18px;
  background: linear-gradient(180deg, #286944, #174d34);
  color: #fffbed;
  box-shadow:
    0 9px 0 #0e3726,
    0 16px 24px rgba(18, 64, 41, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  text-align: left;
}

.primary-button span {
  display: block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.primary-button small {
  display: block;
  margin-top: 3px;
  color: #cce4c0;
  font-size: 11px;
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover {
  transform: translateY(-2px);
}

.primary-button:active {
  box-shadow: 0 3px 0 #0e3726;
  transform: translateY(5px);
}

.primary-button.compact {
  min-height: 46px;
  padding: 10px 25px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 5px 0 #0e3726, 0 10px 18px rgba(18, 64, 41, 0.2);
}

.secondary-button {
  min-height: 52px;
  padding: 10px 23px;
  border: 1px solid rgba(24, 67, 43, 0.22);
  border-radius: 16px;
  background: rgba(255, 251, 231, 0.7);
  color: #214b34;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 7px 20px rgba(33, 75, 52, 0.08);
}

.text-button {
  padding: 9px 10px;
  background: transparent;
  color: #5f725f;
  font-size: 13px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.feature-row {
  display: flex;
  gap: 27px;
  margin-top: 45px;
  color: #54705b;
  font-size: 13px;
  font-weight: 700;
}

.feature-row b {
  margin-right: 4px;
  color: #235338;
  font-size: 20px;
}

.start-art {
  position: absolute;
  right: 48px;
  top: 60px;
  width: 640px;
  height: 585px;
  z-index: 3;
}

.hero-ring {
  position: absolute;
  left: 131px;
  top: 50px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 250, 218, 0.6);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px rgba(255, 250, 218, 0.1),
    0 0 0 74px rgba(255, 250, 218, 0.08);
}

.halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
}

.halo-one {
  left: 200px;
  top: 98px;
  width: 310px;
  height: 310px;
  background: radial-gradient(circle, rgba(255, 248, 196, 0.9), rgba(247, 219, 125, 0.08) 68%, transparent 70%);
}

.halo-two {
  right: 12px;
  bottom: 28px;
  width: 270px;
  height: 270px;
  background: radial-gradient(circle, rgba(210, 240, 172, 0.56), transparent 70%);
}

.hero-frog {
  position: absolute;
  left: 220px;
  top: 125px;
  width: 278px;
  filter: drop-shadow(0 34px 26px rgba(23, 65, 36, 0.35));
  animation: hero-bob 4.8s ease-in-out infinite;
}

.orbit-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px 7px 7px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 251, 234, 0.82);
  box-shadow: 0 10px 30px rgba(31, 74, 42, 0.22);
  backdrop-filter: blur(7px);
  animation: orbit-float 5s ease-in-out infinite;
}

.orbit-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 4px rgba(61, 55, 24, 0.22));
}

.orbit-card span {
  color: #31523a;
  font-size: 13px;
  font-weight: 900;
}

.orbit-a {
  left: 65px;
  top: 82px;
}

.orbit-b {
  right: 50px;
  top: 160px;
  animation-delay: -1.4s;
}

.orbit-c {
  left: 30px;
  bottom: 98px;
  animation-delay: -2.8s;
}

.orbit-d {
  right: 92px;
  bottom: 49px;
  animation-delay: -0.8s;
}

.star {
  position: absolute;
  color: #fff5b6;
  font-size: 28px;
  text-shadow: 0 4px 12px rgba(67, 93, 40, 0.35);
  animation: twinkle 2.4s ease-in-out infinite;
}

.star-a {
  top: 25px;
  right: 116px;
}

.star-b {
  left: 89px;
  top: 314px;
  font-size: 20px;
  animation-delay: -1s;
}

.star-c {
  right: 40px;
  bottom: 225px;
  animation-delay: -1.7s;
}

.start-footer {
  position: absolute;
  z-index: 5;
  left: 82px;
  right: 48px;
  bottom: 26px;
  display: flex;
  justify-content: space-between;
  color: rgba(237, 250, 224, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.start-footer span:first-child {
  color: #5d735f;
}

@keyframes hero-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1.5deg); }
}

@keyframes orbit-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

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

#gameHud {
  position: absolute;
  z-index: 8;
  top: 13px;
  left: 15px;
  right: 16px;
  height: 105px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

#gameHud > * {
  pointer-events: auto;
}

.laugh-counter {
  width: 94px;
  height: 92px;
  flex: 0 0 94px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid rgba(255, 244, 185, 0.86);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 252, 226, 0.96), rgba(242, 219, 137, 0.94));
  box-shadow: 0 10px 24px rgba(25, 62, 39, 0.25), inset 0 1px 0 #fff;
}

.laugh-icon {
  width: 31px;
  height: 31px;
  margin-top: -4px;
  filter: drop-shadow(0 3px 3px rgba(127, 103, 35, 0.22));
}

.laugh-icon svg {
  width: 100%;
  height: 100%;
}

.laugh-counter strong {
  margin-top: -1px;
  color: #4c4b28;
  font-size: 23px;
  font-weight: 1000;
  line-height: 1;
}

.laugh-counter small {
  margin-top: 2px;
  color: #806b35;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.seed-bar {
  height: 100px;
  margin-left: 8px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 250, 220, 0.6);
  border-radius: 22px;
  background: rgba(235, 225, 183, 0.88);
  box-shadow: 0 10px 28px rgba(22, 63, 37, 0.2);
  backdrop-filter: blur(8px);
}

.seed-card {
  position: relative;
  width: 79px;
  height: 84px;
  flex: 0 0 79px;
  padding: 3px 3px 4px;
  overflow: hidden;
  border: 1px solid #ad8e55;
  border-radius: 11px;
  background: linear-gradient(180deg, #fffbed, #e9d7a5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.54), 0 3px 5px rgba(81, 61, 22, 0.18);
  cursor: pointer;
  transition: transform 110ms ease, filter 110ms ease;
}

.seed-card:hover {
  transform: translateY(-3px);
}

.seed-card.selected {
  outline: 4px solid #fff3a6;
  outline-offset: 1px;
  transform: translateY(-5px);
  box-shadow: 0 0 0 2px #46733c, 0 8px 14px rgba(39, 68, 31, 0.32);
}

.seed-card.unaffordable {
  filter: saturate(0.25) brightness(0.78);
}

.seed-card.cooling::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: linear-gradient(to top, rgba(22, 43, 28, 0.74) var(--cooldown, 100%), transparent var(--cooldown, 100%));
  pointer-events: none;
}

.seed-card img {
  display: block;
  width: 62px;
  height: 56px;
  margin: 0 auto -1px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 2px rgba(87, 62, 27, 0.22));
}

.seed-name {
  display: block;
  overflow: hidden;
  color: #3e432a;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-cost {
  position: absolute;
  left: 5px;
  bottom: 4px;
  min-width: 24px;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(74, 60, 24, 0.72);
  color: #fff8ce;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
  text-align: center;
}

.seed-key {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 253, 226, 0.92);
  color: #725727;
  font-size: 9px;
  font-weight: 1000;
  line-height: 15px;
  text-align: center;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border-radius: 18px;
  background: rgba(246, 238, 204, 0.84);
  box-shadow: 0 9px 22px rgba(22, 63, 37, 0.2);
  backdrop-filter: blur(8px);
}

.icon-button {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(92, 82, 39, 0.18);
  border-radius: 13px;
  background: rgba(255, 252, 232, 0.88);
  color: #3e5a3f;
  cursor: pointer;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 0 3px 0 rgba(101, 80, 35, 0.16);
}

.icon-button:hover,
.icon-button.active {
  background: #fff6ba;
  transform: translateY(-2px);
}

.pause-glyph {
  width: 13px;
  height: 18px;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
}

.shovel-glyph {
  position: relative;
  width: 9px;
  height: 29px;
  border-radius: 2px;
  background: #6e5b36;
  transform: rotate(-35deg);
}

.shovel-glyph::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: -10px;
  width: 20px;
  height: 17px;
  border-radius: 4px 4px 11px 11px;
  background: #8b9b89;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.42);
}

.sound-glyph {
  font-size: 25px;
}

.sound-off {
  opacity: 0.45;
  text-decoration: line-through;
}

.wave-badge {
  position: absolute;
  z-index: 8;
  right: 20px;
  bottom: 16px;
  width: 177px;
  padding: 11px 14px 10px;
  border: 1px solid rgba(255, 250, 219, 0.54);
  border-radius: 17px;
  background: rgba(27, 63, 40, 0.83);
  color: #fff9db;
  box-shadow: 0 9px 23px rgba(16, 45, 27, 0.24);
  backdrop-filter: blur(7px);
}

.wave-kicker {
  display: block;
  color: #cde2bd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.wave-badge strong {
  display: block;
  margin: 2px 0 8px;
  font-size: 20px;
  line-height: 1;
}

.wave-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(231, 244, 203, 0.18);
}

.wave-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2ce68, #fff3b3);
  transition: width 500ms ease;
}

.selection-hint {
  position: absolute;
  z-index: 8;
  left: 20px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 250, 219, 0.48);
  border-radius: 999px;
  background: rgba(27, 63, 40, 0.76);
  color: #eef6dc;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 45, 27, 0.2);
  backdrop-filter: blur(6px);
}

.hint-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #f7df81;
  box-shadow: 0 0 0 4px rgba(247, 223, 129, 0.17);
}

.toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 132px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 246, 190, 0.7);
  border-radius: 999px;
  background: rgba(31, 67, 43, 0.92);
  color: #fff8d7;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 28px rgba(14, 41, 24, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.modal-screen {
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(9, 35, 23, 0.66);
  backdrop-filter: blur(9px);
}

.modal-panel {
  width: min(1120px, calc(100% - 30px));
  max-height: 650px;
  overflow: hidden;
  border: 1px solid rgba(255, 252, 225, 0.84);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 251, 235, 0.98), rgba(242, 231, 195, 0.98)),
    var(--cream);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 34px 18px;
  border-bottom: 1px solid rgba(104, 89, 48, 0.13);
}

.modal-head h2 {
  margin: 6px 0 4px;
  color: #183c2a;
  font-size: 34px;
  letter-spacing: -0.055em;
}

.modal-head p {
  margin: 0;
  color: #637260;
  font-size: 13px;
  font-weight: 700;
}

.round-close {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(43, 77, 48, 0.15);
  border-radius: 50%;
  background: #fffaea;
  color: #3a5a41;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.loadout-panel {
  height: 636px;
  display: flex;
  flex-direction: column;
}

.loadout-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 3px;
}

.deck-count {
  margin-right: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #315f41;
  color: #fffbe6;
  font-size: 12px;
  font-weight: 900;
}

.loadout-roster {
  flex: 1;
  padding: 20px 28px 22px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  scrollbar-color: #b7a36c transparent;
}

.loadout-group-label {
  grid-column: 1 / -1;
  margin: 5px 2px 1px;
  color: #997333;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.16em;
}

.roster-card {
  position: relative;
  height: 96px;
  padding: 6px 8px 6px 58px;
  overflow: hidden;
  border: 1px solid rgba(114, 91, 42, 0.18);
  border-radius: 17px;
  background: rgba(255, 253, 239, 0.72);
  cursor: pointer;
  text-align: left;
  transition: transform 130ms ease, background 130ms ease, border 130ms ease;
}

.roster-card:hover {
  transform: translateY(-2px);
  background: #fffdf1;
}

.roster-card.selected {
  border-color: #517947;
  background: linear-gradient(135deg, #edf7dc, #fff9dc);
  box-shadow: inset 0 0 0 2px #7ea16e;
}

.roster-card.selected::after {
  content: "✓";
  position: absolute;
  right: 8px;
  top: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #366a46;
  color: white;
  font-size: 12px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}

.roster-card img {
  position: absolute;
  left: 4px;
  top: 13px;
  width: 55px;
  height: 55px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(87, 65, 21, 0.16));
}

.roster-card strong {
  display: block;
  padding-right: 18px;
  overflow: hidden;
  color: #294832;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-role {
  display: block;
  margin-top: 3px;
  color: #8b713c;
  font-size: 10px;
  font-weight: 800;
}

.roster-desc {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: #697665;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.roster-cost {
  position: absolute;
  right: 9px;
  bottom: 7px;
  color: #79612d;
  font-size: 10px;
  font-weight: 1000;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 30px 22px;
  border-top: 1px solid rgba(104, 89, 48, 0.13);
}

.codex-panel {
  height: 650px;
  display: flex;
  flex-direction: column;
}

.codex-tabs {
  display: flex;
  gap: 7px;
  padding: 14px 30px 0;
}

.codex-tab {
  padding: 8px 16px;
  border: 1px solid rgba(94, 81, 40, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 237, 0.65);
  color: #677260;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.codex-tab.active {
  border-color: #315f41;
  background: #315f41;
  color: #fff9dc;
}

.codex-grid {
  flex: 1;
  padding: 18px 30px 28px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  scrollbar-color: #b7a36c transparent;
}

.codex-card {
  position: relative;
  min-height: 190px;
  padding: 12px 13px 13px 96px;
  border: 1px solid rgba(108, 87, 40, 0.17);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 23%, rgba(243, 218, 130, 0.25), transparent 28%),
    rgba(255, 253, 240, 0.78);
}

.codex-card img {
  position: absolute;
  left: 8px;
  top: 17px;
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(82, 61, 22, 0.2));
}

.codex-card .zodiac-badge {
  position: absolute;
  left: 20px;
  top: 98px;
  width: 54px;
  color: #a47d30;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-align: center;
}

.codex-card h3 {
  margin: 2px 0 1px;
  color: #254832;
  font-size: 18px;
}

.codex-title {
  color: #a57425;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.codex-stats {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  color: #73806f;
  font-size: 9px;
  font-weight: 800;
}

.codex-stats span {
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(100, 126, 74, 0.09);
}

.codex-ability {
  margin: 8px 0 0;
  color: #596957;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.original-codex {
  flex: 1;
  min-height: 0;
  padding: 15px 30px 25px;
  overflow: auto;
  text-align: center;
}

.original-codex img {
  max-height: 440px;
  max-width: 100%;
  border-radius: 15px;
  box-shadow: 0 14px 35px rgba(72, 55, 19, 0.18);
}

.help-panel {
  width: min(980px, calc(100% - 30px));
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 26px 32px 30px;
}

.help-grid article {
  min-height: 182px;
  padding: 17px;
  border: 1px solid rgba(103, 85, 43, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 239, 0.68);
}

.help-grid b {
  color: #d2aa4e;
  font-size: 25px;
  letter-spacing: -0.05em;
}

.help-grid h3 {
  margin: 18px 0 6px;
  color: #294c35;
  font-size: 15px;
}

.help-grid p {
  margin: 0;
  color: #687565;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
}

.shortcut-note {
  margin-right: auto;
  color: #7a806e;
  font-size: 11px;
  font-weight: 700;
}

.pause-screen {
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(10, 37, 23, 0.5);
  backdrop-filter: blur(6px);
}

.pause-card,
.result-card {
  width: 390px;
  padding: 33px;
  border: 1px solid rgba(255, 251, 224, 0.8);
  border-radius: 29px;
  background: linear-gradient(150deg, #fffdf0, #eee0b4);
  box-shadow: var(--shadow);
  text-align: center;
}

.pause-card h2,
.result-card h2 {
  margin: 9px 0 8px;
  color: #21482f;
  font-size: 35px;
  letter-spacing: -0.06em;
}

.pause-card p,
.result-card p {
  margin: 0 0 22px;
  color: #697460;
  font-size: 13px;
  font-weight: 700;
}

.pause-card .primary-button,
.pause-card .secondary-button,
.pause-card .text-button {
  width: 100%;
  margin-top: 11px;
}

.result-screen {
  z-index: 35;
  display: grid;
  place-items: center;
  background: rgba(10, 37, 23, 0.62);
  backdrop-filter: blur(9px);
}

.result-card {
  width: 470px;
  padding: 36px 40px 31px;
}

.result-seal {
  width: 69px;
  height: 69px;
  margin: 0 auto 13px;
  border: 5px solid #fff8d4;
  border-radius: 50%;
  background: linear-gradient(145deg, #6ca15a, #2c6946);
  color: #fffde1;
  font-size: 36px;
  font-weight: 900;
  line-height: 60px;
  box-shadow: 0 8px 20px rgba(36, 81, 43, 0.2);
}

.result-card.defeat .result-seal {
  background: linear-gradient(145deg, #d58f70, #8f4131);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 23px 0 15px;
  border-top: 1px solid rgba(105, 91, 50, 0.13);
  border-bottom: 1px solid rgba(105, 91, 50, 0.13);
}

.result-stats div {
  padding: 16px 4px 13px;
  border-right: 1px solid rgba(105, 91, 50, 0.13);
}

.result-stats div:last-child {
  border-right: 0;
}

.result-stats span {
  display: block;
  color: #7b806d;
  font-size: 10px;
  font-weight: 800;
}

.result-stats b {
  display: block;
  margin-top: 4px;
  color: #31573b;
  font-size: 23px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin-top: 20px;
}

.rotate-notice {
  display: none;
}

.rotate-notice.is-dismissing {
  opacity: 0;
  pointer-events: none;
}

.rotate-notice.is-hidden {
  display: none;
}

/* 提示只出现一次：用户跳过或超时后，后续尺寸变化都不再弹出。 */
body.notice-dismissed .rotate-notice {
  display: none;
}

@media (orientation: portrait) and (max-width: 760px) {
  body {
    background: #1a3b2a;
  }

  /* 竖屏只做一次性提醒：2 秒后自动消失，也可以点跳过。不做任何画面旋转。 */
  .rotate-notice {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    padding: 24px;
    background: rgba(20, 48, 34, 0.97);
    color: #fff8dc;
    text-align: center;
    z-index: 80;
    transition: opacity 280ms ease;
  }

  .rotate-notice span {
    font-size: 64px;
    animation: rotate-hint 2.6s ease-in-out infinite;
  }

  .rotate-notice p {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.06em;
  }

  .rotate-skip {
    margin-top: 4px;
    padding: 9px 28px;
    border: 1px solid rgba(255, 248, 220, 0.55);
    border-radius: 999px;
    background: rgba(255, 248, 220, 0.14);
    color: #fff8dc;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
  }

  .rotate-skip:active {
    background: rgba(255, 248, 220, 0.3);
  }
}

@keyframes rotate-hint {
  0%, 25% { transform: rotate(0); }
  65%, 100% { transform: rotate(90deg); }
}

@media (max-width: 1000px) {
  .start-copy {
    left: 52px;
    transform: scale(0.9);
    transform-origin: left top;
  }

  .start-art {
    right: -30px;
    transform: scale(0.9);
  }

  .seed-card {
    width: 72px;
    flex-basis: 72px;
  }

  .seed-card img {
    width: 58px;
  }
}

/* ---------- V1.2: 难度选择 / 自动收集 / 首次提示 ---------- */

.difficulty-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 34px;
  border-bottom: 1px solid rgba(104, 89, 48, 0.1);
  background: rgba(255, 250, 232, 0.55);
}

.difficulty-label {
  flex: 0 0 auto;
  color: #4b6549;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.18em;
}

.difficulty-switch {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(46, 86, 58, 0.09);
}

.difficulty-option {
  display: grid;
  gap: 1px;
  min-width: 88px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3f5a44;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1.25;
}

.difficulty-option small {
  color: #7d8a72;
  font-size: 10px;
  font-weight: 700;
}

.difficulty-option.active {
  background: #315f41;
  color: #fff8e2;
  box-shadow: 0 3px 0 rgba(20, 49, 30, 0.32);
}

.difficulty-option.active small {
  color: rgba(255, 248, 226, 0.8);
}

.difficulty-note {
  flex: 1;
  min-width: 0;
  color: #6a7a63;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
}

@keyframes seed-attention {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(238, 191, 85, 0);
    transform: translateY(0);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(238, 191, 85, 0.55);
    transform: translateY(-4px);
  }
}

.seed-card.hint-attention {
  animation: seed-attention 1.3s ease-in-out 4;
  outline: 2px solid rgba(238, 191, 85, 0.9);
  outline-offset: 2px;
}
