:root {
  color-scheme: dark;
  --bg: #07080d;
  --bg-soft: #0f1220;
  --panel: rgba(19, 23, 41, 0.88);
  --panel-strong: rgba(31, 37, 66, 0.94);
  --text: #f7f4ed;
  --muted: #b9b4c9;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #f4b750;
  --accent-2: #7dd3fc;
  --hot: #ff6b7a;
  --ok: #7bed9f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 183, 80, 0.18), transparent 34rem),
    radial-gradient(circle at 86% 12%, rgba(125, 211, 252, 0.2), transparent 30rem),
    linear-gradient(145deg, var(--bg), #111322 64%, #06070b);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button,
.hero-actions a {
  border: 1px solid rgba(244, 183, 80, 0.38);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  color: #1b1305;
  background: linear-gradient(135deg, #ffd987, var(--accent));
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(244, 183, 80, 0.2);
}

button.ghost,
.filters button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  box-shadow: none;
}

button:hover,
.hero-actions a:hover {
  transform: translateY(-1px);
}

.shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.04;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  letter-spacing: -0.075em;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.045em;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions,
.form-row,
.panel-heading,
.filters,
.card-meta,
.card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.room-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.room-card {
  display: grid;
  gap: 12px;
  align-content: center;
  padding: 22px;
}

.label,
.hint,
.presence,
.card-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

#room-code {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.status {
  width: fit-content;
  border-radius: 999px;
  padding: 0.34rem 0.66rem;
  color: #04100a;
  background: var(--ok);
  font-size: 0.85rem;
  font-weight: 900;
}

.status.local,
.status.connecting {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.panel {
  margin-top: 18px;
  padding: 20px;
}

.identity {
  display: grid;
  grid-template-columns: 190px minmax(180px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.identity p {
  margin: 0;
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(125, 211, 252, 0.82);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.14);
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading.wrap {
  align-items: flex-start;
}

.form-row {
  margin-top: 12px;
  align-items: end;
}

.form-row label {
  flex: 1 1 170px;
}

.form-row button {
  flex: 1 1 170px;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.filters button {
  padding: 0.58rem 0.78rem;
  font-size: 0.84rem;
}

.filters button.active {
  border-color: rgba(125, 211, 252, 0.74);
  background: rgba(125, 211, 252, 0.16);
}

.empty {
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.thought-list,
.top-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thought-card,
.top-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: var(--panel-strong);
}

.thought-card.pinned {
  border-color: rgba(244, 183, 80, 0.58);
  box-shadow: inset 0 0 0 1px rgba(244, 183, 80, 0.18);
}

.card-text {
  margin: 10px 0 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.badge {
  border-radius: 999px;
  padding: 0.25rem 0.58rem;
  color: #081018;
  background: var(--accent-2);
  font-weight: 900;
  text-transform: capitalize;
}

.badge.owner {
  color: #211405;
  background: var(--accent);
}

.vote {
  min-width: 82px;
}

.vote.voted,
.pin.pinned {
  color: #27060b;
  background: linear-gradient(135deg, #ff9aa6, var(--hot));
  border-color: rgba(255, 107, 122, 0.7);
}

.delete {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.top-item {
  display: grid;
  gap: 8px;
}

.top-rank {
  color: var(--accent);
  font-weight: 900;
}

#toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  color: var(--text);
  background: rgba(8, 10, 18, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: 160ms ease;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 880px) {
  .hero,
  .board-grid,
  .identity {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px;
  }
}
