/* Nature's Revenge — field-journal aesthetic: deep forest, warm parchment,
   moss and amber. All art is CSS/canvas; no external fonts or assets. */

:root {
  --nr-bg: #07110d;
  --nr-bg-2: #0b1a13;
  --nr-surface: #10251a;
  --nr-surface-2: #173123;
  --nr-surface-3: #1d3b2a;
  --nr-line: rgba(219, 232, 196, 0.14);
  --nr-line-strong: rgba(219, 232, 196, 0.28);
  --nr-text: #eef3e4;
  --nr-muted: #a6b6a1;
  --nr-faint: #748573;
  --nr-moss: #a6d171;
  --nr-moss-bright: #c8ec8e;
  --nr-moss-deep: #4f7a3d;
  --nr-amber: #e8b96d;
  --nr-amber-bright: #ffd894;
  --nr-water: #6fc8d8;
  --nr-danger: #df8172;
  --nr-parchment: #f3ead0;
  --nr-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --nr-body: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  --nr-radius-sm: 8px;
  --nr-radius: 14px;
  --nr-radius-lg: 22px;
  --nr-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --nr-shadow-soft: 0 8px 26px rgba(0, 0, 0, 0.28);
  --nr-ease: cubic-bezier(0.22, 0.7, 0.25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--nr-bg);
  color: var(--nr-text);
  font-family: var(--nr-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 16% 8%, rgba(122, 178, 92, 0.18), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(232, 185, 109, 0.09), transparent 30%),
    radial-gradient(circle at 52% 110%, rgba(64, 130, 104, 0.18), transparent 42%),
    linear-gradient(155deg, #07110d 0%, #091710 48%, #050c09 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image: radial-gradient(rgba(235, 245, 215, 0.22) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
a { color: var(--nr-moss-bright); }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
.nr-hidden { display: none !important; }
.nr-muted { color: var(--nr-muted); }
.nr-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.nr-skip {
  position: fixed; left: 12px; top: -60px; z-index: 10000;
  padding: 10px 16px; border-radius: 8px; background: var(--nr-parchment); color: #142014;
  font-weight: 700; text-decoration: none; transition: top 160ms ease;
}
.nr-skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--nr-amber-bright); outline-offset: 3px; }

.nr-app {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 36px) 40px;
}

