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

:root {
  --primary: #0066cb;
  --primary-hover: #0052a3;
  --primary-glow: rgba(0, 102, 203, 0.25);
  --success: #10b981;
  --success-bg: #f0fdf4;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --radius: 12px;

  /* Music Note Color Palette */
  --note-c: #ef4444; /* Do - Kırmızı */
  --note-d: #f97316; /* Re - Turuncu */
  --note-e: #eab308; /* Mi - Sarı */
  --note-f: #10b981; /* Fa - Yeşil */
  --note-g: #06b6d4; /* Sol - Camgöbeği */
  --note-a: #3b82f6; /* La - Mavi */
  --note-b: #8b5cf6; /* Si - Mor */
  --note-c5: #ec4899; /* Do2 - Pembe */
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 16px 18px;
  line-height: 1.55;
}

/* =========================================
   HEADER & GENEL BİLEŞENLER
   ========================================= */
.step-header {
  margin-bottom: 16px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 102, 203, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
}

p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

/* Hero Box */
.hero-box {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 102, 203, 0.04);
}

.hero-box h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-box p {
  color: #334155;
  font-size: 13px;
  margin-bottom: 8px;
}

/* Donanım Bağlantı Kutusu */
.hardware-box {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
}

.pin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 12.5px;
}

.pin-row:last-child {
  border-bottom: none;
}

.pin-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}

.pin-tag.pwm { background: #e0f2fe; color: #0284c7; border: 1px solid #7dd3fc; }
.pin-tag.d1  { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.pin-tag.pwr { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* Butonlar */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0066cb 0%, #0284c7 100%);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 102, 203, 0.2);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 102, 203, 0.3);
}

.btn-template-required {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45) !important;
  animation: templatePulse 1.5s infinite !important;
}

.btn-template-loaded {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  animation: none !important;
}

@keyframes templatePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 22px rgba(234, 88, 12, 0.65); }
}

/* Görev Listesi */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.activity-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  transition: all 0.25s ease;
}

.activity-card.completed {
  border-color: #86efac;
  background: var(--success-bg);
}

.activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.activity-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 14px;
  background: #e2e8f0;
  color: #64748b;
}

.activity-card.completed .status-badge {
  background: #dcfce7;
  color: #15803d;
}

/* Kategori Rozetleri */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 0 3px;
  vertical-align: middle;
}

.cat-kontrol {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid #fbbf24;
}

.cat-sensorler {
  background: rgba(168, 85, 247, 0.12);
  color: #7e22ce;
  border: 1px solid #c084fc;
}

.cat-giris-cikis, .cat-io {
  background: rgba(6, 182, 212, 0.12);
  color: #0891b2;
  border: 1px solid #22d3ee;
}

.cat-donguler {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid #34d399;
}

.cat-metin {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  border: 1px solid #fb7185;
}

.code-pill {
  background: #ffffff;
  color: #0f172a;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
}

.instruction-step {
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
}

.instruction-step ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
}

.instruction-step li {
  margin-bottom: 6px;
}

/* Programın Mantığı Kutusu */
.logic-box {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.logic-box h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #6b21a8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logic-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.6;
}

.logic-list li {
  margin-bottom: 4px;
}

.logic-list strong {
  color: #581c87;
}

/* Çalıştırma & Terminal Kutusu */
.guide-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.guide-box h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
}

.step-num {
  background: #0066cb;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Tebrik Kartı */
.congrats-card {
  display: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  animation: fadeInScale 0.3s ease forwards;
  margin-top: 12px;
}

.congrats-card.visible {
  display: block;
}

.congrats-card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

.congrats-card p {
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  font-size: 13px;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================
   🎵 NOTA & FREKANS TABLOSU & KARTLARI
   ========================================= */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 480px) {
  .notes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.note-chip {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.note-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  border-color: #94a3b8;
}

.note-chip.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 12px rgba(0, 102, 203, 0.3);
}

.note-chip-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.note-chip-freq {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.note-chip-code {
  font-size: 10px;
  font-family: monospace;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
  color: #475569;
  display: inline-block;
  margin-top: 3px;
}

/* =========================================
   🎛️ CANLI MÜZİK & SPEKTRUM HUD PANELİ (Adım 4)
   ========================================= */
.spectrum-dashboard {
  background: #090d16;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  color: #f8fafc;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid #1e293b;
}

.spectrum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 8px;
}

.spectrum-title {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spectrum-screen {
  background: #030712;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.spectrum-canvas {
  width: 100%;
  height: 110px;
  display: block;
  border-radius: 6px;
}

.spectrum-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #1f2937;
  font-size: 12px;
}

.spectrum-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #1e293b;
  font-weight: 700;
  color: #f1f5f9;
}

