/* Arayüz Bileşenleri — İnce Üst Şerit, Konuşma Balonu, Kontroller, Başlık & Final Kartları */

/* === 1. İnce Üst Şerit (HUD) === */
.hud-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-logo-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f5ebd6;
  border: 2px solid #d7c5a3;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hud-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-primary);
  white-space: nowrap;
}

.hud-title-short {
  display: none;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-chapters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chapter-pip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  background: #ece5d8;
  color: var(--ink-muted);
  border: 2px solid #d5cab6;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.chapter-pip.is-active {
  background: var(--chalk-pink);
  color: #fff;
  border-color: #b73566;
  transform: scale(1.1);
}

.chapter-pip.is-done {
  background: var(--chalk-green);
  color: #fff;
  border-color: #207645;
}

.hud-counter {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: #f5efe3;
  border: 1.5px solid #ddd2be;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.sound-toggle-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f5efe3;
  border: 2px solid #d8ccb6;
  color: var(--ink-primary);
  transition: transform 0.14s ease, background-color 0.14s ease;
}

.sound-toggle-btn:hover {
  background: #efe5d1;
}

.sound-toggle-btn:active {
  transform: scale(0.95);
}

/* === 2. Tek Konuşma Balonu (Rehber Karakter) === */
.mascot-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mascot-avatar-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fffaf0;
  border: 2.5px solid #d9cbb3;
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 3px;
}

.mascot-avatar-img,
.mascot-avatar-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.speech-bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-primary);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 13px;
  height: 13px;
  background: inherit;
  border-left: 2px solid var(--surface-border);
  border-bottom: 2px solid var(--surface-border);
}

.speech-speaker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--chalk-coral);
  margin-right: 6px;
}

.speech-bubble.is-feedback-success {
  background: var(--state-success-bg);
  border-color: #6bc493;
}

.speech-bubble.is-feedback-success::before {
  border-color: #6bc493;
}

.speech-bubble.is-feedback-error {
  background: var(--state-error-bg);
  border-color: #e48d81;
}

.speech-bubble.is-feedback-error::before {
  border-color: #e48d81;
}

.speech-bubble.is-feedback-hint {
  background: var(--state-hint-bg);
  border-color: #e5bd5c;
}

.speech-bubble.is-feedback-hint::before {
  border-color: #e5bd5c;
}

/* === 3. Alt Kontrol Alanı (Bölüme Göre Tek Kontrol) === */

/* Bölüm 1: 3 resimli büyük tahmin düğmesi */
.choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice-card-btn {
  min-height: 64px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 2.5px solid #d4c6b0;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: left;
  transition: transform 0.14s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.choice-card-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--chalk-blue);
  background: #ffffff;
}

.choice-card-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.choice-card-btn.is-correct {
  background: var(--state-success-bg);
  border-color: var(--state-success);
}

.choice-card-btn.is-wrong {
  background: var(--state-error-bg);
  border-color: var(--state-error);
  opacity: 0.78;
}

.choice-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #e6dfd4;
  border: 1.5px solid #c9bea9;
  display: grid;
  place-items: center;
}

.choice-label {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-primary);
}

/* Bölüm 2: Çizim kontrol çubuğu */
.draw-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.draw-point-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.point-pill-btn {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  background: #f1eadc;
  border: 2px solid #d4c6b0;
  color: var(--ink-secondary);
  transition: all 0.14s ease;
}

.point-pill-btn.is-selected {
  background: var(--chalk-blue);
  border-color: #18699c;
  color: #fff;
}

.draw-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Bölüm 3 (Örnek 7 & 8): 4 tabela açı seçeneği */
.angle-options-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sign-option-btn {
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9e8c7 0%, #efd29c 100%);
  border: 2.5px solid var(--wood-edge);
  box-shadow: 0 3px 0 #93642e;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--wood-dark);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.sign-option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.sign-option-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sign-option-btn.is-correct {
  background: linear-gradient(180deg, #dcf7e7 0%, #b5ebd0 100%);
  border-color: var(--state-success);
  color: #155c35;
  box-shadow: 0 3px 0 #1b6e41;
}

.sign-option-btn.is-wrong {
  background: linear-gradient(180deg, #fde9e6 0%, #f7cdc7 100%);
  border-color: var(--state-error);
  color: #8b271c;
  opacity: 0.72;
}

/* Bölüm 3 (Örnek 9): Sürükle/Dokun sayı çipleri + Kontrol Et */
.chip-dock {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 2px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
}

.angle-chips-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.angle-chip {
  min-width: 58px;
  min-height: var(--touch-min);
  padding: 0 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9e8c7 0%, #efd29c 100%);
  border: 2.5px solid var(--wood-edge);
  box-shadow: 0 3px 0 #93642e;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--wood-dark);
  touch-action: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.angle-chip:hover {
  transform: translateY(-2px);
}

.angle-chip.is-selected {
  border-color: var(--chalk-pink);
  background: #fff1f6;
  color: #9e2152;
  box-shadow: 0 0 0 3px rgba(223, 75, 130, 0.25);
  transform: translateY(-2px);
}

/* Sürüklenen hayalet çip */
.drag-chip-ghost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.08);
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff6df;
  border: 2.5px solid var(--chalk-pink);
  box-shadow: 0 10px 22px rgba(45, 36, 22, 0.24);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wood-dark);
}