/* ---------------------------------------------------------------- topbar */
.nr-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px 12px;
  background: linear-gradient(180deg, rgba(7, 17, 13, 0.96), rgba(7, 17, 13, 0.72) 70%, transparent);
  backdrop-filter: blur(14px);
}
.nr-topbar-left, .nr-topbar-actions { display: flex; align-items: center; gap: 10px; }
.nr-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--nr-text); }
.nr-brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.nr-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.nr-brand-text strong { font-family: var(--nr-display); font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; }
.nr-brand-text small { color: var(--nr-muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.nr-icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--nr-line);
  border-radius: 12px;
  background: rgba(16, 37, 26, 0.72);
  color: var(--nr-muted);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.nr-icon-btn:hover { color: var(--nr-text); border-color: var(--nr-line-strong); background: var(--nr-surface-2); }
.nr-icon-btn:active { transform: scale(.95); }
.nr-icon-btn svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ menu */
.nr-main { outline: none; }
.nr-screen { animation: nr-fade-up 480ms var(--nr-ease) both; }
@keyframes nr-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.nr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: min(640px, 76vh);
  padding: clamp(22px, 5vw, 64px) 0 clamp(18px, 3vw, 40px);
}
.nr-kicker {
  color: var(--nr-amber);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.nr-hero-title {
  margin: 14px 0 4px;
  font-family: var(--nr-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 9vw, 7.4rem);
  line-height: .86;
  letter-spacing: -.045em;
  color: var(--nr-parchment);
  text-wrap: balance;
}
.nr-hero-title span { display: block; font-style: italic; opacity: .86; }
.nr-hero-title em {
  display: block;
  font-style: italic;
  font-weight: 700;
  color: var(--nr-moss-bright);
  text-shadow: 0 8px 40px rgba(130, 190, 90, .22);
}
.nr-tagline {
  margin-top: 18px;
  font-family: var(--nr-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  color: var(--nr-amber-bright);
}
.nr-intro {
  max-width: 58ch;
  margin-top: 16px;
  color: var(--nr-muted);
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
}
.nr-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.nr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.nr-btn svg { width: 18px; height: 18px; }
.nr-btn:hover { transform: translateY(-2px); }
.nr-btn:active { transform: translateY(0) scale(.98); }
.nr-btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.nr-btn--primary {
  background: linear-gradient(135deg, var(--nr-moss-bright), var(--nr-moss));
  color: #102010;
  box-shadow: 0 8px 24px rgba(166, 209, 113, .18);
}
.nr-btn--primary:hover { box-shadow: 0 12px 32px rgba(166, 209, 113, .26); }
.nr-btn--ghost {
  background: rgba(16, 37, 26, .62);
  border-color: var(--nr-line);
  color: var(--nr-text);
}
.nr-btn--ghost:hover { background: var(--nr-surface-2); border-color: var(--nr-line-strong); }
.nr-btn--danger { background: rgba(223, 129, 114, .14); border-color: rgba(223, 129, 114, .42); color: #ffc4b8; }
.nr-btn--end {
  background: linear-gradient(135deg, #c8ec8e, #8dbb5c);
  color: #102010;
  box-shadow: 0 8px 22px rgba(150, 200, 100, .18);
}
.nr-btn--end.is-ready { animation: nr-pulse 1.8s ease-in-out infinite; }
@keyframes nr-pulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(150, 200, 100, .18); }
  50% { box-shadow: 0 8px 34px rgba(200, 236, 142, .38); }
}

.nr-hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  isolation: isolate;
}
.nr-hero-art img {
  position: relative;
  z-index: 2;
  width: min(100%, 500px);
  height: auto;
  filter: drop-shadow(0 34px 60px rgba(0, 0, 0, .48));
  animation: nr-float 9s ease-in-out infinite;
}
@keyframes nr-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
.nr-hero-halo {
  position: absolute;
  width: min(92%, 470px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(166, 209, 113, .16), rgba(232, 185, 109, .05) 48%, transparent 68%);
  border: 1px solid rgba(200, 236, 142, .12);
  box-shadow: inset 0 0 80px rgba(166, 209, 113, .06);
}
.nr-hero-leaf {
  position: absolute;
  width: 18px; height: 44px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(160deg, var(--nr-moss-bright), var(--nr-moss-deep));
  opacity: .55;
  animation: nr-leaf 11s ease-in-out infinite;
}
.nr-hero-leaf--a { top: 16%; left: 12%; transform: rotate(-28deg); }
.nr-hero-leaf--b { bottom: 20%; right: 10%; transform: rotate(34deg); animation-delay: -3s; }
.nr-hero-leaf--c { top: 62%; left: 4%; width: 12px; height: 30px; transform: rotate(16deg); animation-delay: -6s; }
@keyframes nr-leaf {
  0%, 100% { translate: 0 0; opacity: .42; }
  50% { translate: 8px -18px; opacity: .72; }
}

.nr-resume {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin: 8px 0 22px;
  padding: 16px 18px;
  border: 1px solid rgba(232, 185, 109, .28);
  border-radius: var(--nr-radius);
  background: linear-gradient(120deg, rgba(232, 185, 109, .1), rgba(16, 37, 26, .8));
}
.nr-resume-copy { display: flex; flex-direction: column; gap: 2px; }
.nr-resume-copy strong { font-family: var(--nr-display); font-size: 1.15rem; }
.nr-resume-copy span { color: var(--nr-muted); font-size: .85rem; }
.nr-resume-actions { display: flex; gap: 10px; }

.nr-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.nr-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--nr-line);
  border-radius: var(--nr-radius-lg);
  background:
    radial-gradient(circle at 100% 0, rgba(166, 209, 113, .1), transparent 42%),
    linear-gradient(160deg, rgba(23, 49, 35, .92), rgba(10, 24, 17, .96));
  box-shadow: var(--nr-shadow-soft);
  overflow: hidden;
  transition: transform 220ms var(--nr-ease), border-color 220ms ease, box-shadow 220ms ease;
}
.nr-mode-card::before {
  content: "";
  position: absolute; inset: 0 auto auto 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--nr-moss), transparent 70%);
  opacity: .5;
}
.nr-mode-card:hover { transform: translateY(-5px); border-color: var(--nr-line-strong); box-shadow: var(--nr-shadow); }
.nr-mode-card h2 { font-family: var(--nr-display); font-size: 1.45rem; font-weight: 600; }
.nr-mode-card p { color: var(--nr-muted); font-size: .9rem; flex: 1; }
.nr-mode-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: rgba(166, 209, 113, .1);
  border: 1px solid rgba(166, 209, 113, .2);
  color: var(--nr-moss-bright);
}
.nr-mode-icon svg { width: 24px; height: 24px; }
.nr-card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.nr-mode-metric { display: flex; flex-direction: column; line-height: 1.1; }
.nr-mode-metric strong { font-family: var(--nr-display); font-size: 1.5rem; color: var(--nr-parchment); }
.nr-mode-metric span { color: var(--nr-faint); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.nr-card-footer .nr-btn { min-height: 38px; padding: 8px 13px; font-size: .78rem; }

.nr-progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(5, 12, 9, .7);
  border: 1px solid rgba(219, 232, 196, .1);
  overflow: hidden;
}
.nr-progress span {
  display: block; height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nr-moss-deep), var(--nr-moss-bright));
  transition: width 500ms var(--nr-ease);
}
.nr-progress span.is-complete { background: linear-gradient(90deg, var(--nr-amber), var(--nr-amber-bright)); }
.nr-progress--thin { height: 4px; }

