:root {
  --bg-dark: #1b2416;
  --wood-dark: #4a2e16;
  --wood-mid: #6e4522;
  --wood-light: #936235;
  --parchment: #f4e6c1;
  --parchment-dark: #dfca98;
  --grass-green: #4fa633;
  --gold: #ffd447;
  --fusion-purple: #a855f7;
  --text-light: #fef9ef;
  --text-dark: #2c1d0e;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at top, #27381f 0%, #10160d 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text-light);
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* ==================== 主菜单 ==================== */
.menu-bg {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(120, 210, 90, 0.22), transparent 60%),
    linear-gradient(180deg, #1b3622 0%, #244827 52%, #1a2d18 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.menu-title-banner {
  text-align: center;
  position: relative;
}

.badge-fusion {
  display: inline-block;
  background: linear-gradient(135deg, #9333ea, #ec4899);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.5);
  margin-bottom: 8px;
}

.menu-title-banner h1 {
  margin: 0;
  font-size: clamp(34px, 4.8vw, 56px);
  color: #fff8d6;
  text-shadow: 0 4px 0 #3b220d, 0 8px 20px rgba(0, 0, 0, 0.6);
  letter-spacing: 2px;
}

.menu-title-banner h1 span {
  color: #ffd447;
  background: linear-gradient(180deg, #ffe77a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #4d2606);
}

.subtitle {
  margin: 8px 0 0;
  color: #cbe6b8;
  font-size: 15px;
  letter-spacing: 1px;
}

.menu-layout {
  display: flex;
  gap: 28px;
  align-items: stretch;
  max-width: 980px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.menu-tombstone {
  background: linear-gradient(180deg, #5d646b 0%, #3d4248 100%);
  border: 4px solid #26292d;
  border-radius: 36px 36px 14px 14px;
  padding: 28px 24px 20px;
  width: 390px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.18), 0 18px 40px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pvz-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 3px solid #2e1b0b;
  cursor: pointer;
  text-align: left;
  color: #fff;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 5px 0 #2e1b0b, 0 8px 16px rgba(0,0,0,0.35);
}

.pvz-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.pvz-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #2e1b0b;
}

.pvz-btn .btn-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.pvz-btn .btn-text {
  display: flex;
  flex-direction: column;
}

.pvz-btn .btn-text strong {
  font-size: 18px;
}

.pvz-btn .btn-text small {
  font-size: 12px;
  opacity: 0.9;
}

.primary-btn {
  background: linear-gradient(180deg, #65c237 0%, #3d8c1d 100%);
}

.accent-btn {
  background: linear-gradient(180deg, #a855f7 0%, #6d28d9 100%);
}

.secondary-btn {
  background: linear-gradient(180deg, #b87c42 0%, #7d4f24 100%);
}

.danger-btn {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}

.compact-btn {
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 700;
  justify-content: center;
}

.menu-footer-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.mini-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.2);
  color: #e5e7eb;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.mini-btn:hover {
  background: rgba(255,255,255,0.16);
}

.menu-showcase-card {
  flex: 1;
  min-width: 320px;
  max-width: 500px;
  background: rgba(244, 230, 193, 0.96);
  color: var(--text-dark);
  border: 5px solid var(--wood-dark);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-showcase-card h3 {
  margin: 0 0 12px;
  color: #5b2c06;
  font-size: 20px;
  border-bottom: 2px dashed #c4a46a;
  padding-bottom: 8px;
}

.menu-showcase-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.quick-recipes-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.recipe-pill {
  background: #ead4a1;
  border: 1px solid #b8924d;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #4f2b09;
}

/* ==================== 选关界面 & 通用木板容器 ==================== */
.panel-container {
  width: min(1040px, 95vw);
  max-height: 90vh;
  background: var(--parchment);
  color: var(--text-dark);
  border: 6px solid var(--wood-dark);
  border-radius: 20px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #cdb079;
  padding-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  color: #4d2809;
}

.wood-btn {
  background: linear-gradient(180deg, #8b5a2b 0%, #5c3817 100%);
  color: #fff8e7;
  border: 2px solid #2e1908;
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #2e1908;
}

.wood-btn:hover {
  filter: brightness(1.1);
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding: 4px;
}

.level-card {
  background: #fff8e7;
  border: 3px solid #966f3d;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.level-card:hover:not(.locked) {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(74, 46, 22, 0.25);
  border-color: #4fa633;
}

.level-card.locked {
  opacity: 0.58;
  cursor: not-allowed;
  background: #e3d6ba;
}

.level-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.level-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
}

.theme-day { background: #3b9c28; }
.theme-night { background: #3b3f8c; }
.theme-pool { background: #0ea5e9; }
.theme-roof { background: #b45309; }
.theme-boss { background: #9333ea; }

.chapter-heading {
  grid-column: 1 / -1;
  font-size: 16px;
  font-weight: 900;
  color: #5b2c06;
  padding: 4px 2px 6px;
  border-bottom: 2px dashed rgba(91, 44, 6, 0.35);
}

.level-card h3 {
  margin: 0;
  font-size: 18px;
  color: #3d2109;
}

.level-card p {
  margin: 0;
  font-size: 13px;
  color: #5c4327;
  line-height: 1.4;
}

.level-unlock-note {
  font-size: 12px;
  color: #8f3a13;
  font-weight: 700;
  margin-top: auto;
}

/* ==================== 选卡界面 ==================== */
.seed-select-container {
  width: min(1140px, 96vw);
  height: min(680px, 92vh);
  background: var(--parchment);
  color: var(--text-dark);
  border: 6px solid var(--wood-dark);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}

.seed-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 3px solid #cdb079;
  padding-bottom: 10px;
}

.level-title-info h2 {
  margin: 0;
  font-size: 20px;
}

.level-title-info p {
  margin: 2px 0 0;
  font-size: 13px;
  color: #6b4b25;
}

.seed-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.seed-actions .wood-btn,
.seed-actions .pvz-btn {
  white-space: nowrap;
}

.seed-select-body {
  display: flex;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.seed-left {
  flex: 2.2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.seed-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.selected-tray-box, .subcard-box, .available-pool-box, .zombie-preview-box, .recipe-hints-box {
  background: #ebd8ae;
  border: 2px solid #b58d52;
  border-radius: 12px;
  padding: 10px 12px;
}

.available-pool-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tray-label {
  font-size: 13px;
  font-weight: 800;
  color: #5b3712;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-cards-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 66px;
}

.subcard-slot {
  min-height: 54px;
  max-height: 132px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #6e4e26;
}

.available-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.pick-card-wrap {
  background: #fff9ea;
  border: 2px solid #96723e;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: transform 0.1s, border-color 0.1s;
}

.pick-card-wrap:hover {
  transform: translateY(-2px);
  border-color: #4fa633;
}

.pick-card-wrap.selected {
  background: #dcfce7;
  border-color: #16a34a;
  box-shadow: inset 0 0 0 2px #16a34a;
}

.pick-card-wrap .card-emoji {
  font-size: 26px;
}

.pick-card-wrap .card-name {
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.pick-card-wrap .card-cost {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  background: #fef08a;
  padding: 1px 8px;
  border-radius: 999px;
}

.set-sub-btn {
  margin-top: 2px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #9333ea;
  background: #f3e8ff;
  color: #6b21a8;
  cursor: pointer;
  font-weight: 700;
}

.set-sub-btn:hover,
.set-sub-btn.active {
  background: #9333ea;
  color: #fff;
}

.set-sub-btn.active {
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.35);
}

.pick-card-wrap.is-sub {
  border-color: #9333ea;
  box-shadow: inset 0 0 0 2px #9333ea;
}

.tray-chip {
  background: #fffdf5;
  border: 2px solid #593a1a;
  border-radius: 9px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.tray-chip.is-subcard {
  border-color: #9333ea;
  background: #faf5ff;
}

.tray-chip.removable .chip-x {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 900;
  color: #7e22ce;
  opacity: 0.7;
}

.tray-chip.removable:hover .chip-x {
  opacity: 1;
}

.zombie-preview-box, .recipe-hints-box {
  overflow-y: auto;
}

.zombie-preview-box h3, .recipe-hints-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #5b2c06;
}

.level-zombies-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zombie-tag {
  background: #fff;
  border: 1px solid #b5925b;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.level-recipe-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.hint-row {
  background: #fff9ea;
  border-left: 4px solid #a855f7;
  padding: 6px 8px;
  border-radius: 4px;
}

/* ==================== 战斗主界面 ==================== */
.game-wrapper {
  width: min(1060px, 99vw);
  height: min(720px, 98vh);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, #754a24 0%, #523215 100%);
  border: 3px solid #2c1908;
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sun-counter {
  background: linear-gradient(180deg, #fff5c0 0%, #f5d259 100%);
  color: #3f2405;
  border: 3px solid #4d2e0d;
  border-radius: 10px;
  min-width: 78px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
  font-size: 18px;
  line-height: 1.1;
}

.sun-counter .sun-icon {
  font-size: 18px;
}

.bank-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bank-nav {
  flex-shrink: 0;
  width: 18px;
  height: 40px;
  padding: 0;
  border: 2px solid #2b1808;
  border-radius: 6px;
  background: linear-gradient(180deg, #8e6134 0%, #63401e 100%);
  color: #fff9eb;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0.9;
}

.bank-nav:hover {
  opacity: 1;
  filter: brightness(1.12);
}

.bank-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.hud-seed-bank {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  flex: 1;
  min-width: 0;
  cursor: grab;
  scroll-behavior: smooth;
}

.hud-seed-bank.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.hud-seed-bank::-webkit-scrollbar {
  height: 8px;
}

.hud-seed-bank::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.hud-seed-bank::-webkit-scrollbar-thumb {
  background: rgba(255, 236, 179, 0.55);
  border-radius: 4px;
}

.seed-packet {
  width: 68px;
  height: 76px;
  background: linear-gradient(180deg, #f8f0d8 0%, #d8c69b 100%);
  border: 2px solid #3c260e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  color: #2d1b09;
  transition: transform 0.08s;
}

.seed-packet:hover:not(.disabled) {
  transform: translateY(-2px);
}

.seed-packet.selected {
  outline: 3px solid #ffd447;
  box-shadow: 0 0 12px rgba(255, 212, 71, 0.9);
  transform: translateY(-3px);
}

.seed-packet.is-subcard {
  border-color: #9333ea;
  background: linear-gradient(180deg, #faf5ff 0%, #e9d5ff 100%);
}

.seed-packet.disabled {
  filter: grayscale(0.55) brightness(0.75);
  cursor: not-allowed;
}

.seed-packet .pkt-emoji {
  font-size: 24px;
  line-height: 1;
  margin-top: 2px;
}

.seed-packet .pkt-name {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seed-packet .pkt-cost {
  font-size: 11px;
  font-weight: 900;
  background: rgba(255,255,255,0.75);
  padding: 0 6px;
  border-radius: 99px;
}

.seed-packet .pkt-cd-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.58);
  pointer-events: none;
}

.hud-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tool-btn {
  background: linear-gradient(180deg, #8e6134 0%, #63401e 100%);
  border: 2px solid #2b1808;
  color: #fff9eb;
  border-radius: 10px;
  padding: 6px 9px;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  position: relative;
}

.tool-btn:hover {
  filter: brightness(1.12);
}

.tool-btn.active {
  outline: 3px solid #ffd447;
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
}

.tool-btn .tool-icon {
  font-size: 19px;
}

.tool-cd {
  font-size: 10px;
  color: #fde047;
}

.canvas-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #142210;
  border: 4px solid #3c260e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#game-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: crosshair;
}

.hover-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(20, 14, 8, 0.92);
  border: 2px solid #ffd447;
  color: #fff8e7;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 15;
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
}

.wave-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(125, 16, 16, 0.9);
  border: 3px solid #ffd447;
  color: #fff6d1;
  padding: 12px 32px;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 3px 0 #3a0606;
  pointer-events: none;
  z-index: 20;
  animation: pulseBanner 0.5s ease;
}

@keyframes pulseBanner {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #3d2611;
  border: 2px solid #241407;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px;
}

.hud-level-name {
  font-weight: 800;
  color: #fde68a;
  white-space: nowrap;
}

.wave-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.wave-text {
  white-space: nowrap;
  font-weight: 700;
}

.wave-bar-track {
  flex: 1;
  height: 12px;
  background: #1f1308;
  border: 2px solid #754e28;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

.wave-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #facc15, #ef4444);
  transition: width 0.3s ease;
}

.hud-tips {
  color: #d6e8c8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-card {
  background: var(--parchment);
  color: var(--text-dark);
  border: 6px solid var(--wood-dark);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}

.compact-modal {
  width: 340px;
  text-align: center;
}

.modal-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.result-modal {
  width: min(480px, 92vw);
  text-align: center;
}

.result-icon {
  font-size: 56px;
}

.result-unlock {
  background: #dcfce7;
  border: 2px solid #16a34a;
  color: #14532d;
  border-radius: 10px;
  padding: 10px;
  margin: 12px 0;
  font-weight: 700;
}

.result-stats {
  background: #ebd8ae;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-buttons-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ==================== 图鉴弹窗 ==================== */
.almanac-modal {
  width: min(980px, 94vw);
  height: min(650px, 90vh);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.almanac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 3px solid #cdb079;
  padding-bottom: 10px;
}

.almanac-header h2 {
  margin: 0;
  font-size: 20px;
}

.almanac-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  background: #dfca98;
  border: 2px solid #8a6432;
  color: #3f2409;
  padding: 6px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.tab-btn.active {
  background: #5c3817;
  color: #fff6d9;
}

.close-x {
  background: #b91c1c;
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.almanac-search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

#almanac-search {
  flex: 1;
  min-width: 220px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid #9e773f;
  background: #fffdf5;
  font-size: 14px;
}

.filter-pills {
  display: flex;
  gap: 6px;
}

.pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #9e773f;
  background: #ebd8ae;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.pill-btn.active {
  background: #7c3aed;
  color: #fff;
  border-color: #5b21b6;
}

.almanac-content {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding-right: 4px;
}

.almanac-entry {
  background: #fffaf0;
  border: 2px solid #b58f55;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.almanac-entry.is-ultimate {
  border-color: #9333ea;
  background: linear-gradient(180deg, #faf5ff 0%, #fffdf5 100%);
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-emoji {
  font-size: 30px;
}

.entry-title {
  font-size: 16px;
  font-weight: 900;
  color: #3d2109;
}

.entry-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fef08a;
  color: #854d0e;
}

.entry-badge.ult {
  background: #9333ea;
  color: #fff;
}

.entry-recipe {
  background: #f3e8ff;
  border: 1px dashed #a855f7;
  color: #581c87;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
}

.entry-stats {
  font-size: 12px;
  color: #6b4b25;
  font-weight: 700;
}

.entry-desc {
  font-size: 12px;
  color: #4a351c;
  line-height: 1.45;
}
