:root {}

.app-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 72px 0 24px;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.theme-toggle #theme-toggle-text {
  display: none !important;
}

.theme-toggle #theme-toggle-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
}

.theme-toggle #theme-toggle-icon svg {
  width: 100%;
  height: 100%;
}

.theme-toggle,
.auth-view .primary-button,
.auth-view .accent-button,
.auth-view .ghost-link {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease;
  will-change: transform;
}

.theme-toggle:hover,
.auth-view .primary-button:hover,
.auth-view .accent-button:hover,
.auth-view .ghost-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
}

.theme-toggle:active,
.auth-view .primary-button:active,
.auth-view .accent-button:active,
.auth-view .ghost-link:active {
  transform: translateY(1px) scale(0.985);
  filter: brightness(0.98);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.auth-view .primary-button:hover {
  box-shadow: 0 18px 34px rgba(227, 109, 51, 0.2);
}

.auth-view .accent-button:hover {
  box-shadow: 0 18px 34px rgba(42, 142, 130, 0.2);
}

.auth-view {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.auth-shell {
  display: grid;
  gap: 16px;
  position: relative;
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 320px;
  gap: 18px;
  align-items: end;
  padding: 18px 4px 2px;
}

.auth-hero__copy {
  display: grid;
  gap: 12px;
}

.auth-hero__copy h1 {
  font-family: "Rubik Mono One", monospace !important;
  font-size: clamp(2.3rem, 5vw, 4.4rem) !important;
  line-height: 0.92 !important;
  letter-spacing: -0.06em !important;
  max-width: 8ch !important;
  font-weight: 400 !important;
}

.hero-note,
.auth-status {
  color: var(--muted);
  line-height: 1.5;
}

.auth-hero__chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-hero__chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-hero__aside {
  display: grid;
  gap: 12px;
  justify-items: end;
  text-align: right;
  align-self: center;
  padding-top: 46px;
}

.auth-hero__aside p {
  max-width: 30ch;
  color: var(--muted);
  line-height: 1.5;
}

.auth-hero__aside .ghost-link {
  position: absolute;
  top: 0;
  right: 0;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 280px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  box-shadow: 0 18px 40px rgba(26, 19, 12, 0.08);
}

.auth-card__head {
  display: grid;
  gap: 8px;
}

.auth-card__head h2 {
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  line-height: 1;
}

.auth-card__head p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.auth-card--leader {
  background:
    radial-gradient(circle at top right, rgba(232, 102, 53, 0.1), transparent 24%),
    var(--panel);
}

.auth-card--player {
  background:
    radial-gradient(circle at top right, rgba(22, 105, 94, 0.12), transparent 24%),
    var(--panel);
}

.auth-view .panel--inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 100%;
}

.auth-view .panel--inner button {
  min-width: 0 !important;
}

.auth-view .auth-card.panel--inner > button.primary-button,
.auth-view .auth-card.panel--inner > button.accent-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-top: auto !important;
  min-height: 56px !important;
  padding: 0 18px !important;
  border-radius: 16px !important;
}

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

.field span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.auth-card__head .panel__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel__kicker-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.panel__kicker-icon svg {
  width: 100%;
  height: 100%;
}

.field__control {
  position: relative;
}

.field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(23, 20, 17, 0.45);
  pointer-events: none;
}

.field__icon svg {
  width: 100%;
  height: 100%;
}

.auth-view input,
.auth-view select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: 14px;
  border: 1px solid rgba(23, 20, 17, 0.12);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
}

.auth-view button,
.auth-view .ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  text-align: center;
  line-height: 1;
}

.auth-view .primary-button {
  background: linear-gradient(135deg, var(--accent), #ff8c56);
  color: #fff;
}

.auth-view .accent-button {
  background: var(--green);
  color: #fff;
}

.auth-view .ghost-link {
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(23, 20, 17, 0.06);
  color: var(--ink);
}

.auth-card > .primary-button,
.auth-card > .accent-button {
  align-self: stretch !important;
  justify-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-top: auto !important;
  min-height: 56px !important;
  border-radius: 16px !important;
}

.auth-button__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.auth-button__icon svg {
  width: 100%;
  height: 100%;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.code-chip__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.code-chip__icon svg {
  width: 100%;
  height: 100%;
}

.auth-footer {
  display: grid;
  gap: 10px;
}

.auth-status:empty {
  display: none;
}

body[data-theme="dark"] .auth-hero__chips span {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe6;
}

body[data-theme="dark"] .auth-card {
  border-color: rgba(245, 239, 230, 0.08);
  box-shadow: none;
}

body[data-theme="dark"] .auth-view input,
body[data-theme="dark"] .auth-view select {
  background: rgba(19, 24, 31, 0.96);
  border-color: rgba(245, 239, 230, 0.12);
  color: #f5efe6;
}

body[data-theme="dark"] .field__icon {
  color: rgba(245, 239, 230, 0.45);
}

body[data-theme="dark"] .auth-view .ghost-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 239, 230, 0.1);
  color: #f5efe6;
}

