:root {
  color-scheme: dark;
  --bg: #16130f;
  --bg-2: #221c16;
  --ink: #f6efe4;
  --muted: #b7aa9a;
  --line: rgba(246, 239, 228, 0.14);
  --accent: #ff5a36;
  --accent-ink: #2a0d06;
  --ok: #d6ff4a;
  --danger: #ff8d78;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #0c0a08;
  color: var(--ink);
}

body { min-height: 100dvh; }

button, input { font: inherit; color: inherit; }

button { cursor: pointer; touch-action: manipulation; }

#app {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
}

.narrow { padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }

.topbar, .top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
}

.brand {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.hello { margin: 0; font-size: 14px; }

.pill {
  min-height: 36px;
  padding: 0 14px;
  background: #fff;
  color: #1a120e;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 92dvh;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  height: 140px;
  background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-copy {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 88px 20px 22px;
  background: linear-gradient(180deg, transparent, rgba(12, 10, 8, 0.2) 18%, rgba(12, 10, 8, 0.92));
}

.hero h1 { font-size: 40px; line-height: 1.05; }

.hero .lead { margin-top: 10px; color: rgba(246, 239, 228, 0.86); }

.hero .primary { margin-top: 18px; min-height: 52px; }

.age { margin: 10px 0 0; color: rgba(246, 239, 228, 0.62); font-size: 12px; text-align: center; }

.strip-label {
  margin: 18px 16px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.gallery {
  display: flex;
  gap: 12px;
  margin: 10px 0 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  flex: 0 0 78%;
  scroll-snap-align: start;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 22px;
}

.card div {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 48px 16px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  border-radius: 0 0 22px 22px;
}

.card h2 { margin: 0 0 4px; font-size: 20px; }

.card p { margin: 0; color: rgba(246, 239, 228, 0.86); line-height: 1.45; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check input { width: auto; margin: 0; }

.switch { margin-top: 14px; }

.screen[hidden] { display: none; }

#home:not([hidden]),
#auth:not([hidden]),
#lobby:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.points li:last-child { border-bottom: 1px solid var(--line); }

.points strong { display: block; margin-bottom: 4px; font-size: 16px; }

.points span { color: var(--muted); font-size: 14px; line-height: 1.5; }

#home .primary { margin-top: 28px; }

.mast-small h1 { font-size: 32px; }

.text-btn {
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
}

.top-actions .text-btn {
  margin: 0;
  align-self: center;
  min-height: 44px;
  padding: 0 8px;
  color: #fff;
}

.site-footer {
  margin-top: auto;
  padding: 28px 16px calc(12px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.site-footer p { margin: 0; }

.site-footer a { color: var(--muted); text-decoration: none; }

.site-footer a:hover { color: var(--ink); }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 46px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lead, .note {
  color: var(--muted);
  line-height: 1.6;
}

.lead { margin: 14px 0 0; }

.panel, .rooms {
  margin-top: 22px;
  padding: 16px;
  background: rgba(34, 28, 22, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 12px;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  min-height: 48px;
}

input:focus {
  outline: 2px solid rgba(255, 90, 54, 0.7);
  border-color: transparent;
}

.primary, .ghost, .key, #refresh, .room-code {
  border: 0;
}

.primary {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-weight: 700;
}

.primary:disabled { opacity: 0.6; }

.error {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.rooms-head, .room-bar, .person-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h2 { margin: 0; font-size: 16px; }

#refresh, .ghost {
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}

#room-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

#room-list li + li { margin-top: 8px; }

.room-item, .person {
  width: 100%;
  text-align: left;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.room-item strong { display: block; font-size: 18px; letter-spacing: 0.08em; }

.room-item span, .empty { color: var(--muted); font-size: 13px; }

.room-bar { align-items: flex-end; }

.room-code {
  padding: 0;
  background: none;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

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

.note { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; }

.people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.person { padding: 14px; }

.person.speaking { box-shadow: inset 0 0 0 2px var(--ok); }

.person .name {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #3a241c;
  color: var(--ink);
  font-weight: 750;
}

.person.speaking .avatar { background: #31400d; color: var(--ok); }

.meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.kick {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--danger);
  font-size: 12px;
}

.dock {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 28%);
}

.key {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--ink);
  color: #1a120e;
  font-weight: 750;
}

.key[aria-pressed="true"] {
  background: #3a241c;
  color: var(--danger);
}

.empty { padding: 8px 0 2px; }
