/* v0.10.2 — stable cards, full-width Android navigation and synced page canvases. */

/* A card must not move its own pointer hit area: doing so can create an enter/leave loop. */
.show-card .poster,
.show-card:hover .poster {
  transform: none !important;
  transition: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .show-card,
  .show-card:hover {
    transform: none !important;
  }

  .show-card:hover {
    background: var(--surface-container, var(--md-sys-color-surface-container));
    box-shadow: 0 2px 5px rgb(31 29 26 / 7%), 0 10px 25px rgb(31 29 26 / 7%);
  }

  .show-card:active {
    transform: scale(.992) !important;
  }
}

/* Background picker */
.background-section {
  display: grid;
  gap: 10px;
}

.background-intro {
  margin: -2px 0 4px;
  color: var(--on-surface-variant);
  font-size: 12px;
  line-height: 1.5;
}

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

.background-options button {
  min-width: 0;
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--outline-variant);
  border-radius: 18px;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.background-options button:hover {
  background: var(--surface-container-low);
}

.background-options button[aria-pressed="true"] {
  border: 2px solid var(--primary);
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.background-options button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 2px;
}

.background-options button > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.background-options b {
  font-size: 13px;
  font-weight: 650;
}

.background-options small {
  color: var(--on-surface-variant);
  font-size: 11px;
  line-height: 1.35;
}

.background-preview {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgb(31 29 26 / 10%);
}

.background-preview-plain {
  background: #f8f5ee;
}

.background-preview-night {
  background:
    radial-gradient(circle at 72% 24%, rgb(91 122 155 / 32%), transparent 30%),
    #101720;
}

.background-preview-mono {
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgb(255 255 255 / 42%) 7px 9px, rgb(0 0 0 / 12%) 9px 10px),
    conic-gradient(from 225deg at 54% 49%, #171717, #deded9 20%, #262626 36%, #efeee8 58%, #111 78%, #dad9d3);
}

.background-preview-violet {
  background:
    repeating-linear-gradient(90deg, transparent 0 7px, rgb(255 255 255 / 45%) 7px 9px, rgb(72 35 122 / 12%) 9px 10px),
    radial-gradient(ellipse at 48% 43%, #5d278e 0 20%, #9671be 36%, transparent 60%),
    #e7e5e2;
}

/* Solid night canvas: a complete low-saturation Material tonal set. */
html[data-background="night-blue"] {
  color-scheme: dark;
  --md-sys-color-background: #101720;
  --md-sys-color-on-background: #edf2f7;
  --md-sys-color-surface: #101720;
  --md-sys-color-on-surface: #edf2f7;
  --md-sys-color-surface-container-lowest: #131c27;
  --md-sys-color-surface-container-low: #17212c;
  --md-sys-color-surface-container: #1c2733;
  --md-sys-color-surface-container-high: #23303d;
  --md-sys-color-surface-container-highest: #2a3846;
  --md-sys-color-on-surface-variant: #bec8d3;
  --md-sys-color-outline: #8e9aa7;
  --md-sys-color-outline-variant: #394653;
  --surface: #101720;
  --on-surface: #edf2f7;
  --surface-container-lowest: #131c27;
  --surface-container-low: #17212c;
  --surface-container: #1c2733;
  --surface-container-high: #23303d;
  --surface-container-highest: #2a3846;
  --on-surface-variant: #bec8d3;
  --outline: #8e9aa7;
  --outline-variant: #394653;
}

html[data-background="night-blue"],
html[data-background="night-blue"] body {
  background: #101720 !important;
}

/* Nothing-inspired ribbed canvases: graphic, angular and intentionally quiet. */
html[data-background="prism-mono"] body {
  background-color: #f2f1ec !important;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 30px, rgb(255 255 255 / 24%) 30px 33px, rgb(38 37 35 / 4%) 33px 35px),
    conic-gradient(from 210deg at 8% 64%, transparent 0 8%, rgb(23 23 22 / 9%) 13%, transparent 21%),
    conic-gradient(from 32deg at 94% 28%, transparent 0 10%, rgb(35 34 32 / 7%) 15%, transparent 24%);
  background-attachment: fixed;
  background-size: auto, 72vw 92vh, 76vw 86vh;
  background-repeat: repeat, no-repeat, no-repeat;
}

html[data-background="prism-violet"] body {
  background-color: #f3f0f4 !important;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 30px, rgb(255 255 255 / 28%) 30px 33px, rgb(62 35 94 / 4%) 33px 35px),
    radial-gradient(ellipse at 90% 23%, rgb(111 68 151 / 11%) 0 15%, transparent 42%),
    radial-gradient(ellipse at 4% 78%, rgb(75 44 103 / 8%) 0 14%, transparent 38%);
  background-attachment: fixed;
  background-repeat: repeat, no-repeat, no-repeat;
}

html[data-mode="dark"][data-background="prism-mono"] body,
html[data-mode="dark"][data-background="prism-violet"] body {
  background-color: #171615 !important;
  background-blend-mode: screen, normal, normal;
}

/* Compact full-width Android navigation: the bar owns the full bottom surface,
   while each destination gets an equal half and a small tonal state indicator. */
@media (max-width: 719px) {
  :root {
    --mobile-bottom-nav-height: 56px;
  }

  body {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));
    padding: 4px max(24px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(24px, env(safe-area-inset-right));
    border: 0;
    border-radius: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    background: color-mix(in srgb, var(--surface-container-high) 96%, transparent);
    box-shadow: 0 -8px 24px rgb(31 29 26 / 8%);
    transform: none;
    backdrop-filter: blur(10px);
    transition: transform 200ms cubic-bezier(.2, 0, 0, 1), opacity 150ms cubic-bezier(.2, 0, 0, 1);
  }

  .mobile-bottom-nav.is-scroll-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 8px));
  }

  .mobile-bottom-tab {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 18px;
    justify-content: center;
    background: transparent;
    color: var(--on-surface-variant);
  }

  .mobile-bottom-tab.active {
    background: transparent;
    color: var(--on-primary-container);
  }

  .mobile-tab-indicator,
  .mobile-bottom-tab.active .mobile-tab-indicator {
    width: 64px;
    height: 40px;
    border-radius: 20px;
    background: var(--surface-container-highest);
    color: inherit;
  }

  .mobile-bottom-tab.active .mobile-tab-indicator {
    background: var(--primary-container);
  }

  .mobile-tab-indicator .material-symbols-rounded {
    font-size: 24px;
  }

  .mobile-bottom-tab:active {
    transform: scale(.96);
  }

  .profile-dialog.mobile-tab-page .insights-scroll {
    padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
  }

  .background-options {
    grid-template-columns: 1fr;
  }

  .background-options button {
    min-height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav,
  .mobile-bottom-tab,
  .show-card {
    transition: none !important;
  }
}
