:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --card: #151922;
  --text: #eef2ff;
  --muted: #9aa6c2;
  --accent: #3dd6ff;
  --btn: #1e2a44;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1a2740, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.lead,
.hint,
.status {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}

.room-line {
  display: flex;
  gap: 12px;
  align-items: center;
}

.code {
  font-size: 2rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #041018;
  font-weight: 650;
  padding: 12px 14px;
  font-size: 0.95rem;
}

button.secondary {
  background: var(--btn);
  color: var(--text);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.actions button:first-child {
  grid-column: 1 / -1;
}

.actions.mirror-actions {
  grid-template-columns: 1fr 1fr;
}

.actions.mirror-actions button:first-child {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  border: 1px solid #2a3348;
  border-radius: 10px;
  background: #0e121a;
  color: var(--text);
  padding: 12px;
  font-size: 1rem;
}

.url {
  display: block;
  word-break: break-all;
  background: #0e121a;
  padding: 10px;
  border-radius: 10px;
  margin: 8px 0 12px;
  font-size: 0.8rem;
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.type-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #07090e;
  padding: env(safe-area-inset-top, 8px) 12px env(safe-area-inset-bottom, 8px);
}

.type-panel[hidden] {
  display: none !important;
}

body.type-mode {
  overflow: hidden;
}

.type-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.type-bar button {
  flex: 0 0 auto;
  min-width: 4.5rem;
}

.type-label {
  flex: 1;
  text-align: center;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.type-field {
  flex: 1;
  display: flex;
  min-height: 0;
}

.type-field textarea {
  width: 100%;
  height: 100%;
  min-height: 7rem;
  resize: none;
  border: 1px solid #2a3348;
  border-radius: 14px;
  background: #0e121a;
  color: var(--text);
  padding: 16px 18px;
  font-size: 1.35rem;
  line-height: 1.35;
  caret-color: var(--accent);
}

.type-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (orientation: landscape) {
  .type-panel {
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .type-field textarea {
    font-size: 1.55rem;
    min-height: 5.5rem;
  }

  .type-hint {
    display: none;
  }
}
