/* ═══════════════ Trivia Rumble — my quizzes library ═══════════════ */
/* Tokens come from tokens.css. Layout implements the MyQuizzes board
   plus the my-quizzes empty card from the EmptyStates board. */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 85% -10%, oklch(0.30 0.06 25 / 0.55), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, oklch(0.28 0.05 255 / 0.45), transparent 60%);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
main { max-width: 1440px; margin: 0 auto; }

/* ─────────── shared bits (landing conventions) ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 800; letter-spacing: 0.01em; border: 0; cursor: pointer;
  border-radius: var(--r-ctl); padding: 14px 24px; font-size: 1.05rem;
  color: var(--gold-ink); background: var(--gold); box-shadow: 0 4px 0 var(--gold-edge);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.2s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px) scale(0.99); box-shadow: 0 1px 0 var(--gold-edge); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; }
.btn-ghost:active { transform: scale(0.98); box-shadow: inset 0 0 0 2px var(--line); }

.card { background: var(--bg-raise); border-radius: var(--r-panel); box-shadow: inset 0 0 0 2px var(--line); }

/* ─────────── nav ─────────── */
.nav {
  max-width: 1440px; margin: 0 auto; padding: 24px 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; row-gap: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-tiles { display: flex; gap: 5px; }
.brand-tiles i { width: 22px; height: 22px; border-radius: 7px; }
.brand-tiles .t-coral { background: var(--coral); box-shadow: 0 2px 0 var(--coral-edge); }
.brand-tiles .t-amber { background: var(--amber); box-shadow: 0 2px 0 var(--amber-edge); }
.brand-tiles .t-teal  { background: var(--teal);  box-shadow: 0 2px 0 var(--teal-edge); }
.brand-tiles .t-blue  { background: var(--blue);  box-shadow: 0 2px 0 var(--blue-edge); }
.brand-name { font-weight: 900; font-size: 1.35rem; text-transform: uppercase; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-weight: 700; font-size: 1rem; color: var(--ink-dim); transition: color 0.2s; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.btn-nav { padding: 10px 20px; font-size: 0.95rem; }
.nav-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  background: oklch(0.33 0.05 85); /* board-mandated selected fill, matches auth.css */
  box-shadow: inset 0 0 0 2px var(--gold);
  display: grid; place-items: center; font-size: 21px;
}

/* ─────────── library ─────────── */
.library { padding: 40px 72px 72px; display: flex; flex-direction: column; gap: 32px; }
.library-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.library-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.25rem); font-weight: 900;
  letter-spacing: -0.03em; text-transform: uppercase; line-height: 1;
}
#new-quiz-btn { padding: 14px 28px; font-size: 1.05rem; }

