* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(246,248,252,.78), rgba(246,248,252,.82)),
    url("../background.jpg") center/cover fixed;
}

.room-header {
  padding: 14px clamp(34px, 3.2vw, 54px) 0;
  border-bottom: 1px solid rgba(203,213,225,.72);
  background: rgba(255,255,255,.34);
  backdrop-filter: blur(2px);
}

.room-wrap {
  max-width: none;
  margin: 0 auto;
}

.room-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.room-title {
  margin: 0;
  font-size: clamp(38px, 3.2vw, 48px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
}

.back-link:hover {
  color: var(--ink);
}

.room-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
  padding-bottom: 14px;
}

.chip,
.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 750;
  line-height: 1;
  min-height: 38px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}

.chip[aria-pressed="true"],
.btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chip:disabled,
.chip[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search input {
  width: min(24vw, 280px);
  min-width: 250px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 15px;
  background: rgba(255,255,255,.9);
  font: inherit;
  box-shadow: inset 0 1px 1px rgba(15,23,42,.04);
}

.meter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-left: 10px;
  white-space: nowrap;
}

.bubble {
  display: inline-grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-weight: 800;
}

.stage {
  position: relative;
  max-width: none;
  margin: 0 auto;
  padding: 14px clamp(56px, 4.8vw, 72px) 44px;
}

.startpanel {
  width: min(1276px, calc(100vw - 136px));
  margin: 0 auto;
  max-height: calc(100vh - 176px);
  overflow: auto;
  padding: 26px 24px 34px;
  border: 1px solid rgba(226,232,240,.88);
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow:
    0 22px 70px rgba(15,23,42,.13),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.startpanel h2 {
  margin: 0 0 20px;
  font-size: 28px;
  line-height: 1.1;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #344054;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.topic-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.count {
  display: inline-grid;
  min-width: 26px;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(82,105,195,.12);
  color: #5269c3;
}

.topic-chip[aria-pressed="true"] .count {
  background: rgba(255,255,255,.25);
  color: #fff;
}

.startgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 50px 50px;
}

.startcard {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 170px;
  border: 1px solid rgba(15,23,42,.18);
  border-radius: 14px;
  overflow: hidden;
  background: #1e293b;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
  transform: translateZ(0);
}

.startcard-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(.34) brightness(.78);
  transition: transform .35s ease, filter .35s ease;
}

.startcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(0,0,0,.12), transparent 48%),
    linear-gradient(180deg, transparent 36%, rgba(0,0,0,.72));
}

.startcard:hover .startcard-bg {
  transform: scale(1.05);
  filter: grayscale(.12) brightness(.84);
}

.startcard-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 16px 18px;
}

.startcard-title {
  font-size: clamp(18px, 1.7vw, 23px);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 2px 7px rgba(0,0,0,.95);
}

.startcard-meta {
  margin-top: 4px;
  color: rgba(255,255,255,.9);
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 5px rgba(0,0,0,.9);
}

.deck {
  position: relative;
  min-height: calc(100vh - 168px);
  perspective: 1200px;
}

.article-card {
  position: absolute;
  left: clamp(56px, 4.8vw, 72px);
  top: 0;
  width: min(1148px, calc(100vw - 210px));
  height: min(76vh, 780px);
  overflow: auto;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(226,232,240,.96);
  border-radius: 18px;
  box-shadow:
    0 30px 80px rgba(15,23,42,.19),
    0 6px 22px rgba(15,23,42,.08);
  transform-origin: 50% 12%;
  transition: transform .46s cubic-bezier(.2,.8,.2,1), opacity .28s ease, filter .28s ease;
}

.article-card[data-pos="0"] {
  z-index: 5;
  transform: translateX(0) translateY(0) rotate(0deg) scale(1);
}

.article-card[data-pos="1"] {
  z-index: 4;
  transform: translateX(42px) translateY(20px) rotate(-1.2deg) scale(.985);
  opacity: .96;
  pointer-events: none;
}

.article-card[data-pos="2"] {
  z-index: 3;
  transform: translateX(82px) translateY(42px) rotate(1.6deg) scale(.966);
  opacity: .9;
  pointer-events: none;
}

