:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #121a2e;
  --panel-2: #18223a;
  --text: #eef3ff;
  --muted: #9aa8c7;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --danger: #ff5c7a;
  --ok: #2ee59d;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: calc(100vh - 1.4rem);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.25), transparent 32rem),
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.24);
}

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

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

button.secondary {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border: 1px solid var(--border);
}

.page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

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

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-2);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2.1rem, 6vw, 4.3rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 1rem;
}

.subtitle {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.status-pill {
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.status-pill.ok {
  color: var(--ok);
}

.status-pill.error {
  color: var(--danger);
}

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

.card,
.board-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.games-list {
  color: var(--muted);
  margin-bottom: 1rem;
}

.game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

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

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0 0 1rem;
}

.status-grid div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
}

dt {
  color: var(--muted);
  font-size: 0.82rem;
}

dd {
  margin: 0.2rem 0 0;
  font-weight: 900;
}

.message {
  color: var(--muted);
  margin-bottom: 0;
}

.board-card {
  margin-top: 1rem;
}

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

.board-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 0.75rem;
  max-width: 520px;
}

.cell {
  aspect-ratio: 1;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: clamp(2.4rem, 10vw, 5rem);
  font-weight: 1000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.cell.mark-x {
  color: var(--accent-2);
}

.cell.mark-o {
  color: var(--accent);
}

.cell.winner {
  outline: 3px solid var(--ok);
}

.log {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.log li {
  margin: 0.35rem 0;
}

@media (max-width: 760px) {
  .hero,
  .board-header {
    flex-direction: column;
  }

  .grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .board {
    max-width: none;
  }
}

.landing-page {
  min-height: calc(100vh - 1.4rem);
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.landing-hero {
  text-align: center;
}

.landing-kicker {
  margin: 0 0 0.75rem;
  color: var(--accent-2);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-title {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.construction-banner {
  width: 100%;
  height: 1.4rem;
  overflow: hidden;
  background: #d00000;
  border-bottom: 1px solid rgba(255, 230, 0, 0.45);
  display: flex;
  align-items: center;
}

.construction-track {
  display: flex;
  width: max-content;
  animation: construction-scroll 18s linear infinite;
}

.construction-message {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 3rem;
  color: #ffe600;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.construction-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 0.62rem;
  border: 1px solid rgba(255, 230, 0, 0.8);
  border-radius: 0.08rem;
  background: repeating-linear-gradient(
    135deg,
    #ffe600 0 0.18rem,
    #161616 0.18rem 0.36rem
  );
  box-shadow: 0 0 0.35rem rgba(255, 230, 0, 0.35);
  animation: construction-icon-wobble 0.85s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes construction-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-33.333%);
  }
}

@keyframes construction-icon-wobble {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }

  50% {
    transform: rotate(8deg) translateY(-1px);
  }
}

.landing-logo {
  display: block;
  width: min(86vw, 820px);
  max-height: calc(100vh - 8rem);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 28px 70px rgba(0, 0, 0, 0.45));
}
.construction-icon::before,
.construction-icon::after {
  content: "";
  position: absolute;
  bottom: -0.42rem;
  width: 0.08rem;
  height: 0.42rem;
  background: #ffe600;
  opacity: 0.8;
}

.construction-icon::before {
  left: 0.25rem;
}

.construction-icon::after {
  right: 0.25rem;
}

/* LOCAL LANDING OVERRIDES START */

.construction-banner {
  width: 100%;
  height: 1.12rem;
  overflow: hidden;
  background: #d00000;
  border-bottom: 1px solid rgba(255, 230, 0, 0.45);
  display: flex;
  align-items: center;
}

.construction-track {
  display: flex;
  width: max-content;
  animation: construction-scroll 18s linear infinite;
}

.construction-message {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 3rem;
  color: #ffe600;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.construction-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 0.62rem;
  border: 1px solid rgba(255, 230, 0, 0.8);
  border-radius: 0.08rem;
  background: repeating-linear-gradient(
    135deg,
    #ffe600 0 0.18rem,
    #161616 0.18rem 0.36rem
  );
  box-shadow: 0 0 0.35rem rgba(255, 230, 0, 0.35);
  animation: construction-icon-wobble 0.85s ease-in-out infinite;
  transform-origin: center bottom;
}

.construction-icon::before,
.construction-icon::after {
  content: "";
  position: absolute;
  bottom: -0.42rem;
  width: 0.08rem;
  height: 0.42rem;
  background: #ffe600;
  opacity: 0.8;
}

.construction-icon::before {
  left: 0.25rem;
}

.construction-icon::after {
  right: 0.25rem;
}

.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 1.15rem clamp(1rem, 3vw, 2.5rem);
}

