/* ============ Neon Island — Wuhu by day, Vice by night ============ */

:root {
  --font-body: 'M PLUS Rounded 1c', 'Nunito', system-ui, sans-serif;
  --font-script: 'Yellowtail', 'Brush Script MT', cursive;
  --font-display: 'Bungee', 'Impact', system-ui, sans-serif;
  --radius: 22px;
}

/* Day: Wii Sports Resort */
html[data-theme="day"] {
  color-scheme: light;
  --sky1: #3fb4ef; --sky2: #8fdcff; --sky3: #e8f9ff;
  --sun: #fff6b8; --sun2: #ffd23f;
  --sea1: #1fb0e2; --sea2: #0b7fc0;
  --palm: #1d8a5a;
  --panel: rgba(255, 255, 255, 0.9); --panel2: #eaf7ff;
  --line: #bfe9fb; --line-strong: #5cc8f2;
  --text: #1b3550; --muted: #56768f;
  --title-bg: linear-gradient(180deg, #7fd8ff 0%, #2aa6e8 55%, #1c93d6 100%);
  --title-text: #ffffff;
  --accent: #ff3fa4; --accent2: #12b8e6; --accent3: #ffb800;
  --btn-bg: linear-gradient(180deg, #ffffff 0%, #e6f5fd 100%);
  --btn-text: #2a5d86; --btn-border: #cbe8f7; --ring: #3fc3f7;
  --shadow: 0 6px 0 #a6dbf1, 0 14px 30px rgba(10, 90, 140, 0.18);
  --logo-shadow: 0 4px 0 #1c93d6, 0 8px 18px rgba(0, 60, 110, 0.35);
  --field-bg: #ffffff;
  --bubble: #f2faff;
  --map-deep: #1aa7e0; --map-deep2: #1597d0; --map-shallow: #62d3f5; --map-sand: #f5e3a0;
  --map-grass: #79c84b; --map-grass2: #6bb940; --map-road: #9aa0b5; --map-side: #eee8df;
  --map-rock: #8d6f5a; --map-lava: #ff5a2a; --map-pier: #b98a5a; --map-bld: 0.25;
}

/* Night: Vice */
html[data-theme="night"] {
  color-scheme: dark;
  --sky1: #12062e; --sky2: #4a1466; --sky3: #ff5e8a;
  --sun: #ffe45c; --sun2: #ff3f8e;
  --sea1: #2a0f5c; --sea2: #0a0826;
  --palm: #14061f;
  --panel: rgba(24, 11, 48, 0.86); --panel2: #26104c;
  --line: #5b2d8c; --line-strong: #ff4fd8;
  --text: #fbeaff; --muted: #c9a9e6;
  --title-bg: linear-gradient(90deg, #ff3fa4 0%, #b44cff 60%, #4f7bff 100%);
  --title-text: #ffffff;
  --accent: #ff4fd8; --accent2: #3ff0ff; --accent3: #ffd23f;
  --btn-bg: linear-gradient(180deg, #2e1760 0%, #1a0d36 100%);
  --btn-text: #7ff6ff; --btn-border: #6a35a8; --ring: #ff4fd8;
  --shadow: 0 0 0 1px rgba(255, 79, 216, 0.35), 0 0 26px rgba(255, 79, 216, 0.25), 0 14px 30px rgba(0, 0, 0, 0.5);
  --logo-shadow: 0 0 10px #ff4fd8, 0 0 30px #ff4fd8, 0 4px 0 #6d1a8a;
  --field-bg: #150a2c;
  --bubble: #2a1352;
  --map-deep: #1c1250; --map-deep2: #170e44; --map-shallow: #2f2d8c; --map-sand: #b58474;
  --map-grass: #1e6a5a; --map-grass2: #1a5e50; --map-road: #3a2d5c; --map-side: #5a4a78;
  --map-rock: #4a2f45; --map-lava: #ff5a2a; --map-pier: #6e4a52; --map-bld: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--sky2);
}
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- 2D fallback background: sun, sea and palms ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 55%, var(--sky3) 100%);
  transition: background 0.6s;
}
.backdrop .sun {
  position: absolute; left: 50%; bottom: 24vh;
  width: min(52vw, 460px); aspect-ratio: 1;
  transform: translate(-50%, 50%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sun) 10%, var(--sun2) 100%);
  box-shadow: 0 0 80px var(--sun2);
}
html[data-theme="night"] .backdrop .sun {
  -webkit-mask-image: linear-gradient(#000 50%, transparent 50%), repeating-linear-gradient(180deg, transparent 0 7px, #000 7px 22px);
  mask-image: linear-gradient(#000 50%, transparent 50%), repeating-linear-gradient(180deg, transparent 0 7px, #000 7px 22px);
}
.backdrop .sea {
  position: absolute; left: 0; right: 0; bottom: 0; height: 24vh;
  background: linear-gradient(180deg, var(--sea1), var(--sea2));
  overflow: hidden;
}
.backdrop .sea::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 22px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, transparent 40%, #000 60%, transparent 80%, #000);
  mask-image: linear-gradient(90deg, transparent, #000 20%, transparent 40%, #000 60%, transparent 80%, #000);
  opacity: 0.6;
}
html[data-theme="night"] .backdrop .sea::before {
  inset: 0 -50% -40% -50%;
  background:
    linear-gradient(rgba(255, 79, 216, 0.8) 2px, transparent 2px) 0 0 / 80px 40px,
    linear-gradient(90deg, rgba(63, 240, 255, 0.6) 2px, transparent 2px) 0 0 / 80px 40px;
  -webkit-mask-image: none; mask-image: none;
  transform: perspective(260px) rotateX(58deg);
  transform-origin: 50% 0;
  animation: grid-run 2.5s linear infinite;
  opacity: 0.55;
}
@keyframes grid-run { to { background-position: 0 40px, 0 40px; } }
.backdrop svg { position: absolute; bottom: 0; height: 62vh; width: 40vh; color: var(--palm); fill: currentColor; opacity: 0.9; }
.backdrop .palm-l { left: -6vh; }
.backdrop .palm-r { right: -6vh; transform: scaleX(-1); }

/* ---------- 3D background ---------- */
.bg3d { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
.has-3d .bg3d { opacity: 1; }
.has-3d .backdrop { display: none; }
.has-3d .banner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.14));
}
.has-3d .banner-sun, .has-3d .banner-sea, .has-3d .banner-island { display: none; }
html[data-theme="night"].has-3d .banner { background: linear-gradient(180deg, rgba(18, 6, 46, 0.05), rgba(18, 6, 46, 0.3)); }

/* ---------- Page ---------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 20px 28px;
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  height: 240px;
  border-radius: 30px 30px 0 0;
  overflow: hidden;
  border: 4px solid var(--line-strong);
  border-bottom: 0;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 60%, var(--sky3) 100%);
  display: grid;
  place-items: center;
}
.banner-sun {
  position: absolute; left: 50%; top: 150px; width: 260px; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sun), var(--sun2));
  box-shadow: 0 0 60px var(--sun2);
}
html[data-theme="night"] .banner-sun {
  -webkit-mask-image: linear-gradient(#000 45%, transparent 45%), repeating-linear-gradient(180deg, transparent 0 6px, #000 6px 16px);
  mask-image: linear-gradient(#000 45%, transparent 45%), repeating-linear-gradient(180deg, transparent 0 6px, #000 6px 16px);
}
.banner-sea {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  background: linear-gradient(180deg, var(--sea1), var(--sea2));
}
.banner-island { position: absolute; left: 0; bottom: 30px; width: 100%; height: 200px; }
.banner-island .isle { fill: var(--palm); }
.banner-island .isle-far { fill: var(--palm); opacity: 0.55; }
.banner-island .isle-palms { color: var(--palm); fill: var(--palm); }
.banner-island .isle-city rect { fill: var(--palm); }
.banner-island .lava { fill: #ff7a2a; }
html[data-theme="day"] .banner-island .lava { fill: #c9a07a; }
html[data-theme="night"] .banner-island .isle-city rect { stroke: #3ff0ff; stroke-width: 1.5; }
html[data-theme="night"] .banner-island .isle-city rect:nth-child(2n) { stroke: #ff4fd8; }

.logo { position: relative; text-align: center; line-height: 1; margin-top: -14px; }
.logo-top {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(27, 16, 48, 0.55);
  padding: 4px 12px 3px;
  border-radius: 999px;
  text-transform: uppercase;
}
.logo-name {
  margin: 4px 0 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(64px, 12vw, 108px);
  color: var(--accent);
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  text-shadow: var(--logo-shadow);
  transform: rotate(-4deg);
}
.logo-sub {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(18px, 3.6vw, 28px);
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(180deg, #3ff0ff, #1c93d6);
  padding: 2px 14px 0;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
}
html[data-theme="night"] .logo-sub { background: linear-gradient(180deg, #ffd23f, #ff7a45); box-shadow: 0 0 18px #ffd23f88; }

/* ---------- Navigation ---------- */
.nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  padding: 12px;
  background: var(--panel);
  border: 4px solid var(--line-strong);
  border-radius: 0 0 30px 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  margin-bottom: 20px;
}
.wii-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px;
  font: 800 15px/1.2 var(--font-body);
  color: var(--btn-text);
  text-decoration: none;
  background: var(--btn-bg);
  border: 3px solid var(--btn-border);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--btn-border);
  transition: transform 0.12s, box-shadow 0.12s;
}
.wii-btn:hover, .wii-btn:focus-visible {
  outline: none;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 3px 0 var(--btn-border), 0 0 0 4px color-mix(in srgb, var(--ring) 55%, transparent);
}
.wii-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-border); }
.theme-btn { margin-left: auto; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar, .main { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .theme-btn { margin-left: 0; }
}

/* ---------- Wii-style panels ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  backdrop-filter: blur(8px);
}
.panel::before {
  content: ""; position: absolute; inset: 3px 3px auto 3px; height: 40%;
  border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 50% 50% / calc(var(--radius) - 4px) calc(var(--radius) - 4px) 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
}
html[data-theme="night"] .panel::before { background: linear-gradient(180deg, rgba(255, 79, 216, 0.1), transparent); }
.panel > * { position: relative; }
.panel-title {
  margin: -4px -6px 14px;
  padding: 6px 16px;
  font: 800 16px/1.3 var(--font-body);
  text-align: center;
  color: var(--title-text);
  background: var(--title-bg);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}
.big-title {
  margin: 0 0 8px;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 64px);
  line-height: 1.1;
  text-align: center;
  color: var(--accent);
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
  text-shadow: var(--logo-shadow);
}
.welcome p { margin: 0 0 10px; font-size: 16px; }

/* ---------- Profile ---------- */
.profile { display: grid; gap: 12px; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.avatar {
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--panel2), var(--line));
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--line-strong), 0 6px 14px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: grid; place-items: end center;
}
.avatar img, .avatar svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-name { margin: 0; font: 800 22px/1.1 var(--font-body); }
.profile-handle { color: var(--muted); font-size: 13px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800;
  background: var(--panel2); border: 2px solid var(--line);
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #3ddc84); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, #3ddc84) 30%, transparent); }
.status-online .status-dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--dot) 0%, transparent); } }
.status-text {
  margin: 0; padding: 10px 12px; border-radius: 16px;
  background: var(--bubble); border: 2px solid var(--line);
  font-weight: 700; font-size: 14px;
  position: relative;
}
.status-text::before {
  content: ""; position: absolute; top: -9px; left: 36px;
  border: 8px solid transparent; border-top: 0; border-bottom-color: var(--line);
}
.profile-rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.profile-rows li { display: grid; grid-template-columns: 26px 1fr; align-items: start; gap: 4px; }
.profile-rows .k { color: var(--muted); font-size: 12px; font-weight: 700; display: block; line-height: 1.2; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 6px; vertical-align: -1px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; background: var(--accent2); }
.eq i:nth-child(3) { animation-delay: -0.6s; background: var(--accent3); }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.profile-foot { font-size: 11px; color: var(--muted); text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4f6d; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.row-body { min-width: 0; }
.row-body a { color: inherit; text-decoration: none; }
.row-body a:hover { color: var(--accent); text-decoration: underline; }
.muted { color: var(--muted); font-size: 13px; }
.src { color: var(--muted); font-size: 12px; font-weight: 700; }
.last-played { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.np {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  margin-top: 4px; padding: 8px; border-radius: 14px;
  background: var(--bubble); border: 2px solid var(--line);
}
.np-art { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; display: block; background: linear-gradient(135deg, #1db954, #3ff0ff); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }
.np-text { min-width: 0; line-height: 1.3; }
.np-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.np-text .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.np-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1db954, var(--accent2)); transition: width 1s linear; }
.game-cap { display: block; width: 100%; max-width: 231px; margin-top: 6px; border-radius: 10px; border: 2px solid var(--line); }
.admin-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; font-size: 13px; font-weight: 700; }

/* ---------- Guestbook ---------- */
.gb-note { margin: 0 0 8px; font-size: 12px; color: var(--muted); background: var(--bubble); border-radius: 12px; padding: 6px 10px; }
.gb-list {
  list-style: none; margin: 0 0 12px; padding: 4px;
  max-height: 340px; overflow-y: auto;
  display: grid; gap: 8px;
  scrollbar-width: thin;
}
.gb-list li { background: var(--bubble); border: 2px solid var(--line); border-radius: 14px; padding: 6px 10px; font-size: 14px; overflow-wrap: anywhere; }
.gb-meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.gb-name { font-weight: 800; color: var(--accent); }
.gb-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.gb-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.gb-empty { text-align: center; color: var(--muted); font-size: 13px; }
.gb-form { display: grid; gap: 8px; }
.gb-row { display: flex; gap: 8px; }
.gb-row .field { flex: 1; min-width: 0; }
.field {
  font: 700 14px var(--font-body);
  color: var(--text);
  background: var(--field-bg);
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  width: 100%;
}
.field:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent); }
.send-btn { flex: none; }
.gb-status { margin: 0; min-height: 1.2em; font-size: 12px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb-admin { display: flex; gap: 8px; }

/* ---------- Map ---------- */
.map-wrap {
  position: relative;
  width: 100%; max-width: 560px; margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 26px;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: 0 0 0 3px var(--line-strong), inset 0 0 30px rgba(0, 0, 0, 0.2);
  background: var(--map-deep);
}
.map-wrap canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.map-pins { position: absolute; inset: 0; }
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  width: 42px; height: 50px;
  border: 0; padding: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.35));
  transition: transform 0.15s;
}
.pin::before {
  content: ""; position: absolute; left: 50%; top: 0;
  width: 42px; height: 42px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 50% 50% 0 50%;
  background: #fff;
}
.pin span {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
  background: var(--title-bg);
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 14px; height: 6px;
  transform: translateX(-50%); border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }
.pin:hover, .pin:focus-visible, .pin.active { outline: none; transform: translate(-50%, -110%) scale(1.12); }
.pin.active span { box-shadow: 0 0 0 3px var(--accent); }
.map-compass {
  position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font: 16px var(--font-display); color: var(--accent);
  background: #fff; border: 3px solid var(--line-strong);
}
.map-card {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  margin-right: 46px;
  background: var(--panel);
  border: 3px solid var(--line-strong);
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  animation: pop 0.2s ease-out;
}
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.map-card h3 { margin: 0 0 2px; font-size: 16px; }
.map-card p { margin: 0 0 8px; font-size: 14px; }
.map-card .row { display: flex; gap: 8px; justify-content: flex-end; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* ---------- About me ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; }
.facts div { background: var(--bubble); border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 800; }
.facts dd { margin: 0; font-weight: 700; }

/* ---------- Links ---------- */
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700;
  backdrop-filter: blur(8px);
}
.counter { font-family: var(--font-display); letter-spacing: 0.05em; }
.counter b { display: inline-block; min-width: 1.2em; margin: 0 1px; padding: 0 3px; text-align: center; border-radius: 4px; background: #1b1030; color: #7dffb3; font-weight: 400; }
.secret-btn {
  width: 44px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  opacity: 0.35; transition: opacity 0.2s, transform 0.2s;
}
.secret-btn:hover, .secret-btn:focus-visible { opacity: 1; outline: none; animation: wiggle 0.4s ease-in-out 2; }
.secret-btn svg { width: 100%; height: 100%; }
.tape-body { fill: #1b1030; }
.tape-label { fill: #ff4fd8; }
.tape-reel { fill: #fff; stroke: #1b1030; stroke-width: 2; }
.tape-window { fill: #3ff0ff; }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

/* ---------- VHS transition ---------- */
.vhs {
  position: fixed; inset: 0; z-index: 100;
  background: #000 repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 4px);
  color: #fff; font: 28px/1 var(--font-display);
  animation: vhs-in 0.9s steps(6) forwards;
}
.vhs-play { position: absolute; top: 28px; left: 32px; text-shadow: 2px 0 #ff4fd8, -2px 0 #3ff0ff; }
.vhs-date { position: absolute; bottom: 28px; right: 32px; font-size: 20px; }
@keyframes vhs-in { 0% { opacity: 0; filter: blur(4px); } 30% { opacity: 1; } 100% { opacity: 1; filter: none; } }

@media (max-width: 560px) {
  .banner { height: 200px; }
  .banner-sun { width: 180px; top: 120px; }
  .page { padding-inline: 12px; }
  .footer { border-radius: 24px; justify-content: center; text-align: center; }
  .pin { width: 34px; height: 42px; }
  .pin::before { width: 34px; height: 34px; }
  .pin span { width: 26px; height: 26px; font-size: 14px; top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Custom banner image ---------- */
.banner.has-image { background-size: cover; background-position: center; }
.banner.has-image .banner-sun, .banner.has-image .banner-sea, .banner.has-image .banner-island { display: none; }

/* ---------- Bio ---------- */
.bio { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Music button ---------- */
.music-btn {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 10px;
  font: 800 14px var(--font-body); color: var(--btn-text);
  background: var(--btn-bg); border: 3px solid var(--btn-border); border-radius: 999px;
  box-shadow: 0 3px 0 var(--btn-border), 0 8px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.music-btn:hover, .music-btn:focus-visible { outline: none; box-shadow: 0 3px 0 var(--btn-border), 0 0 0 4px color-mix(in srgb, var(--ring) 55%, transparent); }
.music-icon {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--title-bg); color: #fff; font-size: 15px;
}
.music-btn:not(.on) .music-icon { background: #9aa3b5; }
.music-btn.on .music-icon { animation: bob 1.1s ease-in-out infinite; }
.music-btn.waiting { animation: nudge 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-8deg); } }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 88% { transform: scale(1.07); } }
@media (max-width: 560px) { .music-label { display: none; } .music-btn { padding: 6px; } }

/* ---------- Editor ---------- */
.edit-btn { width: 100%; margin: 12px 0 0; }
.ed-pencil { display: none; }
body.editing [data-edit] { outline: 3px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }
body.editing .ed-pencil,
body.editing .panel > .ed-pencil {
  display: grid; place-items: center;
  position: absolute; top: -12px; right: -10px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 3px solid #fff;
  font-size: 15px; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
body.editing .banner > .ed-pencil { top: 10px; right: 10px; }
body.editing .ed-pencil:hover { transform: scale(1.1); }
.editor {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--panel2); color: var(--text);
  border-left: 4px solid var(--line-strong);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  padding-top: env(safe-area-inset-top, 0px);
}
.ed-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--title-bg); color: #fff; font-size: 17px; }
.ed-close { border: 0; background: rgba(255, 255, 255, 0.25); color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.ed-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.ed-tabs button { border: 2px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-text); border-radius: 999px; padding: 4px 10px; font: 800 12px var(--font-body); cursor: pointer; }
.ed-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ed-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; display: grid; gap: 12px; align-content: start; }
.ed-field { display: grid; gap: 4px; }
.ed-field > label { font-size: 12px; font-weight: 800; color: var(--muted); }
.ed-field small, .ed-note { font-size: 12px; color: var(--muted); margin: 0; }
.ed-field textarea.field { border-radius: 16px; resize: vertical; line-height: 1.5; font-weight: 400; }
.ed-field input[type=range] { width: 100%; accent-color: var(--accent); }
.ed-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-row .wii-btn { padding: 6px 12px; font-size: 13px; }
.ed-row2 { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.ed-check { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; cursor: pointer; }
.ed-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.ed-img {
  height: 110px; border-radius: 16px; border: 3px dashed var(--line);
  background: var(--bubble) center / cover no-repeat;
  display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 700;
}
.ed-img.avatar { width: 110px; border-radius: 50%; }
.ed-list { display: grid; gap: 10px; }
.ed-item { display: grid; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--bubble); border: 2px solid var(--line); }
.ed-item-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.ed-item-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-item-bar span { display: flex; gap: 4px; flex: none; }
.ed-item-bar button { border: 2px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-text); border-radius: 10px; width: 30px; height: 28px; cursor: pointer; }
.ed-item-bar button:disabled { opacity: 0.35; cursor: default; }
.ed-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--line); display: grid; gap: 8px; }
.ed-status { margin: 0; min-height: 1.3em; font-size: 13px; font-weight: 700; color: var(--muted); }
.ed-status.warn { color: #d98a00; }
.ed-status.ok { color: #1a9d5c; }
.ed-status.err { color: #e0364f; }
.ed-actions { display: flex; gap: 8px; justify-content: flex-end; }
.ed-save { background: linear-gradient(180deg, #ff86d6, #ff3fa4); color: #fff; border-color: #ffc2e6; }
body.editing .music-btn { right: calc(min(440px, 100vw) + 16px); }
.map-wrap.picking { cursor: crosshair; box-shadow: 0 0 0 4px var(--accent), 0 0 30px var(--accent); }
.map-wrap.picking .pin { pointer-events: none; opacity: 0.6; }
@media (max-width: 700px) {
  .editor { top: auto; height: 78vh; width: 100vw; border-left: 0; border-top: 4px solid var(--line-strong); border-radius: 22px 22px 0 0; }
  body.editing .music-btn { right: 16px; bottom: calc(78vh + 12px); }
}

/* ---------- Performance over the 3D background ----------
   A blurred glass effect over an animated canvas has to be recomputed every frame,
   which is very expensive. Over the 3D we use solid panels instead. */
.has-3d .panel, .has-3d .nav, .has-3d .footer, .has-3d .map-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-theme="day"].has-3d { --panel: rgba(255, 255, 255, 0.94); }
html[data-theme="night"].has-3d { --panel: rgba(24, 11, 48, 0.93); }
.bg3d-toggle {
  border: 2px solid var(--line); background: var(--bubble); color: var(--text);
  border-radius: 999px; padding: 3px 12px; font: 700 12px var(--font-body); cursor: pointer;
}
.bg3d-toggle:hover { border-color: var(--ring); }

/* ---------- Images inside the About me cards ---------- */
.facts > .fact { position: relative; overflow: hidden; }
.fact dt, .fact dd { position: relative; z-index: 1; }
.fact-img {
  position: absolute; z-index: 2; max-width: none; height: auto;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.fact-img.back { z-index: 0; }
.fact-img.pixel { image-rendering: pixelated; }
body.editing .fact-img { pointer-events: auto; cursor: grab; outline: 2px dashed var(--accent); outline-offset: 2px; touch-action: none; }
body.editing .fact-img.dragging { cursor: grabbing; outline-style: solid; }
.ed-sub { display: grid; gap: 8px; padding-top: 6px; border-top: 2px dashed var(--line); }
.ed-img.sticker { height: 90px; background-size: contain; }