.article-card[data-pos="3"] {
  z-index: 2;
  transform: translateX(-34px) translateY(62px) rotate(-2.2deg) scale(.948);
  opacity: .82;
  pointer-events: none;
}

.article-card[data-pos="4"] {
  z-index: 1;
  transform: translateX(116px) translateY(84px) rotate(2.8deg) scale(.93);
  opacity: .74;
  pointer-events: none;
}

.article-card:not([data-pos="0"]) {
  overflow: hidden;
  filter: grayscale(.08);
}

.article-card:not([data-pos="0"]) .article-body,
.article-card:not([data-pos="0"]) .tags {
  display: none;
}

.article-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 19px;
  border-bottom: 1px solid var(--line);
  background: rgba(248,251,255,.96);
  backdrop-filter: blur(3px);
}

.article-head h2 {
  margin: 0;
  font-size: clamp(22px, 1.8vw, 26px);
  line-height: 1.12;
}

.year {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.article-body {
  padding: 30px 48px 42px;
}

.content {
  font-size: 19px;
}

.content p,
.content .text-block {
  margin: 0 0 22px;
}

.content figure {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(15,23,42,.08);
}

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

.gallery-block figure {
  margin: 0;
}

.content img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  cursor: zoom-in;
}

.content figcaption {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  padding: 10px 12px 12px;
}

.quote-block {
  position: relative;
  margin: 30px 0;
  border-left: 5px solid rgba(82,105,195,.74);
  border-radius: 14px;
  padding: 22px 26px;
  background: rgba(236,241,255,.86);
  font-size: 20px;
  font-style: italic;
}

.quote-block::before {
  content: "“";
  position: absolute;
  top: -2px;
  left: 20px;
  color: rgba(82,105,195,.28);
  font-size: 70px;
  line-height: 1;
}

.quote-content {
  position: relative;
  z-index: 1;
}

.quote-source {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 15px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(82,105,195,.14);
  text-align: right;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  padding: 7px 11px;
  color: var(--muted);
  cursor: pointer;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.media-card {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(15,23,42,.08);
}

.media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}

.media-card-body {
  padding: 10px 12px;
  font-size: 14px;
}

.media-card a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 53%;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  padding: 0 18px;
  pointer-events: none;
}

.nav .btn {
  pointer-events: auto;
  min-width: 52px;
  min-height: 52px;
  padding: 0 18px;
  box-shadow: 0 14px 30px rgba(15,23,42,.16);
}

.empty {
  color: var(--muted);
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.hidden {
  display: none !important;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  background: rgba(0,10,30,.72);
  backdrop-filter: blur(2px);
}

.lb figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.lb img {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .2s ease;
  transform-origin: var(--x, 50%) var(--y, 50%);
}

.lb.zoomed img {
  transform: scale(2.35);
  cursor: zoom-out;
}

.lb figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .startgrid,
  .gallery-block {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .article-card {
    width: calc(100vw - 126px);
  }
}

@media (max-width: 780px) {
  .room-header {
    padding: 14px 16px 0;
  }

  .stage {
    padding: 14px 16px 30px;
  }

  .room-title {
    font-size: 42px;
  }

  .room-controls {
    gap: 8px;
  }

  .search {
    width: 100%;
    margin-left: 0;
  }

  .search input {
    width: 100%;
    min-width: 0;
  }

  .meter {
    margin-left: 0;
  }

  .startpanel {
    max-height: none;
    padding: 20px 14px;
    border-radius: 20px;
  }

  .startgrid,
  .gallery-block,
  .media-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .deck {
    min-height: 72vh;
  }

  .article-card {
    left: 16px;
    width: calc(100vw - 32px);
    height: 70vh;
  }

  .article-card[data-pos="1"] {
    transform: translateX(18px) translateY(16px) rotate(-1.2deg) scale(.982);
  }

  .article-card[data-pos="2"] {
    transform: translateX(28px) translateY(30px) rotate(1.4deg) scale(.966);
  }

  .article-head {
    padding: 18px;
  }

  .article-body {
    padding: 20px 18px 26px;
  }

  .nav {
    top: auto;
    bottom: 20px;
    padding: 0 18px;
  }
}