@media (max-width: 900px) {
  .auth-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

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

  .auth-hero__copy h1 {
    max-width: 100%;
  }

  .auth-hero__aside {
    justify-items: start;
    text-align: left;
    padding-top: 0;
  }

  .auth-hero__aside .ghost-link {
    position: static;
  }

  .auth-card {
    min-height: 0;
  }
}

/* Hard override: every game lobby uses this exact auth layout. */
.auth-view {
  display: grid !important;
  gap: 18px !important;
  padding: 16px !important;
}

.auth-shell {
  display: grid !important;
  gap: 16px !important;
  position: relative !important;
}

.auth-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) 320px !important;
  gap: 18px !important;
  align-items: end !important;
  padding: 18px 4px 2px !important;
}

.auth-hero__copy {
  display: grid !important;
  gap: 12px !important;
}

.auth-hero__copy h1 {
  font-family: "Rubik Mono One", monospace !important;
  font-size: clamp(2.3rem, 5vw, 4.4rem) !important;
  line-height: 0.92 !important;
  letter-spacing: -0.06em !important;
  max-width: 8ch !important;
  font-weight: 400 !important;
}

.auth-hero__heading {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
  flex-wrap: wrap !important;
}

.auth-hero__chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.auth-hero__chips span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  background: rgba(23, 20, 17, 0.06) !important;
  color: var(--ink) !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
}

.auth-hero__aside {
  display: grid !important;
  gap: 12px !important;
  justify-items: end !important;
  align-self: center !important;
  text-align: right !important;
  padding-top: 46px !important;
}

.auth-hero__aside p {
  max-width: 30ch !important;
  color: var(--muted) !important;
  line-height: 1.5 !important;
}

.auth-hero__aside .ghost-link {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
}

.auth-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.auth-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  min-height: 280px !important;
  padding: 18px !important;
  border-radius: 24px !important;
  border: 1px solid rgba(23, 20, 17, 0.08) !important;
  box-shadow: 0 18px 40px rgba(26, 19, 12, 0.08) !important;
}

.auth-card__head {
  display: grid !important;
  gap: 8px !important;
}

.auth-card__head h2 {
  font-size: clamp(1.7rem, 2vw, 2.2rem) !important;
  line-height: 1 !important;
}

.auth-card__head p:last-child {
  color: var(--muted) !important;
  line-height: 1.45 !important;
}

.auth-card--leader {
  background:
    radial-gradient(circle at top right, rgba(232, 102, 53, 0.1), transparent 24%),
    var(--panel) !important;
}

.auth-card--player {
  background:
    radial-gradient(circle at top right, rgba(22, 105, 94, 0.12), transparent 24%),
    var(--panel) !important;
}

.auth-view .panel--inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  min-height: 100% !important;
  padding: 16px !important;
}

.auth-view .field {
  display: grid !important;
  gap: 8px !important;
}

.auth-view .field span {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
}

.auth-view .field__control {
  position: relative !important;
}

.auth-view .field__icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  color: rgba(23, 20, 17, 0.45) !important;
  pointer-events: none !important;
}

.auth-view .field__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.auth-view input,
.auth-view select {
  width: 100% !important;
  padding: 12px 14px 12px 42px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(23, 20, 17, 0.12) !important;
  background: var(--field-bg) !important;
  color: var(--ink) !important;
  font: inherit !important;
}

.auth-view button,
.auth-view .ghost-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  border: 0 !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font: inherit !important;
  font-weight: 800 !important;
  text-align: center !important;
  line-height: 1 !important;
}

.auth-view .primary-button,
.auth-view .accent-button {
  display: inline-flex !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  justify-content: center !important;
  width: 100% !important;
  inline-size: 100% !important;
  min-inline-size: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
  min-height: 56px !important;
  padding: 0 18px !important;
  border-radius: 16px !important;
}

.auth-view .auth-card > .primary-button,
.auth-view .auth-card > .accent-button,
.auth-view .auth-card > button.primary-button,
.auth-view .auth-card > button.accent-button,
.auth-view .auth-card .primary-button:last-child,
.auth-view .auth-card .accent-button:last-child {
  display: inline-flex !important;
  align-self: stretch !important;
  justify-self: stretch !important;
  justify-content: center !important;
  width: 100% !important;
  inline-size: 100% !important;
  min-inline-size: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-top: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  flex: 0 0 auto !important;
  min-height: 56px !important;
}

