:root {
  --wallpaper: url("/assets/backgrounds/LIBRARY.png");
  --library-wallpaper-size: cover;
  --library-wallpaper-position: center center;
  --ink: #2d180f;
  --accent: #d48635;
  --accent-dark: #8f4d18;
  --paper: #f3e0be;
  --paper-edge: #d2ae79;
  --glass: rgba(28, 15, 9, 0.62);
  --library-popup-topo: url("../backgrounds/wild-eyez-dark-brown-topo.jpg");
  --library-popup-leather: url("../backgrounds/wild-eyez-leather-player.jpg");
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #110a05;
}

body {
  min-height: 100vh;
  color: #f6e6ca;
  background-color: #110a05;
  background-image:
    linear-gradient(180deg, rgba(13, 7, 4, 0.05), rgba(13, 7, 4, 0.35)),
    var(--wallpaper);
  background-position: center top, var(--library-wallpaper-position);
  background-size: auto, var(--library-wallpaper-size);
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .public-library-folders,
  .public-library-results,
  .public-file-card {
    animation: none;
  }
}

.topbar:not(.hard-copy-topbar) {
  display: none !important;
}

.hard-copy-topbar {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 30120 !important;
  pointer-events: none;
}

.hard-copy-topbar .uoga-page-nav-control,
.hard-copy-topbar .uoga-primary-nav,
.hard-copy-topbar .topbar-right {
  pointer-events: auto;
}

.hard-copy-topbar .uoga-primary-nav {
  display: none !important;
}

.page-nav-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  pointer-events: none;
}

.page-nav-case {
  pointer-events: auto;
}

.utility-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(233, 197, 146, 0.8);
  background: rgba(255, 252, 246, 0.75);
  box-shadow: 0 10px 24px rgba(15, 8, 4, 0.36);
  backdrop-filter: blur(8px);
}

.utility-link {
  min-width: 128px;
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #c9a27f;
  background: linear-gradient(180deg, #4c2b18, #201109);
  color: #f08c19;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 10px rgba(0, 0, 0, 0.28);
}

.utility-link.active {
  color: #201007;
  border-color: #f0b46f;
  background: linear-gradient(180deg, #78411a, #cf7420);
  box-shadow: 0 0 0 2px rgba(255, 232, 190, 0.5), 0 8px 18px rgba(0, 0, 0, 0.33);
}

.public-library-shell {
  min-height: 100vh;
  width: 100vw;
  padding: 76px 20px 28px;
  box-sizing: border-box;
}

.library-wall-stage {
  min-height: calc(100vh - 92px);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.public-library-controls {
  position: absolute;
  left: 43%;
  top: clamp(210px, 20vh, 250px);
  transform: translateX(-50%);
  width: min(820px, 68vw);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 8;
}

.public-library-search {
  flex: 1;
  height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(221, 177, 120, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.96), rgba(244, 227, 188, 0.95));
  color: #2b170b;
  padding: 0 16px;
  font-size: 20px;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.public-library-search::placeholder {
  color: #5a351b;
  opacity: 0.85;
}

.public-library-clear {
  height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(207, 137, 61, 0.95);
  padding: 0 16px;
  background: linear-gradient(180deg, #9d5518, #5f300d);
  color: #ffd89a;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 215, 154, 0.35);
}

.public-library-note {
  display: none;
}

.public-library-folders {
  position: absolute !important;
  left: 43% !important;
  top: clamp(292px, 34vh, 372px) !important;
  transform: translateX(-50%) !important;
  width: min(854px, 82vw) !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 18px;
  z-index: 5;
  opacity: 1;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    filter 220ms ease;
  animation: uogaFolderRailIn 420ms ease-out both;
}

body.library-results-open .public-library-folders {
  animation: none;
  opacity: 0.16;
  transform: translateX(-50%) translateY(18px) scale(0.96) !important;
  filter: blur(1px) saturate(0.78);
  pointer-events: none;
}

.public-folder {
  --folder-tilt: 0deg;
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 24px 14px 13px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 5px 7px 6px 4px;
  border: 1px solid rgba(93, 52, 22, 0.78);
  background:
    radial-gradient(140% 90% at 8% 8%, rgba(255, 244, 209, 0.55), rgba(255, 244, 209, 0) 42%),
    radial-gradient(115% 100% at 92% 90%, rgba(101, 57, 26, 0.20), rgba(101, 57, 26, 0) 46%),
    repeating-linear-gradient(
      38deg,
      rgba(92, 54, 26, 0.07) 0,
      rgba(92, 54, 26, 0.07) 2px,
      rgba(238, 211, 160, 0.035) 2px,
      rgba(238, 211, 160, 0.035) 6px
    ),
    linear-gradient(180deg, #e9c991 0%, #d8a965 56%, #bf8445 100%) !important;
  color: #2e1709 !important;
  box-shadow:
    0 5px 7px rgba(0, 0, 0, 0.42),
    0 14px 24px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 238, 201, 0.48),
    inset 0 0 28px rgba(69, 39, 18, 0.28);
  clip-path: polygon(2% 0, 98% 1%, 100% 4%, 99% 96%, 97% 100%, 4% 99%, 0 96%, 1% 5%);
  cursor: pointer;
  text-align: left;
  transform: rotate(var(--folder-tilt));
  transform-origin: 50% 8px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  overflow: hidden;
}

.public-folder:nth-child(4n + 1) {
  --folder-tilt: -0.6deg;
}

.public-folder:nth-child(4n + 2) {
  --folder-tilt: 0.35deg;
}

.public-folder:nth-child(4n + 3) {
  --folder-tilt: -0.25deg;
}

.public-folder:nth-child(4n) {
  --folder-tilt: 0.55deg;
}

.public-folder::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1px solid rgba(48, 24, 10, 0.75);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 232, 163, 0.95), rgba(184, 104, 37, 0.8) 40%, rgba(45, 21, 9, 0.95) 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 241, 205, 0.5);
}

.public-folder::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 46px;
  height: 1px;
  background: linear-gradient(90deg, rgba(110, 70, 36, 0), rgba(110, 70, 36, 0.42), rgba(110, 70, 36, 0));
}

