:root {
  color-scheme: light;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  --seekr-bg-gradient: linear-gradient(135deg, #befe5a 0%, #2cd4a1 100%);
  background: var(--seekr-bg-gradient);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--seekr-bg-gradient);
  min-height: 100%;
}

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--seekr-bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

body.is-name-transitioning {
  pointer-events: none;
  cursor: wait;
}

dialog::backdrop {
  background: var(--seekr-bg-gradient);
}

.welcome-screen {
  width: min(100%, 24rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  border-radius: 1.25rem;
  background-color: rgba(248, 250, 252, 0.98);
  box-shadow: 0 24px 45px -28px rgba(15, 23, 42, 0.7);
  opacity: 0;
  transform: translateY(2.5rem);
  transition: transform 280ms ease, opacity 280ms ease;
  pointer-events: none;
}

.welcome-screen--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.welcome-screen--hidden {
  display: none;
}

.welcome-screen--intro {
  animation: welcome-screen-intro 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes welcome-screen-intro {
  0% {
    opacity: 0;
    transform: translateY(2.5rem) scale(0.96);
    filter: blur(6px);
  }
  55% {
    filter: blur(0);
  }
  70% {
    transform: translateY(-0.35rem) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.welcome-screen__logo {
  width: clamp(8rem, 60vw, 12rem);
  height: auto;
}

.welcome-screen__message {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.welcome-screen__title {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
}

.welcome-screen__description {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
}

.welcome-screen__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.welcome-screen__input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #94a3b8;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.25rem;
}

.welcome-screen__input:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
  border-color: #2563eb;
}

.welcome-screen__code {
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.4rem;
  color: #2563eb;
  background-color: rgba(226, 232, 240, 0.7);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
}

.welcome-screen__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.welcome-screen__actions.welcome-screen__actions--inline {
  flex-direction: column;
}

.welcome-screen__actions.welcome-screen__actions--inline .welcome-screen__button {
  width: 100%;
  flex: none;
}

.seeker-highlight {
  width: 100%;
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(45, 212, 191, 0.15));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.seeker-highlight__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
  color: #2563eb;
}

.seeker-highlight__name {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.seeker-highlight__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 600;
}

.seeker-highlight__badge--other {
  background: rgba(45, 212, 191, 0.16);
  color: #0f766e;
}

.seeker-highlight__instructions {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
}

.countdown__role {
  margin: 0;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18rem;
  text-transform: uppercase;
}

.countdown__role--seeker {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.countdown__role--hider {
  background: rgba(45, 212, 191, 0.16);
  color: #0f766e;
}

.countdown__timer {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 1.1rem 1.6rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(45, 212, 191, 0.18));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  font-weight: 800;
  color: #0f172a;
}

.countdown__timer-unit {
  min-width: 2.6rem;
  text-align: center;
}

.countdown__timer-separator {
  font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  color: rgba(15, 23, 42, 0.75);
}

.countdown__instructions {
  margin-top: 0.25rem;
  color: #0f172a;
}

.countdown__hint {
  margin: -0.25rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.welcome-screen__subtitle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.welcome-screen__lobby {
  width: 100%;
  background: rgba(248, 250, 252, 0.75);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.welcome-screen__lobby-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.welcome-screen__lobby-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
}

.welcome-screen__lobby-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.welcome-screen__lobby-empty {
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(226, 232, 240, 0.35);
  color: #64748b;
  font-weight: 500;
  text-align: center;
}

.welcome-screen__lobby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(226, 232, 240, 0.6);
  color: #0f172a;
  font-weight: 600;
  gap: 0.5rem;
}

.welcome-screen__lobby-item.you {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.welcome-screen__lobby-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.welcome-screen__lobby-meta {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
}

#create-screen .welcome-screen__lobby {
  text-align: left;
}

#create-screen .welcome-screen__lobby-item,
#create-screen .welcome-screen__lobby-name {
  text-align: left;
}

.welcome-screen__lobby-helper {
  margin: -0.5rem 0 0;
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.game-role {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.game-role__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16rem;
  text-transform: uppercase;
}

.game-role__badge--hider {
  background: rgba(45, 212, 191, 0.16);
  color: #0f766e;
}

.game-role__description {
  margin: 0;
  font-size: 0.95rem;
  color: #0f172a;
  text-align: center;
}

.game-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.08);
  transition: opacity 0.2s ease;
}

.game-timer[hidden] {
  display: none;
}

