/* ============================================================
   Easy Flight — Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fredoka', sans-serif;
  background: #1a1a2e;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ── Canvas ── */

#gameCanvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ── Loading Screen ── */

#ef-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s;
}

#ef-loading.ef-fade-out {
  opacity: 0;
  pointer-events: none;
}

.ef-loading-plane {
  font-size: 64px;
  animation: ef-fly 1.5s ease-in-out infinite;
}

@keyframes ef-fly {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.ef-loading-text {
  font-size: 24px;
  font-weight: 600;
  margin-top: 20px;
  color: #ffd700;
}

.ef-loading-dots::after {
  content: '';
  animation: ef-dots 1.5s steps(3) infinite;
}

@keyframes ef-dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

/* ── Overlay Screens ── */

.ef-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ef-screen-bg {
  background: rgba(20, 20, 50, 0.92);
  backdrop-filter: blur(6px);
}

/* ── Title Screen ── */

.ef-title-logo {
  font-size: 52px;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 4px 0 #b8860b, 0 0 30px rgba(255, 215, 0, 0.4);
  margin-bottom: 8px;
  text-align: center;
  line-height: 1.1;
}

.ef-title-sub {
  font-size: 18px;
  color: #90caf9;
  margin-bottom: 40px;
}

.ef-title-plane {
  font-size: 80px;
  margin-bottom: 30px;
  animation: ef-float 3s ease-in-out infinite;
}

@keyframes ef-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ── Points Display ── */

.ef-points-bar {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #ffc107;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
  z-index: 20;
}

/* ── Buttons ── */

.ef-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 14px 36px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin: 6px;
  min-width: 180px;
  text-align: center;
}

.ef-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ef-btn:active {
  transform: translateY(1px);
}

.ef-btn-play {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  font-size: 22px;
  padding: 16px 48px;
}

.ef-btn-shop-main {
  background: linear-gradient(135deg, #ff9800, #e65100);
  color: #fff;
}

.ef-btn-go {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
}

.ef-btn-select {
  background: linear-gradient(135deg, #2196f3, #1565c0);
  color: #fff;
}

.ef-btn-buy {
  background: linear-gradient(135deg, #ff9800, #e65100);
  color: #fff;
}

.ef-btn-locked {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

.ef-btn-locked:hover {
  transform: none;
  box-shadow: none;
}

.ef-btn-back {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-size: 14px;
  padding: 8px 20px;
  min-width: auto;
}

.ef-btn-retry {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  font-size: 22px;
}

.ef-btn-menu-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ddd;
}

.ef-btn-sm {
  font-size: 13px;
  padding: 6px 14px;
  min-width: auto;
  margin: 0 0 0 10px;
  border-radius: 8px;
}

/* ── Selection Screens ── */

.ef-select-title {
  font-size: 24px;
  font-weight: 600;
  color: #90caf9;
  margin-bottom: 20px;
}

.ef-select-carousel {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.ef-arrow-btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ef-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ef-select-preview {
  width: 160px;
  height: 120px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.ef-select-world-preview {
  width: 220px;
  height: 140px;
}

.ef-select-name {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ef-select-cost {
  font-size: 16px;
  color: #ffc107;
  margin-bottom: 4px;
  min-height: 22px;
}

.ef-select-owned {
  font-size: 14px;
  color: #81c784;
  margin-bottom: 12px;
  min-height: 20px;
}

.ef-select-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── Shop ── */

.ef-shop-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 16px;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 2px 4px rgba(0,0,0,0.4);
  letter-spacing: 2px;
}

.ef-shop-scroll {
  max-height: 62vh;
  overflow-y: auto;
  width: 100%;
  max-width: 420px;
  padding: 0 6px;
}

.ef-shop-scroll::-webkit-scrollbar {
  width: 6px;
}

.ef-shop-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 3px;
}

/* Section headings */
.ef-shop-heading {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin: 18px 0 10px;
  padding: 6px 14px;
  border-radius: 20px;
  text-align: center;
  border: none;
}

.ef-shop-heading:first-child {
  margin-top: 4px;
}

.ef-shop-heading[data-section="planes"] {
  background: linear-gradient(135deg, rgba(255,152,0,0.25), rgba(255,87,34,0.25));
  color: #ffcc80;
  text-shadow: 0 0 8px rgba(255,152,0,0.4);
}
.ef-shop-heading[data-section="pilots"] {
  background: linear-gradient(135deg, rgba(76,175,80,0.25), rgba(0,150,136,0.25));
  color: #a5d6a7;
  text-shadow: 0 0 8px rgba(76,175,80,0.4);
}
.ef-shop-heading[data-section="worlds"] {
  background: linear-gradient(135deg, rgba(156,39,176,0.25), rgba(103,58,183,0.25));
  color: #ce93d8;
  text-shadow: 0 0 8px rgba(156,39,176,0.4);
}

/* Card grid */
.ef-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

/* Individual cards */
.ef-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.08);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: default;
  overflow: hidden;
}

.ef-shop-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  opacity: 0.7;
}

.ef-shop-card:hover {
  transform: scale(1.03);
}

/* Color accent stripe per card */
.ef-shop-card[data-accent]::before {
  background: var(--card-accent);
}

/* Icon area */
.ef-shop-card-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Color swatch row */
.ef-shop-swatch {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
}

.ef-shop-swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Card name */
.ef-shop-card-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.2;
}