.spectrum-badge.playing {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.5);
  animation: pulseGlow 1s infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 8px rgba(6, 182, 212, 0.4); }
  to { box-shadow: 0 0 18px rgba(56, 189, 248, 0.8); }
}

/* Hızlı Ses Test Butonları (HUD altı) */
.sound-test-bar {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-sound-key {
  flex: 1;
  min-width: 38px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn-sound-key span {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 500;
}

.btn-sound-key:hover {
  background: #334155;
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.btn-sound-key:active {
  transform: scale(0.95);
  background: #0284c7;
}

/* =========================================
   🎹 İNTERAKTİF PİYANO & DANS EDEN KEDİ STÜDYOSU (Adım 5)
/* =========================================
   🎹 PİYANO & KEDİ MÜZİK STÜDYOSU (RESPONSIVE & CLEAN)
   ========================================= */
.piano-studio {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  color: #f8fafc;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.4);
  border: 1.5px solid #312e81;
  box-sizing: border-box;
  width: 100%;
}

.piano-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.piano-studio-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Nota Monitör Kutusu */
.note-monitor-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-height: 46px;
}

.note-monitor-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.note-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.note-value {
  font-size: 15px;
  font-weight: 900;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-status-badge {
  font-size: 11px;
  font-weight: 700;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Şarkı Çalma Kutusu (Preset Songs) */
.song-player-box {
  margin-bottom: 10px;
}

.song-player-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #c7d2fe;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.song-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-song {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(165, 180, 252, 0.25);
  color: #f1f5f9;
  padding: 8px 6px;
  min-height: 36px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  text-align: center;
}

.btn-song:hover {
  background: rgba(165, 180, 252, 0.18);
  border-color: #a5b4fc;
  transform: translateY(-1px);
}

.btn-song.playing {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  border-color: #f472b6;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
  animation: templatePulse 1.2s infinite;
}

.btn-song-anthem {
  background: rgba(225, 29, 72, 0.18);
  border-color: #f43f5e;
  color: #ffe4e6;
}

/* Kontroller (Oktav & Klavye İpuçları) */
.piano-controls-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.octave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.octave-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.octave-buttons {
  display: flex;
  gap: 4px;
}

.btn-octave {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-octave.active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
}

.shortcut-tip {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 6px;
  border-radius: 5px;
  line-height: 1.3;
}

/* =========================================
   🎹 GERÇEKÇİ PİYANO KLAVYESİ
   ========================================= */
.piano-keyboard-container {
  background: #020617;
  border-radius: 10px;
  padding: 10px 8px 8px 8px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.7), 0 3px 12px rgba(0,0,0,0.4);
  position: relative;
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.piano-keys {
  display: flex;
  position: relative;
  height: 140px;
  border-radius: 6px;
  width: 100%;
}

/* BEYAZ TUŞLAR */
.piano-key-white {
  flex: 1;
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 85%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2), inset 0 -3px 0 #94a3b8;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  transition: all 0.08s ease;
  z-index: 1;
  min-width: 0;
}

.piano-key-white:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 85%, #e2e8f0 100%);
}

.piano-key-white.active, .piano-key-white:active {
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 85%, #7dd3fc 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 -2px 0 #0284c7;
  transform: translateY(2px);
}

.piano-key-white .key-note-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
  line-height: 1.1;
}

.piano-key-white .key-shortcut-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 3px;
  border-radius: 3px;
  margin-top: 2px;
  line-height: 1.1;
}

