/* Online panel shared by the online games; colours follow the page's theme */

.online-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font: 600 14px system-ui, sans-serif;
  text-align: center;
}

.online-panel[hidden],
.online-panel [hidden] {
  display: none !important;
}

.online-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.online-panel button,
.online-panel input {
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 14px;
  border: 2px solid currentColor;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.online-panel button {
  cursor: pointer;
}

.online-panel input {
  width: 8em;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.online-panel input::placeholder {
  color: inherit;
  opacity: 0.6;
  letter-spacing: normal;
  text-transform: none;
}

.online-panel #player-name {
  width: 10em;
  text-transform: none;
  letter-spacing: normal;
}

.public-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  cursor: pointer;
}

.online-panel .public-toggle input {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  accent-color: currentColor;
}

.room-code {
  font-size: 18px;
  letter-spacing: 3px;
}

.online-error {
  min-height: 1.2em;
  margin: 0;
  color: inherit;
  opacity: 0.85;
}

/* Chat and reactions */

.online-chat {
  width: min(100%, 560px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-log {
  max-height: 110px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 10px;
  list-style: none;
  border: 2px solid currentColor;
  border-radius: 10px;
  text-align: left;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.chat-log:empty::before {
  content: "Chat with the other players here";
  opacity: 0.6;
}

.chat-log .mine strong {
  opacity: 0.7;
}

.reactions {
  display: flex;
  gap: 4px;
}

.online-panel .reactions button {
  min-width: 44px;
  padding: 6px 8px;
  font-size: 18px;
  line-height: 1;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.online-panel .chat-input {
  width: 13em;
  text-transform: none;
  letter-spacing: normal;
}

.float-reaction {
  position: fixed;
  bottom: 40px;
  z-index: 900;
  font: 700 44px system-ui, sans-serif;
  pointer-events: none;
  animation: float-up 2.2s ease-out forwards;
}

@keyframes float-up {
  from { transform: translateY(0) scale(0.6); opacity: 0; }
  15% { transform: translateY(-20px) scale(1.15); opacity: 1; }
  to { transform: translateY(-240px) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .float-reaction { animation: none; opacity: 0.9; }
}
