:root {
  --forest: #1f4a38;
  --deep: #173e2e;
  --ink: #26342d;
  --cream: #f4efe4;
  --paper: #fffaf0;
  --gold: #b49a5b;
  --muted: #728076;
  --line: #d9cfbb;
  --danger: #a34b3f;
  --good: #47785e;
  --shadow: 0 18px 45px rgba(26, 50, 39, 0.14);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: #e7e0d3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, #fff9ea 0, transparent 32%),
    linear-gradient(150deg, #e9e2d5, #d7d3c6);
}
button {
  font: inherit;
  color: inherit;
}
.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: auto;
  background: var(--cream);
  box-shadow: 0 0 65px rgba(20, 49, 36, 0.2);
  overflow: hidden;
}
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(244, 239, 228, 0.92);
  border-bottom: 1px solid rgba(31, 74, 56, 0.1);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand {
  border: 0;
  background: none;
  text-align: center;
  cursor: pointer;
  display: grid;
  gap: 1px;
}
.brand small,
.eyebrow {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  color: #94733d;
}
.brand strong {
  font-family: Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--forest);
}
.round-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  font-weight: 900;
  cursor: pointer;
}
.round-button[hidden] {
  visibility: hidden;
  display: block;
}
#app {
  min-height: calc(100vh - 70px);
}
.screen {
  padding: 22px 18px 34px;
}
.home {
  padding-top: 18px;
}
.hero {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: white;
  border-radius: 30px;
  padding: 30px 24px 28px;
  box-shadow: var(--shadow);
}
.hero:after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -100px;
  top: -80px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(255, 255, 255, 0.04),
    0 0 0 62px rgba(255, 255, 255, 0.025);
}
.hero .eyebrow {
  color: #dbc58b;
}
.hero h1 {
  font:
    700 clamp(2.7rem, 13vw, 4rem)/0.88 Georgia,
    serif;
  letter-spacing: -0.04em;
  margin: 18px 0 15px;
}
.hero h1 span {
  color: #dfc782;
}
.hero-copy {
  max-width: 290px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
  font-size: 0.86rem;
}
.mode-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.mode-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: 18px;
  text-align: left;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(30, 56, 44, 0.06);
  transition: 0.2s;
}
.mode-card:active {
  transform: scale(0.985);
}
.mode-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: #e3d4ac;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}
.mode-card small {
  display: block;
  color: #92713c;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 0.58rem;
}
.mode-card strong {
  display: block;
  font:
    700 1.25rem Georgia,
    serif;
  margin: 3px 0;
}
.mode-card span span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}
.home-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.soft-button,
.action,
.text-button {
  border: 0;
  cursor: pointer;
}
.soft-button {
  padding: 13px;
  border-radius: 15px;
  background: #e7e1d3;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.section-head h1,
.panel h2,
.result h1,
.modal h2 {
  font-family: Georgia, serif;
  margin: 3px 0;
}
.section-head h1 {
  font-size: 1.8rem;
}
.section-head p {
  margin: 0;
}
.chapter {
  margin: 22px 0 10px;
}
.chapter h2 {
  font:
    700 1.35rem Georgia,
    serif;
  margin: 0;
}
.chapter p {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 4px 0 12px;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.level-button {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  cursor: pointer;
  font-weight: 900;
}
.level-button span {
  font-size: 0.66rem;
  color: var(--gold);
  letter-spacing: -1px;
}
.level-button.locked {
  opacity: 0.42;
  cursor: not-allowed;
}
.level-button.current {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}
.rank-card {
  border-radius: 26px;
  padding: 22px;
  background: var(--forest);
  color: white;
  box-shadow: var(--shadow);
}
.rank-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rank-title strong {
  font:
    700 1.6rem Georgia,
    serif;
}
.rank-title span {
  font-size: 1.8rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.stat {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 13px;
}
.stat b {
  display: block;
  font-size: 1.25rem;
}
.stat small {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
}
.game-head {
  display: grid;
  gap: 12px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.status-pill {
  background: #e6dece;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}
.status-pill.dark {
  background: var(--forest);
  color: white;
}
.progress-track {
  height: 7px;
  background: #ddd4c2;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #d4bc78);
  transition: width 0.3s;
}
.objective {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 14px 16px;
  border-radius: 17px;
  margin-top: 14px;
}
.objective b {
  font:
    700 1rem Georgia,
    serif;
}
.objective p {
  margin: 5px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.45;
}
.objective .score-rule {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: #876628;
  font-size: 0.62rem;
  font-weight: 800;
}
.chain-wrap {
  margin-top: 16px;
}
.chain-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.story-chain {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 2px 15px;
  scroll-snap-type: x proximity;
}
.story-chain-latest {
  justify-content: center;
  overflow: hidden;
  min-height: 194px;
}
.story-chain-latest .card {
  flex: 0 1 148px;
  width: min(42vw, 148px);
}
.chain-arrow {
  align-self: center;
  color: var(--gold);
  font-weight: 900;
}
.card {
  flex: 0 0 112px;
  min-height: 174px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--paper);
  padding: 7px;
  box-shadow: 0 7px 16px rgba(29, 53, 42, 0.1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  scroll-snap-align: end;
  transition: 0.18s;
}
.card.character {
  border-color: var(--forest);
}
.card.connection {
  border-color: #c9ad6a;
  background: #fff8e8;
}
.card.playable {
  box-shadow:
    0 0 0 3px rgba(75, 125, 93, 0.16),
    0 9px 20px rgba(29, 53, 42, 0.12);
}
.card.selected {
  transform: translateY(-5px);
  border-color: #e0a927;
}
.card-art {
  min-height: 118px;
  aspect-ratio: 5 / 7;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(145deg, #efe4cb, #d7c59e);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
}
.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.card-art-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 24%, #fff8df 0 12%, transparent 13%),
    linear-gradient(145deg, #dbc78f, #a88949);
  color: var(--forest);
  font: 700 1.55rem Georgia, serif;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}
.card-art-fallback[hidden] {
  display: none;
}
.card-name {
  font:
    700 0.78rem Georgia,
    serif;
  text-align: center;
  margin: 7px 2px 2px;
  line-height: 1.05;
}
.card-type {
  font-size: 0.46rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-align: center;
  color: var(--muted);
  margin-top: 3px;
}
.root-break {
  flex: 0 0 auto;
  align-self: center;
  border-radius: 999px;
  background: #dac895;
  padding: 7px 9px;
  font-size: 0.54rem;
  font-weight: 900;
}
.feedback {
  min-height: 40px;
  border-radius: 14px;
  padding: 11px 13px;
  margin: 2px 0 12px;
  background: #e6e0d4;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}
.feedback.good {
  background: #dce9df;
  color: #315c46;
}
.feedback.bad {
  background: #f1ddd7;
  color: #8b3f35;
}
.feedback.path {
  background: #eee3bd;
  color: #765d27;
}
.hand-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 7px 0 9px;
}
.hand-head h2 {
  font:
    700 1.15rem Georgia,
    serif;
  margin: 0;
}
.hand-head small {
  color: var(--muted);
}
.hand {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 6px 3px 15px;
}
.hand .card {
  flex-basis: 126px;
  min-height: 194px;
}
.hand .card-art {
  min-height: 140px;
}
.connection-reveal {
  margin: 0 0 15px;
  padding: 14px 15px;
  border: 1px solid #cdbb89;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  background: linear-gradient(145deg, #fffaf0, #eee3c9);
  box-shadow: 0 8px 20px rgba(31, 74, 56, 0.07);
}
.connection-reveal-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}
.connection-reveal-head span {
  grid-column: 1 / -1;
  color: #92703a;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}
.connection-reveal-head b {
  color: var(--forest);
  font: 700 0.94rem Georgia, serif;
}
.connection-reveal-head em {
  border-radius: 999px;
  background: #dfd1aa;
  padding: 4px 7px;
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.connection-reveal p {
  margin: 9px 0 7px;
  font-size: 0.76rem;
  line-height: 1.5;
}
.connection-reveal cite {
  color: #876628;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 900;
}
.result .connection-reveal {
  margin-top: 14px;
  text-align: left;
}
.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--cream) 18%);
}
.action {
  border-radius: 999px;
  background: var(--forest);
  color: white;
  padding: 14px 18px;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 18px rgba(31, 74, 56, 0.2);
}
.action.gold {
  background: var(--gold);
  color: #1e3329;
}
.action.secondary {
  background: #e5dece;
  color: var(--ink);
  box-shadow: none;
}
.action:disabled {
  opacity: 0.42;
}
.setup-card,
.panel,
.result {
  border-radius: 25px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}
.choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.choice {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 15px;
  padding: 12px 6px;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}
.choice.active {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}
.turn-board {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-top: 12px;
}
.player-chip {
  min-width: 95px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px;
  background: var(--paper);
}
.player-chip.active {
  background: var(--forest);
  color: white;
}
.player-chip b,
.player-chip small {
  display: block;
}
.player-chip small {
  font-size: 0.56rem;
  opacity: 0.7;
  margin-top: 2px;
}
.pass-overlay {
  position: fixed;
  inset: 0;
  background: var(--deep);
  color: white;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}
.pass-overlay[hidden] {
  display: none;
}
.pass-overlay h1 {
  font:
    700 2.3rem Georgia,
    serif;
}
.pass-overlay p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 280px;
  line-height: 1.6;
}
.review-list {
  display: grid;
  gap: 12px;
}
.review-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  padding: 15px;
}
.review-pair {
  display: flex;
  gap: 7px;
  align-items: center;
  font:
    700 1rem Georgia,
    serif;
  color: var(--forest);
}
.strength {
  margin-left: auto;
  font:
    900 0.55rem Inter,
    sans-serif;
  letter-spacing: 0.09em;
  border-radius: 999px;
  background: #e7dcc0;
  padding: 5px 7px;
}
.review-item p {
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 10px 0 6px;
}
.review-item cite {
  font-size: 0.62rem;
  color: #92703a;
  font-style: normal;
  font-weight: 900;
}
.result {
  text-align: center;
  margin-top: 18px;
}
.result-mark {
  font-size: 3rem;
}
.stars {
  color: #c49b39;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
}
.result-actions {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.modal {
  width: min(calc(100% - 28px), 480px);
  border: 0;
  border-radius: 26px;
  background: var(--paper);
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}
.modal::backdrop {
  background: rgba(13, 34, 25, 0.72);
}
.modal-close {
  float: right;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #e7e0d1;
  font-size: 1.25rem;
}
.modal section {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.modal p {
  font-size: 0.8rem;
  line-height: 1.6;
}
.modal-note {
  background: #e9e1ce;
  border-radius: 14px;
  padding: 12px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px;
}
.toast-score {
  position: fixed;
  left: 50%;
  top: 105px;
  transform: translateX(-50%);
  background: var(--forest);
  color: white;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 900;
  z-index: 60;
  animation: scorePop 0.8s forwards;
}
.network-mode-card {
  border-color: #bca361;
  background: linear-gradient(145deg, #fffaf0, #eee2c6);
}
.network-mode-card .mode-icon {
  background: var(--forest);
  color: #f2d98c;
}
.network-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.network-head h1 {
  margin: 3px 0 0;
  font: 700 1.55rem Georgia, serif;
}
.network-status {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--danger);
  white-space: nowrap;
}
.network-status b {
  color: var(--forest);
  font-size: 0.7rem;
}
.network-objective {
  margin-bottom: 13px;
}
.network-random-note {
  margin: 12px 0;
  border: 1px solid #c9ad68;
  border-radius: 14px;
  background: #f7edcf;
  padding: 11px 13px;
  display: grid;
  gap: 3px;
}
.network-random-note b {
  color: var(--forest);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.network-random-note span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}
.network-canvas {
  position: relative;
  height: var(--network-height, 350px);
  min-height: 350px;
  overflow: hidden;
  border: 1px solid #d5c8aa;
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 45%, rgba(180, 154, 91, 0.13), transparent 42%),
    repeating-linear-gradient(8deg, transparent 0 30px, rgba(77, 104, 82, 0.035) 31px 32px),
    #efe8d8;
  box-shadow: inset 0 0 35px rgba(43, 73, 57, 0.08);
}
.network-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.network-edge {
  pointer-events: stroke;
}
.network-edge line:not(.edge-hit) {
  stroke: #8d7442;
  stroke-width: 0.8;
  stroke-linecap: round;
  stroke-dasharray: 2 1.2;
  vector-effect: non-scaling-stroke;
  animation: growEdge 0.35s ease-out both;
}
.network-edge .edge-hit {
  stroke: transparent;
  stroke-width: 9;
  vector-effect: non-scaling-stroke;
}
.network-edge.invalid line:not(.edge-hit) {
  stroke: var(--danger);
  stroke-width: 1.4;
  stroke-dasharray: 3 2;
}
.network-edge[role='button'] {
  cursor: pointer;
  pointer-events: stroke;
}
.network-node {
  position: absolute;
  left: var(--nx);
  top: var(--ny);
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 76px;
  min-height: 76px;
  border: 2px solid var(--forest);
  background: #fffaf0;
  color: var(--ink);
  padding: 5px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(24, 52, 39, 0.15);
  transition: transform 0.18s, box-shadow 0.18s;
  animation: rootGrow 0.28s ease-out both;
}
.network-node.character {
  border-radius: 50%;
}
.network-node.connection {
  min-height: 68px;
  border-color: #b28b3f;
  border-radius: 16px;
  background: #fff4d7;
}
.network-node.active {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 0 5px rgba(180, 154, 91, 0.25), 0 8px 18px rgba(24, 52, 39, 0.19);
}
.network-node-art {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #dbc992;
  font-size: 1.25rem;
}
.network-node-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.network-node b {
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 700 0.65rem Georgia, serif;
  white-space: nowrap;
}
.candidate-prompt {
  margin: 15px 0 8px;
}
.candidate-prompt small {
  color: #91703a;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}
.candidate-prompt h2 {
  margin: 3px 0;
  font: 700 1.05rem Georgia, serif;
}
.network-candidates {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 8px;
  scroll-snap-type: x proximity;
}
.network-choice {
  flex: 0 0 82px;
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  padding: 7px 4px;
  display: grid;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
  scroll-snap-align: start;
}
.network-choice > span {
  width: 48px;
  height: 52px;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e4d6ae;
  font-size: 1.4rem;
}
.network-choice.character > span {
  border-radius: 50%;
}
.network-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.network-choice b {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 0.68rem Georgia, serif;
}
.network-choice small {
  color: var(--muted);
  font-size: 0.43rem;
  font-weight: 900;
}
.network-level-list {
  display: grid;
  gap: 8px;
}
.network-level {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  padding: 12px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.network-level > span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: white;
  font-weight: 900;
}
.network-level > b {
  font: 700 0.9rem Georgia, serif;
}
.network-level > small {
  color: #bd913b;
  letter-spacing: -1px;
}
.network-level.locked {
  opacity: 0.42;
  cursor: not-allowed;
}
.roots-summary {
  width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 18px;
  background: var(--forest);
  color: white;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.roots-summary span,
.roots-summary small {
  color: #d9c98f;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.roots-summary b {
  font: 700 1.15rem Georgia, serif;
}
.roots-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 13px;
}
.roots-stats div {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  padding: 11px 6px;
  text-align: center;
}
.roots-stats b,
.roots-stats small {
  display: block;
}
.roots-stats b {
  color: var(--forest);
  font-size: 0.85rem;
}
.roots-stats small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.48rem;
  font-weight: 900;
}
.roots-review,
.network-review {
  margin-top: 18px;
}
.network-review {
  text-align: left;
}
.roots-empty {
  min-height: 260px;
  border: 1px dashed #bcae8d;
  border-radius: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
  background: #eee7d8;
}
.roots-empty span {
  font-size: 2.5rem;
}
.roots-empty h2 {
  margin: 5px 0;
  font: 700 1.2rem Georgia, serif;
}
.roots-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}
@keyframes rootGrow {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  to { opacity: 1; }
}
@keyframes growEdge {
  from { opacity: 0; stroke-dashoffset: 8; }
  to { opacity: 1; stroke-dashoffset: 0; }
}
@keyframes scorePop {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -18px);
  }
}
@media (min-width: 700px) {
  .app-shell {
    width: min(100%, 920px);
  }
  .screen {
    padding: 28px 36px 42px;
  }
  .home-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 18px;
  }
  .mode-grid {
    margin-top: 0;
  }
  .level-grid {
    grid-template-columns: repeat(10, 1fr);
  }
  .game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 20px;
  }
  .controls {
    position: static;
  }
  .hand {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }
  .hand .card {
    width: 100%;
  }
  .hand .card-art {
    min-height: 180px;
  }
  .story-chain-latest {
    min-height: 205px;
  }
  .story-chain-latest .card {
    width: 150px;
  }
  .network-canvas {
    min-height: 440px;
  }
  .network-candidates {
    overflow: visible;
    justify-content: center;
  }
  .network-choice {
    flex-basis: 104px;
  }
  .network-level-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
}