.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* ─────────── pack card ─────────── */
.pack-card { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.pack-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pack-emoji {
  width: 72px; height: 72px; border-radius: 20px; background: var(--bg-sink);
  display: grid; place-items: center; font-size: 40px;
}
.pack-menu-wrap { position: relative; }
.pack-menu-btn {
  width: 44px; height: 44px; margin: -8px -10px 0 0;
  border: 0; background: transparent; cursor: pointer; border-radius: 12px;
  font: inherit; font-weight: 900; font-size: 18px; letter-spacing: 0.1em;
  color: var(--ink-dim); transition: color 0.2s, background 0.2s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pack-menu-btn:hover, .pack-menu-btn[aria-expanded="true"] { color: var(--ink); background: var(--bg-sink); }
.pack-menu {
  position: absolute; top: calc(100% + 2px); right: 0; z-index: 10;
  min-width: 150px; background: var(--bg-raise); border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--line); padding: 6px;
}
.pack-menu-item {
  width: 100%; min-height: 44px; border: 0; cursor: pointer; font: inherit;
  background: transparent; border-radius: 10px; padding: 10px 14px;
  font-weight: 700; font-size: 15px; text-align: left; color: var(--bad);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pack-menu-item:hover, .pack-menu-item:focus-visible { background: var(--bg-sink); }

.pack-meta { display: flex; flex-direction: column; gap: 4px; }
.pack-name { font-weight: 800; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.pack-sub { font-weight: 600; font-size: 14px; color: var(--ink-dim); }

.pack-actions { display: flex; gap: 10px; margin-top: auto; }
.btn-host {
  flex: 1; min-height: 44px; border: 0; cursor: pointer; font: inherit;
  border-radius: 12px; background: var(--gold); box-shadow: 0 3px 0 var(--gold-edge);
  color: var(--gold-ink); font-weight: 800; font-size: 15px; padding: 11px; text-align: center;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.2s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn-host:hover:not(:disabled) { filter: brightness(1.06); }
.btn-host:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-edge); }
.btn-host:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-edit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  border-radius: 12px; background: transparent; box-shadow: inset 0 0 0 2px var(--line);
  color: var(--ink-dim); font-weight: 700; font-size: 15px; padding: 11px 20px;
  transition: color 0.2s;
}
.btn-edit:hover { color: var(--ink); }

/* dashed "Start a new pack" card (MyQuizzes board, last grid item) */
.new-pack-card {
  border-radius: var(--r-panel); border: 2px dashed var(--line); background: transparent;
  padding: 28px; min-height: 240px; cursor: pointer; font: inherit; color: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: border-color 0.2s, transform 0.15s var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.new-pack-card:hover, .new-pack-card:focus-visible { border-color: var(--gold); }
.new-pack-card:active { transform: scale(0.99); }
.ghost-tiles { display: flex; gap: 8px; }
.ghost-tiles i { width: 28px; height: 28px; border-radius: 9px; opacity: 0.5; }
.ghost-tiles .gt-coral { background: var(--coral); }
.ghost-tiles .gt-amber { background: var(--amber); transform: translateY(-4px); }
.ghost-tiles .gt-teal  { background: var(--teal); }
.ghost-tiles .gt-blue  { background: var(--blue); transform: translateY(-3px); }
.new-pack-title { font-weight: 800; font-size: 18px; color: var(--ink-dim); }
.new-pack-sub {
  font-weight: 500; font-size: 14px; color: var(--ink-dim); opacity: 0.75;
  text-align: center; max-width: 26ch;
}

/* ─────────── empty state (EmptyStates board, my-quizzes card) ─────────── */
.empty-state { max-width: 640px; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.empty-copy { display: flex; flex-direction: column; gap: 6px; }
.empty-copy h2 { font-weight: 900; font-size: 28px; letter-spacing: -0.02em; text-transform: uppercase; }
.empty-copy p { font-weight: 500; font-size: 15px; color: var(--ink-dim); line-height: 1.5; }
.ghost-list { display: flex; flex-direction: column; gap: 12px; }
.ghost-pack {
  border-radius: var(--r-panel); border: 2px dashed var(--line);
  padding: 18px 22px; display: flex; align-items: center; gap: 16px; opacity: 0.75;
}
.ghost-pack.tilt-l { transform: rotate(-1deg); }
.ghost-pack.tilt-r { transform: rotate(1deg); }
.ghost-emoji { font-size: 30px; filter: grayscale(1); opacity: 0.6; }
.ghost-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ghost-meta b { font-weight: 800; font-size: 17px; color: var(--ink-dim); }
.ghost-meta i { font-style: normal; font-weight: 600; font-size: 13px; color: var(--ink-dim); opacity: 0.75; }
.empty-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#empty-new-btn { padding: 15px 30px; font-size: 17px; }
.empty-fine { font-weight: 600; font-size: 14px; color: var(--ink-dim); }

/* ─────────── guest notice ─────────── */
.notice-wrap { padding: 64px 20px 96px; display: flex; justify-content: center; }
.notice-card {
  max-width: 460px; width: 100%; padding: 40px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.notice-card .ghost-tiles { margin-bottom: 6px; }
.notice-card h2 { font-weight: 900; font-size: 26px; letter-spacing: -0.02em; text-transform: uppercase; line-height: 1.1; }
.notice-card p { font-weight: 500; font-size: 15px; color: var(--ink-dim); line-height: 1.5; }
.notice-card .btn { margin-top: 8px; padding: 15px 30px; font-size: 17px; }

/* ─────────── mobile ─────────── */
@media (max-width: 900px) {
  .nav { padding: 20px; }
  .nav-links { gap: 18px; }
  .nav-link.is-soon { display: none; }
  .library { padding: 24px 20px 56px; gap: 24px; }
  .pack-grid { grid-template-columns: 1fr; gap: 16px; }
  .empty-state { padding: 28px 20px; max-width: none; }
  .ghost-pack.tilt-l, .ghost-pack.tilt-r { transform: none; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .nav-links { gap: 14px; }
}

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

.pack-menu-item.is-armed { color: oklch(0.9 0.05 25); background: oklch(0.32 0.09 25); animation: shake 0.4s var(--ease); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
