:root {
  --bg: #15141a;
  --surface: #1f1e26;
  --surface-2: #29283340;
  --text: #f2efe6;
  --text-dim: #a6a3b0;
  --amber: #f2a53d;
  --amber-dim: #8a6a2f;
  --danger: #e2574c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, #f2a53d14, transparent 40%),
    radial-gradient(circle at 85% 100%, #f2a53d0d, transparent 45%);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px 1px var(--amber);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.28em;
  font-size: 13px;
  color: var(--text-dim);
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 22px 60px;
}

.screen.hidden { display: none; }

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.15;
  margin: 10px 0 8px;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  margin: 4px 0 18px;
}

.sub {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 26px;
}

.back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 0;
  margin-bottom: 18px;
  cursor: pointer;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-btn {
  text-align: left;
  background: var(--surface);
  border: 1px solid #34323e;
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card-btn:hover, .card-btn:focus-visible {
  border-color: var(--amber-dim);
  transform: translateY(-1px);
}

.card-btn-title {
  font-size: 17px;
  font-weight: 600;
}

.card-btn-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

.primary-btn {
  width: 100%;
  background: var(--amber);
  color: #1a1305;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.primary-btn:active { transform: scale(0.98); }

.danger-btn {
  width: 100%;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 18px;
}

input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid #34323e;
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
}

input[type="text"]:focus-visible, .card-btn:focus-visible, .primary-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.room-code-box {
  border: 1px dashed var(--amber-dim);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.room-code-box .label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.room-code-box .code {
  font-family: "Courier New", monospace;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--amber);
}

.share-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.qr-canvas {
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  line-height: 0;
}

.share-link-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.share-link-row input {
  flex: 1;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.copy-btn {
  background: var(--surface);
  border: 1px solid #34323e;
  color: var(--text);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn.copied {
  border-color: var(--amber);
  color: var(--amber);
}

.sub.tiny {
  font-size: 12.5px;
  margin: 0;
  text-align: center;
}

video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.video-wrap {
  position: relative;
}

.video-wrap:fullscreen video,
.video-wrap:-webkit-full-screen video {
  border-radius: 0;
  height: 100%;
  object-fit: contain;
}

.fullscreen-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: #00000099;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.fullscreen-btn:hover, .fullscreen-btn:focus-visible {
  background: #000000cc;
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.viewer-count {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 12px 2px 0;
}

.viewer-count span {
  color: var(--amber);
  font-weight: 700;
}

.error {
  color: var(--danger);
  font-size: 13.5px;
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .card-btn { transition: none; }
}
