:root {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #f7f7fb;
  background: #0d0d12;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(168, 85, 247, 0.14), transparent 30rem),
    radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.12), transparent 28rem),
    #0d0d12;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.site-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: conic-gradient(
    #ef4444,
    #facc15,
    #22c55e,
    #06b6d4,
    #3b82f6,
    #a855f7,
    #ef4444
  );
}

.connection-status {
  min-height: 20px;
  color: #a5a5b2;
  font-size: 0.85rem;
}

.screen {
  animation: enter 180ms ease-out;
}

.hidden {
  display: none !important;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  max-width: 730px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #a5a5b2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.3rem, 8vw, 5rem);
  line-height: 0.97;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 660px;
  margin-bottom: 0;
  color: #bdbdc8;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.55;
}

.panel {
  border: 1px solid #292932;
  border-radius: 18px;
  background: rgba(20, 20, 27, 0.92);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

#homeScreen .panel {
  max-width: 520px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #d9d9e0;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid #34343f;
  border-radius: 11px;
  outline: none;
  background: #101016;
  color: #fff;
  padding: 13px 14px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

input:focus {
  border-color: #737381;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

button {
  border: 1px solid #3a3a45;
  border-radius: 11px;
  background: #202028;
  color: #fff;
  padding: 12px 16px;
  font-weight: 800;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
}

button.primary {
  border-color: #fff;
  background: #fff;
  color: #0d0d12;
}

button.ghost {
  background: transparent;
}

.small-button {
  padding: 8px 11px;
  font-size: 0.82rem;
}

.full-width {
  width: 100%;
  margin-top: 20px;
}

.action-row {
  margin-top: 14px;
}

.action-row .primary {
  width: 100%;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #777784;
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  height: 1px;
  flex: 1;
  background: #2a2a33;
  content: "";
}

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

.room-input {
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.error {
  min-height: 22px;
  margin: 14px 0 0;
  color: #fca5a5;
  font-size: 0.9rem;
}

.room-heading,
.game-heading,
.panel-heading,
.room-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.room-heading,
.game-heading {
  margin-bottom: 28px;
}

.room-heading h1,
.game-heading h1 {
  margin: 0;
}

.room-code-row {
  justify-content: flex-start;
}

.room-code-row h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  letter-spacing: 0.05em;
}

.two-column {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.rules-list {
  margin: 0;
  padding-left: 22px;
  color: #d5d5dc;
  line-height: 1.65;
}

.rules-list li + li {
  margin-top: 7px;
}

.note,
.hint {
  color: #9494a1;
  font-size: 0.88rem;
  line-height: 1.5;
}

.note {
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid #2b2b34;
}

.hint {
  min-height: 21px;
  margin: 12px 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #353540;
  border-radius: 999px;
  color: #bdbdc8;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.player-list {
  display: grid;
  gap: 8px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #2a2a33;
  padding: 10px 0;
}

.player-row:last-child {
  border-bottom: 0;
}

.player-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 750;
}

.you-tag {
  color: #878794;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b4b56;
}

.status-dot.online {
  background: #22c55e;
}

.ready-state {
  color: #8c8c98;
  font-size: 0.8rem;
}

.ready-state.ready {
  color: #86efac;
}

.game-heading h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.color-card {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  background: var(--card-color, #23232b);
  color: var(--card-text, #fff);
  padding: 18px;
}

.color-card.unknown {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #1d1d25, #292933);
}

.color-card .card-name {
  position: relative;
  z-index: 1;
  font-weight: 900;
}

.color-card .card-color-name {
  position: absolute;
  right: 16px;
  bottom: 13px;
  left: 16px;
  font-size: 1.55rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.color-card.unknown .card-color-name {
  position: static;
  color: #8e8e9c;
  text-align: center;
  font-size: 4rem;
}

.guess-panel {
  text-align: center;
}

.guess-panel p {
  color: #a5a5b2;
}

.guess-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 20px;
}

.guess-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--guess-color);
  color: var(--guess-text);
  min-width: 104px;
  text-transform: capitalize;
}

.result-card {
  max-width: 760px;
  margin: 40px auto 0;
  text-align: center;
}

.result-card h1 {
  font-size: clamp(2.4rem, 8vw, 5.2rem);
}

.secret-word-wrap {
  display: grid;
  gap: 6px;
  max-width: 540px;
  margin: 32px auto;
  border: 1px solid #3a3a44;
  border-radius: 16px;
  background: #101016;
  padding: 22px;
}

.secret-word-wrap span {
  color: #8b8b97;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.secret-word-wrap strong {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 8vw, 4.3rem);
  letter-spacing: 0.05em;
}

.final-colors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px 0;
}

.final-chip {
  border-radius: 999px;
  background: var(--chip-color);
  color: var(--chip-text);
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 900;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1040px);
    padding-top: 14px;
  }

  .site-header {
    margin-bottom: 38px;
  }

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

  .room-heading,
  .game-heading {
    align-items: flex-start;
  }

  .panel {
    padding: 19px;
  }

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

  .color-card {
    min-height: 135px;
  }
}
