/* FrameDeck design tokens — ShotDeck-inspired, quieter taste */
:root {
  --ink: #070708;
  --ink-elevated: #0c0c0e;
  --panel: rgba(14, 14, 16, 0.82);
  --panel-solid: #121214;
  --text: #f2f2f3;
  --muted: #8b8b96;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #c45c6a;
  --accent-deep: #9e3d4a;
  --accent-glow: rgba(196, 92, 106, 0.35);
  --accent-soft: rgba(196, 92, 106, 0.12);
  --gold: #c4a574;
  --gold-soft: rgba(196, 165, 116, 0.12);
  --ok: #6ee7a0;
  --deck-w: min(440px, 100vw);
  --radius: 0.85rem;
  --radius-lg: 1.15rem;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  /* legacy aliases used by albums.css / monetization.css */
  --red: var(--accent);
  --red-glow: var(--accent-glow);
}

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

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.fd-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.fd-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  color: var(--text);
  line-height: 1;
}

.fd-mark span {
  color: var(--accent);
}

.fd-brand-meta {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.fd-nav {
  display: flex;
  gap: 0.35rem 1.1rem;
  align-items: center;
  flex-wrap: wrap;
}

.fd-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.fd-nav a:hover,
.fd-nav a[aria-current="page"] {
  color: var(--text);
}

.fd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fd-chip.active {
  border-color: rgba(196, 92, 106, 0.45);
  background: var(--accent-soft);
  color: #f0c4ca;
}

.legal-foot {
  position: fixed;
  bottom: 0.5rem;
  left: 1rem;
  z-index: 12;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: rgba(161, 161, 170, 0.55);
  max-width: 22rem;
  line-height: 1.4;
  pointer-events: none;
}

body.deck-open .legal-foot {
  opacity: 0;
}

/* Kit picker */
.kit-picker {
  pointer-events: auto;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kit-picker label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.kit-picker-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.kit-picker select {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  min-width: 9rem;
  cursor: pointer;
}

.kit-picker select:focus {
  outline: none;
  border-color: rgba(196, 92, 106, 0.55);
}

/* Library page shell */
.lib-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lib-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.92);
  backdrop-filter: blur(16px);
}

.lib-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.lib-filters {
  border-right: 1px solid var(--line);
  padding: 1.25rem 1.1rem 2rem;
  overflow-y: auto;
  background: var(--ink-elevated);
}

.lib-filters h3 {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.1rem 0 0.55rem;
  font-weight: 500;
}

.lib-filters h3:first-child {
  margin-top: 0;
}

.lib-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lib-filter-list button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.lib-filter-list button:hover,
.lib-filter-list button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.lib-filter-list button.active {
  border-color: rgba(196, 92, 106, 0.4);
  background: var(--accent-soft);
}

.lib-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lib-search-bar {
  padding: 1.15rem 1.5rem 0.85rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lib-search-input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius);
  letter-spacing: 0.01em;
}

.lib-search-input::placeholder {
  color: var(--muted);
}

.lib-search-input:focus {
  outline: none;
  border-color: rgba(196, 92, 106, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lib-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.45rem;
  padding: 1rem 1.25rem 3rem;
  align-content: start;
}

.lib-card {
  appearance: none;
  border: 1px solid transparent;
  padding: 0;
  margin: 0;
  background: #0e0e10;
  border-radius: 0.4rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4 / 5;
  transition: border-color 0.15s, transform 0.15s;
}

.lib-card:hover,
.lib-card:focus-visible {
  border-color: rgba(196, 92, 106, 0.55);
  transform: translateY(-1px);
  outline: none;
}

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

.lib-card .lib-card-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.55rem 0.45rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ddd;
  text-align: left;
}

.lib-card.blurred img {
  filter: blur(12px) brightness(0.5);
  transform: scale(1.06);
}

.lib-empty {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.lib-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  z-index: 40;
  background: rgba(10, 10, 12, 0.96);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
}

.lib-drawer.open {
  transform: translateX(0);
}

.lib-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lib-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lib-drawer-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.lib-drawer img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: #111;
  margin-bottom: 1rem;
}

.lib-drawer h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.lib-drawer .sub {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.lib-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 1.25rem;
}

.lib-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lib-actions a,
.lib-actions button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.lib-actions a.ghost,
.lib-actions button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.lib-drawer-close {
  appearance: none;
  align-self: flex-end;
  margin: 0.85rem 0.85rem 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.25rem 3rem;
}

.cam-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(18, 18, 22, 0.85);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}

.cam-card:hover {
  border-color: rgba(196, 92, 106, 0.45);
  transform: translateY(-2px);
}

.cam-card .brand {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.cam-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.cam-card p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 860px) {
  .lib-main {
    grid-template-columns: 1fr;
  }
  .lib-filters {
    border-right: none;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding: 0.85rem 1rem;
    max-height: none;
  }
  .lib-filters h3 {
    width: 100%;
    margin: 0.5rem 0 0.25rem;
  }
  .lib-filter-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .lib-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