.auth-view .primary-button {
  background: linear-gradient(135deg, var(--accent), #ff8c56) !important;
  color: #fff !important;
}

.auth-view .accent-button {
  background: var(--green) !important;
  color: #fff !important;
}

.auth-view .ghost-link {
  min-height: 42px !important;
  padding: 0 16px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  background: rgba(23, 20, 17, 0.06) !important;
  color: var(--ink) !important;
}

.auth-button__icon {
  display: inline-flex !important;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
}

.auth-button__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.auth-status,
.hero-note {
  color: var(--muted) !important;
  line-height: 1.5 !important;
}

.auth-view .panel--inner button {
  justify-self: stretch !important;
  align-self: stretch !important;
  min-width: 0 !important;
}

body[data-theme="dark"] .auth-hero__chips span {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5efe6 !important;
}

body[data-theme="dark"] .auth-card {
  border-color: rgba(245, 239, 230, 0.08) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .auth-view input,
body[data-theme="dark"] .auth-view select {
  background: rgba(19, 24, 31, 0.96) !important;
  border-color: rgba(245, 239, 230, 0.12) !important;
  color: #f5efe6 !important;
}

body[data-theme="dark"] .auth-view .field__icon {
  color: rgba(245, 239, 230, 0.45) !important;
}

body[data-theme="dark"] .auth-view .ghost-link {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(245, 239, 230, 0.1) !important;
  color: #f5efe6 !important;
}

@media (max-width: 900px) {
  .auth-hero {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    align-items: start !important;
  }

  .auth-grid {
    grid-template-columns: 1fr !important;
  }

  .auth-hero__copy h1 {
    max-width: 100% !important;
  }

  .auth-hero__aside {
    justify-items: start !important;
    text-align: left !important;
    padding-top: 0 !important;
  }

  .auth-hero__aside .ghost-link {
    position: static !important;
  }

  .auth-card {
    min-height: 0 !important;
  }
}

.auth-hero__titlebar {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
}

.streamer-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(23, 20, 17, 0.08) !important;
  border-radius: 999px !important;
  background: rgba(23, 20, 17, 0.045) !important;
  color: var(--muted) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
  cursor: pointer !important;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease !important;
}

.streamer-toggle:hover {
  background: rgba(23, 20, 17, 0.045) !important;
  color: var(--muted) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
}

.streamer-toggle:active {
  background: rgba(23, 20, 17, 0.045) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05) !important;
}

.streamer-toggle__icon {
  display: inline-flex !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.streamer-toggle__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.streamer-toggle__label {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.streamer-toggle__switch {
  position: relative !important;
  width: 46px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: rgba(23, 20, 17, 0.09) !important;
  flex: 0 0 46px !important;
  transition: background-color 0.16s ease !important;
}

.streamer-toggle__switch::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12) !important;
  transition: transform 0.16s ease, background-color 0.16s ease !important;
}

.streamer-toggle.is-active {
  color: var(--muted) !important;
  background: rgba(23, 20, 17, 0.045) !important;
  border-color: rgba(23, 20, 17, 0.08) !important;
}

.streamer-toggle.is-active .streamer-toggle__switch {
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent))) !important;
}

.streamer-toggle.is-active .streamer-toggle__switch::after {
  transform: translateX(22px) !important;
}

.auth-view[hidden],
.game-view[hidden],
[hidden] {
  display: none !important;
}

body[data-theme="dark"] .streamer-toggle {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(246, 240, 231, 0.08) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14) !important;
}

body[data-theme="dark"] .streamer-toggle__switch {
  background: rgba(255, 255, 255, 0.12) !important;
}

body[data-theme="dark"] .streamer-toggle__switch::after {
  background: #f6f0e7 !important;
}

body[data-theme="dark"] .streamer-toggle.is-active {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(246, 240, 231, 0.08) !important;
}

body[data-streamer-mode="true"] .code-chip strong,
body[data-streamer-mode="true"] #room-code {
  filter: blur(8px) !important;
  user-select: none !important;
}

.auth-view .eyebrow {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.auth-view .eyebrow__icon {
  display: inline-flex !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
}

.auth-view .eyebrow__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.auth-view .ghost-link__icon {
  display: inline-flex !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.auth-view .ghost-link__icon svg {
  width: 100% !important;
  height: 100% !important;
}

.auth-hero__aside {
  width: auto !important;
}

.auth-hero__aside p {
  position: relative !important;
  max-width: 31ch !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(23, 20, 17, 0.08) !important;
  background: rgba(23, 20, 17, 0.045) !important;
  color: var(--muted) !important;
  line-height: 1.5 !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(12px) !important;
}

.auth-hero__aside p::after {
  content: "" !important;
  position: absolute !important;
  top: -7px !important;
  right: 28px !important;
  width: 14px !important;
  height: 14px !important;
  background: inherit !important;
  border-top: 1px solid rgba(23, 20, 17, 0.08) !important;
  border-left: 1px solid rgba(23, 20, 17, 0.08) !important;
  transform: rotate(45deg) !important;
}

.auth-hero__aside .ghost-link {
  min-height: 48px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(23, 20, 17, 0.08) !important;
  background: rgba(23, 20, 17, 0.05) !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="dark"] .auth-hero__aside p {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(245, 239, 230, 0.08) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18) !important;
}

body[data-theme="dark"] .auth-hero__aside p::after {
  border-top-color: rgba(245, 239, 230, 0.08) !important;
  border-left-color: rgba(245, 239, 230, 0.08) !important;
}

body[data-theme="dark"] .auth-hero__aside .ghost-link {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(245, 239, 230, 0.08) !important;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18) !important;
}

@media (max-width: 900px) {
  .auth-hero__titlebar {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .auth-hero__heading {
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .auth-hero__aside {
    width: 100% !important;
  }

  .auth-hero__aside p::after {
    right: auto !important;
    left: 24px !important;
  }
}
