/* ==========================================================
   Marko Cerkez - pixel/RPG portfolio
   Palette inspired by GBC-era Pokémon + Terraria daytime
   ========================================================== */

:root {
  --ink: #1b1032;
  --paper: #fff9ec;
  --sky-top: #6ec6ff;
  --sky-bottom: #bfe9ff;
  --grass-1: #5fe88a;
  --grass-2: #2bb673;
  --dirt: #8a5a2b;
  --accent: #ff8f3c;
  --accent-2: #ffd34d;
  --pink: #ff6fa5;
  --purple: #7b5cff;
  --box-bg: #fff9ec;
  --box-border: var(--ink);
  --danger: #ff4d6d;
  --ok: #3ddc84;
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hard-sm: 2px 2px 0 var(--ink);
  --radius: 10px;
  --font-head: "Press Start 2P", monospace;
  --font-body: "VT323", monospace;
  /* page-level surface/text - separate from --ink/--paper, which are also
     used as fixed (theme-invariant) colors for chips sitting on accent
     backgrounds, so those can't just be swapped wholesale for dark mode */
  --surface: var(--paper);
  --text: var(--ink);
  --text-muted: #6a5c3f;
}

/* ---------- night theme: a real site-wide dark mode, not just the landscape ---------- */
:root[data-theme="night"] {
  --sky-top: #16213e;
  --sky-bottom: #2b2f6b;
  --grass-1: #2f9e63;
  --grass-2: #1a6b44;
  --dirt: #3c2a18;
  --surface: #150e26;
  --box-bg: #241a3d;
  --text: #f4eee0;
  --text-muted: #b7a8d1;
}
:root[data-theme="night"] .ambient-cloud,
:root[data-theme="night"] .cloud {
  opacity: 0.12;
}
:root[data-theme="night"] .mote {
  filter: brightness(1.5);
}
:root[data-theme="night"] .panel--alt { background: #1c1433; }
:root[data-theme="night"] .stat-bar__track { background: #3a2d52; }
:root[data-theme="night"] .location {
  background: linear-gradient(160deg, #1f3a2a, #16301f);
}
:root[data-theme="night"] .location__period { color: #a3c98c; }
:root[data-theme="night"] .trainer-card__portrait {
  background: linear-gradient(160deg, #1b2a3d, #15331f);
}
:root[data-theme="night"] body {
  transition: background 0.4s ease, color 0.4s ease;
}

/* ---------- weather (reskins the hero landscape - sky, ground, trees, clouds) ---------- */
[data-weather="rain"] .hero {
  --sky-top: #5c6b78;
  --sky-bottom: #8a99a4;
  --grass-1: #3f8a58;
  --grass-2: #1f6b42;
  --dirt: #4a3016;
}
[data-weather="snow"] .hero {
  --sky-top: #aebfcf;
  --sky-bottom: #e4edf2;
  --grass-1: #f3f9ff;
  --grass-2: #dde9f0;
  --dirt: #eef5fa;
}
[data-weather="rain"] .hero .cloud,
[data-weather="rain"] .ambient-cloud {
  filter: grayscale(0.5) brightness(0.8);
}
[data-weather="snow"] .hero .cloud,
[data-weather="snow"] .ambient-cloud {
  filter: brightness(1.03) saturate(0.85);
}
[data-weather="rain"] .hero__scenery .scenery-tree,
[data-weather="rain"] .hero__scenery .scenery-bush {
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.2)) brightness(0.82) saturate(0.85);
}
[data-weather="snow"] .hero__scenery .scenery-tree,
[data-weather="snow"] .hero__scenery .scenery-bush {
  filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.15)) brightness(1.25) saturate(0.35);
}
[data-weather="rain"] .hero__ground,
[data-weather="snow"] .hero__ground {
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
[data-weather] .hero {
  transition: background 0.4s ease;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  image-rendering: pixelated;
  overflow-x: hidden;
}

h1, h2, h3, .font-head {
  font-family: var(--font-head);
  line-height: 1.4;
  letter-spacing: 0.5px;
}

button {
  font-family: var(--font-head);
  cursor: pointer;
}

a { color: var(--purple); }

img, svg { image-rendering: pixelated; }

/* ---------- scanline overlay for game-screen feel ---------- */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.055) 0px,
    rgba(0, 0, 0, 0.055) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
}

