:root {
  color-scheme: dark;
  --ink-950: #090c09;
  --ink-900: #101510;
  --ink-850: #151b15;
  --ink-800: #1b221a;
  --cream-50: #fff9e9;
  --cream-100: #f7eed8;
  --cream-300: #d7ccb1;
  --cream-500: #9d967f;
  --lime-300: #d9ff77;
  --lime-400: #bce95c;
  --lime-500: #8fbe3c;
  --amber-300: #ffd481;
  --amber-400: #f3b84d;
  --rust-400: #da7b54;
  --danger: #ff785f;
  --panel: rgba(15, 20, 15, 0.78);
  --panel-strong: rgba(13, 18, 13, 0.94);
  --line: rgba(255, 249, 233, 0.14);
  --line-bright: rgba(217, 255, 119, 0.35);
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.38);
  --shadow-hard: 0 16px 45px rgba(0, 0, 0, 0.52);
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 70% 5%, rgba(194, 234, 94, 0.13), transparent 30%),
    radial-gradient(circle at 8% 82%, rgba(235, 158, 72, 0.11), transparent 36%),
    linear-gradient(145deg, #172016 0%, #0b100c 56%, #13100d 100%);
  color: var(--cream-50);
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  position: fixed;
  z-index: 120;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.055;
  background-image:
    repeating-radial-gradient(circle at 15% 37%, rgba(255, 255, 255, 0.65) 0 0.45px, transparent 0.7px 3px),
    repeating-radial-gradient(circle at 73% 61%, rgba(255, 221, 146, 0.45) 0 0.4px, transparent 0.7px 4px);
  background-size: 5px 5px, 7px 7px;
  mix-blend-mode: soft-light;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--lime-300);
  outline-offset: 3px;
}

kbd {
  display: inline-flex;
  min-width: 1.65em;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.38rem;
  border: 1px solid rgba(255, 249, 233, 0.2);
  border-bottom-color: rgba(255, 249, 233, 0.32);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  color: var(--cream-100);
  font-family: inherit;
  font-size: 0.73em;
  font-weight: 700;
  letter-spacing: 0;
}

#game {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(to bottom, rgba(217, 255, 119, 0.08), transparent 38%),
    linear-gradient(150deg, #263324, #101711 72%);
}

#game canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.screen-layer {
  position: fixed;
  display: grid;
  z-index: 80;
  inset: 0;
  overflow-y: auto;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  overscroll-behavior: contain;
}

.eyebrow {
  margin: 0;
  color: var(--lime-300);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-glyph {
  position: relative;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(217, 255, 119, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(217, 255, 119, 0.2), rgba(217, 255, 119, 0.04)),
    rgba(8, 12, 8, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 25px rgba(0, 0, 0, 0.2);
  transform: rotate(45deg);
}

.brand-glyph::before,
.brand-glyph::after,
.brand-glyph span {
  position: absolute;
  display: block;
  content: "";
  background: var(--lime-300);
  box-shadow: 0 0 12px rgba(217, 255, 119, 0.48);
}

.brand-glyph::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 2px;
}

.brand-glyph::after {
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  transform: translate(0.55rem, -0.55rem);
}

.brand-glyph span {
  width: 0.17rem;
  height: 0.17rem;
  border-radius: 50%;
  opacity: 0.72;
  transform: translate(-0.5rem, 0.5rem);
}

.brand-glyph--large {
  width: 3.4rem;
  height: 3.4rem;
  margin-bottom: 1.6rem;
  border-radius: 14px;
}

.brand-glyph--mini {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 7px;
}

.brand-glyph--mini::before {
  width: 0.32rem;
  height: 0.32rem;
}

.brand-glyph--mini::after,
.brand-glyph--mini span {
  display: none;
}

.loading-screen {
  z-index: 100;
  background:
    radial-gradient(circle at 50% 42%, rgba(188, 233, 92, 0.12), transparent 32%),
    linear-gradient(145deg, #141c13 0%, #090c09 72%);
  transition: opacity 500ms var(--ease-out), visibility 500ms;
}

.loading-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.45;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.025) 50%, transparent 50.2%),
    linear-gradient(transparent 49.8%, rgba(255, 255, 255, 0.025) 50%, transparent 50.2%);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle, black, transparent 70%);
}

