:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #111;
  color: #f3f3f3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #1b1b1b;
  --surface-raised: #242424;
  --border: rgba(235, 235, 235, 0.13);
  --muted: #a7a7a7;
  --accent: #dedede;
  --accent-dark: #242424;
  --danger: #e0e0e0;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(190, 190, 190, 0.075), transparent 34rem),
    radial-gradient(ellipse at 92% 78%, rgba(125, 125, 125, 0.08), transparent 32rem),
    #111;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #f5f5f5;
  text-decoration: none;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #dedede;
  color: #171717;
  font-weight: 900;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.current-user {
  color: #dedede;
  font-size: 14px;
}

.auth-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 9%;
  padding: 72px 0 96px;
}

.hero-copy h1,
.lobby-intro h1 {
  margin: 12px 0 18px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -3.4px;
}

.hero-description,
.lobby-intro p:not(.eyebrow) {
  max-width: 490px;
  color: #c0c0c0;
  font-size: 17px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.hero-stats span,
.count-badge {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #d1d1d1;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(38, 38, 38, 0.98), rgba(25, 25, 25, 0.98));
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.auth-panel {
  padding: 29px;
}

.panel-heading h2,
.create-panel h2,
.rooms-heading h2 {
  margin: 8px 0 0;
  font-size: 23px;
  letter-spacing: -0.6px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 25px 0 22px;
  padding: 5px;
  border: 1px solid rgba(235, 235, 235, 0.08);
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.42);
}

.tab-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.tab-button:not(.is-active):hover {
  color: #ededed;
  background: rgba(255, 255, 255, 0.045);
}

.tab-button.is-active {
  color: #fff;
  background: linear-gradient(180deg, #414141, #353535);
  box-shadow: inset 0 0 0 1px rgba(245, 245, 245, 0.09), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tab-button:focus-visible {
  outline: 2px solid rgba(230, 230, 230, 0.8);
  outline-offset: 2px;
}

.field-label {
  display: block;
  margin: 17px 0 8px;
  color: #d0d0d0;
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(235, 235, 235, 0.14);
  border-radius: 9px;
  outline: none;
  color: #f3f3f3;
  background: #151515;
}

input:focus,
select:focus {
  border-color: rgba(230, 230, 230, 0.8);
  box-shadow: 0 0 0 3px rgba(230, 230, 230, 0.12);
}

input::placeholder {
  color: #858585;
}

.button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
  transition: background 120ms ease, transform 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #151515;
  background: #e0e0e0;
}

.button-primary:hover {
  background: #f2f2f2;
}

.button-wide {
  width: 100%;
  min-height: 47px;
  margin-top: 20px;
}

.button-quiet {
  border-color: var(--border);
  color: #dedede;
  background: rgba(255, 255, 255, 0.045);
}

.button-quiet:hover {
  background: rgba(255, 255, 255, 0.09);
}

.panel-footnote {
  margin: 17px 0 0;
  color: #a0a0a0;
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.verification-message {
  margin: 0 0 10px;
  color: #c0c0c0;
  font-size: 13px;
  line-height: 1.5;
}

.lobby-layout {
  flex: 1;
  padding: 58px 0 72px;
}

.lobby-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 31px;
}

.lobby-intro h1 {
  margin-bottom: 8px;
  font-size: clamp(40px, 5vw, 58px);
}

.lobby-intro p:not(.eyebrow) {
  margin: 0;
  font-size: 15px;
}

.lobby-intro > .button {
  flex: 0 0 auto;
  margin-bottom: 5px;
}

.lobby-columns {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.create-panel {
  padding: 25px;
}

.create-panel form {
  margin-top: 18px;
}

.rooms-heading {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.rooms-heading h2 {
  font-size: 22px;
}

.count-badge {
  min-width: 38px;
  padding: 8px 11px;
  text-align: center;
}

.rooms-list {
  display: grid;
  gap: 12px;
}

.room-card {
  padding: 18px 19px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(32, 32, 32, 0.88);
}

.room-card-top,
.room-card-bottom,
.room-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.room-code {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.room-meta {
  margin: 9px 0 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.room-card-bottom {
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.room-size {
  color: #c8c8c8;
  font-size: 12px;
}

.room-actions {
  justify-content: end;
}

.room-actions .button {
  min-height: 35px;
  font-size: 12px;
}

.button-danger {
  border-color: rgba(220, 220, 220, 0.24);
  color: #e2e2e2;
  background: rgba(220, 220, 220, 0.06);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed rgba(235, 235, 235, 0.18);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.status-message {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 17px;
  border: 1px solid rgba(225, 225, 225, 0.25);
  border-radius: 11px;
  color: #f0f0f0;
  background: #292929;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
  font-size: 13px;
}

.site-footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: #969696;
  font-size: 12px;
  text-align: center;
}

.site-footer span {
  padding: 0 6px;
  color: var(--accent);
}

@media (max-width: 780px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding: 55px 0 70px;
  }

  .hero-copy h1 {
    font-size: 54px;
  }

  .auth-panel {
    width: min(100%, 470px);
  }

  .lobby-columns {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 32px, 1120px);
  }

  .topbar {
    min-height: 72px;
  }

  .current-user {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-panel,
  .create-panel {
    padding: 22px;
  }

  .hero-copy h1 {
    font-size: 45px;
    letter-spacing: -2.4px;
  }

  .lobby-layout {
    padding-top: 40px;
  }

  .lobby-intro {
    align-items: start;
    flex-direction: column;
  }

  .lobby-intro h1 {
    font-size: 43px;
    letter-spacing: -2.5px;
  }

  .room-card {
    padding: 15px;
  }
}