.public-folder:hover,
.public-folder.active {
  transform: translateY(-5px) scale(1.01) rotate(var(--folder-tilt));
  border-color: rgba(255, 223, 171, 0.96);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(255, 214, 157, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 0 24px rgba(87, 52, 23, 0.22);
}

.public-folder-title {
  display: block;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 800;
  font-size: clamp(13px, 0.75vw, 15px);
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 244, 216, 0.5);
}

.public-folder-description {
  display: none;
  margin-top: 0;
  min-height: 0;
  font-size: 10px;
  line-height: 1.35;
  color: #4f2c15;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 240, 210, 0.45);
}

.public-folder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  margin: 6px auto 2px;
  opacity: 0.86;
  filter: sepia(0.35) saturate(0.78) contrast(1.05);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.public-folder-icon img {
  display: block;
  max-width: 70px;
  max-height: 54px;
  object-fit: contain;
}

.public-folder[data-folder="rules"] .public-folder-icon img {
  max-width: 80px;
}

.public-folder[data-folder="draw"] .public-folder-icon img,
.public-folder[data-folder="conservation"] .public-folder-icon img,
.public-folder[data-folder="calendar"] .public-folder-icon img,
.public-folder[data-folder="outfitters"] .public-folder-icon img {
  max-height: 58px;
}