.nr-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 0;
  border: 1px solid var(--nr-line);
  border-radius: var(--nr-radius);
  background: var(--nr-line);
  overflow: hidden;
}
.nr-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 18px;
  background: rgba(10, 24, 17, .86);
}
.nr-stat strong { font-family: var(--nr-display); font-size: 1.7rem; color: var(--nr-parchment); }
.nr-stat span { color: var(--nr-faint); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }

/* -------------------------------------------------------------- campaign */
.nr-screen-head {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 0 26px;
  border-bottom: 1px solid var(--nr-line);
}
.nr-screen-head > div:nth-child(2) { flex: 1; }
.nr-screen-head h2 { font-family: var(--nr-display); font-size: clamp(1.2rem, 2.6vw, 1.8rem); font-weight: 500; }
.nr-head-progress { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.nr-head-progress strong { font-family: var(--nr-display); font-size: 1.9rem; color: var(--nr-amber-bright); }
.nr-head-progress span { color: var(--nr-faint); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.nr-campaign-list { display: flex; flex-direction: column; gap: 28px; padding-top: 26px; }
.nr-chapter-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.nr-chapter-head .nr-kicker { margin-bottom: 4px; }
.nr-chapter-head .nr-muted { font-size: .86rem; }
.nr-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.nr-level-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--nr-line);
  border-radius: var(--nr-radius);
  background: linear-gradient(160deg, rgba(23, 49, 35, .76), rgba(10, 24, 17, .9));
  text-align: left;
  cursor: pointer;
  transition: transform 180ms var(--nr-ease), border-color 180ms ease, background 180ms ease;
}
.nr-level-card:hover:not(:disabled) { transform: translateY(-3px); border-color: rgba(200, 236, 142, .35); background: var(--nr-surface-2); }
.nr-level-card.is-complete { border-color: rgba(232, 185, 109, .28); }
.nr-level-card.is-locked { opacity: .5; cursor: not-allowed; }
.nr-level-number { font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: var(--nr-amber); }
.nr-level-name { font-family: var(--nr-display); font-size: 1.02rem; line-height: 1.15; }
.nr-level-stars { display: flex; gap: 2px; color: rgba(219, 232, 196, .18); font-size: .82rem; }
.nr-level-stars .is-filled { color: var(--nr-amber-bright); }
.nr-level-best { margin-top: auto; color: var(--nr-faint); font-size: .68rem; line-height: 1.25; }

