:root {
  --wine-950: #120707;
  --wine-900: #220b0c;
  --wine-800: #3a1115;
  --wine-700: #621b22;
  --wine-500: #91272f;
  --brass: #c7a86b;
  --parchment: #f0e4cc;
  --smoke: #c2b7a3;
  --ink: #271d14;
  --card: rgba(43, 13, 15, 0.78);
  --border: rgba(199, 168, 107, 0.35);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

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

body {
  margin: 0;
  color: var(--parchment);
  font-family: "Cormorant Garamond", serif;
  background:
    radial-gradient(circle at 12% 15%, rgba(146, 39, 47, 0.45), transparent 35%),
    radial-gradient(circle at 87% 88%, rgba(90, 26, 28, 0.45), transparent 30%),
    linear-gradient(160deg, var(--wine-950), var(--wine-900) 45%, #14090b);
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    );
}

.shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(1px);
  animation: rise 0.45s ease both;
}

.hero {
  padding: 1.2rem 1.2rem 1.3rem;
  border: 1px solid rgba(199, 168, 107, 0.55);
  background: linear-gradient(170deg, rgba(54, 16, 19, 0.92), rgba(30, 10, 11, 0.9));
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--smoke);
  font-size: 0.83rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Cinzel", serif;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

.subtitle,
.muted,
.meet-copy,
.meet-subcopy {
  margin: 0.45rem 0 0;
  color: var(--smoke);
}

