* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Tahoma, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(124,58,237,.25), transparent 32%),
    radial-gradient(circle at 80% 10%, rgba(192,38,211,.20), transparent 28%),
    #101318;
  color: #f5f7fb;
}

button,
input,
a {
  font: inherit;
}

button,
.discord {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: white;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-height: 44px;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

input {
  width: 100%;
  border: 1px solid #303744;
  border-radius: 12px;
  padding: 12px 14px;
  background: #171c24;
  color: white;
  min-height: 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(16,19,24,.96);
  border-bottom: 1px solid #252b35;
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: #fff;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 12px 28px rgba(124,58,237,.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  color: #fff;
  font-size: 17px;
}

.brand-text span {
  color: #d8c8ff;
  font-size: 13px;
}

.brand-text small {
  color: #aeb7c6;
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,.07);
  font-weight: 800;
  white-space: nowrap;
}

.nav-btn.discord {
  background: linear-gradient(135deg, #5865f2, #7c3aed);
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 16px;
}

.home {
  width: min(520px, 100%);
  margin: 40px auto;
  display: grid;
  gap: 12px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: #d8c8ff;
  font-weight: 900;
}

.home h1 {
  margin: 0;
  font-size: 42px;
}

.subtitle {
  margin: 0;
  color: #fff;
  font-weight: 900;
}

.intro {
  color: #aeb7c6;
  line-height: 1.8;
  margin: 0 0 12px;
}

.home-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #252b35;
  border-radius: 18px;
  background: rgba(21,26,34,.88);
}

.joinRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.wide {
  display: block;
}

.room {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #252b35;
  border-radius: 18px;
  background: rgba(21,26,34,.94);
}

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

.discord.small {
  padding: 9px 11px;
  min-height: auto;
}

.lobbyTools {
  display: grid;
  gap: 10px;
}

.lobbyTools h2,
.panel h2 {
  margin: 4px 0;
  font-size: 18px;
}

.lobbyTools label {
  color: #aeb7c6;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented button {
  background: #242b36;
  padding: 10px 8px;
}

.segmented button.active {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
}

.timer,
.status,
.player {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #1c222c;
}

.status {
  flex-direction: column;
}

.start {
  width: 100%;
  background: linear-gradient(135deg, #22a06b, #2b68ff);
}

.boardWrap {
  min-width: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.card {
  min-height: 84px;
  padding: 10px;
  background: #232a35;
  border: 1px solid #343d4c;
  color: #f5f7fb;
  overflow-wrap: anywhere;
}

.card.type-hidden {
  background: #232a35;
  border-color: #343d4c;
}

.card.type-red {
  background: #9f2f35;
}

.card.type-blue {
  background: #285da8;
}

.card.type-neutral {
  background: #77705d;
}

.card.type-danger {
  background: #111;
}

.contact-section {
  margin-top: 36px;
  padding: 24px;
  border: 1px solid #252b35;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(88,101,242,.14), rgba(124,58,237,.10));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.contact-section h2 {
  margin: 6px 0 8px;
}

.contact-section p {
  color: #aeb7c6;
  line-height: 1.8;
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #fff;
  color: #101318;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 80;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  body {
    padding-top: 126px;
  }

  .topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .brand {
    justify-content: center;
  }

  .brand-text small {
    display: none;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .nav-btn {
    text-align: center;
    font-size: 12px;
    padding: 10px 6px;
  }

  .shell {
    padding: 14px 10px 24px;
  }

  .home {
    margin: 12px auto;
  }

  .home h1 {
    font-size: 30px;
  }

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

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

  .panel {
    position: static;
    padding: 12px;
  }

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

  .segmented.two {
    grid-template-columns: 1fr 1fr;
  }

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

  .card {
    min-height: 72px;
    padding: 8px;
  }

  .contact-section {
    flex-direction: column;
    align-items: stretch;
  }
}
