/* ══════════════════════════════════════════════════════════
   WORD MATCH — Two-column card pair matching
══════════════════════════════════════════════════════════ */

.task-word-match {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  gap: 10px;
}
.task-word-match .answer-label {
  text-align: center;
}

.match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-align: center;
  transition: all 0.2s;
  user-select: none;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
  hyphens: auto;
  position: relative;
  overflow: hidden;
}

.match-card:hover:not(:disabled):not(.matched) {
  border-color: var(--gold);
  background: rgba(247,201,72,0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(247,201,72,0.2);
}

.match-card.selected-ru {
  border-color: var(--teal);
  background: rgba(78,205,196,0.15);
  color: var(--teal);
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(78,205,196,0.25);
}

.match-card.selected-en {
  border-color: var(--gold);
  background: rgba(247,201,72,0.15);
  color: var(--gold);
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(247,201,72,0.25);
}

.match-card.matched {
  border-color: var(--green);
  background: rgba(46,204,113,0.15);
  color: var(--green);
  cursor: default;
  opacity: 0.75;
  animation: matchPop 0.35s ease;
}

.match-card.wrong-flash {
  border-color: var(--red);
  background: rgba(232,93,117,0.2);
  color: var(--red);
  animation: wrongShake 0.4s ease;
}

.match-card:disabled, .match-card.matched {
  pointer-events: none;
}

.match-card-word {
  font-size: 1.15rem;
  font-weight: 800;
  color: #4ecdc4;
  letter-spacing: 0.3px;
  font-family: var(--font-title);
  min-height: 64px;
}

.match-card-def {
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  min-height: 64px;
  padding: 10px 14px;
}

.match-card-word.selected-ru {
  border-color: var(--teal);
  background: rgba(78, 205, 196, 0.18);
  color: #4ecdc4;
  box-shadow: 0 0 16px rgba(78, 205, 196, 0.35);
}

.match-card-def.selected-en {
  border-color: var(--gold);
  background: rgba(247, 201, 72, 0.18);
  color: #ffd166;
  box-shadow: 0 0 16px rgba(247, 201, 72, 0.35);
}

/* Column header labels */
.match-col-ru .match-card::after {
  content: 'RU';
  position: absolute;
  top: 3px; right: 5px;
  font-size: 0.6rem;
  opacity: 0.35;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.match-col-en .match-card::after {
  content: 'EN';
  position: absolute;
  top: 3px; right: 5px;
  font-size: 0.6rem;
  opacity: 0.35;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.match-card-word::after,
.match-card-def::after {
  display: none !important;
}

.task-word-match.is-definition-mode .match-columns {
  grid-template-columns: 1fr 1.35fr;
  gap: 14px;
}

.match-progress {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 700;
  min-height: 20px;
}

@keyframes matchPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Responsive: smaller text on small screens */
@media (max-width: 380px) {
  .match-card { font-size: 0.82rem; padding: 9px 6px; min-height: 44px; }
}

/* ══════════════════════════════════════════════════════════
   FILL BLANK — Sentence with blank + option buttons
══════════════════════════════════════════════════════════ */

.task-fill-blank {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.fill-dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.fill-avatar-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.fill-char-avatar {
  width: var(--task-portrait-width);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  border-radius: 16px;
  border: 3px solid var(--teal);
  box-shadow: 0 4px 20px rgba(78,205,196,0.3);
}

.fill-char-name {
  margin-top: -10px;
  background: var(--teal);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.45);
  z-index: 5;
  width: max-content;
  max-width: 120px;
}

.fill-char-name .char-badge-name {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
}

.fill-char-name .char-badge-role {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  opacity: 0.95;
  text-align: center;
  white-space: normal;
}

.fill-speech-bubble {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  position: relative;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  min-height: 90px;
  display: flex;
  align-items: center;
}

.fill-speech-bubble::before {
  content: '';
  position: absolute;
  top: 30px;
  left: -9px;
  width: 16px;
  height: 16px;
  background: var(--card);
  border-left: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  transform: rotate(45deg);
}

.fill-sentence {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 2.2;
  color: var(--text);
  text-align: left;
  white-space: pre-line;
}

/* The blank slot rendered as an interactive inline span */
.fill-blank-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 36px;
  background: rgba(78,205,196,0.08);
  border-bottom: 3px solid var(--teal);
  border-radius: 6px 6px 0 0;
  vertical-align: middle;
  margin: 0 6px;
  padding: 0 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--teal);
  user-select: none;
}

.fill-blank-slot.active-slot {
  border-bottom-color: var(--gold);
  background: rgba(247,201,72,0.15);
  box-shadow: 0 0 12px rgba(247,201,72,0.3);
}

.fill-blank-slot.filled {
  min-width: 70px;
  color: var(--teal);
  background: rgba(78,205,196,0.18);
  border-bottom: 3px solid var(--teal);
}

.fill-blank-slot.filled:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(247,201,72,0.15);
}

