:root {
  color-scheme: light;
  --ink: #1e2522;
  --muted: #66736c;
  --line: #d9e1d9;
  --paper: #fbfbf7;
  --panel: #ffffff;
  --leaf: #2f6b4f;
  --leaf-dark: #214b39;
  --sun: #f4c95d;
  --coral: #df6b55;
  --sky: #7eb7c8;
  --lilac: #9f87c7;
  --shadow: 0 18px 40px rgba(29, 44, 36, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
}

header {
  border-bottom: 1px solid rgba(97, 107, 79, 0.13);
  width: 100%;
}

#family-library {
  font-size: 1.2rem;
  margin-bottom: 3px;
  margin-top: 5px;
}
#family-library + small {
  font-size: 1rem;
}

#top-bar {
  top: 0;
  z-index: 10;
  display: flex;
  padding: 22px 0;
  justify-content: space-between;
  background: rgba(251, 251, 247, 0.9);
  backdrop-filter: blur(18px);
  
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand small,
.hint,
.card-meta,
.card-owner,
.filters span,
.form-grid span,
label > span {
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--leaf);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.topnav {
  display: flex;
  gap: 8px;
}

.topnav a {
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.topnav a:hover {
  background: rgba(47, 107, 79, 0.09);
  color: var(--leaf-dark);
}

.account {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.account[data-auth-pending] {
  min-width: 172px;
  min-height: 44px;
  pointer-events: none;
  visibility: hidden;
}

.link-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.link-button:hover {
  color: var(--leaf-dark);
}

.user-chip {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

main, #top-bar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-footer {
  border-top: 1px solid rgba(97, 107, 79, 0.13);
  color: var(--muted);
  margin-top: 13vh;
}

.footer-inner {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto;
}

#footerAccountArea:empty {
  display: none;
}

.footer-account {
  display: flex;
  align-items: center;
  gap: 16px;
}

body.is-authenticated .footer-inner {
  justify-content: space-between;
}

.footer-logout {
  color: var(--muted);
}

.hero {
  align-items: center;
  padding: clamp(32px, 9vw, 130px) 20px;
  position: relative;
  margin-bottom: 9vh;
}

.hero-copy {
  order: -1;
}

.eyebrow {
  margin: 0 0 10px;
  color: #a9a9a9;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 4rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.hero p:not(.eyebrow) {
  max-width: 640px;
  color: #49544e;
  font-size: 1.12rem;
  line-height: 1.65;
}

.hero-actions,
.filters,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  position: relative;
  z-index: 2;
}

.hero-piece {
  position: absolute;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.primary {
  border-color: var(--leaf);
  background: var(--leaf);
  color: #fff;
  box-shadow: 0 2px 0 rgba(33, 75, 57, 0.18);
  font-weight: 750;
}

.primary:hover {
  border-color: var(--leaf-dark);
  background: #2a6047;
  color: #fff;
}

.get-going {
  background: #d12518; 
  background: #108714;
  border-color: #108714;
  color: #fff;
}

.get-going:hover {
  background: #0d7611;
  border-color: #0d7611;
  color: #fff;
}


#link-header-login {
  margin-right: 13px;
}  

.secondary {
  border-color: var(--line);
  background: #fff;
}

.ghost {
  background: transparent;
  color: var(--leaf-dark);
}

.hero-art {
  min-height: 520px;
  position: relative;
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(126, 183, 200, 0.2), rgba(244, 201, 93, 0.16)),
    repeating-linear-gradient(90deg, rgba(47, 107, 79, 0.08) 0 1px, transparent 1px 80px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.box {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 3px solid rgba(30, 37, 34, 0.18);
  border-radius: 7px;
  color: #fff;
  font-weight: 950;
  box-shadow: inset 0 -18px rgba(0, 0, 0, 0.12);
}

.puzzle {
  background: var(--coral);
}

.game {
  min-height: 210px;
  background: var(--leaf);
}

.tall {
  min-height: 250px;
  background: var(--lilac);
}

.cards {
  min-height: 185px;
  background: var(--sky);
}

.table {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 10%;
  height: 98px;
  border-radius: 50% 50% 12px 12px;
  background: #c99c63;
}

.piece,
.meeple {
  position: absolute;
  bottom: 24%;
  display: block;
}

.piece {
  width: 42px;
  height: 42px;
  border-radius: 8px 16px 8px 16px;
}

.one {
  left: 28%;
  background: var(--sun);
}

.two {
  left: 43%;
  transform: rotate(18deg);
  background: var(--sky);
}

.three {
  right: 26%;
  transform: rotate(-13deg);
  background: var(--coral);
}

.meeple {
  left: 58%;
  width: 34px;
  height: 58px;
  border-radius: 16px 16px 9px 9px;
  background: var(--leaf-dark);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 46px;
}

.stats article,
.panel,
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(29, 44, 36, 0.06);
}

.stats article {
  padding: 20px;
}

.stats strong {
  display: block;
  font-size: 2rem;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 22px;
  margin-bottom: 18px;
}

body.is-authenticated .toolbar {
  grid-template-columns: 1fr;
  padding-top: 26px;
}

body.is-authenticated .toolbar > div:first-child {
  display: none;
}

body.is-authenticated .filters {
  width: 100%;
}

body.is-authenticated .filters label:first-child,
body.is-authenticated .filters label:nth-child(2) {
  flex: 1 1 280px;
}

