.landing {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.landing-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: stretch;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.hero {
  position: relative;
  min-height: min(70vh, 640px);
  border-radius: calc(var(--radius-md) + 8px);
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(800px 420px at 20% 10%, var(--wood-highlight), transparent 55%),
    linear-gradient(155deg, var(--frame-light), var(--frame-mid) 40%, var(--frame-outer));
  box-shadow: 0 28px 60px var(--piece-shadow);
  display: grid;
  align-content: end;
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      92deg,
      transparent 0 10px,
      rgba(255, 230, 190, 0.04) 10px 12px,
      transparent 12px 28px
    ),
    radial-gradient(circle at 70% 30%, rgba(255, 230, 190, 0.14), transparent 45%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.hero-copy .eyebrow {
  margin: 0 0 0.55rem;
  color: rgba(255, 236, 210, 0.78);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1;
  color: #fff4e4;
}

.hero-copy p {
  margin: 0.85rem 0 0;
  color: rgba(255, 236, 210, 0.84);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 26rem;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(30, 14, 6, 0.12);
  overflow: hidden;
}

#auth-views {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--panel-border);
}

.auth-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.95rem 0.5rem;
  cursor: pointer;
}

.auth-tabs button.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
  background: var(--accent-soft);
}

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.15rem 1.25rem;
}

.auth-form {
  display: none;
  gap: 0.85rem;
}

.auth-form.active {
  display: grid;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-0) 70%, transparent);
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.85rem;
  outline: none;
}

.field select {
  appearance: none;
  padding-right: 2.15rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.4 1.6 L6 6.2 L10.6 1.6' stroke='%23725a3c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.7rem 0.45rem;
}

html[data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.4 1.6 L6 6.2 L10.6 1.6' stroke='%23d4c2a4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.field input:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--panel-border));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-error {
  min-height: 1.2rem;
  margin: 0;
  color: #b33b2b;
  font-size: 0.85rem;
}

html[data-theme="dark"] .auth-error {
  color: #f0a090;
}

.btn-primary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  color: #fffaf4;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

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

.lobby {
  display: none;
  gap: 1.25rem;
}

.lobby.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lobby-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lobby-user strong {
  display: block;
  font-size: 1.05rem;
}

.lobby-user span {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.linkish {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1;
  gap: 1.15rem;
}

.lobby-block {
  display: grid;
  gap: 0.7rem;
}

.lobby-block-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lobby-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-muted);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: center;
  color: var(--ink-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--panel-border);
}

#join-code {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

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

  .hero {
    min-height: 280px;
  }
}