.game-timer__label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #475569;
  font-weight: 700;
}

.game-timer__value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.game-timer__unit {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.game-timer__separator {
  font-size: clamp(1.4rem, 6vw, 2rem);
  font-weight: 700;
  color: #94a3b8;
}

.game-card {
  width: 100%;
  background: rgba(248, 250, 252, 0.96);
  border-radius: 1rem;
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.game-card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.game-card__highlight {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-weight: 800;
  color: #1d4ed8;
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.game-card__highlight--warning {
  color: #dc2626;
}

.game-card__meta {
  font-size: 0.9rem;
  color: #475569;
}

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

.game-card__details dt {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.15rem;
}

.game-card__details dd {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.game-card__hint {
  margin: -0.25rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.game-card__systems {
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.system-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.system-indicator__icon {
  width: 1rem;
  height: 1rem;
}

.system-indicator__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #cbd5f5;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  transition: background-color 0.2s ease;
}

.system-indicator[data-state='pending'] {
  background: rgba(234, 179, 8, 0.14);
  color: #b45309;
}

.system-indicator[data-state='pending'] .system-indicator__dot {
  background: #f59e0b;
}

.system-indicator[data-state='ok'] {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.system-indicator[data-state='ok'] .system-indicator__dot {
  background: #22c55e;
}

.system-indicator[data-state='error'] {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.system-indicator[data-state='error'] .system-indicator__dot {
  background: #ef4444;
}

.welcome-screen__button {
  width: 100%;
  padding: 0.9rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.welcome-screen__button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.welcome-screen__button--primary {
  background-color: #2563eb;
  color: #fff;
  box-shadow: 0 12px 25px -18px rgba(37, 99, 235, 0.9);
}

.welcome-screen__button--primary[disabled] {
  background-color: #94a3b8;
  color: #f8fafc;
}

.welcome-screen__button--primary:hover,
.welcome-screen__button--primary:focus-visible {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
  box-shadow: 0 16px 28px -18px rgba(37, 99, 235, 0.9);
}

.welcome-screen__button:not(.welcome-screen__button--primary) {
  background-color: rgba(226, 232, 240, 0.95);
  color: #0f172a;
}

.welcome-screen__button:not(.welcome-screen__button--primary):hover,
.welcome-screen__button:not(.welcome-screen__button--primary):focus-visible {
  background-color: #dbeafe;
  transform: translateY(-1px);
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.login-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.login-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}

.login-button__icon-image,
.login-button__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.game-screen__chat-row,
.game-screen__leave {
  width: 100%;
  display: flex;
  justify-content: center;
}

.game-screen__chat-row {
  gap: 0.75rem;
  align-items: stretch;
}

.welcome-screen__button.game-screen__leave-button {
  max-width: 18rem;
  background-color: #ef4444;
  color: #fff;
  box-shadow: 0 12px 24px -16px rgba(239, 68, 68, 0.55);
}

.welcome-screen__button.game-screen__leave-button:hover,
.welcome-screen__button.game-screen__leave-button:focus-visible {
  background-color: #dc2626;
  outline: 3px solid rgba(239, 68, 68, 0.35);
  outline-offset: 2px;
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -18px rgba(239, 68, 68, 0.6);
}

.welcome-screen__button.game-screen__chat-button,
.welcome-screen__button.game-screen__roster-button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: none;
  padding: 0.85rem 1rem;
  gap: 0.4rem;
}

.welcome-screen__button.game-screen__chat-button {
  flex: 3 1 0;
}

.welcome-screen__button.game-screen__roster-button {
  flex: 1 1 0;
  font-weight: 700;
  gap: 0.4rem;
}

.chat-button__badge {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 9999px;
  background-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.65);
  transform: translateY(-50%);
}

.roster-button__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  min-height: 1.6rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background-color: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(248, 250, 252, 0.55);
}

.roster-button__icon {
  font-size: 1.1rem;
}

.roster-button__label {
  font-weight: 700;
}

.chat-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 1200;
}

.chat-overlay[hidden] {
  display: none;
}

.chat-overlay.chat-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.roster-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 1180;
}

.roster-overlay[hidden] {
  display: none;
}

.roster-overlay.roster-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.chat-overlay__panel {
  width: min(40rem, 100%);
  max-height: 90vh;
  background: #f8fafc;
  border-radius: 1.5rem;
  box-shadow: 0 22px 48px -24px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.chat-overlay__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

.chat-overlay__close {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  color: #1e293b;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.chat-overlay__close:hover,
.chat-overlay__close:focus-visible {
  background: rgba(15, 23, 42, 0.15);
  transform: scale(1.04);
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.roster-overlay__panel {
  width: min(34rem, 100%);
  max-height: 85vh;
  background: #f8fafc;
  border-radius: 1.5rem;
  box-shadow: 0 22px 48px -24px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.roster-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.roster-overlay__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.roster-overlay__close {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  color: #1e293b;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.roster-overlay__close:hover,
.roster-overlay__close:focus-visible {
  background: rgba(15, 23, 42, 0.15);
  transform: scale(1.04);
  outline: none;
}

.roster-overlay__body {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.roster-overlay__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.roster-overlay__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(226, 232, 240, 0.6);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.roster-overlay__item.is-self {
  background: rgba(37, 99, 235, 0.15);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.roster-overlay__item.is-seeker {
  background: rgba(37, 99, 235, 0.12);
}

.roster-overlay__item.is-found {
  background: rgba(244, 114, 182, 0.12);
}

.roster-overlay__item.is-offline {
  opacity: 0.65;
}

.roster-overlay__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.roster-overlay__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.roster-overlay__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.roster-overlay__badge--seeker {
  background: rgba(37, 99, 235, 0.18);
  color: #1e3a8a;
}

.roster-overlay__badge--hider {
  background: rgba(45, 212, 191, 0.2);
  color: #0f766e;
}

.roster-overlay__badge--host {
  background: rgba(247, 144, 9, 0.18);
  color: #b45309;
}

.roster-overlay__badge--self {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

.roster-overlay__badge--found {
  background: rgba(244, 114, 182, 0.2);
  color: #be185d;
}

.roster-overlay__badge--offline {
  background: rgba(100, 116, 139, 0.18);
  color: #334155;
}

.roster-overlay__empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  background: rgba(241, 245, 249, 0.6);
  border-radius: 1rem;
}

.chat-overlay__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.9) 0%, rgba(226, 232, 240, 0.7) 100%);
}

.chat-overlay__empty {
  margin: 3rem auto;
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-message__meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-message__author {
  color: #0f172a;
  font-weight: 700;
}

/* Horodatage masqué (élément non rendu) */

.chat-message__bubble {
  max-width: 28rem;
  width: fit-content;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 18px -18px rgba(15, 23, 42, 0.6);
  font-size: 0.95rem;
  line-height: 1.35rem;
  color: #0f172a;
  word-break: break-word;
}

.chat-message--self {
  align-items: flex-end;
}

.chat-message--self .chat-message__bubble {
  background: #2563eb;
  color: #f8fafc;
}

.chat-message--self .chat-message__meta {
  flex-direction: row-reverse;
  color: rgba(15, 23, 42, 0.65);
}

/* Horodatage masqué (élément non rendu) */

.chat-overlay__form {
  padding: 1.1rem 1.5rem 1.4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.95);
}

.chat-overlay__input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-overlay__input {
  flex: 1;
  border-radius: 9999px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  color: #0f172a;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.chat-overlay__input:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.chat-overlay__submit {
  border: none;
  border-radius: 9999px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.chat-overlay__submit:hover,
.chat-overlay__submit:focus-visible {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -18px rgba(2, 132, 199, 0.55);
}

body.chat-open {
  overflow: hidden;
}

body.roster-open {
  overflow: hidden;
}

.notification-container {
  position: fixed;
  top: clamp(0.75rem, 4vw, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1600;
  pointer-events: none;
  width: min(24rem, calc(100vw - 2rem));
}

.notification {
  background: rgba(248, 250, 252, 0.98);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 18px 28px -22px rgba(15, 23, 42, 0.55);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
  border-left: 4px solid transparent;
}

.notification--visible {
  opacity: 1;
  transform: translateY(0);
}

.notification--info {
  border-left-color: #0ea5e9;
}

.notification--warning {
  border-left-color: #eab308;
}

.notification--danger {
  border-left-color: #ef4444;
}

.game-config__options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.75rem;
}

.game-config__option {
  border-radius: 0.85rem;
  font-weight: 600;
  border: 2px solid transparent;
}

.game-config__option--selected {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 14px 28px -20px rgba(37, 99, 235, 0.75);
}

.game-config__option--selected:hover,
.game-config__option--selected:focus-visible {
  background-color: #1d4ed8;
}

.game-config__option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
  transition: none;
  pointer-events: none;
}

.game-config__option--selected:disabled {
  opacity: 1;
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.game-config--host .game-config__option--selected,
.game-config--host .game-config__option--selected:hover,
.game-config--host .game-config__option--selected:focus-visible,
.game-config--host .game-config__option--selected:disabled {
  background-color: rgba(226, 232, 240, 0.95);
  color: #0f172a;
  border-color: #2563eb;
  box-shadow: none;
}

.game-config__status {
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
}

.app {
  width: min(100%, 24rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app__header {
  color: #0f172a;
  text-align: center;
}

.logo-title {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  font-family: "Fredoka", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
}

.logo-title img {
  display: block;
  width: clamp(8rem, 60vw, 12rem);
  height: auto;
}

.app__header p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.app__header button {
  margin-top: 0.85rem;
  align-self: center;
  background-color: #2563eb;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 12px 25px -18px rgba(37, 99, 235, 0.9);
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.app__header button:hover,
.app__header button:focus-visible {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.card {
  background-color: rgba(248, 250, 252, 0.98);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 20px 35px -25px rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.card small {
  color: #475569;
  font-weight: 600;
}

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

.metrics dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.metrics dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  word-break: break-word;
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player {
  display: contents;
}

.player__button {
  width: 100%;
  border: none;
  border-radius: 0.85rem;
  padding: 0.85rem;
  background-color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.player__button:focus-visible,
.player__button:hover {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  background-color: #dbeafe;
  transform: translateY(-2px);
}

.player__button[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  outline: none;
  transform: none;
}

.player__name {
  font-weight: 700;
  font-size: 1rem;
}

.player__meta {
  font-size: 0.8rem;
  color: #475569;
}

.target {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #e2e8f0;
  color: #0f172a;
  min-height: 3rem;
}

.distance {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1d4ed8;
}

#name-dialog {
  border: none;
  border-radius: 1.25rem;
  padding: 2rem 1.75rem;
  width: min(26rem, 92vw);
  background-color: rgba(248, 250, 252, 0.98);
  box-shadow: 0 24px 45px -28px rgba(15, 23, 42, 0.7);
}

#name-dialog.name-dialog--opening {
  animation: name-dialog-enter 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#name-dialog.name-dialog--opening::backdrop {
  animation: name-dialog-backdrop-enter 380ms ease forwards;
}

#name-dialog.name-dialog--closing {
  animation: name-dialog-exit 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#name-dialog.name-dialog--closing::backdrop {
  animation: name-dialog-backdrop-exit 380ms ease forwards;
}

@keyframes name-dialog-enter {
  0% {
    opacity: 0;
    transform: translateY(1.4rem) scale(0.94);
    filter: blur(4px);
  }
  60% {
    transform: translateY(0.75rem) scale(0.98);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes name-dialog-backdrop-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes name-dialog-exit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  60% {
    transform: translateY(-0.75rem) scale(0.98);
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    transform: translateY(-1.4rem) scale(0.94);
    filter: blur(4px);
  }
}

@keyframes name-dialog-backdrop-exit {
  to {
    opacity: 0;
  }
}

#name-dialog .dialog__logo {
  align-self: center;
  width: clamp(8rem, 55vw, 11rem);
  height: auto;
}

.name-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
  text-align: center;
}

.name-dialog__subtitle {
  margin: 0;
}

.name-dialog__fields {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.name-dialog__input {
  letter-spacing: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  background-color: rgba(255, 255, 255, 0.95);
}

.name-dialog__actions {
  width: 100%;
}

.dialog__error {
  margin: 0;
  color: #dc2626;
  font-weight: 600;
  font-size: 0.85rem;
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

menu button {
  padding: 0.65rem 1.1rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

menu button.primary {
  background-color: #2563eb;
  color: #fff;
}

menu button.primary:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  body {
    padding: 1.25rem;
  }

  .app__header h1 {
    font-size: 1.4rem;
  }
}

.app--hidden {
  display: none;
}

.welcome-screen--hidden {
  display: none;
}

/* Social Links Styling */
.social-links {
  margin-top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-links__tiktok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
  color: #64748b;
  text-decoration: none;
}

.social-links__tiktok:hover {
  background-color: rgba(100, 116, 139, 0.1);
  transform: translateY(-1px);
  color: #475569;
}

.social-links__tiktok:active {
  transform: translateY(0);
}

.social-links__icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Focus state for accessibility */
.social-links__tiktok:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}