/* ---------- ambient background (behind all panels, fixed to viewport) ---------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-cloud {
  position: absolute;
  opacity: 0.28;
}
.ambient-cloud--1 { top: 6%;  left: -20%; animation: driftSlow 70s linear infinite; }
.ambient-cloud--2 { top: 46%; left: -30%; animation: driftSlow 95s linear infinite; animation-delay: -30s; }
.ambient-cloud--3 { top: 76%; left: -16%; animation: driftSlow 80s linear infinite; animation-delay: -55s; }
@keyframes driftSlow {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}

.stars { position: absolute; inset: 0; overflow: hidden; }
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  opacity: 0;
}
:root[data-theme="night"] .star {
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: var(--peak, 0.8); }
  50% { opacity: 0.15; }
}

.moon {
  position: absolute;
  top: 8%;
  right: 8%;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}
:root[data-theme="night"] .moon { opacity: 1; transform: translateY(0); }

.mote {
  position: absolute;
  bottom: -12px;
  left: var(--x, 50%);
  width: var(--size, 4px);
  height: var(--size, 4px);
  background: var(--mote-color, var(--accent-2));
  box-shadow: 0 0 6px 1px var(--mote-color, var(--accent-2));
  animation: floatUp var(--dur, 12s) ease-in infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes floatUp {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: 0.85; }
  50%  { transform: translate(var(--sway, 24px), -52vh); }
  88%  { opacity: 0.7; }
  100% { transform: translate(0, -106vh); opacity: 0; }
}

.butterfly {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.9;
}
.butterfly__wings {
  display: block;
  animation: flutter 0.35s steps(2) infinite;
  transform-origin: center;
}
@keyframes flutter {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.72); }
}
.butterfly--a { animation: flightA 26s ease-in-out infinite; }
.butterfly--b { animation: flightB 32s ease-in-out infinite; animation-delay: -9s; }
@keyframes flightA {
  0%   { transform: translate(-8vw, 70vh) rotate(0deg); }
  20%  { transform: translate(22vw, 40vh) rotate(8deg); }
  40%  { transform: translate(48vw, 58vh) rotate(-6deg); }
  60%  { transform: translate(68vw, 24vh) rotate(5deg); }
  80%  { transform: translate(88vw, 46vh) rotate(-4deg); }
  100% { transform: translate(-8vw, 70vh) rotate(0deg); }
}
@keyframes flightB {
  0%   { transform: translate(100vw, 30vh) rotate(0deg); }
  25%  { transform: translate(72vw, 64vh) rotate(-7deg); }
  50%  { transform: translate(40vw, 36vh) rotate(6deg); }
  75%  { transform: translate(14vw, 60vh) rotate(-5deg); }
  100% { transform: translate(100vw, 30vh) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-cloud, .mote, .butterfly, .butterfly--a, .butterfly--b, .butterfly__wings,
  .star, .rain-drop, .snow-flake {
    animation: none !important;
    display: none;
  }
  .moon { transition: none; }
  .key-item { animation: none; }
  .dialog-box__cursor.is-ready { animation: none; opacity: 1; }
  .hero__ground { animation: none; }
  .item__chest .chest-closed, .item__chest .chest-open { transition: none; }
  .item:hover .item__chest .chest-open, .item:focus-within .item__chest .chest-open {
    animation: none;
  }
  .map-pin-pop { animation: none !important; opacity: 1; transform: scale(1); }
  .map-modal__tiles { transition: none; }
  .boot-screen { display: none; }
  .boot-screen__hint { animation: none; }
  .badge.is-unlocked { animation: none; }
  .toast { transition: none; }
}

/* ---------- topbar / quest menu ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 14px;
  background: var(--ink);
  flex-wrap: wrap;
}

.topbar__bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar__name {
  font-family: var(--font-head);
  color: var(--paper);
  font-size: 13px;
  white-space: nowrap;
}
.topbar__name-accent { color: var(--accent-2); }

/* Specificity must beat .icon-btn's own `display: inline-flex` (same
   single-class specificity, and .icon-btn comes later in this file) -
   otherwise this button stays visible - and clickable, toggling its own
   label with no visible effect - outside the mobile breakpoint below,
   where .topbar__controls has no collapse styling to respond to it. */
