:root {
  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Strict 3-size body scale below hero */
  --text-heading: 1.18rem;
  --text-body: 0.94rem;
  --text-sm: 0.8125rem;

  --accent: #9cc4ff;
  --accent-soft: rgba(156, 196, 255, 0.18);
  --text-title: #ffffff;
  --text-body-color: rgba(242, 246, 255, 0.92);
  --text-muted: rgba(204, 218, 242, 0.72);
  --text-shadow: 0 1px 10px rgba(4, 8, 18, 0.5);

  --scrim-opacity: 0.34;
  --glass-fill: linear-gradient(
    160deg,
    rgba(11, 15, 24, 0.34) 0%,
    rgba(8, 12, 22, 0.28) 55%,
    rgba(14, 19, 30, 0.36) 100%
  );
  --glass-shadow:
    inset 0 1px 1px rgba(232, 244, 255, 0.36),
    inset 0 -1px 1px rgba(176, 212, 255, 0.16),
    inset 0 0 22px rgba(4, 8, 20, 0.24),
    0 22px 52px -12px rgba(3, 6, 16, 0.56);

  --hairline: rgba(210, 228, 255, 0.13);
}

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

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.58;
  color: var(--text-body-color);
  background-color: #060a14;
  overflow-x: hidden;
}

.svg-defs {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Fixed Shorekeeper Video Backdrop & Scrim */
.bg-backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
}

.bg-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 42%;
}

.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 10, 20, var(--scrim-opacity)) 0%,
    rgba(6, 10, 20, calc(var(--scrim-opacity) * 0.55)) 50%,
    rgba(5, 9, 18, calc(var(--scrim-opacity) * 1.08)) 100%
  );
  transition: background-color 240ms ease-out;
}

.starlight-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Click-to-Enter Liquid Glass Veil */
.entry-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 9, 18, 0.56);
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.entry-veil.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 320ms;
}

.entry-veil-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.entry-veil-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 84vw);
  padding: 26px 38px;
  border: 0;
  border-radius: 30px;
  background: var(--glass-fill);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  box-shadow: var(--glass-shadow);
  color: var(--text-title);
  font-family: var(--font-sans);
  cursor: pointer;
  isolation: isolate;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease-out;
}

.entry-veil-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(224, 240, 255, 0.54) 0%,
    rgba(170, 208, 255, 0.14) 40%,
    rgba(170, 208, 255, 0.08) 64%,
    rgba(206, 228, 255, 0.38) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.entry-veil-card:hover {
  transform: translateY(-2px) scale(1.015);
}

.entry-veil-card:active {
  transform: scale(0.985);
}

.entry-sparkle {
  color: var(--accent);
  display: inline-flex;
  filter: drop-shadow(0 0 10px rgba(156, 196, 255, 0.55));
}

.entry-title {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.entry-sub {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.entry-silent-link {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 160ms ease-out;
}

.entry-silent-link:hover {
  color: var(--text-title);
}

/* Main Bento Shell */
.shell {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(32px, 5.5vh, 58px) 20px 104px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Celestial Liquid Glass Card */
.glass-card {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  padding: 24px 26px;
  background: var(--glass-fill);
  backdrop-filter: blur(8px) saturate(108%);
  -webkit-backdrop-filter: blur(8px) saturate(108%);
  box-shadow: var(--glass-shadow);
  text-shadow: var(--text-shadow);
  isolation: isolate;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(224, 240, 255, 0.5) 0%,
    rgba(170, 208, 255, 0.12) 38%,
    rgba(170, 208, 255, 0.07) 64%,
    rgba(206, 228, 255, 0.36) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 0%),
    rgba(196, 222, 255, 0.11),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 220ms ease-out;
  pointer-events: none;
  z-index: 1;
}

.glass-card:hover::after {
  opacity: 1;
}

.glass-card > * {
  position: relative;
  z-index: 3;
}

.card-heading {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text-title);
}

/* 1. Hero Profile + Socials */
.card-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.avatar-frame {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(224, 240, 255, 0.36);
  background: rgba(156, 196, 255, 0.1);
  -webkit-mask-image: radial-gradient(circle 12px at 67px 67px, transparent 11.5px, #000 12px);
  mask-image: radial-gradient(circle 12px at 67px 67px, transparent 11.5px, #000 12px);
}

.avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-decoration {
  position: absolute;
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  pointer-events: none;
  z-index: 2;
}

.discord-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}

.discord-status svg {
  display: block;
}

.discord-status .st-online,
.discord-status .st-idle,
.discord-status .st-dnd,
.discord-status .st-offline {
  display: none;
}

.discord-status[data-status="online"] .st-online,
.discord-status[data-status="idle"] .st-idle,
.discord-status[data-status="dnd"] .st-dnd,
.discord-status[data-status="offline"] .st-offline {
  display: block;
}

.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.name-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
}

.name-line h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3.6vw, 2.25rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text-title);
}

