.hero-card, .daily-card, .fact-card, .crew-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.hero-art, .fact-lead, .crew-lead {
  width: min(42vw, 180px);
  height: auto;
  border-radius: 18px;
  justify-self: end;
}

.wordmark { font-size: clamp(1.7rem, 7vw, 3rem); line-height: 0.95; }
.pitch { margin-top: 6px; }
.hero-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.preview-canvas {
  width: min(100%, 280px);
  height: auto !important;
  border-radius: 16px;
  background: #49c6ff;
  justify-self: end;
}

.step-grid, .world-grid, .stat-grid, .badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.step-card h3, .world-card h3, .info-card h3, .badge-card h3 { margin: 4px 0; }
.step-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--secondary);
  color: #3a2504;
  font-family: "Hoist Display", sans-serif;
}

.world-card { border-color: var(--accent, var(--line)); }
.world-meta, .sheet-meta, .rank-note { color: var(--muted); font-size: 0.92rem; }

.world-block { display: grid; gap: 8px; }
.world-head, .world-block header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: end;
  min-width: 0;
}
.world-head h2, .world-meter { min-width: 0; }
.world-meter { text-align: right; }

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.node {
  min-width: 0;
  min-height: 74px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 8px 4px;
}

.node.is-locked { filter: saturate(0.6); }
.node b { font-family: "Hoist Display", sans-serif; font-size: 1.2rem; }
.node .star-mark { width: 12px; height: 12px; }
.node-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.sheet { margin-top: 4px; }
.sheet-card { display: grid; gap: 8px; }
.sheet-card .preview-canvas { width: 100%; justify-self: stretch; }

.card-stack, .almanac-panel, .quiz-body, .settings-card, .wind-studio { display: grid; gap: 10px; }
.lede, .info-summary { color: var(--muted); }
.info-card h3 { font-size: 1.25rem; }

.sway-read { font-family: "Hoist Display", sans-serif; font-size: 1.8rem; color: var(--highlight); }
.sway-track { height: 14px; border-radius: 999px; background: rgba(4, 24, 46, 0.45); overflow: hidden; }
.sway-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2fdb8a, #ffe56a, #ff5b3a); }
.compare-row, .sway-meter { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.compare-row span, .compare-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.quiz-options { display: grid; gap: 8px; }
.quiz-option { text-align: left; color: #3a2504; }
.quiz-option.is-right { background: linear-gradient(#b8ffd8, #2fdb8a); }
.quiz-option.is-wrong { background: linear-gradient(#ffd0d8, #ff4b6e); color: white; }
.quiz-explain { color: var(--highlight); }

.crew-card { align-items: start; }
.rank-track { height: 12px; border-radius: 999px; background: rgba(4, 24, 46, 0.45); overflow: hidden; margin-top: 8px; }
.rank-fill { display: block; height: 100%; background: linear-gradient(90deg, #ffc107, #fff1b8); }
.stat-tile { display: grid; gap: 4px; }
.stat-tile strong { font-family: "Hoist Display", sans-serif; font-size: clamp(1.2rem, 4vw, 1.7rem); overflow: hidden; text-overflow: ellipsis; }
.badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.badge-card {
  min-width: 0;
  border: 2px solid rgba(255, 241, 184, 0.35);
  border-radius: 16px;
  padding: 10px;
  background: rgba(8, 32, 64, 0.55);
}
.badge-card p, .stat-tile span { color: var(--muted); }
.badge-card.is-owned { border-color: var(--highlight); background: rgba(18, 80, 150, 0.72); }
.badge-card h3, .badge-card p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.settings-card .btn { width: 100%; }

@media (max-width: 350px) {
  .hero-card, .daily-card, .fact-card, .crew-card, .step-grid, .world-grid, .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art, .fact-lead, .crew-lead, .preview-canvas { width: 100%; justify-self: stretch; }
  .node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 880px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .step-grid, .badge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .world-grid, .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-card { grid-template-columns: minmax(0, 1.1fr) minmax(180px, 0.8fr) auto; }
}

@media (max-height: 640px) and (orientation: landscape) {
  .hero-art, .fact-lead { width: 120px; }
}