body.is-authenticated .filters label:nth-child(3),
body.is-authenticated .filters label:nth-child(4) {
  flex: 0 0 145px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.dropzone {
  display: grid;
  position: relative;
  min-height: 118px;
  place-items: center;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  padding: 18px;
  text-align: center;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--leaf);
  background: rgba(47, 107, 79, 0.08);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-copy,
.dropzone-file {
  display: grid;
  gap: 4px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.dropzone-copy small,
.dropzone-file {
  color: var(--muted);
  font-weight: 650;
}

.batch-image-preview {
  display: grid;
  gap: 10px;
}

.batch-image-preview[hidden] {
  display: none;
}

.batch-image-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.batch-image-row.is-dragging {
  border-color: var(--leaf);
  background: rgba(47, 107, 79, 0.06);
}

.batch-image-row > div:first-child {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.batch-image-row strong,
.batch-image-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-image-row small {
  color: var(--muted);
  font-weight: 650;
}

.batch-image-drop {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 8px;
}

.batch-image-drop > span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.batch-image-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: grab;
  background: #fff;
}

.batch-image-thumb:active {
  cursor: grabbing;
}

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

.publish-button {
  margin-top: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 16px;
  margin-bottom: 56px;
}

.masonry-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.lend-after-list {
  display: flex;
  justify-content: center;
  margin: -24px 0 56px;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(47, 107, 79, 0.1);
  color: var(--leaf-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.status-loaned {
  background: rgba(223, 107, 85, 0.12);
  color: #8d2f1f;
}

.card-visual {
  position: relative;
  overflow: hidden;
  min-height: 242px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 24% 36%, rgba(255, 255, 255, 0.78) 0 13px, transparent 14px),
    linear-gradient(135deg, var(--card-a), var(--card-b));
  box-shadow: inset 0 -28px rgba(0, 0, 0, 0.1);
}

.card-visual.has-image {
  overflow: visible;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card-visual.has-image img {
  position: static;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px 4px 6px 6px;
}

.card-visual img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.item-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.item-card p {
  min-height: 3em;
  margin: 0;
  color: #4f5a54;
  line-height: 1.5;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  align-self: start;
  align-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

.meta-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.variant-list {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.variant-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.variant-thumb {
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(circle at 24% 36%, rgba(255, 255, 255, 0.78) 0 7px, transparent 8px),
    linear-gradient(135deg, var(--card-a), var(--card-b));
}

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

.variant-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.variant-copy strong,
.variant-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variant-copy small {
  color: var(--muted);
}

.workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding-bottom: 64px;
}

.lend-view,
.settings-view {
  min-height: calc(100vh - 96px);
  padding: clamp(24px, 5vw, 56px) 0 72px;
}

.lend-view .panel,
.settings-view .panel {
  max-width: 860px;
  margin: 0 auto;
}

.view-heading {
  max-width: 860px;
  margin: 0 auto 16px;
}

.workbench.is-locked {
  display: none;
}

.side-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 18px;
}

.side-stack h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.pending-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.pending-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(47, 107, 79, 0.05);
  padding: 10px;
}

.pending-item small {
  color: var(--muted);
  font-weight: 650;
}

.toggle-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--leaf);
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.area-suggestions {
  display: grid;
  gap: 6px;
  margin-top: -6px;
}

.area-suggestions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 8px 10px;
}

.area-suggestions button:hover {
  background: rgba(47, 107, 79, 0.08);
}

.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(47, 107, 79, 0.08);
  color: var(--leaf-dark);
  font-weight: 750;
  padding: 6px 8px 6px 10px;
}

.area-chip button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--leaf-dark);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.area-chip button:hover {
  background: rgba(30, 37, 34, 0.1);
}

.empty-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 14px;
}

.mode-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.mode-toggle label {
  display: block;
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.mode-toggle input:checked + span {
  background: rgba(47, 107, 79, 0.12);
  color: var(--leaf-dark);
}

.hint {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.empty-state,
.request {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.request + .request {
  margin-top: 10px;
}

.request strong {
  color: var(--ink);
}

.request-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.handoff-form,
.handoff-confirm {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.handoff-form input[type="file"] {
  min-height: auto;
  padding: 9px;
}

.handoff-confirm img {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 6px;
  object-fit: cover;
}

.handoff-confirm p {
  margin-bottom: 0;
  color: var(--muted);
}

dialog {
  width: min(520px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(30, 37, 34, 0.42);
}

dialog form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.register-only {
  display: none;
}

.is-registering .register-only {
  display: grid;
}

.is-registering .login-only {
  display: none;
}

.dialog-switch {
  justify-self: center;
}

.icon-button {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  color: transparent;
  font-size: 0;
  transition: background-color 0.15s ease;
}

.icon-button:hover {
  background: #f0f0f0;
}

.icon-button::before,
.icon-button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: #171717;
  content: "";
}

.icon-button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close {
  justify-self: end;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .hero,
  .toolbar,
  .workbench {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: 0;
  }

  .hero-art {
    min-height: 380px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .side-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: start;
  }

  .account {
    flex-direction: column;
    align-items: end;
  }

  .brand small,
  .account .user-chip {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .stats,
  .grid,
  .form-grid,
  .batch-image-row {
    grid-template-columns: 1fr;
  }

  .filters {
    display: grid;
  }

  .variant-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .variant-row > div:last-child {
    grid-column: 1 / -1;
  }

  .button {
    width: 100%;
  }

  .account .button {
    width: auto;
  }
}
