/* ============================================================
   LoopTube Unified Subtitle Requirements V11
   Default playback page = Focus Subtitle
   - No large SVO boxes
   - English / Chinese separate lines
   - Prepositions highlighted
   - S/P de-emphasized
   - D/O/A/POS focused
   - Click word => dictionary card
   - Click card blank => repeat / A-B loop callback
   ============================================================ */

:root {
  --lt-v11-card-bg: rgba(15, 23, 42, 0.72);
  --lt-v11-card-border: rgba(148, 163, 184, 0.22);
  --lt-v11-english: rgba(255, 255, 255, 0.96);
  --lt-v11-chinese: #9ca3af;
  --lt-v11-muted: rgba(255, 255, 255, 0.66);

  --lt-v11-prep: #ef4444;
  --lt-v11-det-mod: #10b981;
  --lt-v11-object: #3b82f6;
  --lt-v11-adverb: #f59e0b;
  --lt-v11-complement: #a855f7;
  --lt-v11-punct: rgba(255, 255, 255, 0.42);
}

.looptube-v11-subtitle-card {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 12px;
  background: var(--lt-v11-card-bg);
  border: 1px solid var(--lt-v11-card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.looptube-v11-en {
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(17px, 4.2vw, 20px);
  line-height: 1.24;
  font-weight: 700;
  color: var(--lt-v11-english);
  word-break: normal;
  overflow-wrap: anywhere;
}

.looptube-v11-zh {
  display: block;
  width: 100%;
  margin-top: 2px;
  text-align: center;
  font-size: clamp(14px, 3.5vw, 16px);
  line-height: 1.28;
  font-weight: 500;
  color: var(--lt-v11-chinese);
}

.looptube-v11-word {
  display: inline;
  padding: 0 0.03em;
  border-radius: 4px;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background-color 0.12s ease, opacity 0.12s ease;
}

.looptube-v11-word-clickable {
  cursor: pointer;
}

.looptube-v11-word-clickable:active {
  background: rgba(255, 255, 255, 0.12);
}

.looptube-v11-role-s,
.looptube-v11-role-p {
  opacity: 0.7;
  font-weight: 400;
}

.looptube-v11-pos-adp,
.looptube-v11-focus-preposition {
  color: var(--lt-v11-prep) !important;
  font-weight: 900 !important;
}

.looptube-v11-role-d,
.looptube-v11-role-m,
.looptube-v11-pos-adj {
  color: var(--lt-v11-det-mod);
  font-weight: 800;
}

.looptube-v11-role-o,
.looptube-v11-pos-noun,
.looptube-v11-pos-propn {
  color: var(--lt-v11-object);
  font-weight: 800;
}

.looptube-v11-role-a,
.looptube-v11-pos-adv {
  color: var(--lt-v11-adverb);
  font-weight: 800;
}

.looptube-v11-role-c {
  color: var(--lt-v11-complement);
  font-weight: 800;
}

.looptube-v11-punct {
  color: var(--lt-v11-punct);
  font-weight: 400;
  opacity: 0.78;
}

.looptube-v11-object-chunk {
  background: rgba(59, 130, 246, 0.13);
  box-shadow: inset 0 -2px 0 rgba(59, 130, 246, 0.52);
}

.looptube-v11-modifier-chunk,
.looptube-v11-post-modifier,
.looptube-v11-relative-clause {
  background: rgba(16, 185, 129, 0.11);
  box-shadow: inset 0 -2px 0 rgba(16, 185, 129, 0.52);
}

.looptube-v11-prep-phrase {
  background: rgba(239, 68, 68, 0.12);
  box-shadow: inset 0 -2px 0 rgba(239, 68, 68, 0.64);
}

.looptube-v11-saved-marker {
  margin-left: 5px;
  color: rgba(255,255,255,0.42);
  font-size: 0.78em;
}

/* Bottom dictionary card */
.looptube-v11-dict-card {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 999999;
  box-sizing: border-box;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.86);
  color: white;
  box-shadow: 0 18px 48px rgba(0,0,0,0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.looptube-v11-dict-card.is-open {
  transform: translateY(0);
  opacity: 1;
}

.looptube-v11-dict-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.looptube-v11-dict-word {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
}

.looptube-v11-dict-phonetic {
  font-size: 15px;
  color: #cbd5e1;
  font-weight: 600;
}

.looptube-v11-dict-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.looptube-v11-dict-btn {
  border: none;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.14);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.looptube-v11-dict-pos {
  display: inline-block;
  margin: 3px 0 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.32);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

.looptube-v11-dict-def {
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  line-height: 1.42;
}

.looptube-v11-dict-error {
  color: #fecaca;
  font-size: 14px;
  line-height: 1.35;
}

.looptube-v11-dict-loading {
  color: rgba(255,255,255,0.72);
  font-size: 14px;
}

@media (min-width: 700px) {
  .looptube-v11-dict-card {
    left: 50%;
    right: auto;
    width: min(520px, calc(100vw - 24px));
    transform: translate(-50%, 130%);
  }
  .looptube-v11-dict-card.is-open {
    transform: translate(-50%, 0);
  }
}
