/* ============================================
   星落拾贰 — 星图连线游戏样式
   ============================================ */

/* --- Game Body Overrides --- */
.game-body {
  cursor: default;
  background: var(--color-bg);
}

.game-body #starfield-canvas {
  z-index: 0;
  opacity: 0.5;
}

/* --- Game Canvas --- */
#game-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  cursor: crosshair;
}

/* --- Game UI Layer --- */
#game-ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

#game-ui > * {
  pointer-events: auto;
}

/* --- Header --- */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  gap: 16px;
}

.game-back-btn {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid rgba(200, 170, 110, 0.2);
  border-radius: 20px;
  background: rgba(14, 12, 20, 0.6);
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  letter-spacing: 0.04em;
}

.game-back-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.game-level-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.game-level-label {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  margin-right: 6px;
}

.game-level-num {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(220, 170, 80, 0.4);
}

.game-level-divider,
.game-level-total {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.game-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.game-score-label {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-score-value {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* --- Constellation Name --- */
.game-constellation-name {
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.08em;
  text-shadow: 0 0 30px rgba(220, 170, 80, 0.3);
  margin-top: 8px;
  pointer-events: none;
  opacity: 0.85;
  transition: all 0.5s ease;
}

.game-constellation-name.completed {
  color: var(--color-accent);
  text-shadow: 0 0 40px rgba(220, 170, 80, 0.7);
  transform: scale(1.08);
}

/* --- Hint Text --- */
.game-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-top: 6px;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.game-hint.fade {
  opacity: 0.3;
}

/* --- Actions --- */
.game-actions {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3;
}

.game-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid rgba(200, 170, 110, 0.3);
  background: rgba(14, 12, 20, 0.7);
  color: var(--color-text-secondary);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.game-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  background: rgba(30, 24, 16, 0.8);
  box-shadow: 0 0 16px rgba(220, 170, 80, 0.2);
}

.game-btn:active {
  transform: scale(0.96);
}

.game-btn-hint { }
.game-btn-reset { }
.game-btn-skip { opacity: 0.6; }
.game-btn-skip:hover { opacity: 1; }

.game-btn-next,
.game-btn-back {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 12px auto 0;
  text-align: center;
  padding: 12px 24px;
  font-size: 0.9rem;
}

.game-btn-next {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.game-btn-back {
  border-color: rgba(200, 170, 110, 0.2);
  color: var(--color-text-muted);
  text-decoration: none;
}

/* --- Completion Overlay --- */
.game-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 10, 0.8);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.game-complete-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.game-complete-card {
  background: rgba(16, 14, 24, 0.95);
  border: 1px solid rgba(200, 170, 110, 0.35);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 88vw;
  text-align: center;
  box-shadow: 0 0 60px rgba(220, 170, 80, 0.25);
  animation: cardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
  from { transform: scale(0.85) translateY(24px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.game-complete-stars {
  font-size: 2.4rem;
  margin-bottom: 8px;
  animation: starsPop 0.6s ease 0.2s both;
}

@keyframes starsPop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.game-complete-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--color-accent);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.game-complete-msg {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.game-complete-score {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

/* --- Particle effects on canvas (handled in JS) --- */

/* --- Responsive --- */
@media (max-width: 640px) {
  .game-header { padding: 14px 16px; }
  .game-level-num { font-size: 1.4rem; }
  .game-score-value { font-size: 1.1rem; }
  .game-constellation-name { font-size: 1.2rem; }
  .game-actions { bottom: 20px; gap: 8px; }
  .game-btn { padding: 8px 14px; font-size: 0.76rem; }
  .game-complete-card { padding: 28px 20px 22px; }
}