/* Card description */
.ef-shop-card-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-bottom: 6px;
  font-style: italic;
}

/* Owned badge */
.ef-shop-badge-owned {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #69f0ae;
  background: rgba(105,240,174,0.12);
  padding: 3px 10px;
  border-radius: 12px;
  text-shadow: 0 0 6px rgba(105,240,174,0.3);
}

/* Price tag */
.ef-shop-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd740;
  background: rgba(255,215,64,0.12);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.ef-shop-price-coin {
  font-size: 13px;
}

/* Buy button on card */
.ef-shop-card .ef-btn-buy {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ffab00, #ff6d00);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(255,109,0,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
}

.ef-shop-card .ef-btn-buy:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(255,109,0,0.6);
}

.ef-shop-card .ef-btn-buy:active {
  transform: scale(0.95);
}

/* Locked card style */
.ef-shop-card.ef-shop-locked {
  border-color: rgba(255,255,255,0.04);
}

.ef-shop-card.ef-shop-locked .ef-shop-card-icon {
  filter: grayscale(0.6) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  opacity: 0.5;
}

.ef-shop-card.ef-shop-locked .ef-shop-card-name {
  color: rgba(255,255,255,0.45);
}

.ef-shop-locked-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.35);
  cursor: not-allowed;
}

/* Owned card glow */
.ef-shop-card.ef-shop-card-owned {
  border-color: rgba(105,240,174,0.15);
  box-shadow: inset 0 0 20px rgba(105,240,174,0.04);
}

/* Buyable card glow */
.ef-shop-card.ef-shop-buyable {
  border-color: rgba(255,171,0,0.2);
  box-shadow: 0 0 12px rgba(255,171,0,0.08);
}

.ef-shop-card.ef-shop-buyable:hover {
  border-color: rgba(255,171,0,0.4);
  box-shadow: 0 0 20px rgba(255,171,0,0.15);
}

/* Bounce animation on purchase */
@keyframes ef-shop-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.ef-shop-card.ef-shop-just-bought {
  animation: ef-shop-bounce 0.4s ease;
}

/* ── Crash Screen ── */

.ef-crash-title {
  font-size: 42px;
  font-weight: 700;
  color: #ff5252;
  text-shadow: 0 3px 0 #b71c1c;
  margin-bottom: 8px;
}

.ef-crash-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  animation: ef-spin 1s ease-out;
}

@keyframes ef-spin {
  0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
  50% { transform: rotate(200deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.ef-crash-stats {
  display: flex;
  gap: 30px;
  margin-bottom: 16px;
}

.ef-crash-stat {
  text-align: center;
}

.ef-crash-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffd700;
}

.ef-crash-stat-label {
  font-size: 13px;
  color: #aaa;
  margin-top: 2px;
}

.ef-crash-earned {
  font-size: 20px;
  font-weight: 600;
  color: #81c784;
  margin-bottom: 6px;
}

.ef-crash-high-row {
  font-size: 14px;
  color: #90caf9;
  margin-bottom: 20px;
}

.ef-crash-new-high {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ff9800);
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  animation: ef-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes ef-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.ef-crash-buttons {
  display: flex;
  gap: 12px;
}

/* ── Back to Arcade Link ── */

.ef-back-link {
  display: inline-block;
  margin-top: 20px;
  color: #90caf9;
  font-size: 14px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.ef-back-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── ESC Hint ── */

.ef-esc-hint {
  margin-top: 16px;
  font-size: 12px;
  color: #666;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .ef-title-logo {
    font-size: 36px;
  }

  .ef-title-plane {
    font-size: 56px;
  }

  .ef-btn {
    font-size: 16px;
    padding: 12px 28px;
    min-width: 140px;
  }

  .ef-crash-stats {
    gap: 16px;
  }

  .ef-crash-stat-value {
    font-size: 22px;
  }

  .ef-select-preview {
    width: 120px;
    height: 90px;
  }
}
