:root {
  --bg: #f7f2e8;
  --bg-accent: #efe2c8;
  --panel: rgba(255, 252, 245, 0.92);
  --panel-border: rgba(78, 55, 27, 0.12);
  --ink: #2f2619;
  --muted: #6f6250;
  --gold: #b68a3c;
  --olive: #6e7b46;
  --teal: #476f78;
  --danger: #9c503f;
  --success: #44714e;
  --shadow: 0 18px 48px rgba(63, 45, 21, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(182, 138, 60, 0.18), transparent 22%),
    radial-gradient(circle at top right, rgba(71, 111, 120, 0.16), transparent 18%),
    linear-gradient(180deg, #fbf6ee 0%, #f3eadb 58%, #efe0c9 100%);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Microsoft YaHei", "PingFang SC", sans-serif;
}

button {
  font: inherit;
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  padding: 28px 30px;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(255, 248, 236, 0.95), rgba(245, 234, 213, 0.92));
  border: 1px solid rgba(78, 55, 27, 0.1);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  font-family: "Georgia", "Times New Roman", serif;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 12px;
}

.hero-badges span,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(182, 138, 60, 0.12);
  color: #7a5d27;
  font-size: 0.9rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 12px;
  margin: 20px 0 22px;
}

.tab,
.primary-button,
.secondary-button,
.ghost-button,
.level-card,
.board-cell {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.tab {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(78, 55, 27, 0.12);
  background: rgba(255, 252, 245, 0.9);
  color: var(--ink);
  cursor: pointer;
}

.tab.active {
  background: #2f2619;
  color: #fff4dc;
}

.tab:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.level-card:hover {
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.play-hud .stats-grid {
  margin-bottom: 12px;
  grid-template-columns: 1fr;
}

.play-hud .status-banner {
  margin-bottom: 14px;
}

.play-action-row {
  margin-top: 0;
  flex-direction: column;
  align-items: stretch;
}

.play-action-row .primary-button,
.play-action-row .secondary-button,
.play-action-row .ghost-button {
  width: 100%;
  text-align: center;
}

.stat-card,
.panel,
.status-banner {
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px 20px;
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card strong {
  font-size: 1.35rem;
}

.play-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.play-top-row,
.play-bottom-row {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.center-column,
.right-column,
.left-column {
  display: grid;
  gap: 18px;
}

.play-top-row .left-column .play-hud {
  position: sticky;
  top: 16px;
}

.design-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.panel {
  padding: 20px;
}

.full-width {
  width: 100%;
}

.panel-title {
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.level-list,
.note-stack,
.essay-grid {
  display: grid;
  gap: 12px;
}

.level-card {
  text-align: left;
  width: 100%;
  border: 1px solid rgba(78, 55, 27, 0.12);
  border-radius: 20px;
  background: #fff8ec;
  padding: 14px;
  cursor: pointer;
}

.level-card.selected {
  border-color: rgba(182, 138, 60, 0.6);
  background: linear-gradient(135deg, rgba(255, 244, 222, 1), rgba(250, 236, 206, 0.98));
}

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

.level-index {
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.level-card strong,
.essay-card strong {
  display: block;
  margin-bottom: 6px;
}

.level-card p,
.level-card small,
.status-banner p,
.note-card p,
.essay-card p,
.micro-copy,
.log-list li {
  color: var(--muted);
  line-height: 1.6;
}

.status-banner {
  padding: 18px 20px;
  margin-bottom: 18px;
}

.status-banner.success {
  background: linear-gradient(135deg, rgba(223, 246, 222, 0.98), rgba(244, 253, 242, 0.98));
}

.status-banner.warning {
  background: linear-gradient(135deg, rgba(255, 233, 214, 0.98), rgba(255, 246, 236, 0.98));
}

.status-banner.neutral {
  background: linear-gradient(135deg, rgba(244, 238, 222, 0.98), rgba(255, 250, 242, 0.98));
}

.board-panel {
  padding-bottom: 16px;
}

.board-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.micro-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.micro-pills span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(182, 138, 60, 0.13);
  color: #7a5d27;
  font-size: 0.78rem;
  font-weight: 700;
}

.mission-panel,
.legend-panel {
  margin-bottom: 18px;
}

.mission-hero-card,
.objective-card,
.legend-card,
.summary-panel {
  border-radius: 20px;
  border: 1px solid rgba(78, 55, 27, 0.08);
  background: rgba(255, 248, 236, 0.86);
}

.mission-hero-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.mission-hero-card p,
.objective-card p,
.legend-card p,
.summary-panel p,
.legend-card small {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.mission-hero-icon,
.objective-icon,
.legend-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 247, 224, 0.98), rgba(245, 231, 201, 0.96));
  overflow: hidden;
}

.mission-hero-icon {
  min-height: 88px;
}

.objective-grid,
.legend-grid {
  display: grid;
  gap: 12px;
}

.objective-card,
.legend-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.mechanic-strip {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  margin-top: 12px;
  border-radius: 20px;
  border: 1px solid rgba(97, 70, 33, 0.1);
  background: linear-gradient(135deg, rgba(255, 246, 229, 0.96), rgba(247, 235, 212, 0.92));
}

.rules-panel {
  margin-top: 12px;
  border-radius: 20px;
  border: 1px solid rgba(97, 70, 33, 0.1);
  background: linear-gradient(135deg, rgba(255, 249, 238, 0.96), rgba(248, 237, 216, 0.9));
  overflow: hidden;
}

.rules-panel summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
  color: #6e5325;
  user-select: none;
}

.rules-panel summary::-webkit-details-marker {
  display: none;
}

.rules-panel summary::after {
  content: "展开";
  float: right;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.rules-panel[open] summary::after {
  content: "收起";
}

.rules-grid {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.rule-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.9);
  border: 1px solid rgba(78, 55, 27, 0.08);
}

.rule-card strong {
  display: block;
  margin-bottom: 6px;
}

.rule-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mechanic-strip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(116, 79, 44, 0.18), rgba(245, 224, 190, 0.9));
}

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(78, 55, 27, 0.08);
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3d77e, #d2a339);
}