.fill-blank-slot.correct-slot {
  border-bottom-color: var(--green) !important;
  color: var(--green) !important;
  background: rgba(46,204,113,0.15) !important;
}

.fill-blank-slot.wrong-slot {
  border-bottom-color: var(--red) !important;
  color: var(--red) !important;
  background: rgba(232,93,117,0.15) !important;
}

/* Options grid */
.fill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
}

.fill-option-btn.used {
  opacity: 0.35;
  pointer-events: none;
  transform: scale(0.95);
}

.fill-option-btn {
  background: var(--card-2);
  border: 2px solid rgba(78,205,196,0.2);
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  user-select: none;
}

.fill-option-btn:hover:not(:disabled) {
  border-color: var(--teal);
  background: rgba(78,205,196,0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78,205,196,0.2);
}

.fill-option-btn.selected {
  border-color: var(--gold);
  background: rgba(247,201,72,0.15);
  color: var(--gold);
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════
   HIMALAYAN WHEEL PICKER (DRUM SCROLL)
   ══════════════════════════════════════════════════════════ */

.htx-wheel-picker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

.htx-wheel-hint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.htx-wheel-hint-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 0 6px rgba(245, 164, 37, 0.5));
}

.htx-wheel-drum-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  position: relative;
}

.htx-wheel-viewport {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 165px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #091713 0%, #10261f 50%, #091713 100%);
  border: 2px solid rgba(78, 205, 196, 0.35);
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  perspective: 600px;
  cursor: grab;
  outline: none;
  touch-action: none;
  user-select: none;
}

.htx-wheel-viewport.is-dragging {
  cursor: grabbing;
}

.htx-wheel-viewport:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(245, 164, 37, 0.4);
}

.htx-wheel-lens {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 56px;
  height: 52px;
  border-radius: 12px;
  border: 2px solid #f5a425;
  background: rgba(245, 164, 37, 0.12);
  box-shadow: 0 0 18px rgba(245, 164, 37, 0.35), inset 0 0 12px rgba(245, 164, 37, 0.15);
  pointer-events: none;
  z-index: 2;
}

.htx-wheel-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  pointer-events: none;
  z-index: 3;
}

.htx-wheel-fade-top {
  top: 0;
  background: linear-gradient(to bottom, rgba(9, 23, 19, 0.98) 0%, rgba(9, 23, 19, 0.6) 60%, transparent 100%);
}

.htx-wheel-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(9, 23, 19, 0.98) 0%, rgba(9, 23, 19, 0.6) 60%, transparent 100%);
}

.htx-wheel-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.htx-wheel-item {
  height: 52px;
  line-height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: color 0.18s, transform 0.18s, opacity 0.18s;
  user-select: none;
  font-family: var(--font-title);
  letter-spacing: 0.5px;
}