.handle-tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.pronouns-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.custom-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(226, 236, 255, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-status img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-bio {
  margin: 0;
  max-width: 62ch;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-body-color);
}

.hero-interests {
  margin: -6px 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.hero-divider {
  height: 1px;
  background: var(--hairline);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: rgba(186, 214, 255, 0.1);
  border: 1px solid rgba(206, 228, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(236, 246, 255, 0.26);
  color: var(--text-title);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pill:hover {
  background: rgba(186, 214, 255, 0.18);
  border-color: rgba(218, 236, 255, 0.38);
  transform: translateY(-1px);
}

.pill:active {
  transform: scale(0.98);
}

.pill-split {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.pill-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 11px 0 15px;
  border: 0;
  background: transparent;
  color: var(--text-title);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  text-shadow: inherit;
  cursor: pointer;
}

.pill-main:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pill-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px 0 9px;
  border-left: 1px solid rgba(206, 228, 255, 0.18);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms ease-out, background-color 150ms ease-out;
}

.pill-ext:hover {
  color: var(--text-title);
  background: rgba(255, 255, 255, 0.08);
}

.pill-icon {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.mono-mark {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

/* 2. Animated Word-by-Word Karaoke Drawer */
.lyrics-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  margin-bottom: -16px;
  transition:
    grid-template-rows 340ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms ease-out,
    margin-bottom 340ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 340ms;
}

.lyrics-drawer.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-bottom: 0;
  transition:
    grid-template-rows 340ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease-out 40ms,
    margin-bottom 340ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.lyrics-drawer-inner {
  overflow: hidden;
  min-height: 0;
}

.card-lyrics {
  padding: 20px 26px;
}

.lyrics-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.lyrics-track-meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lyrics-viewport {
  position: relative;
  height: 176px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.lyrics-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 68px 0;
  will-change: transform;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lyric-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.08em;
  border: 0;
  background: transparent;
  padding: 2px 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: rgba(214, 228, 252, 0.34);
  cursor: pointer;
  opacity: 0.44;
  filter: blur(1.2px);
  transform: scale(0.985);
  transform-origin: left center;
  transition: opacity 240ms ease-out, filter 240ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lyric-line.is-near {
  opacity: 0.66;
  filter: blur(0.6px);
}

.lyric-line.is-far {
  opacity: 0.24;
  filter: blur(2.1px);
}

.lyric-line.is-active {
  opacity: 1;
  filter: blur(0);
  transform: scale(1.03);
}

.lyric-line:hover {
  opacity: 0.92;
  filter: blur(0);
}

.lyric-word {
  display: inline-block;
  white-space: pre;
  color: transparent;
  background-image: linear-gradient(
    90deg,
    #ffffff var(--p, 0%),
    rgba(208, 224, 250, 0.34) var(--p, 0%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), filter 180ms ease-out;
}

.lyric-word.is-sung {
  --p: 100%;
}

.lyric-word.is-singing {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 10px rgba(156, 196, 255, 0.54));
}

.lyric-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 18px;
}

.lyric-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(180, 212, 255, 0.45);
  transition: background-color 200ms ease-out, transform 200ms ease-out;
}

.lyric-line.is-active .lyric-dots span {
  background: var(--accent);
}

/* 3. Mid Grid: Live Presence + Scalloped Clock */
.mid-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 16px;
  align-items: stretch;
}

.mid-grid.is-clock-only {
  grid-template-columns: 1fr;
}

.card-presence {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.presence-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 14px;
}

.presence-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.presence-art {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(214, 232, 255, 0.24);
  background: rgba(156, 196, 255, 0.08);
}

.presence-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.presence-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-title);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.presence-sub {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-album {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(196, 220, 255, 0.16);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fbaff, #e8f2ff);
  transition: width 350ms linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.presence-empty {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-muted);
}

/* Scalloped Wavy Liquid Glass Clock */
.card-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 22px;
}