.summary-panel {
  padding: 14px 16px;
  margin-bottom: 16px;
}

.summary-panel.idle {
  background: linear-gradient(135deg, rgba(250, 244, 230, 0.98), rgba(255, 249, 240, 0.98));
}

.summary-panel.busy {
  background: linear-gradient(135deg, rgba(255, 241, 222, 0.98), rgba(255, 250, 242, 0.98));
}

.summary-panel.settled {
  background: linear-gradient(135deg, rgba(237, 247, 234, 0.98), rgba(248, 252, 245, 0.98));
}

.board-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: -4px 0 14px;
  border-radius: 14px;
  background: rgba(255, 248, 228, 0.96);
  border: 1px solid rgba(182, 138, 60, 0.24);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(61, 43, 20, 0.12);
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.summary-chip {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(71, 111, 120, 0.1);
  color: #48656b;
  font-size: 0.8rem;
  font-weight: 700;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(var(--board-size), minmax(0, 1fr));
  gap: 8px;
  touch-action: none;
  user-select: none;
}

.board-cell {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  padding: 8px;
  color: white;
  cursor: pointer;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.08), 0 8px 18px rgba(58, 42, 18, 0.14);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.board-cell.selected {
  outline: 4px solid rgba(250, 241, 211, 0.96);
  box-shadow: 0 0 0 2px rgba(79, 58, 31, 0.18);
}

.board-cell.hint-source,
.board-cell.hint-target {
  box-shadow:
    0 0 0 4px rgba(255, 247, 209, 0.98),
    0 0 0 9px rgba(182, 138, 60, 0.46),
    0 0 22px rgba(255, 216, 122, 0.62);
}

.board-cell.locked {
  pointer-events: none;
}

.board-cell.has-special {
  padding: 0;
  border: 2px solid rgba(255, 247, 221, 0.74);
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.1),
    0 10px 22px rgba(58, 42, 18, 0.18),
    0 0 0 1px rgba(255, 248, 226, 0.5);
}

