@import "tailwindcss";
@source "../../javascript";
@source "../../views";

:root {
  --ink: #141210;
  --panel: rgba(18, 16, 14, 0.78);
  --line: rgba(243, 234, 216, 0.12);
  --cream: #f3ead8;
  --mute: #b9ae9c;
  --brass: #e0b07a;
  --live: #d4533a;
}

.dare-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.15fr);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--ink);
}

.dare-shell:not(.is-office) {
  display: block;
  height: auto;
  min-height: 100vh;
  background: transparent;
}

.dare-shell.is-office .campfire-host {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

#dare-office {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  position: relative;
}

.office-map-only,
.office-map-only .office-map {
  height: 100%;
}

.office-map {
  position: relative;
  min-width: 0;
}

.office-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.office-top {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  pointer-events: none;
}

.office-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}

.office-title {
  font-family: "Fraunces", serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 650;
}

.office-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  font-size: 12px;
  color: var(--mute);
  pointer-events: auto;
}

.office-walk-hint,
.office-stage-hint {
  position: absolute;
  top: 24px;
  right: 20px;
  z-index: 3;
  font-size: 12px;
  color: var(--mute);
  pointer-events: none;
}

.office-dock-wrap {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.office-self {
  width: 168px;
  flex: 0 0 168px;
}

.office-self-frame {
  position: relative;
  height: 118px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1b1814;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.office-self-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.office-self-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: radial-gradient(circle at 50% 20%, #3a3329, #161310 70%);
}

.office-self-ph span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a241c;
  border: 1px solid var(--brass);
  color: var(--brass);
  font-family: "Fraunces", serif;
  font-size: 18px;
}

.office-self-ph small {
  color: var(--mute);
  font-size: 11px;
}

.office-self-meta {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px 0;
  font-size: 11px;
  color: var(--mute);
}

.office-self-meta strong {
  color: var(--cream);
}

.office-peers {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 280px;
}

.peer-tile {
  position: relative;
  width: 112px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1b1814;
  flex: 0 0 112px;
}

.peer-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.peer-tile span {
  position: absolute;
  left: 6px;
  bottom: 5px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.62);
  padding: 1px 5px;
  border-radius: 6px;
}

.peer-tile i {
  display: none;
}

.office-dock {
  margin-left: auto;
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.dock-btn {
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 6px;
  border-radius: 16px;
  color: var(--cream);
  cursor: pointer;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dock-btn.is-on {
  background: rgba(224, 176, 122, 0.16);
  color: var(--brass);
}

.dock-btn[data-mic].is-on,
.dock-btn[data-cam].is-on {
  background: rgba(212, 83, 58, 0.16);
  color: #f0c0b4;
}

.dock-ico {
  display: grid;
  place-items: center;
  height: 22px;
}

.dock-lab {
  font-size: 11px;
  font-weight: 600;
}

.dock-hint {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.campfire {
  --cf-bg: oklch(100% 0 0);
  --cf-text: oklch(0% 0 0);
  --cf-mute: oklch(45% 0 0);
  --cf-bubble: oklch(96% 0.005 96);
  --cf-border: oklch(90% 0.005 96);
  --cf-link: oklch(54% 0.23 255);
  --cf-mention: oklch(51% 0.2 31 / 0.12);
  --cf-selected: oklch(95% 0.03 255);
  display: grid;
  grid-template-columns: 168px 1fr;
  border-left: 1px solid #1c1916;
  background: var(--cf-bg);
  color: var(--cf-text);
  min-width: 0;
  min-height: 0;
  height: 100vh;
}

@media (prefers-color-scheme: dark) {
  .campfire {
    --cf-bg: oklch(12% 0 0);
    --cf-text: oklch(96% 0 0);
    --cf-mute: oklch(70% 0 0);
    --cf-bubble: oklch(22% 0 0);
    --cf-border: oklch(28% 0 0);
    --cf-link: oklch(72% 0.16 248);
    --cf-mention: oklch(74% 0.18 29 / 0.2);
    --cf-selected: oklch(28% 0.05 248);
  }
}

.cf-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 10px 16px;
  border-right: 1px solid var(--cf-border);
  overflow-y: auto;
  background: color-mix(in oklch, var(--cf-bg) 92%, black);
}

.cf-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Fraunces", serif;
  font-size: 16px;
  color: var(--cf-text);
}

.cf-directs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cf-direct {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 48px;
  color: var(--cf-text);
  font-size: 10px;
}

.cf-direct.unread .cf-direct-name {
  font-weight: 800;
}

.cf-direct.unread .cf-avatar::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--cf-text);
}

