.rescue-game {
  max-width: 720px;
  margin: 1rem auto 3rem;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* Shared panel / button styles (duplicated per-game by Corner convention) */
.panel {
  background: var(--card);
  border: 3px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(10px);
}
.panel.hidden { display: none; }

.panel h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.1em;
}

.rescue-icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.tagline {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-weight: 600;
}

.row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0 1.5rem;
}
.row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}
.row select {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: 2px solid var(--primary);
  background: white;
  color: #1f1b2e;
  cursor: pointer;
}

.setup-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  font: inherit;
  font-weight: 800;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
  font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); }

.btn-secondary {
  display: inline-block;
  margin-left: 0.75rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--card-border);
  font-weight: 700;
}

/* HUD */
.rr-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 0.5rem;
}
.hud-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  font-weight: 700;
}
.hud-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

/* Rocket + fuel stage */
.rescue-stage {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 0.5rem 0 1rem;
  flex-wrap: wrap;
}

.rocket {
  font-size: clamp(3rem, 9vw, 4.5rem);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
  animation: bob 3s ease-in-out infinite;
  user-select: none;
  transition: transform 0.2s ease;
}
.rocket.shake { animation: rk-shake 0.4s ease; }
.rocket.launch { animation: rk-launch 1s cubic-bezier(0.5, 0, 0.75, 0) forwards; }

@keyframes rk-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-8px) rotate(-6deg); }
  75% { transform: translateX(8px) rotate(6deg); }
}
@keyframes rk-launch {
  0%   { transform: translateY(0) scale(1); }
  20%  { transform: translateY(6px) scale(1.05); }
  100% { transform: translateY(-320px) scale(0.6); opacity: 0; }
}

.fuel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
.fuel-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.fuel-bar {
  display: flex;
  gap: 4px;
}
.fuel-cell {
  width: 22px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(180deg, #6cce85, #3fae5e);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, transform 0.2s ease;
}
.fuel-cell.empty {
  background: rgba(0, 0, 0, 0.18);
  box-shadow: none;
  transform: scaleY(0.8);
}

/* Clue card */
.clue-card {
  background: linear-gradient(135deg, #fffbe6, #fff5d1);
  color: #4a3000;
  border-radius: 16px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  max-width: 460px;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 209, 102, 0.5);
}
.clue-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}
.clue-cat {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #b5790a;
}
.clue-def {
  margin: 0.2rem 0 0;
  font-weight: 700;
  font-size: 1rem;
}

/* Word slots */
.word-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  min-height: 64px;
  margin-bottom: 1.25rem;
}
.letter-slot {
  width: 44px;
  height: 56px;
  border-radius: 10px;
  border-bottom: 4px solid var(--primary);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
  user-select: none;
}
.letter-slot.revealed {
  background: white;
  color: #1f1b2e;
  border-bottom-color: #6cce85;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  animation: pop 0.35s ease;
}
.letter-slot.missed {
  background: linear-gradient(135deg, #ffd5d5, #ffb3b3);
  color: #5a0a0a;
  border-bottom-color: #ff5c5c;
}

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* On-screen keyboard */
.keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto 0.5rem;
}
.key {
  width: 42px;
  height: 48px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.key:hover:not(:disabled) { transform: translateY(-3px) scale(1.05); }
.key:disabled { cursor: default; }
.key.hit { background: linear-gradient(135deg, #6cce85, #3fae5e); opacity: 0.85; }
.key.miss { background: rgba(0, 0, 0, 0.25); color: rgba(255, 255, 255, 0.5); }

.feedback {
  min-height: 1.5em;
  font-weight: 700;
  margin-top: 1rem;
  font-size: 1.1rem;
}
.feedback.good { color: #2e8b3a; }
.feedback.bad  { color: #b32b2b; }

@media (max-width: 480px) {
  .key { width: 36px; height: 44px; font-size: 1.05rem; }
  .letter-slot { width: 38px; height: 50px; font-size: 1.4rem; }
}
