:root {
  --bg: #e4ece8;
  --ink: #1b2824;
  --muted: #5d6f68;
  --card: #fbfcfa;
  --line: #d3ddd8;
  --accent: #0f6e56;
  --accent-ink: #f4fbf7;
  --danger: #9d342c;
  --live: #e2a008;
  --stage: #121a17;
  --shadow: 0 18px 50px rgba(27, 40, 36, 0.08);
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 10% -10%, #f7f3e4 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
}

body.session {
  height: 100vh;
  overflow: hidden;
  background: var(--stage);
}

button, input { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button:disabled { opacity: 0.55; cursor: default; }

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.danger { background: var(--danger); }

button:focus-visible, input:focus-visible {
  outline: 3px solid #f0c14d;
  outline-offset: 2px;
}

.card, .home {
  width: min(440px, calc(100% - 2rem));
  margin: 8vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.home {
  width: min(860px, calc(100% - 2rem));
  margin: 6vh auto;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.2rem;
}

.split article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem 1.2rem;
  background: #fff;
}

.split h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.download {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mark i {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

h1 { font-size: 1.7rem; line-height: 1.15; margin: 0.8rem 0 0.4rem; }

p { color: var(--muted); line-height: 1.45; }

label { display: block; font-size: 0.92rem; margin: 1rem 0 0.35rem; }

input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
}

input.code {
  font-family: Consolas, monospace;
  font-size: 2rem;
  letter-spacing: 0.28em;
  text-align: center;
}

.row { display: flex; gap: 0.7rem; margin-top: 1.2rem; }

.row button { flex: 1; }

.error {
  color: var(--danger);
  min-height: 1.2rem;
  margin: 0.8rem 0 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.card-head {
  padding: 0;
  border: 0;
  background: transparent;
}

body.session .topbar {
  background: #1b2622;
  color: #f3f7f4;
  border-bottom-color: #2c3b35;
}

body.session .ghost { color: #f3f7f4; border-color: #466055; }

.who { color: var(--muted); }

body.session .who { color: #c9d5ce; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--live);
  color: #2a2108;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.pill i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #2a2108;
  display: inline-block;
}

.stage {
  height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  position: relative;
}

canvas {
  background: #000;
  cursor: crosshair;
  touch-action: none;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
}

.waiting {
  position: absolute;
  color: #d5e2db;
  pointer-events: none;
}

.hint { margin: 0; font-size: 0.92rem; }