.cf-tools {
  display: grid;
  gap: 4px;
}

.cf-tool,
.cf-room,
.cf-person {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--cf-text);
}

.cf-room.unread {
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--cf-text);
}

.cf-tool.is-current,
.cf-room.is-current,
.cf-person:hover,
.cf-tool:hover,
.cf-room:hover {
  background: var(--cf-selected);
}

.cf-kicker {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cf-mute);
}

.cf-empty {
  font-size: 12px;
  color: var(--cf-mute);
  padding: 4px 2px;
}

.cf-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.cf-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--cf-border);
}

.cf-nav h2 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  line-height: 1;
}

.cf-nav p {
  font-size: 12px;
  color: var(--cf-mute);
}

.cf-search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cf-border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--cf-mute);
  height: fit-content;
}

.cf-search input {
  background: transparent;
  width: 110px;
  font-size: 12px;
  color: var(--cf-text);
}

.cf-messages,
.cf-panel {
  flex: 1 1 auto;
  min-height: 180px;
  overflow-y: auto;
  padding: 14px 12px 18px;
}

.cf-empty-room {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--cf-mute);
  opacity: 0.7;
}

.cf-message {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
}

.cf-message.is-me {
  grid-template-columns: 1fr 36px;
}

.cf-message.is-me .cf-avatar { grid-column: 2; grid-row: 1; }
.cf-message.is-me .cf-bubble { grid-column: 1; grid-row: 1; justify-self: end; }
.cf-message.is-me .cf-meta { flex-direction: row-reverse; }
.cf-message.is-threaded .cf-avatar,
.cf-message.is-threaded .cf-meta strong { visibility: hidden; height: 0; }
.cf-message.is-threaded { margin-top: -10px; }
.cf-message.is-failed { opacity: 0.5; }

.cf-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: hsl(var(--h, 200) 45% 42%);
}

.cf-direct .cf-avatar { width: 36px; height: 36px; }

.cf-bubble {
  max-width: min(80ch, 92%);
}

.cf-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 3px;
}

.cf-meta strong { font-weight: 500; }
.cf-meta time { color: var(--cf-mute); font-size: 11px; }

.cf-body {
  background: var(--cf-bubble);
  border-radius: 0.66em;
  padding: 0.66rem 1rem;
  width: fit-content;
  max-width: 100%;
  word-break: break-word;
  line-height: 1.4;
}

.cf-message.is-mentioned .cf-body {
  background: var(--cf-mention);
}

.cf-body mark {
  background: oklch(70% 0.2 44 / 0.35);
  border-radius: 4px;
  padding: 0 3px;
}

.cf-more {
  position: relative;
  margin-left: auto;
}

.cf-more summary {
  list-style: none;
  cursor: pointer;
  opacity: 0;
  letter-spacing: 0.08em;
  color: var(--cf-mute);
  padding: 0 4px;
}

.cf-message:hover .cf-more summary,
.cf-more[open] summary { opacity: 1; }
.cf-more summary::-webkit-details-marker { display: none; }

.cf-menu {
  position: absolute;
  top: 120%;
  right: 0;
  z-index: 4;
  background: var(--cf-bg);
  border: 1px solid var(--cf-border);
  border-radius: 10px;
  padding: 4px;
  min-width: 110px;
  box-shadow: 0 10px 24px oklch(0% 0 0 / 0.12);
}