.clock-stage {
  position: relative;
  width: 208px;
  height: 208px;
  display: grid;
  place-items: center;
}

.scalloped-clock {
  width: 196px;
  height: 196px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 12px 26px rgba(3, 8, 22, 0.45));
}

.clock-digits text {
  font-family: var(--font-sans);
  font-size: 58px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  fill: rgba(206, 226, 255, 0.34);
  user-select: none;
}

.clock-pebble {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(164, 198, 255, 0.22), rgba(76, 114, 192, 0.18));
  border: 1px solid rgba(220, 238, 255, 0.34);
  backdrop-filter: blur(8px) saturate(112%);
  -webkit-backdrop-filter: blur(8px) saturate(112%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 18px rgba(4, 9, 24, 0.38);
  color: var(--text-title);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(4, 8, 20, 0.45);
  z-index: 4;
}

.pebble-day {
  top: 6px;
  left: 4px;
  border-radius: 38% 62% 52% 48% / 44% 38% 62% 56%;
}

.pebble-month {
  right: 4px;
  bottom: 6px;
  border-radius: 56% 44% 58% 42% / 46% 58% 42% 54%;
}

.clock-caption {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.clock-label {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--text-body-color);
}

.clock-ampm {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* 4. AniList Showcase */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.anime-heading-group {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.anilist-stats {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.filter-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 999px;
  background: rgba(186, 214, 255, 0.08);
  border: 1px solid rgba(206, 228, 255, 0.18);
}

.filter-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(176, 208, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(240, 248, 255, 0.34);
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-toggle.is-watching .filter-thumb {
  transform: translateX(100%);
}

.filter-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 5px 15px;
  border-radius: 999px;
  text-shadow: none;
  cursor: pointer;
  transition: color 180ms ease-out;
}

.filter-btn:hover,
.filter-btn.is-active {
  color: var(--text-title);
}

.top-anime-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.anime-poster-card {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(214, 232, 255, 0.22);
  background: rgba(14, 22, 42, 0.65);
  text-decoration: none;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease-out;
}

.anime-poster-card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 232, 255, 0.5);
}

.anime-poster-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.anime-poster-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 9px 9px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 9, 20, 0.92) 72%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anime-rank {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}

.anime-title {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-title);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel-divider {
  height: 1px;
  margin: 18px 0 14px;
  background: var(--hairline);
}

.character-spotlight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: background-color 160ms ease-out;
}

.character-spotlight:hover {
  background: rgba(186, 214, 255, 0.08);
}

.character-portrait {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(214, 232, 255, 0.28);
}

.character-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.character-note {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.character-names {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.character-names strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-title);
}

.character-native {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}

.character-arrow {
  flex-shrink: 0;
}

.watching-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.watching-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(210, 228, 255, 0.14);
  background: rgba(186, 214, 255, 0.06);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.watching-item:hover {
  background: rgba(186, 214, 255, 0.12);
  border-color: rgba(214, 232, 255, 0.3);
}

.watching-cover {
  width: 46px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.watching-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.watching-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watching-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.watching-bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(196, 220, 255, 0.16);
  overflow: hidden;
}