.site-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  color: inherit;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: auto;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.42));
}

.site-name-block {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.site-domain {
  color: var(--accent-2);
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-subtitle {
  color: var(--muted);
  font-size: clamp(0.86rem, 1.4vw, 1.08rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-page {
  min-height: calc(100vh - 1.12rem - 112px);
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: block;
  padding: 2rem 0;
}

.landing-page-empty {
  pointer-events: none;
}

@keyframes construction-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-33.333%);
  }
}

@keyframes construction-icon-wobble {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }

  50% {
    transform: rotate(8deg) translateY(-1px);
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 0.9rem 1rem;
  }

  .site-brand {
    gap: 0.75rem;
  }

  .site-logo {
    height: 52px;
  }

  .site-domain {
    letter-spacing: 0.08em;
  }

  .site-subtitle {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }

  .landing-page {
    min-height: calc(100vh - 1.12rem - 82px);
  }
}

/* LOCAL LANDING OVERRIDES END */

/* LOCAL AUTH PANEL START */

.landing-page {
  min-height: calc(100vh - 1.12rem - 112px);
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 2rem 0 4rem;
}

.auth-panel {
  width: min(100%, 460px);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  text-align: center;
}

.auth-eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-panel h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-description {
  margin: 0.85rem auto 1.5rem;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.auth-actions {
  display: grid;
  gap: 0.8rem;
}

.auth-button {
  width: 100%;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.auth-button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px rgba(124, 92, 255, 0.28);
}

.auth-button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.auth-button-guest {
  color: var(--accent-2);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.28);
}

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

@media (max-width: 680px) {
  .landing-page {
    min-height: calc(100vh - 1.12rem - 82px);
    padding: 1.25rem 0 2rem;
  }

  .auth-panel {
    border-radius: 22px;
  }
}

/* LOCAL AUTH PANEL END */

/* LOCAL FOOTER AND CONTENT START */

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.footer-links-left {
  justify-content: flex-start;
}

.footer-links-right {
  justify-content: flex-end;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--accent-2);
}

.footer-copyright {
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font-weight: 800;
}

.content-page {
  min-height: calc(100vh - 1.12rem - 112px - 72px);
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 2rem 0 4rem;
}

.content-card {
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}

.content-card h1 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.content-card p {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.content-note {
  margin-bottom: 0;
  opacity: 0.78;
}

@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer-links-left,
  .footer-links-right {
    justify-content: center;
  }

  .footer-copyright {
    order: -1;
  }
}

/* LOCAL FOOTER AND CONTENT END */

/* LOCAL AUTH FORM START */

.auth-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.auth-field {
  display: grid;
  gap: 0.35rem;
  text-align: left;
}

.auth-field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.auth-field input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  outline: none;
  font: inherit;
  font-weight: 700;
}

.auth-field input:focus {
  border-color: rgba(0, 212, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.13);
}

.auth-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.1rem 0.15rem;
  font-size: 0.86rem;
}

.auth-links-row a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.auth-links-row a:hover {
  color: var(--accent-2);
}

.auth-button-guest {
  margin-top: 0.15rem;
}

/* LOCAL AUTH FORM END */

/* LOCAL REGISTER PAGE START */

.register-card {
  max-width: 620px;
}

.register-form {
  display: grid;
  gap: 0.95rem;
  margin-top: 1.4rem;
}

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

.register-field label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0.035em;
}

.register-field input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  outline: none;
  font: inherit;
  font-weight: 700;
}

.register-field input:focus {
  border-color: rgba(0, 212, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.13);
}

.register-field-note {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  line-height: 1.4;
}

.required-star {
  color: #ff4d5d;
  font-weight: 1000;
}

.required-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.register-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.register-checkbox input {
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent-2);
}