.cf-menu button {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.cf-menu button:hover { background: var(--cf-selected); }

.cf-boosts {
  margin-top: 4px;
  font-size: 12px;
  color: var(--cf-link);
}

.cf-file {
  display: block;
  margin-top: 6px;
  border: 1px solid var(--cf-border);
  border-radius: 0.66em;
  overflow: hidden;
  color: var(--cf-text);
}

.cf-file img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.cf-file span {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--cf-mute);
}

.cf-inbox-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--cf-border);
  margin-bottom: 8px;
  color: var(--cf-text);
}

.cf-composer {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--cf-border);
}

.cf-composer input[type="text"] {
  background: var(--cf-bubble);
  border: 1px solid var(--cf-border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--cf-text);
}

.cf-attach,
.cf-send {
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--cf-border);
  cursor: pointer;
  color: var(--cf-text);
}

.cf-send {
  background: var(--cf-text);
  color: var(--cf-bg);
}

.campfire-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px 16px;
  border-right: 1px solid var(--line);
  background: #100e0c;
  overflow-y: auto;
}

.campfire-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Fraunces", serif;
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--brass);
}

.rail-section {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}

.rail-btn,
.rail-person {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--cream);
}

.rail-btn em {
  margin-left: auto;
  background: var(--live);
  color: white;
  border-radius: 999px;
  min-width: 16px;
  padding: 0 5px;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.rail-btn.is-on,
.rail-person:hover,
.rail-btn:hover {
  background: rgba(243, 234, 216, 0.08);
}

.rail-btn.is-on {
  background: rgba(224, 176, 122, 0.18);
  color: var(--brass);
}

.rail-empty {
  font-size: 11px;
  color: var(--mute);
  padding: 4px 8px;
}

.campfire-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.campfire-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 8px;
}

.campfire-head h2 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  line-height: 1;
}

.campfire-head p {
  font-size: 12px;
  color: var(--mute);
}

.campfire-search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--mute);
}

.campfire-search input {
  background: transparent;
  width: 120px;
  font-size: 12px;
}

.campfire-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 10px;
  font-size: 11px;
  color: var(--mute);
}

.campfire-inbox,
.campfire-files {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
}

.inbox-row,
.file-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  color: var(--cream);
}

.file-card {
  display: block;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--cream);
}

.file-card img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.file-card span,
.file-row span {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--mute);
}

.boost-btn {
  margin-top: 4px;
  font-size: 11px;
  color: var(--brass);
}

.chat-row.is-mention {
  background: rgba(224, 176, 122, 0.1);
  border-radius: 10px;
  padding: 6px;
}

.chat-row mark {
  background: rgba(224, 176, 122, 0.35);
  color: var(--cream);
  border-radius: 4px;
  padding: 0 3px;
}

.office-chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #171512;
}

.office-chat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 16px 10px;
}

.office-chat-head h2 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  line-height: 1;
}

.office-chat-head p {
  font-size: 12px;
  color: var(--mute);
}

.office-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 16px 10px;
}

.office-scope button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--mute);
}

.office-scope button.is-on {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--cream);
}

.office-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 12px;
}

.chat-row {
  margin-bottom: 10px;
}

.chat-who {
  display: block;
  font-size: 11px;
  color: var(--brass);
}

.chat-row p {
  font-size: 14px;
  line-height: 1.35;
}

.chat-row.is-nearby .chat-who::after {
  content: " · nearby";
  color: var(--mute);
}

.office-compose {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.office-compose input[type="text"] {
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.office-file,
.office-send {
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--cream);
}

.office-send {
  background: var(--brass);
  color: var(--ink);
  border-color: var(--brass);
}

.office-stage {
  position: absolute;
  inset: 72px 28px 160px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.office-stage.hidden,
.hidden,
.sr-only {
  display: none !important;
}

.stage-card {
  width: min(860px, 100%);
  background: #0d0c0b;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.stage-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--mute);
}

.stage-card video {
  width: 100%;
  max-height: 52vh;
  background: black;
}

@media (max-width: 900px) {
  .office { grid-template-columns: 1fr; }
  .campfire { display: none; }
  .office-stage-hint { right: 16px; }
}
