:root {
  color-scheme: dark;
  --bg: #10140f;
  --card: #1a2118;
  --ink: #f3f1e7;
  --muted: #b7bba8;
  --line: #31392c;
  --lime: #d6ff4a;
  --ink-on-lime: #172006;
  --red: #ff4d3a;
  --amber: #ffd56a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

button, input { font: inherit; }

.phone {
  width: min(100%, 440px);
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at 50% 0%, #243024 0%, transparent 42%),
      var(--bg);
  }

  .phone {
    min-height: auto;
    margin: 40px auto;
    padding: 28px 24px 32px;
    background: #141a13;
    border: 1px solid var(--line);
    border-radius: 28px;
  }
}

.eyebrow {
  margin: 0;
  color: var(--lime);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.sub, .note, .hint {
  color: var(--muted);
  line-height: 1.45;
}

.sub { margin: 10px 0 0; }

.banner, .error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.4;
}

.banner {
  background: #3a3012;
  color: var(--amber);
}

.banner p { margin: 0; }

.banner a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  text-decoration: none;
}

.error {
  background: #3a1814;
  color: #ffb1a8;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

.user-id, .peer-id {
  margin: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-all;
}

.peer-id {
  color: var(--muted);
  font-size: 12px;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
}

input:focus {
  outline: 2px solid var(--lime);
  border-color: transparent;
}

.btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: #2a3326;
  color: var(--ink);
  font-weight: 700;
  touch-action: manipulation;
  cursor: pointer;
}

.btn.primary {
  background: var(--lime);
  color: var(--ink-on-lime);
}

.btn.small {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line);
}

.btn:disabled, .round:disabled {
  opacity: 0.45;
  cursor: default;
}

.or {
  margin: 16px 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.note { margin: 16px 0 0; font-size: 14px; }

#call {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  flex: 1;
}

.status {
  margin: 8px 0 0;
  color: var(--lime);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.peer {
  margin: 0;
  font-size: 22px;
}

.timer {
  margin: 8px 0 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 64px;
  letter-spacing: -0.04em;
}

.code-box {
  width: 100%;
  margin-top: 12px;
  padding: 18px 14px;
  background: var(--card);
  border-radius: 20px;
}

.code-label {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.big-code {
  margin: 8px 0 12px;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 48px;
  letter-spacing: 0.08em;
}

#hint { margin-top: 8px; }

.controls {
  display: flex;
  gap: 18px;
  margin-top: auto;
  padding-top: 24px;
}

.round {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 50%;
  background: #2a3326;
  color: var(--ink);
  font-weight: 700;
  touch-action: manipulation;
  cursor: pointer;
}

.round.danger { background: var(--red); color: white; }

.round.answer { background: var(--lime); color: var(--ink-on-lime); }

.round[aria-pressed="true"] { background: var(--amber); color: #241b08; }
