:root {
  color-scheme: light;
  --bg: #0b0d12;
  --card: #131826;
  --muted: #99a3b3;
  --text: #e9eef8;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #7c5cff;
  --primary2: #5bdeff;
  --danger: #ff5370;
  --ok: #45f1a6;
  --shadow: rgba(0, 0, 0, 0.35);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% 0%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(1000px 800px at 90% 20%, rgba(91, 222, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 18, 0.6);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand__title {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand__subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow);
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

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

.h2 {
  margin: 14px 0 10px;
  font-size: 14px;
  color: rgba(233, 238, 248, 0.9);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field--inline {
  display: inline-grid;
  gap: 6px;
  margin-right: 10px;
}

.field__label {
  font-size: 12px;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.textarea {
  resize: vertical;
  min-height: 100px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.row--wrap {
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn--small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.btn--primary {
  border-color: rgba(124, 92, 255, 0.55);
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.9), rgba(91, 222, 255, 0.7));
}

.btn--active {
  border-color: rgba(91, 222, 255, 0.65);
  background: rgba(91, 222, 255, 0.12);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--file input {
  display: none;
}

.error {
  background: rgba(255, 83, 112, 0.12);
  border: 1px solid rgba(255, 83, 112, 0.25);
  color: #ffd7de;
  padding: 10px 12px;
  border-radius: 12px;
}

.pill {
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.pill--connected {
  background: rgba(69, 241, 166, 0.12);
  border-color: rgba(69, 241, 166, 0.25);
  color: rgba(69, 241, 166, 0.95);
}

.pill--disconnected {
  background: rgba(255, 83, 112, 0.1);
  border-color: rgba(255, 83, 112, 0.25);
  color: rgba(255, 83, 112, 0.95);
}

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

.room-code {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.list li {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list--muted li {
  opacity: 0.85;
}

.badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(233, 238, 248, 0.9);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.host {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.status {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.status__title {
  font-size: 18px;
  font-weight: 900;
}

.preview {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.preview__title {
  font-weight: 900;
  margin-bottom: 6px;
}

.preview__text {
  white-space: pre-wrap;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.preview__img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.turn {
  display: grid;
  gap: 12px;
}

.imgpick {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.imgpick__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.imgpick__title {
  font-weight: 900;
}

.imgpick__img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.draw {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.draw__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.draw__canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.94);
  touch-action: none;
}

.reveal {
  display: grid;
  gap: 10px;
}

.segments {
  list-style: decimal;
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 12px;
}

.segments li {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.seg__by {
  font-weight: 900;
  margin-bottom: 8px;
}

.seg__text {
  white-space: pre-wrap;
  margin: 0 0 10px;
}

.seg__img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}