.register-back-link {
  justify-self: center;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.register-back-link:hover {
  color: var(--accent-2);
}

/* LOCAL REGISTER PAGE END */
.auth-message {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7fb;
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-message[data-type="success"] {
  border-color: rgba(76, 175, 80, 0.65);
  background: rgba(76, 175, 80, 0.14);
}

.auth-message[data-type="error"] {
  border-color: rgba(244, 67, 54, 0.72);
  background: rgba(244, 67, 54, 0.14);
}

.auth-message[data-type="warning"] {
  border-color: rgba(255, 193, 7, 0.72);
  background: rgba(255, 193, 7, 0.14);
}

.auth-message[hidden] {
  display: none;
}
.lobby-page {
  width: min(1500px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 7rem;
}

.lobby-title {
  margin: 0 0 1.25rem;
  text-align: center;
  color: #f4f7fb;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0.02em;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.95fr) minmax(0, 0.85fr) minmax(0, 0.65fr);
  gap: 1rem;
  align-items: stretch;
}

.lobby-panel {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.35rem;
  background: rgba(6, 10, 22, 0.76);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.28);
}

.lobby-panel-header {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lobby-panel-header h2 {
  margin: 0;
  color: #f4f7fb;
  font-size: 1.25rem;
}

.lobby-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lobby-select-field {
  display: grid;
  gap: 0.45rem;
  color: #f4f7fb;
  font-weight: 700;
}

.lobby-select-field select,
.lobby-select-field input {
  width: 100%;
  min-height: 2.85rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font: inherit;
}

.lobby-member-invite-button {
  margin-left: auto;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(112, 214, 255, 0.55);
  border-radius: 999px;
  background: rgba(12, 92, 132, 0.45);
  color: #e8f8ff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.lobby-member-invite-button:disabled {
  cursor: default;
  opacity: 0.65;
}

#lobby-game-select option.is-planned {
  color: #6b7280;
  text-decoration-line: line-through;
  text-decoration-thickness: 2px;
}

.lobby-empty-state {
  margin: 0;
  color: rgba(244, 247, 251, 0.72);
  line-height: 1.5;
}

.lobby-chat-panel,
.lobby-online-panel {
  min-height: 560px;
}

.lobby-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 0.25rem;
}

.lobby-chat-message {
  align-self: stretch;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: rgba(255, 255, 255, 0.1);
}

.lobby-chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}

.lobby-chat-sender {
  color: #70d6ff;
  font-weight: 800;
}

.lobby-chat-time {
  color: rgba(244, 247, 251, 0.58);
}

.lobby-chat-text {
  margin: 0;
  color: #f4f7fb;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lobby-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}


.lobby-online-panel {
  overflow: hidden;
}

.lobby-online-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  list-style: none;
  cursor: pointer;
}

.lobby-online-summary::-webkit-details-marker {
  display: none;
}

.lobby-online-title {
  color: #f4f7fb;
  font-size: 1.25rem;
  font-weight: 850;
}

.lobby-online-count {
  color: rgba(197, 211, 238, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.lobby-online-members {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}

.lobby-online-member {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(136, 180, 255, 0.26);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
}

.lobby-online-indicator {
  width: 0.58rem;
  height: 0.58rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 12px rgba(46, 229, 157, 0.34);
}

.lobby-online-name {
  min-width: 0;
  color: rgba(244, 247, 251, 0.94);
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (min-width: 761px) {
  .lobby-online-summary {
    cursor: default;
  }
}

.lobby-chat-form input {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font: inherit;
}

@media (max-width: 1180px) {
  .lobby-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lobby-panel,
  .lobby-chat-panel,
  .lobby-online-panel {
    min-height: auto;
  }

  .lobby-chat-messages {
    min-height: 260px;
  }
}

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

  .lobby-games-panel {
    order: 1;
  }

  .lobby-rooms-panel {
    order: 2;
  }

  .lobby-online-panel {
    order: 3;
  }

  .lobby-chat-panel {
    order: 4;
  }
}
.lobby-select-field.is-disabled select {
  opacity: 1;
  cursor: not-allowed;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.72);
  color: #374151;
  font-weight: 700;
}

.lobby-select-field.is-disabled span {
  color: rgba(244, 247, 251, 0.78);
}
.lobby-controls .auth-button:disabled,
.lobby-controls .auth-button.is-disabled {
  opacity: 1;
  cursor: not-allowed;
  background: rgba(56, 116, 202, 0.48);
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(136, 180, 255, 0.36);
  box-shadow: none;
}
#lobby-open-room-button:disabled,
#lobby-open-room-button.is-disabled {
  pointer-events: none;
  opacity: 1;
  cursor: not-allowed;
  background: rgba(56, 116, 202, 0.48) !important;
  color: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(136, 180, 255, 0.36) !important;
  box-shadow: none !important;
}
.lobby-rooms-panel {
  height: clamp(560px, calc(100vh - 18rem), 760px);
  min-height: 0;
}

.lobby-rooms-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.25rem;
}

.lobby-room-card {
  flex: 0 0 auto;
  min-height: 5.8rem;
  padding: 1rem;
  border: 1px solid rgba(136, 180, 255, 0.32);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(56, 116, 202, 0.15));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.lobby-room-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.lobby-room-owner {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(232, 240, 255, 0.92);
}

.lobby-room-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid rgba(255, 90, 90, 0.85);
  border-radius: 999px;
  background: rgba(190, 25, 25, 0.92);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 45, 45, 0.22);
}

