/* ============================================================
   ATC Storm Claim Mini Game — Styles
   ============================================================ */

.sg-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #2A2A2A;
}

.sg-frame {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border-radius: 44px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(27,58,107,0.08), 0 24px 60px rgba(17,37,72,0.18);
  background: #112548;
  position: relative;
}

.sg-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 24px;
  border-radius: 999px;
  background: #0a0e18;
  z-index: 25;
}

.sg-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 18;
  overflow: hidden;
  border-radius: 34px;
  transition: background 0.8s ease;
  user-select: none;
}

.sg-canvas--calm {
  background: linear-gradient(180deg, #DCF2FF 0%, #EEF7FF 28%, #FCF7EC 29%, #A6E0B0 73%, #58B270 100%);
}

.sg-canvas--storm {
  background: linear-gradient(180deg, #4A5E74 0%, #7A8FA8 28%, #B8C4D1 29%, #8FC49A 73%, #4D8A5E 100%);
}

/* Ambient overlay */
.sg-ambient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 12%, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 42%);
  pointer-events: none;
}

/* Lightning flash */
.sg-lightning {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  pointer-events: none;
  opacity: 0;
  z-index: 12;
  transition: opacity 0.05s;
}

/* HUD */
.sg-hud {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.sg-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.sg-hud-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(203,213,225,0.7);
  box-shadow: 0 8px 16px rgba(15,23,42,0.08);
}

.sg-hud-score {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(203,213,225,0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(15,23,42,0.08);
}

.sg-score-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sg-score-value {
  font-size: 16px;
  font-weight: 900;
  color: #112548;
  min-width: 36px;
  text-align: right;
}

.sg-combo-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: #CFAE64;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  animation: sgScorePop 0.3s ease;
}

.sg-stage-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Progress row */
.sg-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(203,213,225,0.7);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  backdrop-filter: blur(8px);
}

.sg-progress-info {
  flex: 1;
  min-width: 0;
}