/* ------------------------------------------------------------------ game */
.nr-game-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--nr-line);
}
.nr-game-title-wrap { flex: 1; min-width: 0; }
.nr-game-title-wrap .nr-kicker { font-size: .62rem; }
.nr-game-title-wrap h2 { font-family: var(--nr-display); font-size: clamp(1.15rem, 2.4vw, 1.6rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-turn-chip {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05;
  padding: 6px 14px;
  border: 1px solid var(--nr-line);
  border-radius: 12px;
  background: rgba(16, 37, 26, .6);
}
.nr-turn-chip span { color: var(--nr-faint); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.nr-turn-chip strong { font-family: var(--nr-display); font-size: 1.2rem; color: var(--nr-parchment); }
.nr-game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(16px, 2.4vw, 28px);
  align-items: start;
  padding-top: 18px;
}
.nr-board-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.nr-board-frame {
  position: relative;
  width: min(100%, calc(100vh - 190px));
  aspect-ratio: 1 / 1;
  max-height: calc(100vh - 190px);
  min-height: 300px;
  margin-inline: auto;
  border: 1px solid var(--nr-line);
  border-radius: var(--nr-radius-lg);
  background: #07110d;
  box-shadow: var(--nr-shadow);
  overflow: hidden;
}
#boardCanvas { display: block; width: 100%; height: 100%; touch-action: manipulation; cursor: crosshair; }
#boardCanvas:focus-visible { outline-offset: -3px; }
.nr-tooltip {
  position: absolute;
  z-index: 5;
  display: flex; flex-direction: column; gap: 2px;
  width: max-content; max-width: 210px;
  padding: 9px 11px;
  border: 1px solid rgba(219, 232, 196, .22);
  border-radius: 10px;
  background: rgba(7, 17, 13, .94);
  box-shadow: var(--nr-shadow-soft);
  pointer-events: none;
  font-size: .72rem;
  color: var(--nr-muted);
}
.nr-tooltip strong { color: var(--nr-parchment); font-size: .78rem; }
.nr-tooltip em { color: var(--nr-amber-bright); font-style: normal; }
.nr-turn-banner {
  position: absolute; left: 50%; top: 14px; translate: -50% 0;
  padding: 7px 14px;
  border: 1px solid rgba(232, 185, 109, .3);
  border-radius: 999px;
  background: rgba(7, 17, 13, .9);
  color: var(--nr-amber-bright);
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.nr-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(232, 185, 109, .22);
  border-radius: var(--nr-radius);
  background: linear-gradient(120deg, rgba(232, 185, 109, .08), rgba(16, 37, 26, .7));
  color: var(--nr-muted);
  font-size: .84rem;
}
.nr-tip-mark { color: var(--nr-amber-bright); }
.nr-tip p { flex: 1; }
.nr-tip-close { border: 0; background: none; color: var(--nr-faint); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.nr-board-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
.nr-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--nr-faint); font-size: .66rem; }
.nr-legend-group { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.nr-legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.nr-legend-item b { color: var(--nr-parchment); font-weight: 600; font-size: .8rem; }
.nr-legend-item i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.nr-event-feed { display: flex; flex-wrap: wrap; gap: 6px; }
.nr-event {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(166, 209, 113, .08);
  border: 1px solid rgba(166, 209, 113, .14);
  color: var(--nr-muted);
  font-size: .62rem;
  letter-spacing: .03em;
}
.nr-event--rain, .nr-event--spring { color: var(--nr-water); border-color: rgba(111, 200, 216, .25); }
.nr-event--heat, .nr-event--die { color: var(--nr-danger); border-color: rgba(223, 129, 114, .25); }
.nr-event--won { color: var(--nr-amber-bright); border-color: rgba(232, 185, 109, .35); }

.nr-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nr-panel {
  border: 1px solid var(--nr-line);
  border-radius: var(--nr-radius);
  background: linear-gradient(160deg, rgba(23, 49, 35, .62), rgba(10, 24, 17, .82));
  box-shadow: var(--nr-shadow-soft);
  padding: 15px 16px;
}
.nr-panel h2 { font-family: var(--nr-display); font-size: 1.12rem; font-weight: 600; }
.nr-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.nr-panel-head span { color: var(--nr-faint); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; }
.nr-panel-head strong { color: var(--nr-amber-bright); font-family: var(--nr-display); font-size: 1rem; }
.nr-objective-panel { border-color: rgba(232, 185, 109, .22); background: linear-gradient(150deg, rgba(232, 185, 109, .08), rgba(10, 24, 17, .86) 62%); }
.nr-objective-panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.nr-objective-panel .nr-muted { font-size: .78rem; min-height: 1.2em; }
.nr-objective-panel .nr-progress { margin-top: 10px; }
.nr-objective-parts { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.nr-objective-parts li { display: flex; align-items: baseline; gap: 6px; color: var(--nr-muted); font-size: .75rem; }
.nr-objective-parts li span { color: var(--nr-faint); }
.nr-objective-parts li.is-met { color: var(--nr-moss-bright); }
.nr-objective-parts li.is-met span { color: var(--nr-moss-bright); }
.nr-objective-parts li em { margin-left: auto; font-style: normal; color: var(--nr-faint); font-size: .68rem; }

.nr-metrics-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nr-metric { display: flex; flex-direction: column; gap: 4px; }
.nr-metric > span { color: var(--nr-faint); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.nr-metric strong { font-family: var(--nr-display); font-size: 1.35rem; color: var(--nr-parchment); }
.nr-meter { height: 4px; border-radius: 999px; background: rgba(5, 12, 9, .8); overflow: hidden; }
.nr-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--nr-moss); transition: width 420ms var(--nr-ease); }
.nr-meter--health i { background: var(--nr-amber); }
.nr-meter--coverage i { background: var(--nr-water); }

.nr-resources-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nr-resource { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nr-resource-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(166, 209, 113, .08); color: var(--nr-moss-bright); font-size: .9rem; flex: 0 0 auto; }
.nr-resource div { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.nr-resource strong { font-family: var(--nr-display); font-size: 1.1rem; color: var(--nr-parchment); }
.nr-resource span:not(.nr-resource-icon) { color: var(--nr-faint); font-size: .54rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }

.nr-actions-panel h2 { margin-bottom: 10px; }
.nr-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.nr-action {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 7px;
  row-gap: 1px;
  align-items: center;
  min-height: 50px;
  padding: 8px 9px;
  border: 1px solid var(--nr-line);
  border-radius: 10px;
  background: rgba(7, 17, 13, .45);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.nr-action:hover:not(:disabled) { border-color: rgba(200, 236, 142, .32); background: rgba(23, 49, 35, .9); }
.nr-action:active:not(:disabled) { transform: scale(.98); }
.nr-action:disabled { opacity: .36; cursor: not-allowed; }
.nr-action.is-active { border-color: var(--nr-amber); background: rgba(232, 185, 109, .1); box-shadow: 0 0 0 1px rgba(232, 185, 109, .2) inset; }
.nr-action-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(166, 209, 113, .08); color: var(--nr-moss-bright); font-size: .9rem; grid-row: 1 / 3; }
.nr-action-name { font-size: .76rem; font-weight: 600; line-height: 1.1; }
.nr-action-cost { color: var(--nr-faint); font-size: .52rem; line-height: 1.1; white-space: normal; }
.nr-seed-tray-wrap { margin-top: 12px; border-top: 1px solid var(--nr-line); padding-top: 10px; }
.nr-seed-label { color: var(--nr-faint); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.nr-seed-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.nr-seed {
  display: flex; align-items: center; gap: 5px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid var(--nr-line);
  border-radius: 8px;
  background: rgba(7, 17, 13, .4);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}
.nr-seed:hover:not(:disabled) { border-color: rgba(200, 236, 142, .3); }
.nr-seed.is-active { border-color: var(--nr-amber); background: rgba(232, 185, 109, .1); }
.nr-seed:disabled { opacity: .3; cursor: not-allowed; }
.nr-seed-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--seed-color) 22%, transparent); color: var(--seed-color); font-size: .66rem; font-weight: 700; flex: 0 0 auto; }
.nr-seed-name { font-size: .62rem; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-seed-count { margin-left: auto; color: var(--nr-parchment); font-size: .7rem; font-weight: 700; }

.nr-inspector-panel h2 { margin-bottom: 8px; }
.nr-inspect-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.nr-inspect-head div { display: flex; flex-direction: column; }
.nr-inspect-head strong { font-family: var(--nr-display); font-size: 1rem; }
.nr-inspect-head span { color: var(--nr-muted); font-size: .72rem; }
.nr-badge { padding: 2px 7px; border-radius: 999px; background: rgba(111, 200, 216, .12); border: 1px solid rgba(111, 200, 216, .28); color: var(--nr-water); font-size: .6rem; white-space: nowrap; }
.nr-inspect-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 30px; align-items: center; gap: 7px; margin: 4px 0; }
.nr-inspect-row span { color: var(--nr-faint); font-size: .65rem; }
.nr-inspect-row strong { color: var(--nr-muted); font-size: .65rem; text-align: right; }
.nr-inspect-bar { height: 4px; border-radius: 999px; background: rgba(5, 12, 9, .8); overflow: hidden; }
.nr-inspect-bar i { display: block; height: 100%; border-radius: inherit; transition: width 300ms ease; }
.nr-inspect-limit { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--nr-line); color: var(--nr-amber-bright); font-size: .7rem; }
.nr-inspect-limit span { color: var(--nr-faint); }
.nr-inspect-species { margin-top: 5px; color: var(--nr-muted); font-size: .68rem; }
.nr-inspect-species strong { color: var(--nr-parchment); }
.nr-inspect-reason { margin-top: 4px; color: var(--nr-danger); font-size: .68rem; }

