:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f4e9;
  background: #0b1215;
  font-synthesis: none;
  --ink: #f4f4e9;
  --ink-soft: #9bb5b2;
  --cream: #121d21;
  --paper: #0b1215;
  --mint: #62d9b3;
  --mint-dark: #38b896;
  --teal: #79e5c2;
  --gold: #f4bd4f;
  --coral: #f48972;
  --lavender: #9d91dc;
  --line: rgba(148, 205, 194, 0.17);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  --background-rgb: 11, 18, 21;
  --panel-rgb: 18, 29, 33;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: ease-out;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 1ms; }
}

:root[data-color-mode="light"] {
  color-scheme: light;
  color: #264740;
  background: #f8f2d7;
  --ink: #24473f;
  --ink-soft: #506a62;
  --cream: #fffaf0;
  --paper: #f8f2d7;
  --mint: #4fcda5;
  --mint-dark: #176b5b;
  --teal: #1c756b;
  --gold: #8a620c;
  --coral: #b84c3b;
  --line: rgba(36, 71, 63, 0.14);
  --shadow: 0 22px 60px rgba(51, 92, 80, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  background:
    radial-gradient(circle at 8% 7%, rgba(98, 217, 179, 0.32) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 5%, rgba(244, 189, 79, 0.25) 0 3px, transparent 4px),
    linear-gradient(180deg, var(--background-2, #102a30) 0, color-mix(in srgb, var(--background-2, #102a30) 62%, var(--paper)) 32rem, var(--paper) 50rem);
}

:root[data-color-mode="light"] body {
  background:
    radial-gradient(circle at 8% 7%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 5%, rgba(255, 255, 255, 0.65) 0 3px, transparent 4px),
    linear-gradient(180deg, #ccebe4 0, #ebf1d3 32rem, var(--paper) 50rem);
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sky-speckles {
  position: absolute;
  inset: 6rem 0 auto;
  height: 34rem;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    radial-gradient(circle, #fff 0 2px, transparent 2.5px),
    radial-gradient(circle, rgba(54, 143, 124, 0.4) 0 1px, transparent 1.5px);
  background-position: 18% 22%, 77% 15%;
  background-size: 15rem 12rem, 12rem 10rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(var(--panel-rgb), 0.97);
  box-shadow: 0 12px 34px rgba(var(--background-rgb), 0.3);
  backdrop-filter: blur(18px);
  view-transition-name: aniilogs-topbar;
}

:root[data-color-mode="light"] .site-header {
  background: rgba(var(--panel-rgb), 0.97);
  box-shadow: 0 12px 34px rgba(var(--background-rgb), 0.15);
}

.brand { display: inline-flex; align-items: center; gap: 0.65rem; width: fit-content; text-decoration: none; }
.brand-mark { display: block; width: 43px; height: 43px; flex: none; }
.brand-name { color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.brand-name span { color: var(--coral); }

nav { display: flex; align-items: center; gap: 0.35rem; }
nav a { min-height: 36px; padding: 8px 13px; border: 1px solid transparent; border-radius: 999px; color: var(--ink-soft); font-size: 12px; font-weight: 650; text-decoration: none; }
nav a:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--teal); }
nav .nav-disabled, nav .nav-disabled:hover { background: transparent; color: color-mix(in srgb, var(--ink-soft) 62%, var(--paper)); cursor: not-allowed; }

.account-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.account-settings-shortcut { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 20px; text-decoration: none; }
.account-settings-shortcut:hover, .account-settings-shortcut:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.theme-picker-label { display: inline-flex; min-width: 0; align-items: center; flex-direction: column; gap: 2px; color: var(--ink-soft); font-size: 9px; font-weight: 700; line-height: 1; }
.theme-picker-copy { white-space: nowrap; }
.theme-picker { width: 7rem; min-height: 24px; max-width: 7rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--cream) 88%, var(--mint)); color: var(--ink); padding: 2px 24px 2px 10px; font: inherit; font-size: 10px; font-weight: 650; text-align: center; text-align-last: center; cursor: pointer; }
.theme-picker:hover, .theme-picker:focus-visible { border-color: var(--mint); outline: 2px solid color-mix(in srgb, var(--mint) 35%, transparent); outline-offset: 2px; }
.language-picker { width: 38px; height: 34px; flex: 0 0 38px; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--cream) 88%, var(--mint)); color: var(--ink); padding: 0; font: inherit; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 18px; line-height: 1; text-align: center; text-align-last: center; cursor: pointer; }
.language-picker:hover, .language-picker:focus-visible { border-color: var(--mint); outline: 2px solid color-mix(in srgb, var(--mint) 35%, transparent); outline-offset: 2px; }
.account-menu { position: relative; color: var(--ink); }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, #5865f2 62%, var(--line));
  border-radius: 999px;
  background: #5865f2;
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(79, 91, 213, 0.26);
  text-decoration: none;
}
.account-menu-trigger:hover,
.account-menu-trigger:focus-visible,
.account-menu[open] .account-menu-trigger { background: #4752c4; outline: 2px solid color-mix(in srgb, #5865f2 42%, transparent); outline-offset: 2px; }
.discord-icon { width: 19px; height: 19px; flex: 0 0 auto; }
.account-menu-chevron { font-size: 0.86rem; transition: transform 140ms ease; }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: grid;
  width: max-content;
  min-width: 190px;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink);
  padding: 7px;
  box-shadow: 0 18px 44px rgba(5, 17, 19, 0.28);
}
.account-menu-popover a,
.account-menu-popover button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 0.68rem 0.78rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 780;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-popover a:hover,
.account-menu-popover a:focus-visible,
.account-menu-popover button:hover,
.account-menu-popover button:focus-visible { background: color-mix(in srgb, var(--mint) 20%, var(--cream)); color: var(--ink); outline: none; }
.account-menu-popover .account-menu-danger { color: color-mix(in srgb, var(--coral) 55%, var(--ink)); }
.discord-button, .primary-button, .secondary-button, .quiet-button, .avatar-button, .danger-button {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.05rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.discord-button:hover, .primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.discord-button { background: #4f5bd5; color: #fff; box-shadow: 0 7px 18px rgba(79, 91, 213, 0.26); }
.discord-button.is-disabled, .secondary-button.is-disabled { background: rgba(255, 250, 240, 0.58); color: var(--ink-soft); box-shadow: none; cursor: default; }
.avatar-button { background: rgba(98, 217, 179, 0.18); color: var(--ink); }
.quiet-button { background: transparent; color: var(--ink-soft); }
.danger-button { border: 1px solid rgba(244, 137, 114, 0.35); background: rgba(116, 39, 35, 0.35); color: #ffb4a4; }
.danger-button:hover { background: rgba(143, 50, 44, 0.48); }

main { width: min(1180px, 92vw); margin: 0 auto; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  min-height: 690px;
  padding: 5rem 0 6rem;
}
.hero-copy-block { position: relative; z-index: 2; }
.eyebrow, .card-kicker, .coming-soon { color: var(--teal); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow span { color: var(--coral); margin-right: 0.3rem; }
h1 { max-width: 720px; margin: 0.8rem 0 1.4rem; color: var(--ink); font-size: clamp(2.5rem, 5vw, 4.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.045em; }
h1 span { color: var(--coral); white-space: nowrap; }
.hero-copy { max-width: 610px; margin: 0; color: var(--ink-soft); font-size: clamp(1.04rem, 1.8vw, 1.25rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.7rem; }
.primary-button { background: var(--mint); color: var(--on-primary, #0b211c); box-shadow: 0 10px 24px rgba(36, 71, 63, 0.22); }
.primary-button span { display: inline-block; margin-left: 0.35rem; }
.secondary-button { border: 2px solid rgba(36, 71, 63, 0.16); background: rgba(255, 250, 240, 0.58); color: var(--ink); }
.status { min-height: 1.4rem; margin: 1.1rem 0 0; color: var(--ink-soft); font-size: 0.84rem; }
.trail-tags { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.trail-tags li { display: flex; align-items: center; gap: 0.42rem; color: #668078; font-size: 0.78rem; font-weight: 760; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; }
.tag-dot-mint { background: var(--mint); }
.tag-dot-gold { background: var(--gold); }
.tag-dot-coral { background: var(--coral); }

.world-window {
  position: relative;
  min-height: 500px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 48% 52% 45% 55% / 44% 48% 52% 56%;
  background: linear-gradient(165deg, #a7ddd6, #def0d3 68%, #f8e8b7 69%);
  box-shadow: var(--shadow), inset 0 0 0 10px rgba(255, 255, 255, 0.18);
}
.sun { position: absolute; top: 55px; right: 70px; width: 70px; height: 70px; border-radius: 50%; background: #ffe28a; box-shadow: 0 0 0 15px rgba(255, 226, 138, 0.22); }
.cloud { position: absolute; height: 17px; border-radius: 999px; background: rgba(255,255,255,0.72); }
.cloud::before, .cloud::after { content: ""; position: absolute; bottom: 0; border-radius: 50%; background: inherit; }
.cloud::before { left: 12px; width: 31px; height: 31px; }
.cloud::after { right: 10px; width: 24px; height: 24px; }
.cloud-one { top: 75px; left: 56px; width: 88px; }
.cloud-two { top: 145px; right: 32px; width: 62px; transform: scale(0.75); }
.map-card { position: absolute; inset: 122px 45px 62px; overflow: hidden; transform: rotate(2deg); border: 5px solid rgba(255, 255, 255, 0.92); border-radius: 28px; background: #f9f3cf; box-shadow: 0 24px 45px rgba(40, 92, 78, 0.22); }
.map-toolbar { position: relative; z-index: 8; display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; background: rgba(255,250,236,0.94); color: var(--ink); font-size: 0.74rem; font-weight: 860; }
.map-toolbar i { display: inline-block; width: 9px; height: 9px; margin-right: 0.35rem; border-radius: 50%; background: var(--mint); }
.map-progress { color: #779087; font-size: 0.66rem; }
.mini-map { position: absolute; inset: 41px 0 0; overflow: hidden; background: linear-gradient(140deg, #e2edbb, #f5dca3); }
.river { position: absolute; inset: -30% -40% -20% 36%; width: 41%; transform: rotate(-24deg); border-radius: 48%; background: #75cbd1; box-shadow: inset 8px 0 0 rgba(255,255,255,0.22); }
.land { position: absolute; border: 2px solid rgba(63,117,90,0.08); border-radius: 48%; background: #a8d68b; }
.land-one { left: -8%; bottom: 8%; width: 58%; height: 53%; transform: rotate(-10deg); }
.land-two { right: -6%; top: 5%; width: 48%; height: 48%; transform: rotate(12deg); }
.trail { position: absolute; top: 28%; left: 12%; width: 75%; height: 52%; transform: rotate(-11deg); border: 4px dashed rgba(153,104,66,0.45); border-color: rgba(153,104,66,0.45) transparent transparent; border-radius: 50%; }
.map-pin { position: absolute; z-index: 5; display: grid; width: 32px; height: 32px; place-items: center; border: 3px solid #fffbea; border-radius: 50% 50% 50% 12%; transform: rotate(-45deg); box-shadow: 0 5px 12px rgba(52,92,80,0.24); }
.pin-one { top: 24%; left: 22%; background: var(--coral); color: var(--on-coral, #fff); }
.pin-two { top: 35%; right: 19%; background: var(--lavender); color: var(--on-lavender, #221d3b); }
.pin-three { bottom: 13%; left: 44%; background: var(--gold); color: var(--on-highlight, #3a2a00); }
.companion { position: absolute; z-index: 7; right: 20%; bottom: 12%; width: 58px; height: 51px; border: 4px solid #fffbee; border-radius: 52% 48% 48% 52%; background: #4fcda5; box-shadow: 0 7px 16px rgba(35,91,78,0.22); }
.ear { position: absolute; top: -13px; width: 22px; height: 25px; border: 4px solid #fffbee; background: #4fcda5; }
.ear-left { left: 3px; transform: rotate(-25deg); border-radius: 90% 20% 50%; }
.ear-right { right: 2px; transform: rotate(25deg); border-radius: 20% 90% 50%; }
.eye { position: absolute; top: 22px; width: 5px; height: 7px; border-radius: 50%; background: var(--ink); }
.eye-left { left: 16px; }
.eye-right { right: 16px; }
.companion-spark { position: absolute; right: -15px; top: -17px; color: var(--gold); }
.found-bubble { position: absolute; right: -22px; bottom: 47px; z-index: 10; padding: 0.7rem 0.95rem; transform: rotate(-3deg); border: 3px solid #fff; border-radius: 18px 18px 18px 5px; background: var(--coral); color: var(--on-coral, #fff); box-shadow: 0 11px 24px rgba(122,81,65,0.2); font-size: 0.78rem; font-weight: 900; }
.found-bubble span { color: currentColor; }
.floating-leaf { position: absolute; z-index: 9; width: 18px; height: 34px; border-radius: 100% 0 100% 0; background: var(--mint-dark); }
.leaf-one { left: -8px; top: 130px; transform: rotate(30deg); }
.leaf-two { right: 0; top: 255px; transform: rotate(110deg) scale(0.7); background: var(--gold); }

.journey-section { padding: 2rem 0 7rem; }
/* Home page "What's new": one collapsible note per site update, newest first. */
.patch-notes { padding: 0 0 6rem; }
.patch-notes .section-heading { margin-bottom: 1.5rem; }
.patch-note { max-width: 860px; margin: 0 auto; padding: clamp(1.1rem, 2.5vw, 1.8rem) clamp(1.2rem, 3vw, 2.2rem); border: 1px solid var(--line); border-radius: 26px; background: var(--cream); box-shadow: var(--shadow); }
.patch-note > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 1rem; cursor: pointer; list-style: none; }
.patch-note > summary::-webkit-details-marker { display: none; }
.patch-note-title::before { content: "▸"; display: inline-block; margin-right: 0.45rem; color: var(--mint-dark); transition: transform 160ms ease; }
.patch-note[open] .patch-note-title::before { transform: rotate(90deg); }
.patch-note-title { flex: 1 1 18rem; color: var(--ink); font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: 800; }
.patch-note-date { color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.patch-note ul { display: grid; gap: 0.6rem; margin: 1.1rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); line-height: 1.55; }
.patch-note li::marker { color: var(--mint-dark); }
.patch-note strong { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .patch-note-title::before { transition: none; } }
.section-heading { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.section-heading h2 { margin: 0.55rem 0 0.9rem; color: var(--ink); font-size: clamp(2.15rem, 4vw, 3.6rem); font-weight: 760; line-height: 1.02; letter-spacing: -0.04em; }
.section-heading > p:last-child { color: var(--ink-soft); line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; }
.feature-card { position: relative; min-height: 275px; overflow: hidden; padding: clamp(1.5rem, 3vw, 2.5rem); border: 2px solid rgba(255,255,255,0.7); border-radius: 34px; box-shadow: 0 14px 35px rgba(69,100,76,0.08); }
.map-feature { grid-row: span 2; min-height: 566px; background: #cfead0; }
.item-feature { background: #ffe6ad; }
.profile-feature { background: #e3dcf5; }
.card-icon { display: grid; width: 47px; height: 47px; place-items: center; transform: rotate(-4deg); border: 2px solid rgba(36,71,63,0.13); border-radius: 17px 14px 18px 12px; font-size: 1.5rem; font-weight: 900; }
.map-icon { background: var(--mint); }
.item-icon { background: var(--gold); }
.profile-icon { background: var(--lavender); color: #fff; }
.card-kicker { margin: 1.5rem 0 0.5rem; }
.feature-card h3 { margin: 0 0 0.75rem; color: var(--ink); font-size: clamp(1.75rem, 3.2vw, 2.65rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.035em; }
.feature-card > p:not(.card-kicker) { position: relative; z-index: 4; max-width: 490px; color: #58726a; line-height: 1.6; }
.coming-soon { position: relative; z-index: 5; display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.2rem; padding: 0.55rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.55); letter-spacing: 0.07em; }
.coming-soon i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.profile-editor {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--lavender) 45%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--cream) 84%, transparent);
  color: var(--ink);
}
.profile-editor-heading { display: grid; gap: 0.15rem; }
.profile-editor-heading strong { font-size: 0.9rem; }
.profile-editor-heading small { color: var(--ink-soft); font-size: 0.72rem; line-height: 1.35; }
.profile-editor label { display: grid; gap: 0.3rem; color: var(--ink-soft); font-size: 0.7rem; font-weight: 800; }
.profile-editor input,
.profile-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.58rem 0.66rem;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  resize: vertical;
}
.profile-editor input:focus,
.profile-editor textarea:focus { border-color: var(--lavender); outline: 2px solid color-mix(in srgb, var(--lavender) 35%, transparent); outline-offset: 1px; }
.profile-editor-actions { display: flex; min-height: 32px; align-items: center; gap: 0.65rem; }
.profile-editor-actions button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--lavender);
  color: var(--on-lavender, #fff);
  padding: 0.48rem 0.72rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}
.profile-editor-actions button:disabled { cursor: wait; opacity: 0.65; }
.profile-editor-actions [role="status"] { color: var(--ink-soft); font-size: 0.67rem; line-height: 1.3; }
.card-scenery { position: absolute; inset: auto 0 0; height: 45%; }
.scenery-hill { position: absolute; bottom: -28%; width: 80%; height: 115%; border-radius: 50%; }
.hill-back { right: -25%; background: #86c99c; }
.hill-front { left: -27%; bottom: -48%; background: #69b889; }
.scenery-pin { position: absolute; right: 23%; top: 25%; display: grid; width: 54px; height: 54px; place-items: center; border: 5px solid #fff7de; border-radius: 50% 50% 50% 12%; transform: rotate(-45deg); background: var(--coral); color: #fff; font-size: 1.2rem; box-shadow: 0 10px 22px rgba(75,108,86,0.18); }

footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 2rem 4vw; border-top: 1px solid var(--line); background: rgba(255,250,235,0.42); color: #6b827b; font-size: 0.82rem; }
footer a { font-weight: 800; text-decoration: none; }
.footer-brand { color: var(--ink); font-size: 1rem; }
.footer-brand span { color: var(--coral); }
.footer-links { display: flex; gap: 1rem; }

:root:not([data-color-mode="light"]) nav a:hover,
:root:not([data-color-mode="light"]) .secondary-button,
:root:not([data-color-mode="light"]) .coming-soon {
  background: rgba(var(--accent-rgb), 0.13);
  color: color-mix(in srgb, var(--accent) 34%, var(--ink));
}

:root:not([data-color-mode="light"]) .primary-button {
  background: var(--mint);
  color: var(--on-primary, #0b211c);
}

:root:not([data-color-mode="light"]) .found-bubble {
  color: var(--on-coral, #2b1713);
}

:root:not([data-color-mode="light"]) .found-bubble span {
  color: currentColor;
}

:root[data-color-mode="light"] .trail-tags li,
:root[data-color-mode="light"] .map-progress {
  color: var(--ink-soft);
}

:root:not([data-color-mode="light"]) .world-window {
  border-color: rgba(98, 217, 179, 0.22);
  background: linear-gradient(165deg, #153b41, #17312d 68%, #3f3420 69%);
  box-shadow: var(--shadow), inset 0 0 0 10px rgba(98, 217, 179, 0.05);
}

:root:not([data-color-mode="light"]) .map-card {
  border-color: rgba(244, 244, 233, 0.2);
  background: #152328;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.4);
}

.profile-overview { padding: 0 0 6rem; }
.profile-overview-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.profile-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0.35rem 0 0.4rem; }
.profile-name-row h2 { margin: 0; }
.profile-presence { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.2rem 0.7rem; border-radius: 999px; background: color-mix(in srgb, var(--paper) 60%, transparent); color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; }
.profile-presence[hidden] { display: none; }
.profile-presence::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18), 0 0 10px 2px rgba(61, 220, 132, 0.75); animation: presence-glow 2.4s ease-in-out infinite; }
.profile-presence[data-state="offline"]::before { background: #f0525a; box-shadow: 0 0 0 3px rgba(240, 82, 90, 0.18), 0 0 8px 1px rgba(240, 82, 90, 0.6); animation: none; }
.profile-presence[data-state="afk"]::before { background: #f5b942; box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.18), 0 0 8px 1px rgba(245, 185, 66, 0.6); animation: none; }
@keyframes presence-glow { 50% { box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.1), 0 0 16px 4px rgba(61, 220, 132, 0.9); } }
@media (prefers-reduced-motion: reduce) { .profile-presence::before { animation: none; } }
.profile-overview-header h2 { margin: 0.35rem 0 0.4rem; color: var(--ink); font-size: clamp(1.9rem, 3.5vw, 2.8rem); font-weight: 760; line-height: 1.05; letter-spacing: -0.035em; }
.profile-avatar { flex: none; width: 64px; height: 64px; border: 3px solid var(--lavender); border-radius: 50%; object-fit: cover; }
.profile-overview-bio, .profile-overview-characters { margin: 0.2rem 0 0; color: var(--ink-soft); line-height: 1.5; }
.profile-overview-characters { font-size: 0.82rem; }
.profile-overview-status { min-height: 1.2em; margin: 0 0 0.8rem; color: var(--ink-soft); font-size: 0.82rem; }
.profile-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.profile-panel { min-width: 0; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: 24px; background: color-mix(in srgb, var(--cream) 88%, transparent); color: var(--ink); }
.profile-panel h3 { margin: 0 0 0.75rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.profile-panel p { margin: 0; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.5; }
.profile-panel h4 { margin: 0.9rem 0 0.35rem; color: var(--teal); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.profile-panel h4:first-child { margin-top: 0; }
.profile-photos { grid-column: 1 / -1; }
.profile-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.profile-photo { display: grid; gap: 0.4rem; margin: 0; }
.profile-photo > a { display: block; overflow: hidden; border-radius: 16px; background: var(--line); }
.profile-photo > a img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.2s ease; }
.profile-photo > a:hover img { transform: scale(1.02); }
.profile-photo figcaption { display: grid; gap: 0.35rem; color: var(--ink-soft); font-size: 0.78rem; }
.profile-photo-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.profile-photo-aniimo, .profile-photo-place { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem 0.15rem 0.2rem; border-radius: 999px; background: color-mix(in srgb, var(--paper) 70%, transparent); color: var(--ink); font-size: 0.76rem; text-decoration: none; }
.profile-photo-place { padding-left: 0.55rem; }
.profile-photo-aniimo img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.profile-photo-aniimo:hover, .profile-photo-place:hover { background: var(--line); }
.profile-rows { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.profile-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0.2rem 0.75rem; padding: 0.45rem 0.6rem; border-radius: 12px; background: color-mix(in srgb, var(--paper) 60%, transparent); font-size: 0.86rem; }
.profile-rows li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-rows small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.74rem; }
.profile-rows strong { font-variant-numeric: tabular-nums; }
.profile-position { color: var(--teal); font-weight: 900; font-variant-numeric: tabular-nums; text-decoration: none; }
.profile-position:hover { text-decoration: underline; }
.profile-rows li > .profile-rank { display: inline-flex; align-items: center; gap: 0.5rem; }
.profile-rank-icon { flex: none; width: 34px; height: 34px; object-fit: contain; }
.profile-meter { height: 6px; margin-top: 0.3rem; grid-column: 1 / -1; overflow: hidden; border-radius: 999px; background: var(--line); }
.profile-meter i { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.profile-game-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 0.5rem; margin: 0 0 0.4rem; padding: 0; list-style: none; }
.profile-game-stats[hidden] { display: none; }
.profile-game-stat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.45rem 0.7rem; border-radius: 999px; background: color-mix(in srgb, var(--paper) 60%, transparent); font-size: 0.84rem; }
.profile-game-stat-icon { width: 28px; height: 28px; object-fit: contain; }
.profile-game-stat-label { color: var(--ink-soft); line-height: 1.25; overflow-wrap: anywhere; }
.profile-game-stat strong { font-variant-numeric: tabular-nums; }
.profile-panel-soon { border-style: dashed; background: transparent; }

:root:not([data-color-mode="light"]) .map-toolbar {
  background: rgba(18, 29, 33, 0.95);
}

:root:not([data-color-mode="light"]) .mini-map {
  filter: saturate(0.82) brightness(0.7);
}

:root:not([data-color-mode="light"]) .feature-card {
  border-color: rgba(148, 205, 194, 0.14);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.24);
}

:root:not([data-color-mode="light"]) .map-feature { background: #142d28; }
:root:not([data-color-mode="light"]) .item-feature { background: #332b1c; }
:root:not([data-color-mode="light"]) .profile-feature { background: #25233b; }
:root:not([data-color-mode="light"]) .feature-card > p:not(.card-kicker),
:root:not([data-color-mode="light"]) .trail-tags li,
:root:not([data-color-mode="light"]) footer { color: var(--ink-soft); }
:root:not([data-color-mode="light"]) footer { background: rgba(10, 18, 21, 0.72); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .world-window { width: min(590px, 100%); min-height: 470px; margin: 0 auto; }
}
@media (max-width: 820px) {
  .site-header { grid-template-areas: "brand account" "nav nav"; grid-template-columns: minmax(0, 1fr) auto; width: 100%; margin: 0; border-radius: 0; }
  .site-header .brand { grid-area: brand; }
  .site-header nav { grid-area: nav; display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-header .account-actions { grid-area: account; }
  .theme-picker { width: 6.75rem; max-width: 6.75rem; }
  .account-menu-trigger > span:not(.account-menu-chevron) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; }
  .account-sign-in { width: 36px; min-height: 36px; justify-content: center; padding: 0; font-size: 0; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .discord-button { padding-inline: 0.78rem; }
  .hero { min-height: 0; padding: 4rem 0; }
  h1 { font-size: clamp(2.5rem, 11vw, 3.65rem); }
  .world-window { min-height: 420px; }
  .map-card { inset: 108px 24px 50px; }
  .found-bubble { right: -4px; }
  .feature-grid { grid-template-columns: 1fr; }
  .map-feature { grid-row: auto; min-height: 460px; }
  footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .world-window { animation: float-in 650ms ease-out both; }
  .companion-spark { animation: twinkle 1.8s ease-in-out infinite; }
  @keyframes float-in { from { opacity: 0; transform: translateY(18px) rotate(1deg); } to { opacity: 1; transform: translateY(0) rotate(0); } }
  @keyframes twinkle { 50% { transform: rotate(35deg) scale(1.3); } }
}

/* Profile visibility opt-in and the public link */
.profile-editor label.profile-public-toggle { display: flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; }
.profile-public-toggle input { width: auto; flex: none; }
.profile-public-toggle input { margin-top: 0.2rem; }
.profile-public-toggle small { display: block; opacity: 0.75; font-size: 0.82em; }
.profile-public-link { margin: 0; font-size: 0.85em; overflow-wrap: anywhere; }
.profile-stars { display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle; }
.profile-star { width: 1em; height: 1em; }

/* Inside the AniiLogs Companion app (theme-shell.js): the app's own tabs replace the site's logo, page links and footer */
html[data-embed="app"] .site-header .brand, html[data-embed="app"] .site-header nav,
html[data-embed="app"] .app-topbar-brand, html[data-embed="app"] .app-topbar nav,
html[data-embed="app"] body > footer { display: none !important; }

/* The profile page (/?view=profile): only the profile, with a player search at the top */
body.profile-page main > section:not(#my-profile) { display: none; }
body.profile-page #my-profile { margin-top: 1.5rem; }
.profile-search { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.profile-search-field { flex: 1 1 18rem; max-width: 34rem; }
.profile-search-field input { width: 100%; min-height: 2.6rem; padding: 0.55rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2, rgba(255, 255, 255, 0.06)); color: var(--text, inherit); font: inherit; }
.profile-search-field input:focus-visible { outline: none; border-color: var(--accent, var(--mint)); box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 98, 217, 179), 0.22); }
.profile-search-results { position: absolute; top: calc(100% + 0.35rem); left: 0; z-index: 30; width: min(34rem, 100%); margin: 0; padding: 0.35rem;
  list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--panel, #121d21); box-shadow: var(--shadow); max-height: 22rem; overflow-y: auto; }
.profile-search-results[hidden] { display: none; }
.profile-search-results a { display: grid; gap: 0.1rem; padding: 0.55rem 0.75rem; border-radius: 10px; color: inherit; text-decoration: none; }
.profile-search-results a:hover, .profile-search-results a:focus-visible { outline: none; background: rgba(var(--accent-rgb, 98, 217, 179), 0.14); }
.profile-search-results small { color: var(--muted, var(--ink-soft)); font-size: 0.78rem; }
.profile-search-empty { padding: 0.6rem 0.75rem; color: var(--muted, var(--ink-soft)); font-size: 0.85rem; }
.profile-search-back { font-size: 0.88rem; }
.profile-search-back[hidden], .profile-signin[hidden], .profile-edit[hidden] { display: none; }
.profile-signin { display: grid; justify-items: start; gap: 0.5rem; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); color: var(--text); padding: 1.3rem 1.4rem; }
.profile-signin strong { font-size: 1.1rem; }
.profile-signin p { margin: 0; color: var(--muted, var(--ink-soft)); }
.profile-edit { margin: 0 0 1.25rem; }
.profile-edit > summary { cursor: pointer; font-weight: 700; color: var(--accent, var(--mint)); }
.profile-edit > form { margin-top: 0.75rem; max-width: 34rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: the logo alone and the theme menu without its caption, so the theme menu no longer covers the name. */
@media (max-width: 560px) {
  .site-header .brand-name,
  .theme-picker-copy { display: none; }
}
