/* ─────────────── Ortak Puzzle UI Bileşenleri ─────────────── */

/* TopBar — siyah surface, beyaz yazı, accent renk glyph
   Üst kenarda padding yok (ekrana yapışık), köşeler düz */
.puzzle-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--puzzle-topbar-bg, #0d0d10);
  color: #ffffff;
  gap: 8px;
}

.puzzle-topbar-side {
  width: 80px;
  display: flex;
  gap: 4px;
}

.puzzle-topbar-side.right {
  justify-content: flex-end;
}

.puzzle-topbar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  flex: 1;
  text-align: center;
}

.puzzle-topbar-glyph {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.puzzle-topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s;
}

.puzzle-topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* SubBar */
.puzzle-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  gap: 8px;
}

.puzzle-subbar-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}

.puzzle-subbar-diff-pill {
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
}

.puzzle-subbar-diff-pill strong {
  color: var(--ink);
}

.puzzle-subbar-reset {
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}

.puzzle-subbar-reset:hover {
  background: var(--line-2);
}

/* ProgressBar */
.puzzle-progress {
  padding: 4px 20px 12px;
}

.puzzle-progress-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.puzzle-progress-track {
  height: 6px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}

.puzzle-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
  border-radius: 999px;
}

/* HelpPanel + ExamplesPanel */
.puzzle-panel {
  background: var(--card-bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}

.puzzle-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  width: 100%;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
}

.puzzle-panel-chevron {
  transition: transform .2s ease;
  color: var(--ink-2);
}

.puzzle-panel-chevron.open {
  transform: rotate(180deg);
}

.puzzle-panel-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.puzzle-help-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.puzzle-help-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--app-bg);
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.puzzle-help-text {
  color: var(--ink-2);
  flex: 1 1 auto;
}

/* Examples carousel */
.puzzle-examples-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
}

.puzzle-examples-canvas {
  flex: 0 0 auto;
}

.puzzle-examples-arrow {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background .15s;
}

.puzzle-examples-arrow:hover {
  background: var(--app-bg);
}

.puzzle-examples-caption {
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
}

.puzzle-examples-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.puzzle-examples-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  transition: background .15s;
}

.puzzle-examples-dot.active {
  background: var(--accent);
}

/* Tutorial Modal */
.puzzle-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.puzzle-modal-card {
  width: min(420px, 100%);
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.puzzle-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
}

.puzzle-modal-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.puzzle-modal-close {
  background: transparent;
  border: 0;
  color: var(--ink-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}

.puzzle-modal-body {
  padding: 18px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.puzzle-modal-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 0 18px 12px;
}

.puzzle-modal-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.puzzle-modal-dot.active {
  background: var(--accent);
}

.puzzle-modal-actions {
  display: flex;
  gap: 10px;
  padding: 12px 18px 18px;
}

.puzzle-modal-secondary {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.puzzle-modal-primary {
  flex: 1 1 auto;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* "Sonraki bulmacaya geç" button — done state'te */
.puzzle-next-btn {
  background: var(--accent);
  color: var(--card-bg);
  border: 0;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Help text at bottom of game screen */
.puzzle-help-footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-2);
  padding: 8px 16px 0;
  line-height: 1.4;
}