/* SİYAH TUŞLAR */
.piano-key-black {
  position: absolute;
  top: 0;
  width: 7.5%;
  height: 85px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 75%, #020617 100%);
  border: 1px solid #020617;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 -2px 0 #334155;
  cursor: pointer;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4px;
  transition: all 0.08s ease;
}

.piano-key-black:hover {
  background: linear-gradient(180deg, #334155 0%, #1e293b 75%, #0f172a 100%);
}

.piano-key-black.active, .piano-key-black:active {
  background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 -1px 0 #312e81;
  transform: translateY(2px);
}

.piano-key-black .key-note-label {
  font-size: 8.5px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.1;
}

.piano-key-black .key-shortcut-label {
  font-size: 7.5px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.1;
}

/* Siyah tuşların yatay pozisyonları */
.piano-key-black.pos-csharp { left: 8.75%; }
.piano-key-black.pos-dsharp { left: 21.25%; }
.piano-key-black.pos-fsharp { left: 46.25%; }
.piano-key-black.pos-gsharp { left: 58.75%; }
.piano-key-black.pos-asharp { left: 71.25%; }


/* =========================================
   📡 IMU (İVMEÖLÇER & JİROSKOP) BİLEŞENLERİ
   ========================================= */

/* IMU Sensörleri İkili Kart */
.imu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.imu-mini-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font-size: 12.5px;
}

