:root {
  color-scheme: light;
  --bg: #f8f5f1;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --border: rgba(164, 16, 52, 0.14);
  --text: #221a1b;
  --muted: #62575a;
  --accent: #a41034;
  --accent-soft: rgba(164, 16, 52, 0.08);
  --shadow: 0 20px 48px rgba(64, 33, 38, 0.12);
  --card: rgba(248, 244, 240, 0.96);
  --line: rgba(34, 26, 27, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(164, 16, 52, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(214, 160, 99, 0.16), transparent 26%),
    linear-gradient(180deg, #fbf8f4 0%, #f1ebe4 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  overflow: hidden;
}

button {
  font: inherit;
}

.room-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#room-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.room-topbar,
.room-panel,
.focus-card,
.room-footer {
  position: absolute;
  z-index: 2;
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.room-topbar {
  top: 24px;
  left: 24px;
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.topbar-link,
.topbar-button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.topbar-link:hover,
.topbar-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.room-panel {
  top: 96px;
  left: 24px;
  width: min(360px, calc(100vw - 48px));
  padding: 22px 22px 18px;
  border-radius: 28px;
  background: var(--panel);
}

.panel-kicker,
.focus-tag,
.panel-label,
.room-footer {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-kicker,
.focus-tag {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--accent);
}

.room-panel h1,
.focus-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.95;
}

.panel-copy,
#focus-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.96rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.panel-grid > div {
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}

.panel-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.75rem;
}

.panel-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.focus-card {
  right: 24px;
  top: 96px;
  bottom: 24px;
  width: min(430px, calc(100vw - 48px));
  padding: 20px;
  border-radius: 24px;
  background: var(--panel-strong);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.focus-card[hidden] {
  display: none;
}

.focus-card.is-overview {
  bottom: auto;
  max-height: min(560px, calc(100vh - 120px));
}

.focus-card.is-compact {
  bottom: auto;
  max-height: none;
}

.focus-card.is-active {
  border-color: rgba(164, 16, 52, 0.32);
}

.focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.focus-close {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.focus-close:hover {
  color: var(--accent);
  border-color: rgba(164, 16, 52, 0.25);
  transform: translateY(-1px);
}

.focus-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.focus-body:empty {
  display: none;
}

.focus-body::-webkit-scrollbar {
  width: 10px;
}

.focus-body::-webkit-scrollbar-thumb {
  background: rgba(164, 16, 52, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.focus-empty {
  margin: 0;
  color: var(--muted);
}

.detail-section + .detail-section {
  margin-top: 18px;
}

.detail-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}

.detail-item h3,
.detail-item h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.detail-item p,
.detail-item li {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.detail-item ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.detail-meta {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-actions,
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-chip,
.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 0.86rem;
}

.detail-chip {
  background: rgba(164, 16, 52, 0.06);
  color: var(--accent);
}

.detail-link {
  border: 1px solid rgba(164, 16, 52, 0.18);
  color: var(--accent);
  background: #fff;
}

.detail-link:hover {
  text-decoration: none;
  background: rgba(164, 16, 52, 0.05);
}

.detail-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.room-footer {
  left: 24px;
  bottom: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.72rem;
}

@media (max-width: 900px) {
  .room-panel {
    width: min(320px, calc(100vw - 32px));
    left: 16px;
    top: 82px;
    padding: 18px;
  }

  .focus-card {
    right: 16px;
    top: 82px;
    bottom: 16px;
    width: min(340px, calc(100vw - 32px));
  }

  .room-topbar,
  .room-footer {
    left: 16px;
  }
}

@media (max-width: 640px) {
  .room-topbar {
    top: 14px;
    left: 14px;
    right: 14px;
    justify-content: space-between;
  }

  .room-panel {
    top: auto;
    bottom: 164px;
    left: 14px;
    right: 14px;
    width: auto;
    padding: 16px;
  }

  .focus-card {
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 78px;
    width: auto;
    padding: 16px;
    max-height: 48vh;
  }

  .room-footer {
    left: 14px;
    right: 14px;
    bottom: 14px;
    border-radius: 24px;
    justify-content: center;
    text-align: center;
  }
}