/* Birincil ve İkincil Düğmeler */
.btn-primary {
  min-height: var(--touch-min);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #2fb068 0%, #238d52 100%);
  border: 2px solid #1a6d3e;
  box-shadow: 0 3px 0 #175c35;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-secondary {
  min-height: var(--touch-min);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: #f2eadc;
  border: 2px solid #d1c3ac;
  color: var(--ink-secondary);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover:not(:disabled) {
  background: #e9decb;
}

.next-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.parade-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  border: 2px solid #6bc493;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: #1c6e41;
}

/* === 4. Başlık & Final Kartları === */
.modal-card {
  width: min(560px, 100%);
  border-radius: 26px;
  background: linear-gradient(180deg, #fffdf8 0%, #f5eee0 100%);
  border: 3px solid #d9cbb3;
  box-shadow: 0 18px 44px rgba(42, 48, 32, 0.28);
  padding: 22px 22px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.title-chalk-board {
  position: relative;
  border-radius: 18px;
  padding: 18px 16px 14px;
  margin-bottom: 14px;
  background:
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(160, 148, 130, 0.22) 44px 46px),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(160, 148, 130, 0.22) 44px 46px),
    #dfd7ca;
  border: 2.5px solid #c6bba9;
}

.title-chalk-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  font-weight: 700;
  color: #fffef9;
  text-shadow:
    0 2px 0 rgba(90, 80, 68, 0.35),
    0 0 10px rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
}

.title-chalk-underline {
  width: 180px;
  height: 10px;
  margin: 6px auto 12px;
}

.title-ants-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  min-height: 102px;
}

.title-ant-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.title-ant-figure img,
.title-ant-figure svg {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.title-ant-tag {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 247, 0.9);
  border: 1.5px solid #d4c6b0;
  color: var(--ink-primary);
}

.modal-story {
  margin: 0 auto 16px;
  max-width: 44ch;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.btn-start-big {
  min-height: 52px;
  padding: 12px 36px;
  font-size: 1.15rem;
}

/* Final Özet Kartı */
.final-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.final-queen-wrap {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
}

.final-queen-wrap img,
.final-queen-wrap svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.final-title-col {
  text-align: left;
}

.final-heading {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--ink-primary);
}

.final-sub {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.35;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.summary-tile {
  padding: 8px 6px;
  border-radius: 14px;
  background: #e2dad0;
  border: 2px solid #c8bdb0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.summary-tile svg {
  width: 72px;
  height: 52px;
}

.summary-tile-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.summary-rule-pill {
  display: inline-block;
  margin: 4px 0 14px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--chalk-yellow-soft);
  border: 2px solid #e7c056;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #6b4909;
}

/* === 5. Mobil Uyum (375×812) === */
@media (max-width: 600px) {
  .hud-strip {
    padding: 4px 8px;
    gap: 6px;
    min-height: 44px;
  }

  .hud-brand {
    gap: 5px;
  }

  .hud-center {
    gap: 6px;
  }

  .hud-title {
    font-size: 0.92rem;
  }

  .hud-title-full {
    display: none;
  }

  .hud-title-short {
    display: inline;
  }

  .hud-logo-badge {
    width: 26px;
    height: 26px;
  }

  .chapter-pip {
    width: 22px;
    height: 22px;
    font-size: 0.74rem;
  }

  .hud-counter {
    font-size: 0.8rem;
    padding: 3px 8px;
  }

  .mascot-avatar-wrap {
    width: 46px;
    height: 46px;
  }

  .speech-bubble {
    padding: 8px 11px;
    font-size: 0.88rem;
    line-height: 1.3;
  }

  .choice-grid {
    gap: 6px;
  }

  .choice-card-btn {
    flex-direction: column;
    text-align: center;
    padding: 7px 5px;
    min-height: 80px;
    gap: 4px;
  }

  .choice-icon {
    width: 34px;
    height: 34px;
  }

  .choice-label {
    font-size: 0.79rem;
    line-height: 1.15;
  }

  .draw-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .point-pill-btn {
    padding: 0 9px;
    font-size: 0.84rem;
  }

  .btn-primary {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .btn-secondary {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .angle-options-row {
    gap: 6px;
  }

  .sign-option-btn {
    min-height: 48px;
    font-size: 1.05rem;
    padding: 6px 4px;
  }

  .chip-dock {
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px 8px;
    gap: 6px;
  }

  .angle-chip {
    min-width: 52px;
    padding: 0 10px;
    font-size: 0.95rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-card {
    padding: 16px 14px;
  }
}

@media (max-width: 340px) {
  .hud-title {
    display: none;
  }
}