.imu-mini-card.accel {
  border-color: #fde047;
  background: linear-gradient(180deg, #fefce8 0%, #ffffff 100%);
}

.imu-mini-card.gyro {
  border-color: #e9d5ff;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

.imu-mini-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.imu-mini-card.accel .imu-mini-title { color: #854d0e; }
.imu-mini-card.gyro .imu-mini-title { color: #6b21a8; }

.imu-mini-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}


/* Live Gyroscope Visualizer Dashboard */
.gyro-dashboard {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  color: #f8fafc;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.2);
}

.gyro-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
}

.gyro-dash-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gyro-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* 3 Gauges Bar Row */
.gyro-gauges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.gauge-row {
  background: #1e293b;
  border-radius: 8px;
  padding: 8px 12px;
}

.gauge-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.gauge-meta .axis-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gauge-meta.x .axis-name { color: #f87171; }
.gauge-meta.y .axis-name { color: #4ade80; }
.gauge-meta.z .axis-name { color: #60a5fa; }

.gauge-bar-bg {
  height: 8px;
  background: #0f172a;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.gauge-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 50%;
  left: 50%;
  border-radius: 4px;
  transition: all 0.08s ease-out;
}

.gauge-row.x .gauge-bar-fill { background: #ef4444; }
.gauge-row.y .gauge-bar-fill { background: #10b981; }
.gauge-row.z .gauge-bar-fill { background: #3b82f6; }

.gauge-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  z-index: 2;
}

/* Universal Dashboard & Oscilloscope Chart */
.gyro-dashboard,
.imu-dashboard {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  color: #f8fafc;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.2);
}

.gyro-dash-header,
.imu-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
}

.gyro-dash-title,
.imu-dash-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gyro-chart-container,
.imu-chart-container {
  background: #020617;
  border: 1.5px solid #1e293b;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 140px;
  display: block;
  border-radius: 6px;
}

#gyroChartCanvas,
#accelChartCanvas {
  width: 100%;
  height: 140px;
  display: block;
  border-radius: 6px;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}


/* =========================================
   🕹️ JOYSTICK SENSÖRÜ BİLEŞENLERİ & OYUN
   ========================================= */

/* Donanım Port Bağlantı Kutusu */
.hardware-box {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
}

.pin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 12.5px;
}

.pin-row:last-child {
  border-bottom: none;
}

.pin-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}

.pin-tag.vrx { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.pin-tag.vry { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.pin-tag.pwr { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }


/* =========================================
   🎮 2D JOYSTICK CANLI SİMÜLATÖR PANELİ (HUD)
   ========================================= */
.joystick-dashboard {
  background: #0f172a;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  color: #f8fafc;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.2);
}

.joystick-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
}

.joystick-dash-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* 2D Joystick Arena & Gauges Layout */
.joystick-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.joystick-arena {
  width: 140px;
  height: 140px;
  background: #020617;
  border: 2px solid #334155;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.joystick-crosshair-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.25);
}

.joystick-crosshair-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.25);
}

.joystick-center-ring {
  width: 50px;
  height: 50px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 50%;
  position: absolute;
}

.joystick-thumbstick {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 35% 35%, #ef4444 0%, #b91c1c 80%);
  border: 2.5px solid #fca5a5;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.6);
  transition: transform 0.05s linear;
  z-index: 10;
}

/* Değer Göstergeleri */
.joystick-gauges {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.joy-gauge-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 8px 12px;
}

.joy-gauge-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.joy-gauge-header.x { color: #f87171; }
.joy-gauge-header.y { color: #4ade80; }

.joy-bar-track {
  height: 8px;
  background: #020617;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.joy-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  border-radius: 4px;
  transition: all 0.06s ease-out;
}

.joy-bar-fill.x { background: #ef4444; }
.joy-bar-fill.y { background: #10b981; }

.joy-center-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  z-index: 2;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================
   🐱 2D SİMOBOT KEDİ BALIK YAKALAMA OYUNU
   ========================================= */
.cat-game-wrapper {
  background: #0f172a;
  border-radius: var(--radius);
  border: 2px solid #334155;
  padding: 16px;
  margin: 16px 0;
  color: #f8fafc;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.35);
}

.game-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
  padding-bottom: 10px;
}

.game-title-text {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-score-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

.canvas-container {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #1e293b;
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 40%, #0f766e 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

#catGameCanvas {
  display: block;
  width: 100%;
  height: 240px;
  cursor: crosshair;
}

.game-telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: #94a3b8;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-item strong {
  color: #f8fafc;
}

.btn-restart-game {
  background: #334155;
  color: #e2e8f0;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-restart-game:hover {
  background: #475569;
  color: #ffffff;
}

/* Can / Kalpler Göstergesi */
.game-hearts-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid #334155;
}

.heart-icon {
  color: #ef4444;
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.6));
  transition: all 0.25s ease;
}

.heart-icon.lost {
  color: #475569;
  filter: none;
  transform: scale(0.85);
}

/* Game Over Ekranı */
.game-over-overlay {
  display: none !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 20;
  border-radius: 8px;
  animation: fadeInScale 0.3s ease forwards;
}

.game-over-overlay.visible {
  display: flex !important;
}

.game-over-overlay h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-over-overlay p {
  margin: 0;
  font-size: 13.5px;
  color: #cbd5e1;
  text-align: center;
}

.btn-play-again {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
  margin-top: 4px;
}

.btn-play-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}




/* =========================================
   🚗 ULTRASONİK MESAFE SENSÖRÜ & PARK RADARI
   ========================================= */

/* =========================================
   📡 CANLI ULTRASONİK RADAR & CETVEL (STEP 4)
   ========================================= */
.sonar-wrapper {
  background: #0f172a;
  border-radius: var(--radius);
  border: 2px solid #334155;
  padding: 16px;
  color: #f8fafc;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.4);
  margin-bottom: 16px;
}

.sonar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.sonar-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.distance-big-display {
  text-align: center;
  padding: 14px 0;
}

.distance-value {
  font-size: 42px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: -1px;
}

.distance-unit {
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
  margin-left: 4px;
}

/* Mesafe Cetveli */
.ruler-container {
  position: relative;
  background: #1e293b;
  border-radius: 8px;
  height: 24px;
  overflow: hidden;
  border: 1px solid #334155;
  margin: 10px 0 6px 0;
}

.ruler-bar {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 35%, #10b981 100%);
  border-radius: 6px;
  transition: width 0.15s ease-out, background 0.2s ease;
}

.ruler-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

/* =========================================
   🚗 ARABA PARK SENSÖRÜ HUD (STEP 5)
   ========================================= */
.car-park-wrapper {
  background: #0f172a;
  border-radius: var(--radius);
  border: 2px solid #334155;
  padding: 16px;
  color: #f8fafc;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.45);
  margin-bottom: 16px;
}

.car-park-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.car-park-title {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-toggle-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.audio-toggle-btn.active {
  background: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
}

.park-arena {
  position: relative;
  background: radial-gradient(circle at center 75%, #1e293b 0%, #0b1329 100%);
  border-radius: 10px;
  border: 1px solid #334155;
  height: 220px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
}

/* Radar Arcs / Dalgaları */
.radar-arcs-container {
  position: absolute;
  top: 15px;
  width: 220px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radar-arc {
  border-radius: 50% 50% 0 0;
  border-top: 6px solid #334155;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: none;
  margin: 3px auto;
  transition: all 0.15s ease-out;
}

.radar-arc-far { width: 200px; height: 35px; }
.radar-arc-mid { width: 140px; height: 28px; }
.radar-arc-near { width: 80px; height: 22px; }

.radar-arc.active-green {
  border-top-color: #22c55e;
  filter: drop-shadow(0 0 8px #22c55e);
}

.radar-arc.active-yellow {
  border-top-color: #eab308;
  filter: drop-shadow(0 0 8px #eab308);
}

.radar-arc.active-red {
  border-top-color: #ef4444;
  filter: drop-shadow(0 0 10px #ef4444);
  animation: pulseRed 0.25s infinite alternate;
}

@keyframes pulseRed {
  from { opacity: 0.7; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.03); }
}

/* Araba Çizimi */
.car-body-box {
  width: 90px;
  height: 52px;
  background: #38bdf8;
  border-radius: 12px 12px 6px 6px;
  border: 3px solid #0284c7;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.car-window {
  width: 70px;
  height: 20px;
  background: #0f172a;
  border-radius: 6px 6px 0 0;
}

.car-taillight {
  position: absolute;
  bottom: 6px;
  width: 14px;
  height: 8px;
  background: #ef4444;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.8);
}
.car-taillight.left { left: 6px; }
.car-taillight.right { right: 6px; }

/* Park Durum Rozeti */
.park-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
}

.park-distance-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 900;
  color: #38bdf8;
}

/* Website presentation iframe on phones. The unit logic stays identical; only
   the final activity surfaces become easier to read and touch. */
@media (max-width: 560px) {
  body { padding: 6px !important; }

  .game-wrapper,
  .peekaboo-stage,
  .cat-game-wrapper,
  .car-park-wrapper,
  .piano-studio,
  .gyro-dashboard,
  .imu-dashboard {
    margin: 0 !important;
    padding: 10px !important;
    border-radius: 12px !important;
  }

  .game-header-bar,
  .stage-header,
  .car-park-header,
  .piano-studio-header,
  .gyro-dash-header,
  .imu-dash-header,
  .note-monitor-box,
  .game-telemetry-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .game-title-text,
  .stage-title,
  .car-park-title,
  .piano-studio-title,
  .gyro-dash-title,
  .imu-dash-title { font-size: 12px; }

  .game-score-badge,
  .audio-toggle-btn,
  .btn-restart-game,
  .btn-song { min-height: 40px; }

  .song-buttons-row { grid-template-columns: 1fr; }
  .note-monitor-box { display: grid; }
  .note-status-badge { white-space: normal; }
  .octave-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .octave-buttons { width: 100%; }
  .btn-octave { flex: 1; min-height: 38px; }
  .piano-keys { height: 124px; }
  .piano-key-black { height: 76px; }

  .weather-dash-grid { grid-template-columns: 1fr !important; }
  .chart-legend { align-items: flex-start !important; flex-wrap: wrap; gap: 6px !important; }
  .gauge-meta { gap: 10px; font-size: 10px; }

  #catGameCanvas { height: 300px; }
  .game-telemetry-row { display: grid; font-size: 11px; }
  .park-arena { height: 280px; }
  .raw-telemetry-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}

/* Manuel Test Kaydırıcısı */
.test-slider-box {
  background: #1e293b;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.test-slider-box input[type=range] {
  flex: 1;
  accent-color: #0284c7;
  cursor: pointer;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
