/* ==========================================================================
   五子棋在线对决与观战大厅系统样式
   ========================================================================== */

/* 顶部联机大厅入口胶囊 */
#online-lobby-btn {
  position: fixed;
  top: 18px;
  right: 170px; /* 避开右上角语言切换键 */
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 27, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 192, 130, 0.3);
  color: #f5f0e6;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  user-select: none;
}

#online-lobby-btn:hover {
  background: rgba(45, 40, 35, 0.95);
  border-color: #e2c082;
  color: #e2c082;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(226, 192, 130, 0.25);
}

/* 联机对战状态条 (游戏中置顶展示) */
#online-status-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 20, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 192, 130, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border-radius: 9999px;
  padding: 6px 18px;
  color: #f5f0e6;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

#online-status-bar.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bar-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.bar-badge.black {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.bar-badge.white {
  background: #f0f0f0;
  color: #111;
  border: 1px solid #ccc;
}

.bar-badge.spectator {
  background: rgba(100, 100, 110, 0.3);
  color: #ced6e0;
}

.bar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f5f0e6;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bar-btn:hover {
  background: #e2c082;
  color: #1a1714;
  border-color: #e2c082;
}

/* 联机对战配置弹窗 */
#online-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#online-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 90%;
  max-width: 440px;
  background: #1e1b18;
  border: 1px solid rgba(226, 192, 130, 0.3);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  padding: 28px;
  color: #f5f0e6;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

#online-modal.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #e2c082;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 12px;
  color: #a4b0be;
  font-weight: 500;
}

.input-row {
  display: flex;
  gap: 8px;
}

.modal-input, .modal-select {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f5f0e6;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-input:focus, .modal-select:focus {
  border-color: #e2c082;
}

.modal-select option {
  background: #222;
  color: #fff;
}

.small-btn {
  background: rgba(226, 192, 130, 0.15);
  border: 1px solid #e2c082;
  color: #e2c082;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.small-btn:hover {
  background: #e2c082;
  color: #1a1714;
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary {
  flex: 1;
  background: #e2c082;
  color: #1a1714;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #ebd4a8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ced6e0;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* 消息轻提示 (Toast) */
#online-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(20, 18, 16, 0.95);
  border: 1px solid rgba(226, 192, 130, 0.4);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  color: #f5f0e6;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

#online-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  #online-lobby-btn {
    right: 14px;
    top: 64px; /* 手机端排在语言按钮下方 */
    font-size: 12px;
    padding: 6px 12px;
  }
  #online-status-bar {
    width: 95%;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    top: 8px;
  }
}