.public-folder-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  margin-top: 10px;
  padding: 5px 10px;
  font-size: 10px;
  color: #f6d59f;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  justify-self: start;
  align-self: end;
  border: 1px solid rgba(70, 40, 18, 0.72);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 212, 146, 0.2), rgba(255, 212, 146, 0) 30%),
    linear-gradient(180deg, #5d3318, #2f180b);
  box-shadow: inset 0 1px 0 rgba(255, 236, 193, 0.26), 0 3px 8px rgba(0, 0, 0, 0.28);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.public-library-results {
  position: fixed;
  inset: 82px 22px 22px;
  z-index: 11000;
  width: auto;
  height: auto;
  max-height: none;
  margin: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(233, 204, 156, 0.68);
  background:
    radial-gradient(circle at 8% 0%, rgba(243, 112, 33, 0.18), transparent 34rem),
    linear-gradient(rgba(27, 16, 10, 0.91), rgba(27, 16, 10, 0.97)),
    var(--library-popup-topo) center / 840px auto repeat;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
  color: #fff7ed;
  padding: 18px;
  animation: uogaResultsPanelIn 220ms ease-out both;
}

.public-library-results[hidden] {
  display: none;
}

.public-library-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.public-library-results-head h2 {
  margin: 0;
  color: #fff7ed;
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.public-library-results-head span {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 900;
  color: #ffb878;
}

.public-library-results-close {
  flex: 0 0 auto;
  border: 1px solid rgba(68, 39, 19, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, #4c2b18, #201109);
  color: #ff8a14;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  text-transform: uppercase;
  box-shadow: 0 10px 20px rgba(50, 25, 8, 0.22);
}

.public-library-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.public-chip {
  border-radius: 999px;
  border: 1px solid rgba(242, 209, 158, 0.6);
  background: rgba(76, 41, 18, 0.88);
  color: #f8ddb0;
  font-size: 11px;
  padding: 4px 9px;
}

.public-library-results-grid {
  display: grid;
  gap: 12px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.public-file-card {
  display: block;
  text-decoration: none;
  color: #2d180f;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(122, 76, 38, 0.24);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 22px rgba(52, 29, 11, 0.08);
  animation: uogaFileCardIn 200ms ease-out both;
}

@keyframes uogaFolderRailIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes uogaResultsPanelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes uogaFileCardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.public-file-card--button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.public-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.public-file-action {
  border: 1px solid rgba(68, 39, 19, 0.65);
  border-radius: 999px;
  background: linear-gradient(180deg, #6a3a17, #2a1509);
  color: #fff0d9;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}

.public-file-action--disabled,
.public-file-action:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  filter: grayscale(0.35);
}

.public-pdf-research {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(122, 76, 38, 0.22);
  background: rgba(245, 229, 199, 0.6);
  overflow: hidden;
}

.public-pdf-research > summary,
.pdf-research-category > summary {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #2d180f;
  font-weight: 950;
  list-style: none;
}

.public-pdf-research > summary::-webkit-details-marker,
.pdf-research-category > summary::-webkit-details-marker {
  display: none;
}

.public-pdf-research > summary span,
.pdf-research-category > summary span {
  margin: 0;
  color: #2d180f;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-pdf-research > summary b,
.pdf-research-category > summary b {
  border-radius: 999px;
  border: 1px solid rgba(122, 76, 38, 0.22);
  background: rgba(255, 252, 246, 0.82);
  color: #7a3f0c;
  padding: 5px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.pdf-parent-row {
  margin: 0 12px 10px;
  padding: 10px 11px;
  display: grid;
  gap: 3px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(122, 76, 38, 0.16);
}

.pdf-parent-row span {
  margin: 0;
  color: #7a3f0c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdf-parent-row strong {
  font-size: 14px;
}

.pdf-research-groups {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.pdf-research-category {
  border-radius: 10px;
  border: 1px solid rgba(122, 76, 38, 0.18);
  background: rgba(255, 253, 248, 0.74);
  overflow: hidden;
}

.pdf-hunt-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.pdf-hunt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(122, 76, 38, 0.13);
}

.pdf-hunt-row strong,
.pdf-hunt-row span,
.pdf-hunt-row em {
  margin: 0;
}

.pdf-hunt-row strong {
  font-size: 13px;
  color: #24150c;
}

.pdf-hunt-row span {
  font-size: 12px;
  line-height: 1.25;
}

.pdf-hunt-row em {
  font-size: 11px;
}

.pdf-hunt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pdf-hunt-actions .public-file-action {
  padding: 6px 10px;
  font-size: 11px;
}

.pdf-hunt-more {
  color: #6a3a17;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 2px 0;
}

.public-file-card strong {
  display: block;
  color: #24150c;
  font-size: 16px;
  line-height: 1.3;
}

.public-file-card span {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  color: #5b3a23;
}

.public-file-card em {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: #7a3f0c;
  font-style: normal;
  letter-spacing: 0.03em;
  font-weight: 900;
}

.public-empty {
  border-radius: 10px;
  padding: 10px 11px;
  border: 1px dashed rgba(229, 193, 142, 0.5);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .public-library-controls {
    width: min(700px, 86vw);
    top: clamp(205px, 22vh, 250px);
  }

  .public-library-note {
    width: min(720px, 90vw);
    top: clamp(306px, 48vh, 420px);
    font-size: 13px;
  }

  .public-library-search {
    height: 46px;
    font-size: 17px;
  }

  .public-library-clear {
    height: 46px;
  }

  .public-library-folders {
    width: min(854px, 92vw) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    top: clamp(292px, 34vh, 372px) !important;
  }

  .public-folder {
    padding: 22px 12px 12px;
  }

  .public-folder-title {
    font-size: 12px;
  }

  .public-folder-icon {
    height: 56px;
    margin-top: 6px;
  }

  .public-folder-icon img {
    max-width: 66px;
    max-height: 52px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .public-library-controls,
  .public-library-folders {
    left: 50% !important;
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
    background-position: center top, center top;
  }

  .public-library-shell {
    min-height: 100vh;
    padding: 76px 10px 28px;
  }

  .library-wall-stage {
    display: block;
    min-height: auto;
  }

  .public-library-controls {
    position: static;
    transform: none;
    width: min(420px, calc(100vw - 20px));
    margin: 108px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .public-library-note {
    position: static;
    transform: none;
    width: min(420px, 94vw);
    margin: 8px auto 0;
    font-size: 12px;
  }

  .public-library-search {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    font-size: 14px;
  }

  .public-library-clear {
    min-width: 72px;
    min-height: 46px;
    height: 46px;
    padding: 0 10px;
    font-size: 11px;
  }

  .public-library-folders {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: min(420px, calc(100vw - 24px)) !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px auto 0 !important;
    animation: none;
  }

  body.library-results-open .public-library-folders {
    transform: none !important;
  }

  .public-folder {
    padding: 17px 8px 9px;
    touch-action: manipulation;
  }

  .public-folder-title {
    font-size: clamp(10px, 3.1vw, 12px);
    line-height: 1.15;
    letter-spacing: 0.03em;
  }

  .public-folder-icon {
    height: 44px;
    margin: 3px auto 1px;
  }

  .public-folder-icon img,
  .public-folder[data-folder="rules"] .public-folder-icon img,
  .public-folder[data-folder="draw"] .public-folder-icon img,
  .public-folder[data-folder="conservation"] .public-folder-icon img,
  .public-folder[data-folder="calendar"] .public-folder-icon img,
  .public-folder[data-folder="outfitters"] .public-folder-icon img {
    max-width: 52px;
    max-height: 42px;
  }

  .public-folder-count {
    min-width: 0;
    margin-top: 4px;
    padding: 4px 7px;
    justify-self: center;
    font-size: 9px;
  }

  .public-folder::after {
    bottom: 36px;
  }

  .pdf-hunt-row {
    grid-template-columns: 1fr;
  }

  .pdf-hunt-actions {
    justify-content: flex-start;
  }
}

.uoga-pdf-flip-panel {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: block;
  padding: 0;
}

.uoga-pdf-flip-panel[hidden] {
  display: none !important;
}

.uoga-pdf-flip-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 3, 1, 0.78);
  backdrop-filter: blur(5px);
}

.uoga-pdf-flip-modal {
  position: absolute;
  inset: 82px 22px 22px;
  z-index: 1;
  width: auto;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(255, 205, 143, 0.42);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(rgba(27, 16, 10, 0.86), rgba(27, 16, 10, 0.94)),
    var(--library-popup-topo) center / 840px auto repeat;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.72);
}

.uoga-pdf-flip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background:
    linear-gradient(145deg, rgba(38, 20, 11, 0.66), rgba(18, 10, 6, 0.76)),
    var(--library-popup-leather) center / cover no-repeat;
  color: #ffe4bd;
}

.uoga-pdf-flip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uoga-pdf-flip-actions a,
.uoga-pdf-flip-actions button,
.uoga-pdf-flip-toolbar button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f89524, #d56610);
  color: #2b1308;
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.uoga-pdf-flip-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.uoga-pdf-flip-toolbar {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(25, 13, 8, 0.94);
  border-top: 1px solid rgba(244, 197, 124, 0.2);
}

.uoga-pdf-flip-toolbar span {
  font-weight: 800;
  font-size: 12px;
  color: #f7d5a0;
}

.uoga-pdf-flipbook {
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(32, 17, 10, 0.72), rgba(7, 3, 1, 0.88)),
    var(--library-popup-leather) center / cover no-repeat;
}

.uoga-pdf-inline-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #1b1008;
}

.uoga-pdf-spread {
  width: min(1380px, 96vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  background: #2a160a;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.uoga-pdf-spread.cover,
.uoga-pdf-spread.single {
  width: min(690px, 96vw);
  grid-template-columns: 1fr;
}

.uoga-pdf-page {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8eedc;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(80, 50, 25, 0.18);
}

.uoga-pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 240px);
  object-fit: contain;
}

body.uoga-modal-open {
  overflow: hidden;
}

.uoga-embed-panel {
  position: fixed;
  inset: 82px 22px 22px;
  z-index: 13000;
  display: grid;
  grid-template-rows: auto 1fr;
  margin: 0;
  border: 1px solid rgba(255, 205, 143, 0.35);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(rgba(27, 16, 10, 0.86), rgba(27, 16, 10, 0.94)),
    var(--library-popup-topo) center / 840px auto repeat;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

.uoga-embed-panel[hidden] {
  display: none !important;
}

.uoga-embed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background:
    linear-gradient(145deg, rgba(38, 20, 11, 0.66), rgba(18, 10, 6, 0.76)),
    var(--library-popup-leather) center / cover no-repeat;
  color: #ffe4bd;
}

.uoga-embed-head button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f89524, #d56610);
  color: #2b1308;
  font-weight: 900;
  cursor: pointer;
}

.uoga-embed-panel iframe {
  display: block;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  .public-library-shell {
    padding: 84px 12px 16px;
  }

  .uoga-embed-panel iframe {
    min-height: 520px;
  }

  .public-library-results {
    inset: 70px 6px 6px;
    width: auto;
    height: auto;
    max-height: none;
    padding: 10px;
    border-radius: 14px;
  }

  .public-library-results-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .public-library-results-head h2 {
    font-size: clamp(17px, 5vw, 22px);
    line-height: 1.12;
  }

  .public-library-results-head span {
    font-size: 12px;
  }

  .public-library-results-close {
    width: auto;
    min-width: 74px;
    min-height: 44px;
    padding: 9px 12px;
  }

  .public-library-active-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .public-chip {
    flex: 0 0 auto;
  }

  .public-library-results-grid {
    max-height: none;
    gap: 10px;
    padding-right: 1px;
  }

  .public-file-card {
    padding: 12px;
    border-radius: 12px;
  }

  .public-file-card strong {
    font-size: 15px;
  }

  .public-file-card span {
    font-size: 13px;
    line-height: 1.35;
  }

  .public-file-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-file-action {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    text-align: center;
  }

  .uoga-embed-panel {
    inset: 70px 6px 6px;
    border-radius: 14px;
  }

  .uoga-pdf-flip-panel {
    padding: 0;
  }

  .uoga-pdf-flip-modal {
    inset: 70px 0 0;
    min-width: 0;
    width: auto;
    height: auto;
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
  }

  .uoga-pdf-flip-head {
    flex-direction: row;
    align-items: center;
    min-width: 0;
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .uoga-pdf-flip-head > strong {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .uoga-pdf-flip-actions button {
    min-width: 68px;
    min-height: 44px;
  }

  .uoga-pdf-flip-actions {
    flex: 0 0 auto;
  }

  .uoga-pdf-flipbook {
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-height: none;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
  }

  .uoga-pdf-inline-frame {
    border-radius: 0;
  }

  .uoga-pdf-spread {
    grid-template-columns: 1fr;
    width: min(96vw, 440px);
    max-width: min(96vw, 440px);
    padding: 10px;
  }

  .utility-nav {
    max-width: calc(100vw - 12px);
    overflow-x: auto;
    justify-content: flex-start;
  }

  .utility-link {
    min-width: 116px;
    font-size: 10px;
  }
}

@media (max-width: 360px) {
  .public-library-controls {
    width: calc(100vw - 16px);
    margin-top: 102px;
  }

  .public-library-folders {
    width: calc(100vw - 16px) !important;
    gap: 8px;
  }

  .public-folder {
    padding: 15px 6px 8px;
  }

  .public-folder-title {
    font-size: 10px;
  }

  .public-folder-count {
    font-size: 8px;
  }

  .public-file-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) and (max-height: 600px) {
  body {
    background-attachment: scroll;
  }

  .public-library-shell {
    min-height: 100vh;
    padding: 64px 10px 24px;
  }

  .library-wall-stage {
    display: block;
    min-height: auto;
  }

  .public-library-controls {
    position: static;
    transform: none;
    width: min(700px, calc(100vw - 20px));
    margin: 86px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .public-library-search {
    min-width: 0;
    height: 44px;
    font-size: 14px;
  }

  .public-library-clear {
    min-height: 44px;
    height: 44px;
  }

  .public-library-folders {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: min(760px, calc(100vw - 20px)) !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 14px auto 0 !important;
    animation: none;
  }

  body.library-results-open .public-library-folders {
    transform: none !important;
  }

  .public-folder {
    padding: 15px 7px 8px;
  }

  .public-folder-title {
    font-size: clamp(9px, 1.7vw, 11px);
    line-height: 1.12;
  }

  .public-folder-icon {
    height: 38px;
    margin: 2px auto 0;
  }

  .public-folder-icon img,
  .public-folder[data-folder="rules"] .public-folder-icon img,
  .public-folder[data-folder="draw"] .public-folder-icon img,
  .public-folder[data-folder="conservation"] .public-folder-icon img,
  .public-folder[data-folder="calendar"] .public-folder-icon img,
  .public-folder[data-folder="outfitters"] .public-folder-icon img {
    max-width: 46px;
    max-height: 36px;
  }

  .public-folder-count {
    min-width: 0;
    margin-top: 3px;
    padding: 3px 6px;
    justify-self: center;
    font-size: 8px;
  }
}

@media (max-width: 640px) and (max-height: 600px) {
  .public-library-folders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (hover: none) and (pointer: coarse) {
  .public-folder:hover {
    transform: rotate(var(--folder-tilt));
  }
}
