:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #f6f7fb;
  --card: #ffffff;
  --accent: #635bff;
  --text: #1f2430;
  --muted: #5f6775;
  --border: #d7dbe7;
  --surface: #eef1f6;
  --shadow: 0 12px 24px rgba(31, 36, 48, 0.08);
  --shadow-strong: 0 6px 12px rgba(99, 91, 255, 0.3);
  --vote-bg: #f3f4ff;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131a;
  --card: #1b1f2b;
  --accent: #8a84ff;
  --text: #eef1f6;
  --muted: #a6b0c4;
  --border: #31384b;
  --surface: #262c3b;
  --shadow: 0 12px 24px rgba(6, 8, 14, 0.45);
  --shadow-strong: 0 6px 12px rgba(138, 132, 255, 0.35);
  --vote-bg: #24293d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  position: absolute;
  right: 25px;
  top: 25px;
}

.subtitle {
  color: var(--muted);
  margin-top: 0.5rem;
}

.card-get-started {
  background: var(--card);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-right: 3rem;
  padding-left: 3rem;
}

.get-started-container {
  padding-left: 8rem;
  padding-right: 8rem;
}

.card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.6);
}

.modal-card {
  position: relative;
  background: var(--card);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  width: min(90vw, 420px);
  text-align: center;
  border: 1px solid var(--border);
}

.modal-card .subtitle {
  margin-bottom: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-form input {
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.actions.stacked {
  flex-direction: column;
  align-items: stretch;
}

.divider {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.join-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.actions input {
  flex: 1;
  min-width: 160px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

button {
  border: none;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 1.1rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.participant-count {
  background: var(--surface);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.vote-grid button {
  background: var(--vote-bg);
}

.vote-grid button.selected {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-strong);
}

.participant-grid-header {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.participant-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  margin-top: 0.5rem;
  align-items: center;
}

.participant-name {
  font-weight: 600;
  max-width: 15rem;
}

.participant-value {
  min-width: 2.5rem;
  padding: 0.25rem 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 2px 4px rgba(31, 36, 48, 0.12);
}

.participant-value.voted {
  color: #2e9f48;
}

.participant-separator {
  grid-column: 1;
  height: 1px;
  background: var(--border);
  margin-left: 2.5rem;
  margin-right: 2.5rem;
  margin-top: 0rem;
  margin-bottom: 0rem;
}

.participant-separator-spacer {
  grid-column: 2;
}

@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }

  50% {
    transform: rotateY(90deg);
  }

  100% {
    transform: rotateY(0deg);
  }
}

.message {
  color: var(--muted);
  margin-top: 1rem;
}

.room-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}