.nr-controls { display: grid; grid-template-columns: 1fr 1fr 1fr 1.6fr; gap: 7px; }
.nr-controls .nr-btn { min-height: 44px; padding: 9px 8px; font-size: .74rem; }
.nr-end-count { color: rgba(16, 32, 16, .65); font-size: .58rem; font-weight: 700; }

/* --------------------------------------------------------------- dialogs */
.nr-dialog {
  width: min(640px, calc(100vw - 28px));
  max-height: min(86vh, 860px);
  padding: 0;
  border: 1px solid rgba(219, 232, 196, .22);
  border-radius: var(--nr-radius-lg);
  background:
    radial-gradient(circle at 100% 0, rgba(166, 209, 113, .12), transparent 40%),
    linear-gradient(160deg, #132a1d, #08140f);
  color: var(--nr-text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  overflow: hidden;
}
.nr-dialog::backdrop { background: rgba(3, 8, 5, .72); backdrop-filter: blur(7px); }
.nr-dialog:modal { overscroll-behavior: contain; }
.nr-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--nr-line); }
.nr-dialog-head h2 { font-family: var(--nr-display); font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 500; }
.nr-dialog-body { padding: 16px 20px; overflow-y: auto; max-height: calc(86vh - 170px); color: var(--nr-muted); }
.nr-dialog-body p { margin: 0 0 10px; }
.nr-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--nr-line); }
.nr-dialog-actions .nr-btn { min-height: 42px; }
.nr-guide-body { display: flex; flex-direction: column; gap: 14px; }
.nr-guide-body h3 { color: var(--nr-parchment); font-family: var(--nr-display); font-size: 1.05rem; margin-bottom: 3px; }
.nr-guide-body p { font-size: .86rem; line-height: 1.55; }
.nr-settings { display: flex; flex-direction: column; gap: 4px; }
.nr-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--nr-line); font-size: .88rem; }
.nr-setting:last-child { border-bottom: 0; }
.nr-setting input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--nr-moss); }
.nr-setting--danger { align-items: flex-start; flex-direction: column; gap: 8px; }
.nr-setting--danger span { color: var(--nr-danger); font-size: .78rem; }
.nr-lang-buttons { display: flex; gap: 6px; }
.nr-lang-buttons button { padding: 7px 12px; border: 1px solid var(--nr-line); border-radius: 8px; background: transparent; color: var(--nr-muted); cursor: pointer; }
.nr-lang-buttons button.is-active { border-color: var(--nr-amber); color: var(--nr-amber-bright); background: rgba(232, 185, 109, .1); }
.nr-result-stars { display: flex; justify-content: center; gap: 6px; font-size: 2.6rem; color: rgba(219, 232, 196, .16); margin: 2px 0 14px; }
.nr-result-stars .is-filled { color: var(--nr-amber-bright); text-shadow: 0 0 18px rgba(255, 216, 148, .35); }
.nr-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.nr-result-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--nr-line); border-radius: 10px; background: rgba(7, 17, 13, .4); }
.nr-result-grid strong { font-family: var(--nr-display); font-size: 1.35rem; color: var(--nr-parchment); }
.nr-result-grid span { color: var(--nr-faint); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }

.nr-toast {
  position: fixed;
  left: 50%; bottom: 26px;
  z-index: 5000;
  translate: -50% 0;
  max-width: min(440px, calc(100vw - 28px));
  padding: 11px 18px;
  border: 1px solid rgba(219, 232, 196, .22);
  border-radius: 999px;
  background: rgba(7, 17, 13, .95);
  color: var(--nr-parchment);
  box-shadow: var(--nr-shadow);
  font-size: .82rem;
  text-align: center;
  animation: nr-toast-in 240ms var(--nr-ease) both;
}
@keyframes nr-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- accessibility */
.nr-sr-grid {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.nr-a11y-tile { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ------------------------------------------------------------- game guide */
.game-guide {
  width: min(1100px, calc(100% - 32px));
  margin: 28px auto 60px;
  padding: 28px clamp(18px, 4vw, 42px);
  border: 1px solid rgba(219, 232, 196, .12);
  border-radius: var(--nr-radius-lg);
  background: rgba(10, 24, 17, .6);
  color: var(--nr-muted);
  font-family: var(--nr-body);
  line-height: 1.65;
}
.game-guide h2 { color: var(--nr-parchment); font-family: var(--nr-display); font-size: 1.5rem; margin: 18px 0 8px; }
.game-guide .guide-breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--nr-faint); font-size: .78rem; }
.game-guide .guide-breadcrumb a { color: var(--nr-moss-bright); text-decoration: none; }
.game-guide .related-games { padding-left: 18px; margin: 8px 0 0; }
.game-guide .related-games li { margin: 6px 0; }
.game-guide .related-games a { color: var(--nr-moss-bright); }
.game-guide .related-games span { color: var(--nr-muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .nr-game-layout { grid-template-columns: minmax(0, 1fr) 350px; }
  .nr-level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .nr-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 26px; }
  .nr-hero-art { min-height: 240px; order: -1; }
  .nr-hero-art img { width: min(58vw, 320px); }
  .nr-hero-halo { width: min(56vw, 310px); }
  .nr-mode-grid { grid-template-columns: 1fr; }
  .nr-mode-card { min-height: 0; }
  .nr-game-layout { grid-template-columns: 1fr; }
  .nr-board-frame { width: 100%; max-height: min(72vh, 720px); }
  .nr-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .nr-actions-panel, .nr-inspector-panel, .nr-controls { grid-column: 1 / -1; }
  .nr-level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .nr-app { padding: 0 12px 28px; }
  .nr-topbar { padding-top: 10px; }
  .nr-brand-text small { display: none; }
  .nr-brand-text strong { font-size: .95rem; }
  .nr-topbar-actions { gap: 6px; }
  .nr-icon-btn { width: 42px; height: 42px; }
  .nr-hero-title { font-size: clamp(2.9rem, 17vw, 4.4rem); }
  .nr-hero-actions .nr-btn { flex: 1 1 100%; }
  .nr-stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-screen-head { flex-wrap: wrap; }
  .nr-head-progress { align-items: flex-start; }
  .nr-level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-level-card { min-height: 112px; padding: 12px; }
  .nr-game-head { flex-wrap: wrap; gap: 8px; }
  .nr-game-title-wrap { order: 2; width: calc(100% - 52px); }
  .nr-turn-chip { order: 3; margin-left: auto; }
  .nr-board-frame { min-height: 250px; max-height: none; }
  .nr-side { display: flex; flex-direction: column; }
  .nr-actions-panel, .nr-inspector-panel, .nr-controls { grid-column: auto; }
  .nr-action-grid { grid-template-columns: 1fr 1fr; }
  .nr-action { min-height: 54px; }
  .nr-seed-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-seed { min-height: 44px; }
  .nr-controls { position: sticky; bottom: 8px; z-index: 20; padding: 8px; border: 1px solid var(--nr-line); border-radius: 14px; background: rgba(7, 17, 13, .92); backdrop-filter: blur(10px); }
  .nr-controls .nr-btn { min-height: 46px; }
  .nr-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-dialog-body { max-height: calc(84vh - 170px); }
  .nr-board-footer { flex-direction: column; }
  .nr-legend { font-size: .6rem; }
  .nr-toast { bottom: 84px; }
}
@media (max-width: 390px) {
  .nr-brand-mark { width: 36px; height: 36px; }
  .nr-brand-text strong { font-size: .82rem; }
  .nr-turn-chip { padding: 5px 9px; }
  .nr-turn-chip strong { font-size: 1rem; }
  .nr-metrics-panel { grid-template-columns: 1fr; }
  .nr-resources-panel { grid-template-columns: 1fr 1fr; }
  .nr-resource:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