.lobby-room-close-button:hover {
  background: rgba(230, 35, 35, 0.98);
}

.lobby-room-close-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.lobby-room-card-body {
  display: grid;
  gap: 0.42rem;
}

.lobby-room-title,
.lobby-room-details {
  margin: 0;
}

.lobby-room-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
}

.lobby-room-details {
  font-size: 0.78rem;
  color: rgba(197, 211, 238, 0.76);
}

.lobby-room-participants {
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper input.has-password-toggle {
  padding-right: 3.25rem;
}

.password-toggle-button {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 18, 32, 0.82);
  color: rgba(232, 240, 255, 0.95);
  font-size: 1rem;
  line-height: 1;
  cursor: default;
}

.password-toggle-button:hover {
  border-color: rgba(0, 212, 255, 0.55);
  background: rgba(16, 32, 56, 0.95);
}

.password-toggle-button:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.26);
  outline-offset: 2px;
}

.password-toggle-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.optional-note {
  color: #ff4d6d;
  font-weight: 800;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(0, 212, 255, 0.38);
  border-radius: 999px;
  background: rgba(10, 18, 32, 0.78);
  color: rgba(232, 240, 255, 0.96);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.12);
}

.site-header-action:hover {
  border-color: rgba(0, 212, 255, 0.72);
  background: rgba(16, 32, 56, 0.96);
  color: #ffffff;
}

.site-header-action:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.28);
  outline-offset: 2px;
}

.site-header-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.settings-page {
  width: min(100% - 2rem, 920px);
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.settings-shell {
  display: grid;
  gap: 1.25rem;
}

.settings-shell > h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.settings-intro,
.settings-card p {
  color: var(--text-muted, #aeb9cf);
}

.settings-card {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid rgba(174, 185, 207, 0.28);
  border-radius: 1.5rem;
  background: rgba(23, 29, 44, 0.9);
}

.settings-card h2,
.settings-card p {
  margin: 0 0 0.4rem;
}

.settings-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
}

.settings-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-switch-track {
  width: 3.5rem;
  height: 1.9rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: #5b6374;
  transition: background 160ms ease;
}

.settings-switch-track span {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}

.settings-switch input:checked + .settings-switch-track {
  background: #27c981;
}

.settings-switch input:checked + .settings-switch-track span {
  transform: translateX(1.6rem);
}

.settings-switch input:focus-visible + .settings-switch-track {
  outline: 3px solid #6ec8ff;
  outline-offset: 3px;
}

.settings-range,
.settings-select {
  display: grid;
  gap: 0.6rem;
  color: #f4f7fb;
  font-weight: 700;
}

.settings-range input,
.settings-select select {
  width: 100%;
}

.settings-select select {
  min-height: 2.8rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.8rem;
  background: #f4f7fb;
  color: #111827;
  font: inherit;
}

.ranking-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.ranking-games {
  display: grid;
  gap: 1rem;
}

.ranking-summary > div {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.ranking-summary > .ranking-achievements {
  grid-column: 1 / -1;
  text-align: left;
}

body.is-reduced-motion *,
body.is-reduced-motion *::before,
body.is-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

body.is-high-contrast .connect-four-panel,
body.is-high-contrast .connect-four-player,
body.is-high-contrast .connect-four-log-card {
  border: 3px solid #fff;
}

.ranking-summary strong {
  font-size: 1.8rem;
}

.ranking-summary span {
  color: #aeb9cf;
}

.ranking-table-scroll {
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.ranking-table th,
.ranking-table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid rgba(174, 185, 207, 0.2);
  text-align: left;
}

.ranking-table th {
  color: #8fd7ff;
}

@media (max-width: 640px) {
  .ranking-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.site-header-button {
  font: inherit;
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-header-action {
    width: 100%;
    margin-left: 0;
  }
}

.lobby-chat-form input.is-chat-warning {
  border-color: rgba(248, 113, 113, 0.95);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
}

.lobby-chat-form input.is-chat-warning::placeholder {
  color: rgb(248, 113, 113);
  opacity: 1;
}

.lobby-chat-message.is-moderated {
  opacity: 0.76;
}

.lobby-chat-message.is-moderated .lobby-chat-text {
  color: rgba(244, 247, 251, 0.68);
  font-style: italic;
}

.lobby-chat-moderate-delete-button {
  min-height: 1.45rem;
  padding: 0.16rem 0.5rem;
  border: 1px solid rgba(248, 113, 113, 0.72);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.78);
  color: #ffffff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.lobby-chat-moderate-delete-button:hover {
  background: rgba(185, 28, 28, 0.92);
}

.lobby-chat-moderate-delete-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.password-input-wrapper .password-toggle-button,
.password-input-wrapper .password-toggle-button:hover:not(:disabled),
.password-input-wrapper .password-toggle-button:focus,
.password-input-wrapper .password-toggle-button:focus-visible,
.password-input-wrapper .password-toggle-button:active {
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  cursor: default !important;
}

.lobby-visitor-badge {
  width: min(1120px, calc(100% - 2rem));
  margin: -0.35rem auto 1.2rem;
  color: rgba(197, 211, 238, 0.78);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.moderation-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 1.5rem 0;
}

.moderation-actions {
  display: grid;
  gap: 1rem;
}

.moderation-action-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

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

.moderation-action-date,
.moderation-action-meta,
.moderation-action-reason {
  color: rgba(255, 255, 255, 0.72);
}

.moderation-action-date {
  font-size: 0.85rem;
  white-space: nowrap;
}

.moderation-action-message {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.18);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .moderation-action-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .moderation-toolbar {
    justify-content: stretch;
  }

  .moderation-toolbar .auth-button {
    width: 100%;
  }
}

.site-header-action-group {
  position: absolute;
  top: 1.15rem;
  right: clamp(1rem, 3vw, 2.5rem);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.site-header-action-group .site-header-action {
  position: static;
}

.site-header-moderation-link {
  color: #ffffff;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.36);
  box-shadow: none;
}

.site-header-moderation-link:hover {
  color: #ffffff;
  background: rgba(0, 212, 255, 0.2);
}

@media (max-width: 680px) {
  .site-header-action-group {
    top: 0.9rem;
    right: 1rem;
    gap: 0.4rem;
  }

  .site-header-action-group .site-header-action {
    min-height: auto;
    padding: 0.65rem 0.8rem;
    font-size: 0.82rem;
  }
}

.lobby-chat-moderation-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.lobby-chat-moderate-mute-button,
.lobby-chat-moderate-delete-button {
  min-height: auto;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  box-shadow: none;
}

.lobby-chat-moderate-mute-button {
  color: #ffffff;
  background: rgba(255, 193, 7, 0.42);
  border: 1px solid rgba(255, 193, 7, 0.72);
}

.lobby-chat-moderate-delete-button {
  color: #ffffff;
  background: rgba(255, 92, 122, 0.42);
  border: 1px solid rgba(255, 92, 122, 0.72);
}

.moderation-action-details {
  margin: 0.35rem 0 0;
  color: rgba(235, 245, 255, 0.78);
  font-size: 0.9rem;
}

/* Footer unified centered layout */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  flex-wrap: wrap;
  text-align: center;
}

.footer-links,
.footer-links-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1.25rem;
  flex-wrap: wrap;
}

