/* Triangle pointer removed per request; only ::after bubble is used */

.headline.option {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5em;
  white-space: normal;
}

.option-label {
  display: inline-block;
  margin-right: 0.1em;
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: #eef2ff;
  color: #3949ab;
  font-weight: 700;
  line-height: 1.2;
  margin-right: .5em;
}

.option-text {
  display: inline;
}
/* Layout for title and score */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.score-box {
  font-size: 16px;
  background: #f1f5f9;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  margin-bottom: -5px;
  white-space: nowrap;
  opacity: .15;
}

.summary {
  font-size: 22px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
  margin-top: 16px;
}

/* Practice card */
.practice-fact {
  font-size: 18px;
  font-weight: 500;
  margin: 8px 0 16px;
  color: #334155;
}

.styles-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.style-block {
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.style-head {
  font-size: 13px;
  letter-spacing: .5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.style-example {
  font-size: 15px;
  line-height: 1.4;
  color: #1e293b;
}

/* Flash animation for .fact when card changes */
@keyframes factFlash {
  0% { opacity: 0.5; }
  40% { opacity: 0; }
  100% { opacity: 1; }
}

.fact.flash {
  animation: factFlash 2000ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .fact.flash { animation: none; }
}

/* Practice creation mode */
.practice-prompt {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #334155;
}

.practice-input-wrap {
  margin-bottom: 10px;
}

.practice-input {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  resize: vertical;
  background: #ffffff;
  font-family: inherit;
}

.practice-input:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.practice-hint {
  font-size: 13px;
  color: #64748b;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Inverted style for practice card */
.card.practice {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #1e293b;
}
.card.practice .fact,
.card.practice .practice-fact,
.card.practice .practice-prompt,
.card.practice .practice-hint {
  color: #ffffff;
}
.card.practice .practice-hint {
  background: rgba(255,255,255,0.08);
  border-color: #334155;
}
.card.practice .img-box {
  background: #1e293b;
}
.card.practice .headline.option { /* if any options accidentally appear */
  background: #1e293b;
  color: #ffffff;
  border-color: #334155;
}
.card.practice .headline.option:hover:not(:disabled) {
  background: #334155;
}
/* Quiz option styles */
.controls {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#nextBtn {
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #2563eb;
  color: #fff;
}

#nextBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.headline.option {
  display: block;
  width: 100%;
  text-align: left;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 600;
  position: relative; /* for right-side info icon positioning */
  padding-right: 42px; /* space for the lightbulb icon */
}

.headline.option:hover:not(:disabled) {
  background: #eef2ff;
}

.headline.option.correct {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

.headline.option.incorrect {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #f3f4f6;
      margin: 0;
      padding: 14px;
      color: #111827;
    }
    h1 {
      font-size: 1.4rem;
      text-align: center;
      margin: 6px 0 14px 0;
    }
    #feed {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .card {
      background: #ffffff;
      border-radius: 14px;
      padding: 14px 16px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    }
    .fact {
      font-size: 0.85rem;
      color: #828ca0;
      margin-bottom: 10px;
      padding-left: 8px;
    }
    .img-box .fact {
      margin-top: 0.3rem;
      background: #111827; /* slate-900 */
      color: #7d8083;      /* gray-50 */
      padding: 0.6rem 0.75rem;
      border-radius: 6px;
      font-weight: 600;
      position: absolute;
      bottom: 0;
      width: 100%;
      font-weight: 400;
      margin-bottom: 0;
      opacity: .9;
    }

    /* 16:9 box za sliku */
    .img-box {
      width: 100%;
      position: relative;
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 12px;
      background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    }
    .img-box::before {
      content: "";
      display: block;
      padding-top: 56.25%; /* 16:9 */
    }
    .img-box-inner {
      position: absolute;
      inset: 0;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
    }

    .headline {
      margin-bottom: 10px;
      font-size: 1rem;
      line-height: 1.35;
      background: #f9fafb;
      padding: 8px 10px;
      border-radius: 8px;
    }

    footer {
      text-align: center;
      font-size: 0.75rem;
      margin-top: 10px;
      color: #9ca3af;
    }

    .footer-inline {
      font-size: 0.85rem;
      color: #64748b;
      margin-left: auto;
      text-align: right;
    }

  /* Footer help info icon + tooltip */


    .img-box .fact .fact-text.flash {
      animation: factFlash 1200ms ease;
    }

    .fact-text {
      color: white;
    }

    /* Footer help info icon + tooltip */
    .footer-info-icon {
      display: inline-block;
      margin-left: 8px;
      font-size: 16px;
      cursor: pointer;
      vertical-align: middle;
      position: relative;
    }

    .footer-info-icon::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      right: 0;
      transform: translateY(-8px);
      background: #0f172a;
      color: #fff;
      border: 1px solid #334155;
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 12px;
      width: 220px;
      white-space: normal;
      line-height: 1.35;
      opacity: 0;
      pointer-events: none;
      transition: opacity 150ms ease, transform 150ms ease;
      box-shadow: 0 4px 10px rgba(0,0,0,0.15);
      text-align: left;
    }

    .footer-info-icon:hover::after,
    .footer-info-icon:focus::after {
      opacity: 1;
      transform: translateY(-12px);
    }

    .footer-info-icon.flash {
      animation: factFlash 1200ms ease-out;
    }

    /* When the tooltip is inside the option label, open to the right */
    .footer-info-icon.tooltip-right::after {
      top: 50%;
      left: 100%;
      right: auto;
      bottom: auto;
      transform: translate(8px, -50%);
      min-width: 200px;
      max-width: 360px;
      width: auto;
      z-index: 10;
    }
    .footer-info-icon.tooltip-right:hover::after,
    .footer-info-icon.tooltip-right:focus::after {
      opacity: 1;
      transform: translate(12px, -50%);
    }

    /* Right-side lightbulb for options, reusing footer tooltip styling */
    .option-info-icon {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      margin-left: 0;
      font-size: 16px;
    }

    @media (min-width: 768px) {
      body {
        max-width: 520px;
        margin: 0 auto;
      }
    }

/* Responsive: make title and score fit side-by-side on small screens */
@media (max-width: 560px) {
  .title { font-size: 22px; }
  .score-box { font-size: 14px; padding: 6px 10px; }
}

@media (max-width: 380px) {
  .title { font-size: 18px; }
  .score-box { font-size: 12px; padding: 4px 8px; }
}