.icon-btn.menu-toggle { display: none; }

.menu {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.menu button {
  background: var(--purple);
  color: var(--paper);
  border: 2px solid var(--paper);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  box-shadow: var(--shadow-hard-sm);
  transition: transform 0.08s ease, background 0.15s ease;
}
.menu button:hover { background: var(--pink); transform: translateY(-2px); }
.menu button:active { transform: translateY(1px); box-shadow: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  box-shadow: var(--shadow-hard-sm);
}
.icon-btn:hover { background: var(--accent-2); }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }

.icon-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn__icon svg { width: 16px; height: auto; }

.xp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent-2);
}
.xp-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok), #a6ff8f);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bottom) 70%);
  text-align: center;
  padding: 40px 16px 0;
}

.hero__sky { position: absolute; inset: 0; z-index: 0; }

.cloud {
  position: absolute;
  opacity: 0.95;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.12));
}
.cloud--1 { top: 10%; left: -14%; animation: drift 38s linear infinite; }
.cloud--2 { top: 24%; left: -24%; animation: drift 52s linear infinite; animation-delay: -10s; }
.cloud--3 { top: 6%; left: -34%; animation: drift 65s linear infinite; animation-delay: -30s; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(140vw); }
}

.hero__ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background-image:
    repeating-linear-gradient(90deg, var(--grass-2) 0 16px, var(--grass-1) 16px 32px);
  border-top: 6px solid var(--dirt);
  box-shadow: inset 0 -70px 0 -10px var(--dirt);
  z-index: 1;
  animation: grassSway 7s ease-in-out infinite;
}
@keyframes grassSway {
  0%, 100% { background-position-x: 0; }
  50% { background-position-x: 8px; }
}

.hero__scenery {
  position: absolute;
  bottom: 90px;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}
.hero__scenery > * {
  position: absolute;
  bottom: 0;
}
.hero__scenery .scenery-tree { filter: drop-shadow(2px 3px 0 rgba(0,0,0,0.2)); }
.hero__scenery .scenery-bush { filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2)); }

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 640px;
}