.sg-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.sg-badge {
  padding: 5px 9px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.sg-badge--pending {
  border: 1px solid rgba(207,174,100,0.3);
  background: rgba(207,174,100,0.08);
  color: #A8893E;
}

.sg-badge--found {
  border: 1px solid rgba(31,157,85,0.4);
  background: rgba(31,157,85,0.1);
  color: #166534;
}

.sg-progress-hint {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

/* Progress ring SVG */
.sg-ring-track {
  fill: none;
  stroke: rgba(226,232,240,0.5);
}

.sg-ring-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease;
}

.sg-ring-label {
  font-size: 14px;
  font-weight: 900;
  fill: #112548;
}

.sg-ring-sub {
  font-size: 8px;
  font-weight: 700;
  fill: #94a3b8;
}

/* Toast */
.sg-toast {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(17,37,72,0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: sgToast 2s ease forwards;
  z-index: 30;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

/* Score popup */
.sg-score-popup {
  position: absolute;
  pointer-events: none;
  animation: sgFloat 1s ease-out forwards;
  font-size: 16px;
  font-weight: 900;
  color: #CFAE64;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  white-space: nowrap;
  z-index: 20;
}

/* Ground */
.sg-ground {
  position: absolute;
  left: 0;
  right: 0;
  top: 74%;
  height: 5%;
  background: rgba(71,85,105,0.15);
}

/* Sun */
.sg-sun {
  position: absolute;
  right: 12%;
  top: 10%;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: radial-gradient(circle, #CFAE64 40%, rgba(207,174,100,0.3) 100%);
  box-shadow: 0 0 0 14px rgba(207,174,100,0.15), 0 0 40px rgba(207,174,100,0.2);
  transition: opacity 0.4s ease;
}

/* Cloud */
.sg-cloud {
  position: absolute;
  top: 10%;
  width: 174px;
  height: 98px;
  transition: left 0.5s cubic-bezier(0.16,1,0.3,1);
}

.sg-cloud-body { position: absolute; border-radius: 999px; }
.sg-cloud-b1 { left: 24px; top: 18px; width: 120px; height: 44px; background: linear-gradient(180deg, #324155, #1e293b); }
.sg-cloud-b2 { left: 12px; top: 32px; width: 48px; height: 48px; background: #233143; }
.sg-cloud-b3 { left: 56px; top: 8px; width: 56px; height: 56px; background: #233143; }
.sg-cloud-b4 { left: 106px; top: 22px; width: 42px; height: 42px; background: #233143; }

.sg-cloud-drop {
  position: absolute;
  top: 76px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #CFAE64;
  box-shadow: 0 0 0 2px rgba(207,174,100,0.2);
}

.sg-cloud-wind {
  position: absolute;
  top: 78px;
  height: 5px;
  border-radius: 999px;
  background: #70E1D0;
}

/* Weather particles */
.sg-weather {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.sg-hail-particle {
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
  transform: rotate(15deg);
}

.sg-wind-line {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

/* Storm overlay */
.sg-storm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: sgLightning 1.5s ease infinite;
  z-index: 6;
}

/* House container */
.sg-house {
  position: absolute;
  left: 50%;
  top: 30.5%;
  width: 286px;
  height: 294px;
  transform: translateX(-50%);
}

/* Hotspots */
.sg-hotspot {
  position: absolute;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 2px dashed #CFAE64;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), 0 12px 24px rgba(15,23,42,0.10);
  outline: none;
  transition: transform 0.15s ease, opacity 0.3s ease;
  z-index: 8;
}

.sg-hotspot--active {
  cursor: pointer;
}

.sg-hotspot--active:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.sg-hotspot--found {
  opacity: 0.7;
  cursor: default;
}

.sg-hotspot-label {
  position: absolute;
  top: -14px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sg-hotspot-label--pending { background: rgba(17,37,72,0.9); }
.sg-hotspot-label--found { background: rgba(31,157,85,0.9); }

/* Tap cue */
.sg-tap-cue {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(17,37,72,0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(15,23,42,0.15);
  animation: sgTapCue 1.2s ease-in-out infinite;
  z-index: 8;
}

/* Knocker character */
.sg-knocker {
  position: absolute;
  left: 18%;
  top: 63%;
  width: 72px;
  height: 132px;
  animation: sgWalkIn 0.6s ease;
}

/* Dialogue bubble */
.sg-bubble {
  max-width: 210px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.96);
  border-radius: 20px;
  border: 1px solid rgba(203,213,225,0.8);
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
  box-shadow: 0 14px 32px rgba(15,23,42,0.12);
  animation: sgBubble 0.3s ease;
  position: absolute;
  z-index: 9;
}

.sg-bubble--left { top: 17%; left: 6%; }
.sg-bubble--right { top: 17%; right: 6%; left: auto; }

.sg-cursor-blink {
  animation: sgCursor 0.8s step-end infinite;
  margin-left: 1px;
}

/* Bottom tray */
.sg-tray {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 28px;
  background: linear-gradient(to top, rgba(255,255,255,0.96) 70%, rgba(255,255,255,0));
  backdrop-filter: blur(12px);
  border-radius: 0 0 34px 34px;
  animation: sgSlideUp 0.35s ease;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sg-tray-title {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: #112548;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
}

.sg-tray-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: #526072;
  line-height: 1.6;
  text-align: center;
}

.sg-tray-prompt {
  font-size: 13px;
  font-weight: 700;
  color: #526072;
  text-align: center;
}

/* Buttons */
.sg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  padding: 14px 20px;
  min-width: 120px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
  border: none;
  width: 100%;
}

.sg-btn:hover { transform: translateY(-2px) scale(1.02); }
.sg-btn:active { transform: scale(0.96); }

.sg-btn--primary {
  background: linear-gradient(135deg, #112548 0%, #1B3A6B 72%, #A8893E 100%);
  color: #fff;
  border: 1.5px solid #112548;
  box-shadow: 0 12px 32px rgba(17,37,72,0.22);
}

.sg-btn--secondary {
  background: #fff;
  color: #112548;
  border: 1.5px solid #CFAE64;
  box-shadow: 0 8px 20px rgba(168,137,62,0.12);
}

.sg-btn--glow {
  animation: sgGlow 2s ease-in-out infinite;
}

.sg-btn-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

/* Decision cards */
.sg-decision {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform 120ms ease, box-shadow 120ms ease;
  outline: none;
  font-family: inherit;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(203,213,225,0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.sg-decision:active { transform: scale(0.97); }

.sg-decision--recommended {
  border: 2px solid #CFAE64;
  background: linear-gradient(135deg, rgba(207,174,100,0.08) 0%, rgba(207,174,100,0.02) 100%);
  box-shadow: 0 8px 24px rgba(207,174,100,0.15);
  animation: sgGlow 2.5s ease-in-out infinite;
}

.sg-decision-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sg-decision-icon--default {
  background: rgba(226,232,240,0.6);
  color: #64748b;
}

.sg-decision-icon--recommended {
  background: linear-gradient(135deg, #CFAE64, #A8893E);
  color: #fff;
}

.sg-decision-title {
  font-size: 14px;
  font-weight: 800;
  color: #112548;
}

.sg-decision-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

.sg-decision-best {
  padding: 4px 8px;
  border-radius: 999px;
  background: #CFAE64;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Outcome badge */
.sg-outcome-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sg-outcome-badge--best { background: rgba(31,157,85,0.12); color: #1F9D55; }
.sg-outcome-badge--okay { background: rgba(207,174,100,0.15); color: #A8893E; }
.sg-outcome-badge--risky { background: rgba(220,38,38,0.1); color: #DC2626; }

.sg-outcome-text {
  margin-top: 8px;
  font-size: 14px;
  color: #526072;
  line-height: 1.6;
}

/* Final overlay */
.sg-final-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
  animation: sgFadeIn 0.3s ease;
}

.sg-final-card {
  width: 100%;
  max-width: 320px;
  background: rgba(255,255,255,0.98);
  border-radius: 28px;
  padding: 24px 20px;
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 28px 60px rgba(15,23,42,0.25);
  animation: sgCta 0.5s cubic-bezier(0.16,1.3,0.3,1);
  text-align: center;
}

.sg-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.sg-star {
  width: 38px;
  height: 38px;
  font-size: 32px;
  line-height: 38px;
  text-align: center;
}

.sg-star--filled { animation: sgStarBounce 0.5s ease both; }
.sg-star--empty { filter: grayscale(1) opacity(0.3); }

.sg-final-score {
  margin-top: 12px;
  font-size: 42px;
  font-weight: 900;
  font-family: Georgia, serif;
  color: #112548;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sg-final-title {
  font-size: 10px;
  font-weight: 800;
  color: #A8893E;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.sg-final-divider {
  margin: 16px 0;
  height: 1px;
  background: rgba(226,232,240,0.8);
}

.sg-final-summary {
  font-size: 14px;
  color: #526072;
  line-height: 1.7;
  text-align: left;
}

.sg-final-badges {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.sg-final-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

/* ATC Mark */
.sg-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sg-mark-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #112548 0%, #1B3A6B 68%, #CFAE64 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(17,37,72,0.18);
}

/* Bottom info strip */
.sg-info-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  margin-top: 16px;
}

.sg-info-strip span {
  font-size: 11px;
  font-weight: 700;
  color: rgba(100,116,139,0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sg-info-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(100,116,139,0.3);
}

/* ============================================================
   Keyframes
   ============================================================ */

@keyframes sgBubble {
  0% { transform: translateY(12px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes sgCta {
  0% { transform: translateY(40px) scale(0.82); opacity: 0; }
  55% { transform: translateY(-6px) scale(1.03); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

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

@keyframes sgSlideUp {
  0% { transform: translateY(100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes sgFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes sgPulse {
  0%, 100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%,-50%) scale(1.06); opacity: 0.85; }
}

@keyframes sgGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(207,174,100,0.3); }
  50% { box-shadow: 0 0 24px rgba(207,174,100,0.6); }
}

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

@keyframes sgStarBounce {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes sgLightning {
  0% { opacity: 0; }
  5% { opacity: 0.8; }
  10% { opacity: 0.1; }
  15% { opacity: 0.6; }
  25% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes sgCursor {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes sgToast {
  0% { transform: translateX(-50%) translateY(-30px); opacity: 0; }
  15% { transform: translateX(-50%) translateY(0); opacity: 1; }
  85% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-30px); opacity: 0; }
}

@keyframes sgWalkIn {
  0% { transform: translateX(-80px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes sgScorePop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  .sg-outer { padding: 8px !important; }
  .sg-frame { border-radius: 32px; }
  .sg-canvas { border-radius: 24px; }
}