.htx-wheel-item:hover {
  color: rgba(255, 255, 255, 0.75);
}

.htx-wheel-item.active {
  color: #ffd166;
  font-size: 1.45rem;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.6);
  transform: scale(1.08);
}

.htx-wheel-arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(245, 164, 37, 0.4);
  background: rgba(16, 38, 31, 0.9);
  color: #ffd166;
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.htx-wheel-arrow-btn:hover:not(:disabled) {
  background: rgba(245, 164, 37, 0.25);
  border-color: #ffd166;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(245, 164, 37, 0.4);
}

.htx-wheel-arrow-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.htx-wheel-arrow-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.fill-option-btn.correct {
  border-color: var(--green);
  background: rgba(46,204,113,0.15);
  color: var(--green);
}

.fill-option-btn.wrong {
  border-color: var(--red);
  background: rgba(232,93,117,0.15);
  color: var(--red);
}

.fill-option-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ══════════════════════════════════════════════════════════
   READING COMPREHENSION TASK (Short Text + Conclusion)
   ══════════════════════════════════════════════════════════ */

.task-reading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.reading-dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.reading-avatar-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.reading-char-avatar {
  width: var(--task-portrait-width);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  border-radius: 16px;
  border: 3px solid var(--teal);
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
}

.reading-char-name {
  margin-top: -10px;
  background: var(--teal);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  z-index: 5;
  width: max-content;
  max-width: 120px;
}

.reading-char-name .char-badge-name {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
}

.reading-char-name .char-badge-role {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  opacity: 0.95;
  text-align: center;
  white-space: normal;
}

.reading-bubble {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  position: relative;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reading-story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.btn-reading-audio {
  background: rgba(78, 205, 196, 0.15);
  border: 1.5px solid var(--teal);
  color: var(--teal);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reading-audio:hover {
  background: var(--teal);
  color: var(--bg);
  transform: scale(1.08);
}

.reading-story-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  background: rgba(245, 164, 37, 0.12);
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 164, 37, 0.3);
}

.reading-story-text {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.65;
  color: var(--text);
  text-align: left;
}

.reading-question-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(20, 41, 34, 0.65);
  border: 1.5px solid rgba(78, 205, 196, 0.3);
  border-radius: 14px;
}

.reading-question-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 6px rgba(245, 164, 37, 0.4));
}

.reading-question-text {
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffd166;
  font-family: var(--font-title);
  letter-spacing: 0.3px;
}

.reading-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.reading-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--card-2);
  border: 2px solid rgba(78, 205, 196, 0.2);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  text-align: left;
}

.reading-option-card:hover:not(.disabled) {
  border-color: var(--teal);
  background: rgba(78, 205, 196, 0.12);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.reading-option-card.selected {
  border-color: var(--gold);
  background: rgba(245, 164, 37, 0.16);
  box-shadow: 0 0 16px rgba(245, 164, 37, 0.25);
  transform: translateX(6px);
}

.reading-option-card.correct {
  border-color: var(--green) !important;
  background: rgba(46, 204, 113, 0.22) !important;
}

.reading-option-card.wrong {
  border-color: var(--red) !important;
  background: rgba(232, 93, 117, 0.22) !important;
}

.reading-option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.reading-option-card.selected .reading-option-radio {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.7);
}

.reading-option-card.correct .reading-option-radio {
  border-color: var(--green);
  background: var(--green);
}

.reading-option-card.wrong .reading-option-radio {
  border-color: var(--red);
  background: var(--red);
}

.reading-option-radio-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d1f1a;
  display: none;
}

.reading-option-card.selected .reading-option-radio-inner {
  display: block;
}

.reading-option-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.reading-option-card.selected .reading-option-text {
  color: #ffd166;
  font-weight: 800;
}

@media (max-width: 380px) {
  .fill-sentence { font-size: 0.98rem; }
  .fill-option-btn { font-size: 0.88rem; padding: 8px 16px; }
}