.footer-links-right {
  display: none;
}

.footer-copyright {
  margin: 0;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  border-left: 1px solid rgba(235, 245, 255, 0.24);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-footer {
    flex-direction: column;
    gap: 0.85rem;
  }

  .footer-copyright {
    padding-left: 0;
    padding-top: 0.85rem;
    border-left: 0;
    border-top: 1px solid rgba(235, 245, 255, 0.24);
    white-space: normal;
  }
}
/* End footer unified centered layout */

.lobby-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.lobby-room-join-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(109, 229, 255, 0.5);
  background: rgba(109, 229, 255, 0.12);
  color: #dff8ff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  cursor: pointer;
  font-family: inherit;
}

.lobby-room-start-button {
  border-color: rgba(126, 232, 156, 0.72);
  background: linear-gradient(135deg, rgba(46, 180, 112, 0.34), rgba(66, 143, 245, 0.28));
  color: #f3fff7;
}

.lobby-room-join-link:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.lobby-room-join-link:hover,
.lobby-room-join-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(109, 229, 255, 0.85);
  background: rgba(109, 229, 255, 0.2);
}

.player-list {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(235, 245, 255, 0.14);
  border-radius: 1rem;
  background: rgba(8, 14, 28, 0.45);
}

.player-list h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.player-list-items {
  display: grid;
  gap: 0.55rem;
}

.player-list-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
}

.player-list-item.is-current-player {
  outline: 1px solid rgba(109, 229, 255, 0.65);
}

.player-list-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  background: rgba(109, 229, 255, 0.16);
  font-weight: 800;
}

.player-list-name {
  font-weight: 700;
}

.player-list-empty {
  margin: 0;
  opacity: 0.75;
}

.player-symbols-description {
  display: grid;
  gap: 0.35rem;
}

.player-symbols-description p {
  margin: 0;
}

.lobby-room-state-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(235, 245, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(235, 245, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 700;
}