.loading-screen.is-finished {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.loading-card {
  position: relative;
  width: min(25rem, calc(100vw - 3rem));
  text-align: center;
}

.loading-card .brand-glyph {
  margin-inline: auto;
}

.loading-title {
  margin: 0.3rem 0 2rem;
  color: var(--cream-50);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.loading-progress {
  --loading-progress: 0%;
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 249, 233, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.loading-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--loading-progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime-500), var(--lime-300), var(--amber-300));
  box-shadow: 0 0 18px rgba(217, 255, 119, 0.65);
  transition: width 260ms var(--ease-out);
}

.loading-status {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  color: var(--cream-300);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.start-screen {
  background:
    radial-gradient(circle at 50% 48%, transparent 0 12%, rgba(5, 8, 5, 0.22) 65%),
    linear-gradient(90deg, rgba(6, 9, 6, 0.66), rgba(6, 9, 6, 0.18) 50%, rgba(6, 9, 6, 0.66));
  transition: opacity 280ms var(--ease-out), visibility 280ms;
}

.start-screen.is-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.start-screen.is-paused {
  background: rgba(5, 8, 5, 0.62);
  backdrop-filter: blur(5px);
}

.start-screen.is-paused .seed-control,
.start-screen.is-paused .seed-help,
.start-screen.is-paused .size-control {
  display: none;
}

.size-control {
  margin: 0 0 1.1rem;
}

.size-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.size-pill {
  padding: 0.48rem 0.5rem;
  border: 1px solid rgba(255, 249, 233, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream-300);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.size-pill:hover {
  border-color: rgba(217, 255, 119, 0.35);
  color: var(--cream-50);
}

.size-pill.is-active,
.size-pill[aria-pressed="true"] {
  border-color: rgba(217, 255, 119, 0.52);
  background: rgba(217, 255, 119, 0.14);
  color: var(--lime-300);
}

.pause-controls {
  display: none;
  margin-bottom: 1.15rem;
}

.start-screen.is-paused .pause-controls {
  display: grid;
  gap: 0.7rem;
}

.pause-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.secondary-button {
  padding: 0.56rem 0.65rem;
  border: 1px solid rgba(255, 249, 233, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  color: var(--cream-100);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.secondary-button:hover {
  border-color: rgba(217, 255, 119, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.secondary-button[aria-pressed="true"] {
  border-color: rgba(217, 255, 119, 0.45);
  background: rgba(217, 255, 119, 0.14);
  color: var(--lime-300);
}

.secondary-button--danger:hover {
  border-color: rgba(255, 120, 95, 0.55);
  background: rgba(255, 120, 95, 0.14);
  color: #ffad9d;
}

.slider-control {
  display: grid;
  gap: 0.32rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 249, 233, 0.11);
  border-radius: var(--radius-sm);
  background: rgba(3, 6, 3, 0.36);
  color: var(--cream-300);
  font-size: 0.68rem;
  font-weight: 700;
}

.slider-control span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-control strong {
  color: var(--lime-300);
}

.slider-control input[type="range"] {
  width: 100%;
  accent-color: var(--lime-400);
  margin: 0;
}

.seed-random-button {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 249, 233, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream-100);
  font-size: 0.92rem;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease, transform 180ms var(--ease-out);
}

.seed-random-button:hover {
  background: rgba(217, 255, 119, 0.16);
  color: var(--lime-300);
  transform: rotate(90deg);
}

.start-screen.is-paused .start-card {
  width: min(27rem, calc(100vw - 2rem));
}

.start-card {
  position: relative;
  width: min(32rem, calc(100vw - 2rem));
  overflow: hidden;
  padding: clamp(1.6rem, 5vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 35%),
    var(--panel-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.15);
}

.start-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9rem;
  height: 9rem;
  content: "";
  border-radius: 100% 0 0 0;
  background: radial-gradient(circle at 100% 100%, rgba(243, 184, 77, 0.14), transparent 70%);
  pointer-events: none;
}

.start-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.start-card h1 {
  margin: 1.55rem 0 0.7rem;
  color: var(--cream-50);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.92;
  text-wrap: balance;
}

.start-intro {
  max-width: 28rem;
  margin: 0 0 1.8rem;
  color: var(--cream-300);
  font-size: 1rem;
  text-wrap: pretty;
}

.seed-control {
  display: block;
  margin-top: 0.35rem;
}

.seed-control__label {
  display: block;
  margin-bottom: 0.48rem;
  color: var(--cream-100);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.seed-control__field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(255, 249, 233, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(3, 6, 3, 0.45);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.seed-control__field:focus-within {
  border-color: var(--lime-400);
  background: rgba(3, 6, 3, 0.68);
  box-shadow: 0 0 0 3px rgba(188, 233, 92, 0.12);
}

.seed-control__field > span {
  color: var(--lime-300);
  font-size: 0.8rem;
}

#seed-input {
  width: 100%;
  min-width: 0;
  padding: 0.78rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cream-50);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
}

#seed-input::selection {
  background: var(--lime-400);
  color: var(--ink-950);
}

.seed-help {
  margin: 0.48rem 0 1.25rem;
  color: var(--cream-500);
  font-size: 0.72rem;
}

.primary-button,
.craft-button {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0.85rem 1.2rem;
  border: 1px solid rgba(217, 255, 119, 0.5);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--lime-300), #b5e958);
  box-shadow: 0 12px 28px rgba(111, 155, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #17200d;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: transform 150ms var(--ease-out), filter 150ms ease, box-shadow 150ms ease;
}

.primary-button::after,
.craft-button::after {
  position: absolute;
  top: -150%;
  left: -40%;
  width: 35%;
  height: 400%;
  content: "";
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(24deg);
  transition: left 430ms var(--ease-out);
}

.primary-button:hover,
.craft-button:hover:not(:disabled) {
  box-shadow: 0 15px 32px rgba(111, 155, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.primary-button:hover::after,
.craft-button:hover:not(:disabled)::after {
  left: 120%;
}

.primary-button:active,
.craft-button:active:not(:disabled) {
  transform: translateY(0);
}

.craft-button:disabled {
  border-color: rgba(255, 249, 233, 0.1);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  color: var(--cream-500);
  cursor: not-allowed;
}

.start-note {
  margin: 1rem 0 0;
  color: var(--cream-500);
  font-size: 0.7rem;
  text-align: center;
}

.mobile-hint {
  display: none;
  margin: 1rem 0 0;
  padding: 0.75rem;
  border: 1px solid rgba(243, 184, 77, 0.22);
  border-radius: 8px;
  background: rgba(243, 184, 77, 0.07);
  color: var(--amber-300);
  font-size: 0.74rem;
}

.hud {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 200ms ease;
}

body.hud-hidden .hud {
  opacity: 0;
}

#underwater-tint {
  position: fixed;
  z-index: 15;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(28, 124, 174, 0.16), rgba(10, 48, 76, 0.56) 95%);
  transition: opacity 220ms ease;
}

body.is-underwater #underwater-tint {
  opacity: 1;
}

.hud-topline {
  position: absolute;
  top: clamp(0.75rem, 2.5vw, 1.4rem);
  right: clamp(0.75rem, 2.5vw, 1.5rem);
  left: clamp(0.75rem, 2.5vw, 1.5rem);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.hud-chip {
  display: flex;
  min-height: 2.8rem;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 249, 233, 0.12);
  border-radius: 8px;
  background: rgba(11, 15, 11, 0.62);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.hud-chip > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.hud-chip--seed {
  min-width: 0;
  max-width: calc(100vw - 7rem);
}

.hud-chip--time {
  flex: 0 0 auto;
}

.hud-chip--compass {
  gap: 0.5rem;
  padding: 0.48rem 0.72rem;
  flex: 0 0 auto;
}

.hud-chip > span.flight-badge:last-child {
  display: none;
  padding: 0.14rem 0.42rem;
  border: 1px solid rgba(217, 255, 119, 0.45);
  border-radius: 999px;
  background: rgba(217, 255, 119, 0.14);
  color: var(--lime-300);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud-chip > span.flight-badge.is-active:last-child {
  display: inline-flex;
  align-items: center;
}

.minimap-box {
  position: absolute;
  top: clamp(4.2rem, 8.5vh, 5.1rem);
  right: clamp(0.75rem, 2.5vw, 1.5rem);
  width: 9.6rem;
  padding: 0.36rem;
  border: 1px solid rgba(255, 249, 233, 0.14);
  border-radius: 8px;
  background: rgba(10, 14, 10, 0.72);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.minimap-box.is-hidden {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

#minimap-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 249, 233, 0.12);
  border-radius: 5px;
  image-rendering: pixelated;
}

.minimap-north {
  position: absolute;
  top: 0.52rem;
  left: 50%;
  padding: 0.04rem 0.26rem;
  border-radius: 4px;
  background: rgba(9, 12, 9, 0.78);
  color: var(--lime-300);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0;
  transform: translateX(-50%);
}

.minimap-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.28rem;
  color: var(--cream-500);
  font-size: 0.55rem;
  font-weight: 750;
  letter-spacing: 0;
}

.hud-chip small {
  margin-bottom: 0.23rem;
  color: var(--cream-500);
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud-chip strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--cream-100);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sun-mark {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  border: 1px solid var(--amber-300);
  border-radius: 50%;
  background: rgba(255, 212, 129, 0.18);
  box-shadow: 0 0 16px rgba(255, 191, 70, 0.25), inset 0 0 8px rgba(255, 212, 129, 0.25);
}

.sun-mark::before,
.sun-mark::after {
  position: absolute;
  inset: -0.3rem;
  content: "";
  background:
    linear-gradient(var(--amber-300), var(--amber-300)) center top / 1px 3px no-repeat,
    linear-gradient(var(--amber-300), var(--amber-300)) center bottom / 1px 3px no-repeat,
    linear-gradient(90deg, var(--amber-300), var(--amber-300)) left center / 3px 1px no-repeat,
    linear-gradient(90deg, var(--amber-300), var(--amber-300)) right center / 3px 1px no-repeat;
  opacity: 0.72;
}

.sun-mark::after {
  transform: rotate(45deg);
}

.aim-cluster {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.crosshair {
  position: relative;
  width: 1.65rem;
  height: 1.65rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
  transition: filter 120ms ease, transform 120ms ease;
}

.crosshair::before,
.crosshair::after,
.crosshair span::before,
.crosshair span::after {
  position: absolute;
  content: "";
  border-radius: 2px;
  background: rgba(255, 249, 233, 0.94);
}

.crosshair::before,
.crosshair::after {
  top: 50%;
  width: 0.43rem;
  height: 2px;
  transform: translateY(-50%);
}

.crosshair::before {
  left: 0;
}

.crosshair::after {
  right: 0;
}

.crosshair span::before,
.crosshair span::after {
  left: 50%;
  width: 2px;
  height: 0.43rem;
  transform: translateX(-50%);
}

.crosshair span::before {
  top: 0;
}

.crosshair span::after {
  bottom: 0;
}

.crosshair.is-blocked {
  filter: drop-shadow(0 0 5px rgba(255, 120, 95, 0.95));
  transform: scale(0.86);
}

.crosshair.is-blocked::before,
.crosshair.is-blocked::after,
.crosshair.is-blocked span::before,
.crosshair.is-blocked span::after {
  background: var(--danger);
}

.target-label {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 50%;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 249, 233, 0.12);
  border-radius: 7px;
  background: rgba(9, 12, 9, 0.68);
  color: var(--cream-100);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0;
  text-transform: uppercase;
  transform: translate(-50%, -4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.target-label.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.status-toast {
  position: absolute;
  top: clamp(4.8rem, 12vh, 6.5rem);
  left: 50%;
  max-width: min(28rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.58rem 0.82rem;
  border: 1px solid rgba(255, 249, 233, 0.14);
  border-radius: 8px;
  background: rgba(11, 15, 11, 0.78);
  box-shadow: var(--shadow-hard);
  color: var(--cream-100);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0;
  text-align: center;
  transform: translate(-50%, -0.65rem);
  transition: opacity 180ms ease, transform 220ms var(--ease-out);
  backdrop-filter: blur(12px);
}

.status-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.status-toast[data-tone="success"] {
  border-color: rgba(217, 255, 119, 0.35);
  color: var(--lime-300);
}

.status-toast[data-tone="warning"] {
  border-color: rgba(255, 212, 129, 0.38);
  color: var(--amber-300);
}

.status-toast[data-tone="danger"] {
  border-color: rgba(255, 120, 95, 0.4);
  color: #ffad9d;
}

.hud-bottom {
  position: absolute;
  bottom: clamp(0.8rem, 2.4vw, 1.5rem);
  left: 50%;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
}

.selected-label {
  margin: 0 0 0.45rem;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  background: rgba(8, 11, 8, 0.56);
  color: var(--cream-300);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.hotbar {
  display: flex;
  max-width: calc(100vw - 2rem);
  align-items: stretch;
  gap: 0.38rem;
  padding: 0.42rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 249, 233, 0.14);
  border-radius: 8px;
  background: rgba(10, 14, 10, 0.76);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  scrollbar-width: none;
  backdrop-filter: blur(13px) saturate(1.1);
}

.hotbar::-webkit-scrollbar {
  display: none;
}

.hotbar-slot {
  position: relative;
  display: grid;
  width: 4.1rem;
  min-width: 4.1rem;
  height: 4rem;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 0.35rem 0.3rem 0.28rem;
  overflow: hidden;
  border: 1px solid rgba(255, 249, 233, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--cream-100);
  transition: border-color 130ms ease, background 130ms ease, transform 130ms var(--ease-out);
}

.hotbar-slot:hover {
  border-color: rgba(255, 249, 233, 0.25);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.hotbar-slot.is-selected {
  border-color: var(--lime-300);
  background:
    linear-gradient(180deg, rgba(217, 255, 119, 0.13), rgba(217, 255, 119, 0.035)),
    rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(217, 255, 119, 0.15), 0 0 18px rgba(146, 195, 56, 0.12);
  transform: translateY(-3px);
}

.hotbar-slot.is-empty .block-swatch {
  filter: grayscale(0.6);
  opacity: 0.42;
}

.slot-number {
  position: absolute;
  top: 0.2rem;
  left: 0.3rem;
  color: var(--cream-500);
  font-size: 0.55rem;
  font-weight: 800;
}

.slot-count {
  position: absolute;
  top: 0.22rem;
  right: 0.3rem;
  min-width: 1rem;
  padding: 0.03rem 0.16rem;
  border-radius: 4px;
  background: rgba(5, 7, 5, 0.58);
  color: var(--cream-100);
  font-size: 0.55rem;
  font-weight: 850;
  text-align: center;
}

.slot-label {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--cream-300);
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-swatch {
  --block-color: #8aa369;
  position: relative;
  display: block;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 42%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.2), transparent 55%),
    var(--block-color);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 5px 9px rgba(0, 0, 0, 0.25);
}

.block-swatch.has-texture {
  background-color: rgba(15, 22, 16, 0.55);
  background-image: var(--block-texture);
  background-size: 100% 100%;
}

.block-swatch::after {
  position: absolute;
  inset: 3px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 2px;
}

.controls-help {
  position: absolute;
  right: clamp(0.75rem, 2.5vw, 1.5rem);
  bottom: clamp(0.8rem, 2.4vw, 1.5rem);
  width: 10rem;
  padding: 0.72rem;
  border: 1px solid rgba(255, 249, 233, 0.1);
  border-radius: 8px;
  background: rgba(10, 14, 10, 0.58);
  color: var(--cream-300);
  backdrop-filter: blur(9px);
}

.controls-help__title {
  margin: 0 0 0.5rem;
  color: var(--cream-500);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.controls-help dl {
  display: grid;
  gap: 0.3rem;
  margin: 0;
}

.controls-help dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.controls-help dt,
.controls-help dd {
  margin: 0;
  font-size: 0.6rem;
}

.controls-help dd {
  color: var(--cream-500);
}

.inventory-panel {
  position: fixed;
  z-index: 60;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: min(25rem, calc(100vw - 2rem));
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid rgba(255, 249, 233, 0.15);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.065), transparent 28%),
    var(--panel-strong);
  box-shadow: -18px 20px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 2.5rem));
  transition: opacity 240ms ease, transform 360ms var(--ease-out);
  backdrop-filter: blur(22px) saturate(1.15);
  scrollbar-color: rgba(217, 255, 119, 0.24) transparent;
  scrollbar-width: thin;
}

.inventory-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.inventory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 249, 233, 0.1);
}

