:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    sans-serif;
  --btn-bg: linear-gradient(135deg, #ff5fa2, #7a7dff 55%, #41b3ff);
  --menu-link-bg: var(--btn-bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 480px at 5% -10%, #7cc0ff66, transparent),
    radial-gradient(900px 500px at 95% 0%, #ff7ad966, transparent),
    radial-gradient(800px 500px at 50% 110%, #ffd56a66, transparent),
    linear-gradient(180deg, #f5f9ff, #eff6ff 45%, #f7f4ff);
  color: #18263a;
}

body[data-theme="dark"] {
  background:
    radial-gradient(1200px 500px at 10% -10%, #2d8cff33, transparent),
    radial-gradient(900px 500px at 90% 0%, #7d4dff2b, transparent),
    linear-gradient(180deg, #08111d, #0b1728 50%, #08111d);
  color: #e8edf3;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 36px;
}

h1,
h2,
h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin-bottom: 0;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.card {
  background: linear-gradient(165deg, #ffffffeb, #f6fbffef);
  border: 1px solid #cfe1ff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 14px 30px #79a6d926;
  backdrop-filter: blur(4px);
}

body[data-theme="dark"] .card {
  background: linear-gradient(160deg, #1a2638d9, #132033db);
  border-color: #35506b;
  box-shadow: 0 14px 30px #00000040;
}

.topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.topBarSelection {
  align-items: flex-start;
}

.selectionControls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.buttonStylePicker {
  min-width: 220px;
  background: transparent;
  border: 1px solid #c9dcff;
  border-radius: 12px;
  padding: 10px;
}

.buttonStylePicker h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.styleAccordion summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  list-style: none;
}

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

.styleAccordion[open] summary {
  margin-bottom: 8px;
}

.pickerGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.buttonStylePicker label {
  font-size: 0.78rem;
  gap: 4px;
}

.buttonStylePicker input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid #c4d7f7;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
}

.toggleLabel {
  margin-top: 8px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sectionTop {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.backBtn {
  padding: 8px 12px;
  font-size: 0.84rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbe9ff, #cce0ff);
  color: #24446b;
  border: 1px solid #b7cff5;
  animation: none;
}

body[data-theme="dark"] .backBtn {
  background: linear-gradient(135deg, #21354f, #2b4464);
  color: #dbe9ff;
  border-color: #3f5d84;
}

.themePicker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.82rem;
  min-width: 120px;
}

.themePicker select {
  border-radius: 10px;
  border: 1px solid #b9d0f3;
  background: #ffffff;
  color: #1e2f47;
  padding: 8px 10px;
  font-weight: 600;
}

body[data-theme="dark"] .themePicker {
  color: #d8e4f3;
}

body[data-theme="dark"] .themePicker select {
  border-color: #3a4d64;
  background: #0d1623;
  color: #fff;
}

.grid {
  display: grid;
  gap: 14px;
}

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

#startCard .grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

#goCreateBtn,
#goJoinBtn {
  min-height: 52px;
  font-size: 1rem;
}

.inlineFields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inlineFields label {
  margin-bottom: 0;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 8px;
  color: #2c4668;
  font-weight: 600;
}

body[data-theme="dark"] label {
  color: #d8e4f3;
}

input {
  border-radius: 10px;
  border: 1px solid #b9d0f3;
  background: #ffffff;
  color: #1e2f47;
  padding: 11px 12px;
  font-size: 0.98rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body[data-theme="dark"] input {
  border-color: #3a4d64;
  background: #0d1623;
  color: #fff;
}

input::placeholder {
  color: #7f98b8;
}

body[data-theme="dark"] input::placeholder {
  color: #9fb1c7;
}

input:focus {
  outline: none;
  border-color: #2d8cff;
  box-shadow: 0 0 0 3px #2d8cff33;
}

button {
  border: none;
  border-radius: 10px;
  background: var(--btn-bg);
  background-size: 220% 220%;
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 11px 15px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  animation: buttonGradientShift 4.5s ease-in-out infinite;
}

.menuLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  background: var(--btn-bg);
  background-size: 220% 220%;
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 11px 15px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  animation: buttonGradientShift 4.5s ease-in-out infinite;
}

.menuLink::before {
  content: "";
  position: absolute;
  inset: -120% auto -120% -35%;
  width: 34%;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.12) 80%,
    transparent 100%
  );
  pointer-events: none;
  animation: buttonShineSweep 2.8s ease-in-out infinite;
}

.menuLink:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button::before {
  content: "";
  position: absolute;
  inset: -120% auto -120% -35%;
  width: 34%;
  transform: rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 20%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.12) 80%,
    transparent 100%
  );
  pointer-events: none;
  animation: buttonShineSweep 2.8s ease-in-out infinite;
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

button:disabled::before {
  animation: none;
  opacity: 0;
}

@keyframes buttonGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes buttonShineSweep {
  0% {
    left: -42%;
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  55% {
    opacity: 0.95;
  }
  100% {
    left: 122%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    animation: none;
  }

  button::before {
    animation: none;
  }

  .menuLink {
    animation: none;
  }

  .menuLink::before {
    animation: none;
  }
}

.roomHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

li {
  padding: 8px 0;
  border-bottom: 1px solid #d8e5f8;
}

body[data-theme="dark"] li {
  border-bottom-color: #2b3c50;
}

.hidden {
  display: none;
}

.error {
  color: #df355e;
  min-height: 1.2em;
  font-weight: 600;
}

body[data-theme="dark"] .error {
  color: #ff9a9a;
}

.badge {
  font-size: 0.72rem;
  color: #27446a;
  background: #e8f2ff;
  border: 1px solid #bdd8ff;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
}

body[data-theme="dark"] .badge {
  color: #e7f0ff;
  background: #35506b;
  border-color: #4f6f8e;
}

.tableWrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #cddfff;
}

body[data-theme="dark"] .tableWrap {
  border-color: #2b3c50;
}

.resultsTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #ffffff;
}

body[data-theme="dark"] .resultsTable {
  background: #0f1a2a;
}

.resultsTable th,
.resultsTable td {
  border: 1px solid #d6e5ff;
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

body[data-theme="dark"] .resultsTable th,
body[data-theme="dark"] .resultsTable td {
  border-color: #26374a;
}

.resultsTable th {
  background: linear-gradient(180deg, #eef5ff, #e4efff);
  color: #284567;
  font-weight: 700;
}

body[data-theme="dark"] .resultsTable th {
  background: linear-gradient(180deg, #1a2c44, #15253a);
  color: #ddecff;
}

.resultsTable tr:nth-child(even) td {
  background: #f8fbff;
}

body[data-theme="dark"] .resultsTable tr:nth-child(even) td {
  background: #112035;
}

.resultsTable small {
  color: #5a7699;
}

body[data-theme="dark"] .resultsTable small {
  color: #b8c8dc;
}

.resultAccordion {
  border: 1px solid #d2e2ff;
  border-radius: 10px;
  background: #f7fbff;
  padding: 4px 8px;
}

body[data-theme="dark"] .resultAccordion {
  border-color: #2a4161;
  background: #132134;
}

.resultAccordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.resultStatus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.resultStatus.ok {
  color: #087a45;
}

body[data-theme="dark"] .resultStatus.ok {
  color: #5de3a0;
}

.resultStatus.bad {
  color: #c6284f;
}

body[data-theme="dark"] .resultStatus.bad {
  color: #ff7c9f;
}

.resultDetails {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cfe0ff;
  color: #2f4b6f;
  font-size: 0.86rem;
  display: grid;
  gap: 4px;
}

body[data-theme="dark"] .resultDetails {
  border-top-color: #35506b;
  color: #bfd1e7;
}