:root {
  --focus-ring: 0 0 0 3px rgba(242, 193, 78, 0.38);
  --panel-border: rgba(255, 255, 255, 0.14);
}

html {
  text-size-adjust: 100%;
}

body {
  accent-color: var(--gold, #f2c14e);
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:disabled {
  transform: none !important;
}

#connection-status {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #edf4ff;
  background: rgba(7, 12, 52, 0.84);
  border: 1px solid var(--panel-border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#connection-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

#connection-status[data-state="offline"]::before,
#connection-status[data-state="error"]::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

#connection-status[data-state="connecting"]::before {
  background: #f2c14e;
  box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.18);
}

#toast-region {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 10px;
  color: #f7f9ff;
  background: rgba(7, 12, 52, 0.94);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  text-align: left;
  line-height: 1.25;
  animation: toast-in 160ms ease-out both;
}

.toast-message::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #f2c14e;
}

.toast-message[data-type="success"]::before {
  background: #22c55e;
}

.toast-message[data-type="error"]::before {
  background: #ef4444;
}

.toast-message[data-type="info"]::before {
  background: #60a5fa;
}

.clue-cell,
.cat-header {
  min-height: 72px;
}

.modal-card,
#auth-panel,
#lobby-panel,
#scoreboard,
.final-panel,
#active-clue-view,
#final-view {
  backdrop-filter: blur(14px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  #connection-status {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    font-size: 0.76rem;
  }

  #toast-region {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: min(340px, calc(100vw - 20px));
  }

  .clue-cell,
  .cat-header {
    min-height: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
