/* ── Map Hunt — Game-specific styles v2.0.0 ──────────────────────────────────
   Depends on: theme.css + game-shell.css (loaded before this)
   Uses CSS vars: --accent, --bg, --surface, --surface2, --border,
                  --text, --text2, --green, --red, --radius, --shadow
─────────────────────────────────────────────────────────────────────────────── */

/* ── Globe radar decoration (start screen) ──────────────────────────────── */
.globe-radar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto -8px;
  flex-shrink: 0;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: radarPulse 3s ease-in-out infinite;
}

.radar-ring--1 { width: 30px;  height: 30px;  animation-delay: 0s; }
.radar-ring--2 { width: 54px;  height: 54px;  animation-delay: 0.5s; }
.radar-ring--3 { width: 76px;  height: 76px;  animation-delay: 1s; }

.radar-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent), 0 0 16px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: radarBlink 2s ease-in-out infinite;
}

@keyframes radarPulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 0.7; transform: translate(-50%, -50%) scale(1.05); }
}

@keyframes radarBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Silhouette card ──────────────────────────────────────────────────────── */
.silhouette-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

/* Subtle grid/map background pattern */
.silhouette-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

#silhouette-container {
  width: 280px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  box-shadow:
    inset 0 0 30px color-mix(in srgb, var(--accent) 8%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
  transition: box-shadow 0.3s ease;
}

#silhouette-container svg path {
  filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent));
  transition: fill 0.3s ease;
}

/* Correct flash */
#silhouette-container.correct-flash {
  animation: correctFlash 0.6s ease both;
}

@keyframes correctFlash {
  0%   { box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }
  30%  { box-shadow: inset 0 0 50px color-mix(in srgb, var(--green) 20%, transparent), 0 0 20px color-mix(in srgb, var(--green) 30%, transparent), 0 0 0 2px var(--green); }
  100% { box-shadow: inset 0 0 30px color-mix(in srgb, var(--accent) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent); }
}

/* Wrong shake */
#silhouette-container.wrong-shake {
  animation: wrongShake 0.45s ease both;
}

@keyframes wrongShake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(8px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  90%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.question-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}

/* ── Options grid ─────────────────────────────────────────────────────────── */
.options-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.option-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  min-height: 54px;
  line-height: 1.3;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  word-break: break-word;
  hyphens: auto;
}

.option-btn:hover:not(:disabled):not(.correct):not(.wrong) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 20%, transparent);
}

.option-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.option-btn:disabled {
  cursor: default;
}

/* Correct state */
.option-btn.correct {
  background: color-mix(in srgb, var(--green) 15%, var(--surface));
  border-color: var(--green);
  color: var(--green);
  animation: correctPulse 0.5s ease both;
}

@keyframes correctPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.04); }
  60%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* Wrong state */
.option-btn.wrong {
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border-color: var(--red);
  color: var(--red);
  animation: wrongBtnShake 0.4s ease both;
}

@keyframes wrongBtnShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* Reveal (the correct answer highlighted after a wrong guess) */
.option-btn.reveal {
  border-color: var(--green);
  color: var(--green);
  opacity: 0.8;
}

/* ── Clues area ───────────────────────────────────────────────────────────── */
.clues-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.clue-card {
  padding: 12px 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 8%, var(--surface2)),
    var(--surface2));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  animation: clueSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 10%, transparent);
}

.clue-num {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  opacity: 0.75;
  margin-bottom: 6px;
}

.clue-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.clue-card .clue-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.clue-card .clue-text {
  flex: 1;
  min-width: 0;
}

.clue-card .clue-label {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text2);
  display: block;
  margin-bottom: 3px;
}

.clue-card .clue-value {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.clue-card .clue-value strong {
  color: var(--accent);
  font-weight: 800;
}

@keyframes clueSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Feedback bar ─────────────────────────────────────────────────────────── */
.feedback-bar {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  animation: fadeUp 0.2s ease both;
}

.feedback-bar.correct {
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--green);
}

.feedback-bar.wrong {
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
  color: var(--red);
}

/* ── Score float animation ────────────────────────────────────────────────── */
.score-float {
  position: absolute;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--green);
  pointer-events: none;
  animation: scoreFloat 0.9s ease-out both;
  white-space: nowrap;
}

@keyframes scoreFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-48px) scale(0.8); }
}

/* ── Combo burst ──────────────────────────────────────────────────────────── */
.combo-burst {
  animation: comboBurst 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes comboBurst {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Speed timer ──────────────────────────────────────────────────────────── */
#timer-val.danger {
  color: var(--red);
  animation: timerDanger 0.5s ease infinite alternate;
}

@keyframes timerDanger {
  from { opacity: 1; }
  to   { opacity: 0.5; }
}

/* ── Player stats strip ───────────────────────────────────────────────────── */
.player-stats {
  font-size: 0.78rem;
  color: var(--text2);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.player-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Daily mode "already played" state ───────────────────────────────────── */
#daily-btn.done {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Result screen extras ─────────────────────────────────────────────────── */
#result-title {
  background: linear-gradient(135deg, var(--accent), #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

/* ── Mobile: tighter silhouette on small screens ─────────────────────────── */
@media (max-width: 380px) {
  #silhouette-container {
    width: 240px;
    height: 170px;
  }

  .option-btn {
    font-size: 0.8rem;
    padding: 12px 8px;
    min-height: 48px;
  }
}

/* ── Tablet+ ──────────────────────────────────────────────────────────────── */
@media (min-width: 500px) {
  #silhouette-container {
    width: 320px;
    height: 230px;
  }

  .option-btn {
    font-size: 0.92rem;
    min-height: 58px;
  }
}

@media (min-width: 700px) {
  #silhouette-container {
    width: 360px;
    height: 260px;
  }
}

@media (min-width: 900px) {
  #silhouette-container {
    width: 420px;
    height: 300px;
  }
  .option-btn {
    font-size: 1rem;
    min-height: 64px;
  }
}

@media (min-width: 1200px) {
  #silhouette-container {
    width: 480px;
    height: 340px;
  }
}

/* ── Difficulty badge — overlaid on silhouette card ──────────────────────── */
/* Map Hunt diff-badge — inherits colors from shared .diff-badge in game-shell.css */
.diff-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  text-transform: uppercase;
}
.diff-badge:not(:empty) {
  opacity: 1;
  transform: scale(1);
}

/* ── Silhouette loading / fallback states ─────────────────────────────────── */
.silhouette-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.4rem;
}

.loading-spin {
  display: inline-block;
  animation: spinGlobe 1.2s linear infinite;
}

@keyframes spinGlobe {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.silhouette-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 3rem;
  opacity: 0.6;
}

.silhouette-path {
  filter: drop-shadow(0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent));
  transition: fill 0.3s ease;
}

/* ── Survival lives display ───────────────────────────────────────────────── */
.life-heart {
  display: inline-block;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.life-heart--lost {
  opacity: 0.45;
  filter: grayscale(1);
}

.lives-shake {
  animation: livesShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes livesShake {
  10%, 90%  { transform: translate3d(-2px, 0, 0); }
  20%, 80%  { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60%  { transform: translate3d(6px, 0, 0); }
  100%      { transform: translate3d(0, 0, 0); }
}