.inventory-header h2 {
  margin: 0.3rem 0 0;
  color: var(--cream-50);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.icon-button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 249, 233, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream-300);
  font-size: 1.3rem;
  line-height: 1;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--cream-50);
  transform: rotate(4deg);
}

.inventory-hint {
  margin: -0.6rem 0 0.9rem;
  color: var(--cream-500);
  font-size: 0.68rem;
}

.inventory-grid {
  display: grid;
  min-height: 6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.inventory-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 6.2rem;
  align-content: space-between;
  justify-items: start;
  padding: 0.68rem;
  border: 1px solid rgba(255, 249, 233, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms var(--ease-out);
}

.inventory-item:hover {
  border-color: rgba(217, 255, 119, 0.42);
  background: rgba(217, 255, 119, 0.08);
  transform: translateY(-2px);
}

.extra-recipes {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.recipe-mini {
  display: grid;
  gap: 0.5rem;
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(255, 249, 233, 0.11);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.recipe-mini__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.recipe-mini__info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.recipe-mini__info .block-swatch {
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
}

.recipe-mini__title {
  margin: 0;
  color: var(--cream-100);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
}

.recipe-mini__summary {
  margin: 0.1rem 0 0;
  color: var(--cream-500);
  font-size: 0.64rem;
  letter-spacing: 0;
}

.recipe-mini__button {
  width: auto;
  min-width: 4.5rem;
  padding: 0.45rem 0.72rem;
  font-size: 0.68rem;
}

.inventory-item .block-swatch {
  width: 2.1rem;
  height: 2.1rem;
}

.inventory-item__name {
  display: block;
  width: 100%;
  margin-top: 0.58rem;
  overflow: hidden;
  color: var(--cream-100);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item__count {
  position: absolute;
  top: 0.62rem;
  right: 0.62rem;
  color: var(--lime-300);
  font-size: 0.65rem;
  font-weight: 900;
}

.inventory-empty {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  padding: 1.3rem;
  border: 1px dashed rgba(255, 249, 233, 0.13);
  border-radius: 8px;
  color: var(--cream-500);
  font-size: 0.75rem;
  text-align: center;
}

.recipe-card {
  position: relative;
  margin-top: 1rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(243, 184, 77, 0.22);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 100% 100%, rgba(243, 184, 77, 0.11), transparent 48%),
    rgba(255, 255, 255, 0.035);
}

.recipe-card__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.recipe-card h3 {
  margin: 0.25rem 0 0;
  color: var(--cream-50);
  font-size: 1rem;
  font-weight: 750;
}

.recipe-summary {
  margin: 0.9rem 0 0;
  color: var(--cream-100);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
}

.recipe-badge {
  padding: 0.19rem 0.44rem;
  border: 1px solid rgba(255, 212, 129, 0.25);
  border-radius: 999px;
  background: rgba(255, 212, 129, 0.08);
  color: var(--amber-300);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recipe-flow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0 0.45rem;
  color: var(--cream-100);
  font-size: 0.72rem;
}

.recipe-arrow {
  margin: 0 0.12rem;
  color: var(--amber-300);
  font-size: 1rem;
}

.recipe-block {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.recipe-block--log {
  background: linear-gradient(135deg, #8d603b 0 42%, #5e3b24 43% 66%, #aa7747 67%);
}

.recipe-block--planks {
  background: repeating-linear-gradient(0deg, #c18d51 0 4px, #9c6d3d 4px 5px);
}

.recipe-availability {
  margin: 0 0 0.8rem;
  color: var(--cream-500);
  font-size: 0.66rem;
}

#damage-vignette {
  position: fixed;
  z-index: 55;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle, transparent 38%, rgba(112, 18, 5, 0.2) 74%, rgba(193, 48, 24, 0.68) 115%),
    linear-gradient(rgba(255, 120, 95, 0.035), rgba(255, 120, 95, 0.035));
}

#damage-vignette.is-flashing {
  animation: blocked-flash 360ms ease-out;
}

@keyframes blocked-flash {
  0% { opacity: 0; }
  22% { opacity: 0.78; }
  100% { opacity: 0; }
}

noscript {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--cream-50);
  text-align: center;
}

@media (max-width: 760px) {
  .screen-layer {
    padding: 1rem;
  }

  .start-card {
    padding: 1.45rem;
    border-radius: 8px;
  }

  .start-card h1 {
    font-size: 3.2rem;
  }

  .loading-title {
    font-size: 3rem;
  }

  .hud-chip {
    min-height: 2.35rem;
    padding: 0.4rem 0.55rem;
  }

  .hud-chip--seed .brand-glyph,
  .hud-chip small {
    display: none;
  }

  .hud-chip strong {
    font-size: 0.62rem;
  }

  .controls-help,
  .hud-chip--compass,
  .minimap-box {
    display: none;
  }

  .hotbar {
    gap: 0.28rem;
    padding: 0.34rem;
  }

  .hotbar-slot {
    width: 3.45rem;
    min-width: 3.45rem;
    height: 3.55rem;
  }

  .block-swatch {
    width: 1.55rem;
    height: 1.55rem;
  }

  .inventory-panel {
    top: 0.55rem;
    right: 0.55rem;
    bottom: 0.55rem;
    width: calc(100vw - 1.1rem);
    padding: 1rem;
    border-radius: 8px;
  }
}

@media (max-height: 600px) {
  .screen-layer {
    place-items: start center;
    padding-block: 0.5rem;
  }

  .loading-card,
  .start-card {
    margin-block: auto;
  }
}

@media (max-width: 410px) {
  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-flow {
    gap: 0.35rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .mobile-hint {
    display: block;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(255, 255, 255, 0.35);
  }

  .start-card,
  .inventory-panel,
  .hud-chip,
  .hotbar,
  .controls-help {
    background-color: rgba(5, 7, 5, 0.94);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