.watching-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.watching-ep {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}

.watching-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-body-color);
  text-decoration: none;
}

.text-link:hover {
  color: var(--text-title);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer {
  padding: 6px 4px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-shadow: var(--text-shadow);
}

/* Floating Liquid Glass Mini Player */
.mini-player {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(330px, calc(100vw - 24px));
  padding: 7px 10px 7px 9px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(155deg, rgba(16, 24, 42, 0.62), rgba(10, 14, 28, 0.56));
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}

@media (min-width: 1360px) {
  .mini-player {
    left: auto;
    right: 20px;
    bottom: 20px;
    transform: none;
    width: auto;
    max-width: 266px;
  }
}

.mini-player[hidden] {
  display: none;
}

.mini-player::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(224, 240, 255, 0.48) 0%,
    rgba(170, 208, 255, 0.14) 50%,
    rgba(206, 228, 255, 0.34) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.player-cover {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(220, 238, 255, 0.28);
}

.player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.player-title {
  font-size: var(--text-sm);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.player-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(186, 214, 255, 0.12);
  color: var(--text-title);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out, transform 140ms ease-out;
}

.player-btn:hover {
  background: rgba(186, 214, 255, 0.24);
}

.player-btn:active {
  transform: scale(0.94);
}

.player-btn.is-active {
  background: rgba(156, 196, 255, 0.28);
  color: #ffffff;
}

/* Liquid Glass QR Modal */
.glass-modal {
  position: fixed;
  margin: auto;
  padding: 24px 26px;
  width: min(350px, calc(100vw - 32px));
  border: 0;
  border-radius: 28px;
  background: linear-gradient(
    160deg,
    rgba(18, 24, 40, 0.68) 0%,
    rgba(10, 14, 26, 0.62) 55%,
    rgba(18, 24, 40, 0.7) 100%
  );
  backdrop-filter: blur(14px) saturate(110%);
  -webkit-backdrop-filter: blur(14px) saturate(110%);
  box-shadow: var(--glass-shadow);
  color: var(--text-body-color);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-modal[open]:not(.is-closing) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .glass-modal[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

.glass-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(224, 240, 255, 0.48) 0%,
    rgba(170, 208, 255, 0.12) 45%,
    rgba(206, 228, 255, 0.34) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.glass-modal::backdrop {
  background: rgba(4, 7, 15, 0.56);
  backdrop-filter: blur(5px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 800;
  color: var(--text-title);
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-title);
  font-size: 0.9rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.qr-modal {
  text-align: center;
}

.qr-plate {
  width: 204px;
  height: 204px;
  margin: 0 auto 14px;
  padding: 12px;
  border-radius: 20px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-url {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.modal-action-btn {
  width: 100%;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(214, 232, 255, 0.28);
  background: rgba(156, 196, 255, 0.18);
  color: var(--text-title);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.modal-action-btn:hover {
  background: rgba(156, 196, 255, 0.28);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(12, 18, 34, 0.88);
  border: 1px solid rgba(206, 228, 255, 0.26);
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 200ms ease-out, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Mobile Layout */
@media (max-width: 680px) {
  .shell {
    padding: 20px 14px 104px;
    gap: 14px;
  }

  .glass-card {
    border-radius: 24px;
    padding: 20px 18px;
  }

  .mid-grid {
    grid-template-columns: 1fr;
  }

  .top-anime-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 10px;
    padding-bottom: 4px;
  }

  .top-anime-grid::-webkit-scrollbar {
    display: none;
  }

  .anime-poster-card {
    flex: 0 0 128px;
    scroll-snap-align: start;
  }

  .watching-grid {
    grid-template-columns: 1fr;
  }

  .mini-player {
    left: 50%;
    right: auto;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(350px, calc(100vw - 24px));
  }

  .toast {
    bottom: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .lyric-line,
  .lyric-line.is-near,
  .lyric-line.is-far {
    filter: none !important;
    transform: none !important;
  }

  .lyric-word.is-singing {
    transform: none !important;
  }
}