.board-cell.special-base {
  background: linear-gradient(180deg, #f7ecd8, #ead3af);
}

.board-cell.crate-base {
  background: linear-gradient(180deg, #efe2c8, #ceb38d);
}

.board-cell.has-goal-surface,
.board-cell.has-crate-surface {
  padding: 0;
}

.board-cell.special-rocket-h {
  background: linear-gradient(180deg, #f7ecd8, #ead3af);
}

.board-cell.special-rocket-v {
  background: linear-gradient(180deg, #f7ecd8, #ead3af);
}

.board-cell.special-tnt {
  background: linear-gradient(180deg, #f7ecd8, #ead3af);
}

.board-cell.special-paper {
  background: linear-gradient(180deg, #f7ecd8, #ead3af);
}

.board-cell.is-clearing {
  animation: tileClear 240ms ease forwards;
}

.board-cell.is-impact:not(.is-clearing) {
  animation: tilePulse 240ms ease;
}

.board-cell.is-dropping {
  animation: tileDrop 360ms cubic-bezier(0.18, 0.78, 0.28, 1);
}

.board-cell.is-spawned {
  animation: tileSpawn 420ms ease;
}

.board-cell.is-reshuffling {
  animation: tileReshuffle 520ms ease;
  box-shadow:
    0 0 0 4px rgba(255, 247, 209, 0.9),
    0 0 20px rgba(182, 138, 60, 0.46);
}

.board-cell.is-triggered::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 2px dashed rgba(255, 250, 231, 0.88);
  animation: pulseRing 360ms ease;
}

.board-cell.red { background: linear-gradient(180deg, #e66e72, #c94454); }
.board-cell.blue { background: linear-gradient(180deg, #61a7ff, #2f73d3); }
.board-cell.green { background: linear-gradient(180deg, #71b673, #488d50); }
.board-cell.yellow { background: linear-gradient(180deg, #f6cd62, #d6a42e); color: #5a410b; }
.board-cell.purple { background: linear-gradient(180deg, #b58fe5, #7c5db4); }
.board-cell.orange { background: linear-gradient(180deg, #f59a5c, #dd6d31); }

.tile-gloss {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 40%);
  pointer-events: none;
}

.icon-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  pointer-events: none;
}

.goal-badge {
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  background: rgba(255, 247, 214, 0.96);
  box-shadow: 0 6px 12px rgba(130, 95, 24, 0.18);
  z-index: 3;
}

.special-badge {
  left: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(3px);
}

.crate-badge {
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  background: rgba(71, 45, 21, 0.72);
  box-shadow: 0 6px 12px rgba(49, 28, 12, 0.18);
  z-index: 3;
}

.crate-count {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  background: #fff4d0;
  color: #5b3a11;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

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

.special-icon,
.goal-icon,
.crate-icon,
.legend-icon {
  width: 20px;
  height: 20px;
}

.legend-icon {
  width: 42px;
  height: 42px;
}

.tile-special-surface {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
}

.tile-goal-surface,
.tile-crate-surface {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
}

.special-surface-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.goal-surface-svg,
.crate-surface-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.special-name-chip {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  z-index: 3;
  min-width: 44px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(26, 20, 14, 0.62);
  color: #fff6df;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 5px 10px rgba(23, 15, 8, 0.18);
}

.board-cell.has-special .tile-special-surface::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 16px;
  border: 2px solid rgba(255, 248, 225, 0.35);
  animation: specialIdleGlow 1.7s ease-in-out infinite;
}

.board-cell.has-special .tile-gloss {
  opacity: 0.08;
}

.board-cell.has-goal-surface .tile-gloss {
  opacity: 0.2;
}

.board-cell.has-crate-surface .tile-gloss {
  opacity: 0.06;
}

.board-cell.has-goal-surface::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  border: 2px solid rgba(255, 231, 162, 0.45);
  box-shadow: inset 0 0 14px rgba(255, 229, 140, 0.15);
  pointer-events: none;
}

.board-cell.has-crate-surface::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  border: 2px solid rgba(255, 233, 196, 0.18);
  pointer-events: none;
}

.legend-icon-wrap.is-surface {
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f4e8d1, #e8d2b0);
}

.legend-icon-wrap.is-surface .special-surface-svg {
  width: 100%;
  height: 100%;
}

.objective-icon .goal-surface-svg,
.objective-icon .crate-surface-svg,
.mission-hero-icon .goal-surface-svg,
.mechanic-strip-icon .crate-surface-svg {
  width: 100%;
  height: 100%;
}

.crate-rule-card {
  margin-top: 12px;
}

.crate-surface {
  background: linear-gradient(135deg, rgba(119, 80, 45, 0.16), rgba(247, 232, 206, 0.92));
}

.hint-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #5b3d0e;
  background: rgba(255, 245, 204, 0.96);
  box-shadow: 0 6px 12px rgba(96, 66, 18, 0.14);
  pointer-events: none;
}

.hint-tag-source {
  top: -9px;
}

.hint-tag-target {
  bottom: -9px;
}

.icon-rotate-90 {
  transform: rotate(90deg);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-button {
  background: #2f2619;
  color: #fff1d7;
}

.secondary-button {
  background: rgba(182, 138, 60, 0.14);
  color: #7a5d27;
}

.ghost-button {
  background: transparent;
  border-color: rgba(78, 55, 27, 0.16);
  color: var(--ink);
}

.note-card,
.essay-card {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 248, 236, 0.86);
  border: 1px solid rgba(78, 55, 27, 0.08);
}

.note-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-list {
  margin: 0;
  padding-left: 18px;
}

.compact-copy {
  margin-top: 0;
}

.endgame-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(34, 25, 14, 0.42);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.endgame-modal {
  width: min(520px, 100%);
  padding: 28px 26px;
  border-radius: 28px;
  border: 1px solid rgba(91, 69, 36, 0.14);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.99), rgba(252, 244, 230, 0.97));
  box-shadow: 0 24px 56px rgba(40, 28, 12, 0.24);
}

.endgame-modal.success {
  background: linear-gradient(180deg, rgba(247, 255, 244, 0.98), rgba(236, 248, 230, 0.96));
}

.endgame-modal.warning {
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.98), rgba(255, 236, 220, 0.97));
}

.endgame-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(182, 138, 60, 0.14);
  color: #7a5d27;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.endgame-modal h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.08;
}

.endgame-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.endgame-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.endgame-actions .primary-button,
.endgame-actions .secondary-button,
.endgame-actions .ghost-button {
  width: 100%;
  text-align: center;
}

@keyframes tileClear {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  60% { transform: scale(1.12); opacity: 0.88; filter: brightness(1.18); }
  100% { transform: scale(0.68); opacity: 0; filter: brightness(1.3); }
}

@keyframes tilePulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.18); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes tileDrop {
  0% { transform: translateY(calc(var(--drop-distance, 1) * -100%)); opacity: 0.55; }
  72% { transform: translateY(3px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes tileSpawn {
  0% { transform: scale(0.76); box-shadow: 0 0 0 0 rgba(255, 247, 190, 0.7); }
  55% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255, 247, 190, 0); }
  100% { transform: scale(1); }
}

@keyframes tileReshuffle {
  0% { transform: rotate(0deg) scale(1); filter: brightness(1); }
  45% { transform: rotate(4deg) scale(0.9); filter: brightness(1.16); }
  100% { transform: rotate(0deg) scale(1); filter: brightness(1); }
}

@keyframes pulseRing {
  0% { opacity: 0; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.12); }
}

@keyframes specialIdleGlow {
  0% { opacity: 0.35; box-shadow: 0 0 0 rgba(255, 248, 223, 0); }
  50% { opacity: 0.9; box-shadow: 0 0 18px rgba(255, 244, 196, 0.28); }
  100% { opacity: 0.35; box-shadow: 0 0 0 rgba(255, 248, 223, 0); }
}

@keyframes hintPulse {
  0% {
    box-shadow:
      0 0 0 4px rgba(255, 247, 209, 0.98),
      0 0 0 9px rgba(182, 138, 60, 0.42),
      0 0 18px rgba(255, 216, 122, 0.54);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(255, 247, 209, 1),
      0 0 0 11px rgba(182, 138, 60, 0.52),
      0 0 28px rgba(255, 216, 122, 0.72);
  }
  100% {
    box-shadow:
      0 0 0 4px rgba(255, 247, 209, 0.98),
      0 0 0 9px rgba(182, 138, 60, 0.42),
      0 0 18px rgba(255, 216, 122, 0.54);
  }
}

.design-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.design-table th,
.design-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(78, 55, 27, 0.08);
  text-align: left;
  vertical-align: top;
}

.design-table th {
  color: #755a29;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 1180px) {
  .play-top-row,
  .play-bottom-row {
    grid-template-columns: 1fr;
  }

  .right-column,
  .left-column,
  .center-column {
    width: 100%;
  }

  .play-top-row .left-column .play-hud {
    position: static;
  }
}

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

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

  .play-hud .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

   .board-panel-head,
   .mission-hero-card,
   .objective-card,
   .legend-card {
    grid-template-columns: 1fr;
  }

  .board-panel-head {
    display: grid;
  }

  .micro-pills {
    justify-content: flex-start;
  }

  .board-grid {
    gap: 6px;
  }

  .endgame-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding: 18px 14px 28px;
  }

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

  .board-cell {
    border-radius: 14px;
  }

  .gem-label {
    font-size: 0.92rem;
  }

  .goal-badge,
  .special-badge,
  .crate-badge {
    font-size: 0.58rem;
  }

  .endgame-modal-backdrop {
    padding: 16px;
  }

  .endgame-modal {
    padding: 22px 18px;
    border-radius: 22px;
  }
}