.member-row {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.member-pill,
.chip,
.filter {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(199, 168, 107, 0.1);
  color: var(--parchment);
  padding: 0.22rem 0.7rem;
  font-size: 0.9rem;
}

.hero-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn {
  border: 1px solid rgba(199, 168, 107, 0.8);
  border-radius: 10px;
  background: linear-gradient(180deg, #8d242c, #6e1b21);
  color: var(--parchment);
  padding: 0.45rem 0.9rem;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.btn.secondary {
  margin-top: 0.7rem;
  background: rgba(199, 168, 107, 0.1);
}

.section-head .btn.secondary,
.wish-remove {
  margin-top: 0;
}

.banter-quote {
  margin: 0;
  font-style: italic;
  color: var(--parchment);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.stat {
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(199, 168, 107, 0.28);
  background: rgba(17, 7, 8, 0.5);
}

.stat-label {
  margin: 0;
  color: var(--smoke);
  font-size: 0.88rem;
}

.stat-value {
  margin: 0.25rem 0 0;
  font-family: "Cinzel", serif;
  font-size: 1.5rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.countdown {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.count-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(199, 168, 107, 0.2);
  border-radius: 10px;
  padding: 0.55rem 0.4rem;
  text-align: center;
}

.count-val {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
}

.count-label {
  color: var(--smoke);
  font-size: 0.78rem;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
}

input,
select {
  width: 100%;
  background: rgba(10, 4, 5, 0.6);
  color: var(--parchment);
  border: 1px solid rgba(199, 168, 107, 0.3);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.02rem;
}

input::placeholder {
  color: #b59b73;
}

.filter-row {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter {
  cursor: pointer;
}

.filter.active {
  background: rgba(199, 168, 107, 0.24);
}

.book-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
}

.book-card {
  border: 1px solid rgba(199, 168, 107, 0.25);
  border-radius: 14px;
  background: rgba(17, 7, 8, 0.55);
  padding: 0.7rem;
  animation: rise 0.42s ease both;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 0.65rem;
  align-items: start;
}

.book-card h3 {
  margin: 0;
  font-size: 1.23rem;
}

.book-main {
  min-width: 0;
}

.book-cover {
  width: 52px;
  height: 74px;
  border-radius: 5px;
  border: 1px solid rgba(199, 168, 107, 0.45);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: end center;
  padding-bottom: 0.28rem;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  color: #f7edd9;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  background: var(--fallback-cover);
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 50%);
}

.book-cover span {
  position: relative;
  z-index: 1;
}

.cover-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cover-seal {
  position: absolute !important;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 4 !important;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(247, 237, 217, 0.55);
  background: rgba(22, 11, 12, 0.62);
  backdrop-filter: blur(2px);
}

.theme-classic .layer-1 {
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0 2px,
    rgba(0, 0, 0, 0.06) 2px 5px
  );
  animation: panX 8s linear infinite;
}

.theme-classic .layer-2 {
  background: radial-gradient(circle at 30% 20%, rgba(250, 220, 170, 0.22), transparent 48%);
  animation: pulseSoft 4s ease-in-out infinite;
}

.theme-fire {
  background: linear-gradient(175deg, #3b1013, #8f2b1d 55%, #e56f2a);
}

.theme-fire .layer-1 {
  background:
    radial-gradient(circle at 15% 100%, rgba(255, 220, 140, 0.8), transparent 44%),
    radial-gradient(circle at 50% 100%, rgba(255, 170, 70, 0.78), transparent 46%),
    radial-gradient(circle at 85% 100%, rgba(255, 220, 140, 0.74), transparent 43%);
  transform-origin: bottom center;
  animation: flameLift 1.55s ease-in-out infinite alternate;
}

.theme-fire .layer-2 {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 245, 200, 0.3) 0 2px,
    transparent 2px 8px
  );
  animation: emberRise 2.2s linear infinite;
  opacity: 0.58;
}

.theme-rain {
  background: linear-gradient(180deg, #1a202e, #2e3950 60%, #4a5572);
}

.theme-rain .layer-1 {
  background: repeating-linear-gradient(
    165deg,
    rgba(195, 212, 255, 0.45) 0 1px,
    transparent 1px 7px
  );
  animation: rainFall 1.3s linear infinite;
}

.theme-rain .layer-2 {
  background:
    radial-gradient(ellipse at 50% 125%, rgba(170, 200, 250, 0.42), transparent 50%),
    radial-gradient(ellipse at 15% 10%, rgba(225, 235, 255, 0.23), transparent 42%);
}

.theme-dune {
  background: linear-gradient(180deg, #d1974a 0%, #ab6f35 45%, #744421 100%);
}

.theme-dune .layer-1 {
  background:
    radial-gradient(ellipse at 30% 90%, rgba(255, 216, 146, 0.42), transparent 52%),
    radial-gradient(ellipse at 70% 95%, rgba(233, 170, 95, 0.5), transparent 52%);
  animation: duneDrift 5s ease-in-out infinite alternate;
}

.theme-dune .layer-2 {
  background: radial-gradient(circle at 78% 22%, rgba(255, 249, 196, 0.6) 0 7px, transparent 8px);
  animation: sunBreathe 4s ease-in-out infinite;
}

.theme-wolf {
  background: linear-gradient(180deg, #1e2334, #354768);
}

.theme-wolf .layer-1 {
  background:
    radial-gradient(circle at 74% 23%, rgba(245, 246, 255, 0.77) 0 8px, transparent 9px),
    linear-gradient(180deg, transparent 56%, rgba(15, 26, 36, 0.84) 56%);
}

.theme-wolf .layer-2 {
  background: repeating-linear-gradient(
    90deg,
    transparent 0 4px,
    rgba(24, 34, 43, 0.55) 4px 7px
  );
  animation: panX 6s linear infinite;
  opacity: 0.8;
}

.theme-cosmic {
  background: linear-gradient(190deg, #161227, #2b1d46 55%, #46306d);
}

.theme-cosmic .layer-1 {
  background:
    radial-gradient(circle at 18% 24%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 74% 20%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 46% 62%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 28% 78%, #fff 0 1px, transparent 2px);
  animation: twinkle 1.9s ease-in-out infinite alternate;
}

.theme-cosmic .layer-2 {
  background:
    radial-gradient(circle at 70% 30%, rgba(162, 117, 255, 0.56), transparent 35%),
    radial-gradient(circle at 35% 58%, rgba(119, 190, 255, 0.42), transparent 36%);
  animation: pulseSoft 3.2s ease-in-out infinite;
}

.theme-gothic {
  background: linear-gradient(180deg, #10101a, #25172d 48%, #3e2024);
}

.theme-gothic .layer-1 {
  background:
    radial-gradient(circle at 78% 18%, rgba(245, 239, 207, 0.72) 0 8px, transparent 9px),
    linear-gradient(180deg, transparent 56%, rgba(23, 11, 15, 0.82) 56%);
}

.theme-gothic .layer-2 {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 8px,
      rgba(0, 0, 0, 0.35) 8px 10px
    );
  animation: panX 7s linear infinite;
}

.theme-sea {
  background: linear-gradient(180deg, #0f2743, #1d456c 56%, #2d6d8f);
}

.theme-sea .layer-1 {
  background:
    radial-gradient(ellipse at 50% 88%, rgba(148, 214, 255, 0.45), transparent 50%),
    repeating-linear-gradient(
      0deg,
      rgba(74, 163, 214, 0.2) 0 3px,
      rgba(27, 93, 131, 0.34) 3px 7px
    );
  animation: seaSwell 2.4s ease-in-out infinite;
}

.theme-sea .layer-2 {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 45%);
  animation: pulseSoft 2.8s ease-in-out infinite;
}

.theme-circus {
  background: repeating-linear-gradient(
    135deg,
    #a12b31 0 9px,
    #f3dcc4 9px 18px
  );
}

.theme-circus .layer-1 {
  background: radial-gradient(circle at 50% 22%, rgba(255, 244, 201, 0.48), transparent 30%);
  animation: pulseSoft 2.1s ease-in-out infinite;
}

.theme-circus .layer-2 {
  background:
    repeating-radial-gradient(
      circle at 50% 120%,
      rgba(30, 15, 16, 0.2) 0 4px,
      rgba(0, 0, 0, 0) 4px 9px
    );
}

.theme-steel {
  background: linear-gradient(180deg, #202737, #39465c 48%, #58677f);
}

.theme-steel .layer-1 {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.15) 0 2px,
      rgba(0, 0, 0, 0.1) 2px 6px
    );
  animation: panX 7s linear infinite;
}

.theme-steel .layer-2 {
  background:
    radial-gradient(circle at 50% 40%, rgba(247, 232, 185, 0.4), transparent 32%);
  animation: pulseSoft 2.7s ease-in-out infinite;
}

.theme-perfume {
  background: linear-gradient(180deg, #3b284d, #704f8f 55%, #b37fb8);
}

.theme-perfume .layer-1 {
  background:
    radial-gradient(circle at 30% 75%, rgba(255, 206, 235, 0.38), transparent 35%),
    radial-gradient(circle at 65% 30%, rgba(228, 183, 255, 0.36), transparent 33%);
  animation: swirl 6s linear infinite;
}

.theme-perfume .layer-2 {
  background:
    repeating-radial-gradient(
      circle at 70% 85%,
      rgba(255, 255, 255, 0.24) 0 2px,
      transparent 2px 7px
    );
  animation: pulseSoft 2.3s ease-in-out infinite;
}

.book-meta {
  margin: 0.2rem 0 0.45rem;
  color: var(--smoke);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(199, 168, 107, 0.45);
  padding: 0.16rem 0.62rem;
  font-size: 0.9rem;
}

.badge.good {
  background: rgba(95, 183, 123, 0.18);
}

.badge.mid {
  background: rgba(199, 168, 107, 0.2);
}

.badge.low {
  background: rgba(220, 76, 76, 0.2);
}

.badge.pending {
  background: rgba(106, 122, 172, 0.25);
}

.dual {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1rem;
}

.score-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.score-summary {
  margin-top: 0.75rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.score-table {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.3rem;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid rgba(199, 168, 107, 0.18);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  background: rgba(0, 0, 0, 0.18);
}

.row strong {
  color: var(--smoke);
}

.chronicle-list {
  display: grid;
  gap: 0.5rem;
}

.decent-chat-list {
  display: grid;
  gap: 0.55rem;
}

.decent-chat-item {
  border-left: 2px solid rgba(199, 168, 107, 0.55);
  padding-left: 0.62rem;
}

.decent-chat-item p {
  margin: 0;
}

.decent-chat-meta {
  color: #d7c5a2;
  font-size: 0.86rem;
}

.decent-chat-text {
  margin-top: 0.12rem !important;
  font-size: 1.04rem;
}

.chronicle-item {
  border-left: 2px solid rgba(199, 168, 107, 0.55);
  padding-left: 0.6rem;
}

.chronicle-date {
  margin: 0;
  color: #d8c39d;
  font-size: 0.88rem;
}

.chronicle-text {
  margin: 0.14rem 0 0;
  font-size: 1rem;
}

.wishlist-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: center;
}

.wishlist-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.45rem;
}

.wish-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(199, 168, 107, 0.25);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.46rem 0.58rem;
}

.wish-text {
  margin: 0;
}

.wish-text strong {
  color: #f8eac9;
}

.wish-meta {
  color: var(--smoke);
  font-size: 0.9rem;
}

.wish-empty {
  color: var(--smoke);
  margin: 0.2rem 0 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes twinkle {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 0.95;
  }
}

@keyframes panX {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(8px);
  }
}

@keyframes pulseSoft {
  0% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.55;
  }
}

@keyframes rainFall {
  from {
    transform: translateY(-8px);
  }
  to {
    transform: translateY(12px);
  }
}

@keyframes duneDrift {
  from {
    transform: translateX(-3px);
  }
  to {
    transform: translateX(5px);
  }
}

@keyframes seaSwell {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes emberRise {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(-8px);
  }
}

@keyframes flameLift {
  from {
    transform: scaleY(0.92);
  }
  to {
    transform: scaleY(1.08);
  }
}

@keyframes swirl {
  from {
    transform: rotate(0deg) scale(0.98);
  }
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

@keyframes sunBreathe {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

@media (max-width: 960px) {
  .dual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 0.8rem;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

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

  .wishlist-form {
    grid-template-columns: 1fr;
  }
}