.hero__mascot { animation: bob 1.8s ease-in-out infinite; filter: drop-shadow(3px 4px 0 rgba(0,0,0,0.25)); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero__title {
  font-size: clamp(22px, 6vw, 40px);
  color: var(--text);
  text-shadow: 3px 3px 0 var(--accent-2);
  margin: 6px 0 0;
}

.hero__role {
  font-family: var(--font-head);
  font-size: clamp(10px, 2.4vw, 14px);
  color: var(--purple);
  margin: 0;
}

.press-start {
  margin-top: 6px;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: var(--shadow-hard);
  animation: pulse 1.6s ease-in-out infinite;
}
.press-start:hover { background: var(--accent-2); }
.press-start:active { transform: translateY(2px); box-shadow: var(--shadow-hard-sm); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---------- dialog box (Pokémon-style text box) ---------- */
.dialog-box {
  position: relative;
  background: var(--box-bg);
  border: 3px solid var(--box-border);
  border-radius: 8px;
  box-shadow: var(--shadow-hard), inset 0 0 0 3px #fff;
  padding: 16px 20px 20px;
  font-family: var(--font-body);
  font-size: 19px;
  text-align: left;
  max-width: 560px;
}
.dialog-box--wide { max-width: 640px; }
.dialog-box__tagline {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--pink);
  margin: 0 0 8px;
}
.dialog-box p { margin: 4px 0; }
.dialog-box__cursor {
  position: absolute;
  bottom: 8px;
  right: 14px;
  color: var(--text);
  opacity: 0;
}
.dialog-box__cursor.is-ready { animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---------- panels ---------- */
.panel {
  padding: 70px 20px;
  max-width: 1080px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.panel.is-visible { opacity: 1; transform: translateY(0); }
.panel--alt { background: #fef1da; border-top: 4px dashed var(--ink); border-bottom: 4px dashed var(--ink); }

.panel__title {
  font-size: clamp(14px, 3vw, 20px);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}
.panel__title-badge {
  background: var(--ink);
  color: var(--accent-2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.panel__hint {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: -14px;
  margin-bottom: 24px;
}

/* ---------- trainer card ---------- */
.trainer-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  background: var(--box-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 24px;
}
.trainer-card__portrait {
  grid-row: 1 / 3;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #cdeffd, #9fe6c2);
  border: 3px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
}
.trainer-card__portrait img { width: 100%; height: 100%; object-fit: cover; }
.trainer-card__info { display: flex; flex-direction: column; gap: 6px; }
.trainer-card__row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.trainer-card__label {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--purple);
  min-width: 70px;
}
.trainer-card__value { font-size: 20px; }
.trainer-card__bio { margin-top: 10px; font-size: 19px; }
.key-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--font-head);
  font-size: 10px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  box-shadow: var(--shadow-hard-sm), 0 0 10px rgba(255, 211, 77, 0.6);
  animation: keyItemGlow 2.4s ease-in-out infinite;
}
.key-item:hover { background: linear-gradient(180deg, #fff1b8, var(--accent-2)); }
@keyframes keyItemGlow {
  0%, 100% { box-shadow: var(--shadow-hard-sm), 0 0 6px rgba(255, 211, 77, 0.45); }
  50% { box-shadow: var(--shadow-hard-sm), 0 0 14px rgba(255, 211, 77, 0.85); }
}
.trainer-card__stats {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  border-top: 2px dashed var(--ink);
  padding-top: 18px;
}
.stat-bar__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-head);
  font-size: 10px;
  margin-bottom: 4px;
}
.stat-bar__track {
  height: 14px;
  background: #e9dcc0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
}
.stat-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ok), #a6ff8f);
  width: 0%;
  transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}

@media (max-width: 600px) {
  .trainer-card { grid-template-columns: 1fr; }
  .trainer-card__portrait { grid-row: auto; margin: 0 auto; }
  .trainer-card__stats { grid-column: 1; }
}

/* ---------- quest log ---------- */
.quest-log { display: flex; flex-direction: column; gap: 20px; }
.quest {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--box-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  padding: 18px 20px;
}
.quest__icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 3px solid var(--ink);
}
.quest--done .quest__icon { background: var(--ok); }
.quest--active .quest__icon { background: var(--accent-2); }
.quest__title { font-size: 20px; font-weight: bold; margin: 0; }
.quest__place { font-size: 17px; color: var(--text-muted); margin: 2px 0; }
.quest__notes { font-size: 16px; margin: 4px 0 0; }
.quest__status {
  font-family: var(--font-head);
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.quest--done .quest__status { background: var(--ok); }
.quest--active .quest__status { background: var(--accent-2); animation: pulse 2s ease-in-out infinite; }

@media (max-width: 560px) {
  .quest { grid-template-columns: 44px 1fr; }
  .quest__status { grid-column: 1 / 3; justify-self: start; }
}

/* ---------- world map (work) ---------- */
.world-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.location {
  position: relative;
  background: linear-gradient(160deg, #d9f7c4, #bdeab0);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 20px;
  padding-top: 54px;
}
.location__pin {
  position: absolute;
  top: -18px;
  left: 20px;
  width: 36px; height: 36px;
  background: var(--danger);
  border: 3px solid var(--ink);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
}
.location__pin svg { transform: rotate(45deg); width: 20px; height: auto; }
.location__role { font-size: 21px; font-weight: bold; margin: 0; }
.location__company { font-family: var(--font-head); font-size: 11px; color: var(--purple); margin: 4px 0; }
.location__period { font-size: 15px; color: #4c5a30; margin: 0 0 10px; }
.location__desc { font-size: 17px; margin: 0; }

/* ---------- item bag (projects) ---------- */
.item-bag {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.item {
  background: var(--box-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  padding: 16px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.item:hover, .item:focus-within { transform: translateY(-6px); box-shadow: var(--shadow-hard); }
.item__chest { position: relative; margin: 0 auto 10px; width: 68px; height: 44px; }
.item__chest .chest-closed,
.item__chest .chest-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.item__chest .chest-closed { opacity: 1; transform: scale(1) rotate(0deg); }
.item__chest .chest-open { opacity: 0; transform: scale(0.7) rotate(-8deg); }
.item:hover .item__chest .chest-closed,
.item:focus-within .item__chest .chest-closed {
  opacity: 0;
  transform: scale(0.8) rotate(8deg);
}
.item:hover .item__chest .chest-open,
.item:focus-within .item__chest .chest-open {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: chestPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chestPop {
  0% { transform: scale(0.55) rotate(-10deg); }
  65% { transform: scale(1.15) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.item__name { font-size: 19px; font-weight: bold; margin: 4px 0; }
.item__tech {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-bottom: 10px;
}
.item__tech span {
  font-family: var(--font-head);
  font-size: 9px;
  background: var(--purple);
  color: var(--paper);
  padding: 4px 8px;
  border-radius: 5px;
}
.item__desc { font-size: 16px; margin: 0 0 10px; }
.item__link {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 10px;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--ink);
  text-decoration: none;
}
.item__link:hover { background: var(--accent-2); }

/* ---------- patch notes ---------- */
.patch-notes { display: flex; flex-direction: column; gap: 18px; max-width: 760px; margin: 0 auto; }
.patch {
  background: var(--box-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  padding: 16px 20px;
}
.patch__version {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 11px;
  background: var(--purple);
  color: var(--paper);
  padding: 5px 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.patch__notes { margin: 0; padding-left: 20px; }
.patch__notes li { font-size: 18px; margin-bottom: 4px; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.npc-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 11px;
  background: var(--purple);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  text-decoration: none;
}
.contact-links a:hover { background: var(--pink); }

/* ---------- footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}

/* ---------- overworld mini-map modal ---------- */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 16, 50, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.map-modal.is-open { opacity: 1; pointer-events: auto; }
.map-modal__panel {
  background: var(--box-bg);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 18px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.2s ease;
}
.map-modal.is-open .map-modal__panel { transform: translateY(0) scale(1); }
.map-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-head);
  font-size: 12px;
  margin-bottom: 14px;
}
.map-modal__hint {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin: 12px 0 0;
}
.map-modal__stage {
  position: relative;
  --tile-size: clamp(24px, 6.2vw, 34px);
  width: calc(var(--tile-size) * 11);
  height: calc(var(--tile-size) * 7);
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
}
.map-modal__tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(11, var(--tile-size));
  grid-template-rows: repeat(7, var(--tile-size));
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.map-modal.is-open .map-modal__tiles { opacity: 1; transform: scale(1); }
.tile { position: relative; }
.tile--grass { background: var(--grass-1); }
.tile--grass-alt { background: var(--grass-2); }
.tile--path { background: #d8b171; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }
.tile--water { background: linear-gradient(135deg, #5ec8f5, #2f8fd4); animation: shimmer 2.4s ease-in-out infinite; }
.tile__tree { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tile__tree svg { width: 90%; height: auto; }
@keyframes shimmer { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

.map-modal__pins { position: absolute; inset: 0; }
.map-pin-pop {
  position: absolute;
  opacity: 0;
  transform: scale(0.3);
}
.map-modal.is-open .map-pin-pop {
  animation: pinPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms + 150ms);
}
@keyframes pinPop {
  0% { opacity: 0; transform: scale(0.3); }
  70% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}
.map-pin {
  background: var(--danger);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 9px;
  box-shadow: var(--shadow-hard-sm);
  cursor: pointer;
  transform: translate(-50%, -100%) rotate(-45deg);
  transition: transform 0.12s ease;
}
.map-pin span { display: inline-block; transform: rotate(45deg); }
.map-pin:hover { transform: translate(-50%, -100%) rotate(-45deg) scale(1.15); }

@media (max-width: 480px) {
  .map-modal__header span { font-size: 10px; }
}

/* ---------- weather toggle ---------- */
.weather-field {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}
.rain-drop {
  position: absolute;
  top: -5%;
  width: 2px;
  height: 16px;
  background: linear-gradient(to bottom, rgba(94, 200, 245, 0), #5ec8f5);
  animation: rainFall linear infinite;
}
@keyframes rainFall {
  0% { transform: translate(0, 0); opacity: 0.9; }
  100% { transform: translate(-18px, 112vh); opacity: 0.6; }
}
.snow-flake {
  position: absolute;
  top: -5%;
  width: var(--size, 4px);
  height: var(--size, 4px);
  background: #ffffff;
  box-shadow: 0 0 3px rgba(255,255,255,0.8);
  animation: snowFall linear infinite;
}
@keyframes snowFall {
  0%   { transform: translate(0, 0); opacity: 0.95; }
  50%  { transform: translate(var(--sway, 20px), 56vh); }
  100% { transform: translate(0, 112vh); opacity: 0.85; }
}

/* ---------- easter-egg: falling leaves + toast ---------- */
.leaf-field {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}
.falling-leaf {
  position: absolute;
  top: -30px;
  animation: leafFall linear forwards;
}
@keyframes leafFall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) translateX(var(--drift, 40px)) rotate(360deg); opacity: 0.9; }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: var(--ink);
  color: var(--accent-2);
  border: 3px solid var(--accent-2);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-head);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-line;
  max-width: 260px;
  box-shadow: var(--shadow-hard);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }

.hero__mascot.is-squish, .npc-scene__mascot.is-squish {
  animation: squish 0.18s ease;
}
@keyframes squish {
  0% { transform: scale(1, 1); }
  40% { transform: scale(1.18, 0.82); }
  100% { transform: scale(1, 1); }
}
.hero__mascot.is-shiny, .npc-scene__mascot.is-shiny {
  filter: drop-shadow(3px 4px 0 rgba(0,0,0,0.25)) drop-shadow(0 0 10px var(--accent-2));
}

/* ---------- decorative scenery reused in panels ---------- */
.scenery-tree, .scenery-bush { opacity: 0.9; }

/* ---------- boot screen ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  /* Safety net: if script.js never runs (blocked, errors out), this
     still lifts the boot screen on its own after a few seconds instead
     of leaving the whole site covered forever. A no-op in the normal
     case, since JS hides/removes it well before this fires. */
  animation: bootFailsafe 0s 4s forwards;
}
@keyframes bootFailsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.boot-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-screen__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px; }
.boot-screen__title {
  font-family: var(--font-head);
  color: var(--paper);
  font-size: clamp(14px, 4vw, 20px);
  text-align: center;
}
.boot-screen__title span { color: var(--accent-2); }
.boot-bar {
  width: min(70vw, 320px);
  height: 14px;
  background: #2a2140;
  border: 3px solid var(--accent-2);
  border-radius: 4px;
  overflow: hidden;
}
.boot-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok), #a6ff8f);
}
.boot-screen__hint {
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--paper);
  opacity: 0.7;
  animation: blink 1.2s steps(2) infinite;
}

/* ---------- scroll compass ---------- */
.compass {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 40;
  background: var(--ink);
  color: var(--accent-2);
  font-family: var(--font-head);
  font-size: 10px;
  padding: 8px 12px;
  border: 2px solid var(--accent-2);
  border-radius: 6px;
  box-shadow: var(--shadow-hard-sm);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.compass.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- achievement badge shelf ---------- */
.badge-shelf__title {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--purple);
  margin: 0 0 16px;
}
.badge-shelf {
  display: grid;
  /* 7 achievements at this width keeps them on one row on a typical
     desktop viewport instead of stranding the last one alone. */
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}
.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: var(--box-bg);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard-sm);
  padding: 14px 10px;
  transition: transform 0.15s ease;
}
.badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}
.badge__icon svg { width: 34px; height: auto; max-height: 40px; }
.badge.is-locked .badge__icon svg { width: 24px; }
.badge__title { font-family: var(--font-head); font-size: 9px; }
.badge__desc { font-size: 14px; color: var(--text-muted); margin: 0; }
.badge.is-locked {
  opacity: 0.55;
  filter: grayscale(1);
}
.badge.is-unlocked {
  animation: badgeUnlock 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgeUnlock {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- collapsible mobile menu ---------- */
@media (max-width: 760px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 0; }
  .topbar__bar { justify-content: space-between; }
  .icon-btn.menu-toggle { display: inline-flex; }

  .topbar__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
  }
  .topbar__controls.is-open {
    max-height: 600px;
    opacity: 1;
    margin-top: 10px;
  }
  .topbar__controls .menu {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar__controls .menu button,
  .topbar__controls > .icon-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar__controls { transition: none; }
}

@media (max-width: 480px) {
  body { font-size: 18px; }
  .compass { left: 8px; bottom: 8px; font-size: 8px; padding: 6px 9px; }
}
