/* ═══════════════════════════════════════════
   RIDDLES — terminal window aesthetic
═══════════════════════════════════════════ */

#riddles {
  background: var(--bg-dark);
  padding: 100px 0;
}

#riddles .section-label { color: var(--accent); }

#riddles .section-heading { color: var(--text); }
#riddles .section-heading em { color: var(--accent); }

.riddles-heading { margin-bottom: 1rem; }

.riddles-intro {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  max-width: 600px;
}
.riddles-intro::before { content: '// '; color: rgba(233,30,140,0.5); }

/* ─── Grid — always 2×2 ─── */
.riddles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}

/* ─── Terminal Card ─── */
.riddle-card {
  background: #0b0b18;
  border: 1px solid rgba(233,30,140,0.18);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.riddle-card:hover {
  border-color: rgba(233,30,140,0.45);
  box-shadow: 0 0 28px rgba(233,30,140,0.12);
}
.riddle-card.solved {
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(233,30,140,0.22);
}

/* ── Terminal title bar ── */
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(233,30,140,0.12);
  padding: 0.55rem 0.9rem;
  flex-shrink: 0;
}

/* macOS-style traffic-light dots */
.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.t-red    { background: #ff5f57; }
.t-yellow { background: #ffbd2e; }
.t-green  { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

/* ── Code block ── */
.riddle-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.85;
  color: #7ec887;
  padding: 1.6rem 1.6rem 1.4rem;
  white-space: pre;
  overflow-x: auto;
  flex: 1;
  background: transparent;
}

/* ── Input row with $> prompt ── */
.riddle-input-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.9rem 1.4rem 1rem;
  border-top: 1px solid rgba(233,30,140,0.08);
  background: rgba(0,0,0,0.25);
}

.prompt {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  flex-shrink: 0;
  user-select: none;
}

.riddle-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(233,30,140,0.25);
  padding: 0.2rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.riddle-input::placeholder { color: rgba(233,30,140,0.25); font-style: italic; }
.riddle-input:focus { border-bottom-color: var(--accent); }
.riddle-input:disabled { opacity: 0.45; cursor: not-allowed; }

.riddle-submit {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(233,30,140,0.2);
  border-radius: 4px;
  width: 40px;
  height: 34px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.6rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}
.riddle-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.riddle-submit:disabled { opacity: 0.35; pointer-events: none; }

/* ── Feedback line ── */
.riddle-feedback {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.5rem 1.4rem 0.9rem;
  min-height: 1.8em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.25);
}
.riddle-feedback.correct { color: #28c840; }
.riddle-feedback.wrong   { color: #ff5f57; }

/* ── Solved state overlay text ── */
.riddle-card.solved .terminal-title::after {
  content: ' ✓ solved';
  color: #28c840;
}

/* ─── Unlock banner ─── */
.riddle-unlock {
  margin-top: 2.5rem;
  background: rgba(233,30,140,0.08);
  border: 1px solid rgba(233,30,140,0.3);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.6rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  display: none;
  animation: popIn 0.4s ease;
}
.riddle-unlock[aria-hidden="false"] { display: block; }
.riddle-unlock strong { color: var(--accent); }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .riddles-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .riddle-code  { font-size: 0.85rem; }
}
