/* ═══════════════════════════════════════════════
   WORD RUSH — Premium EdTech UI v4
   victoriatis.ru · warm ivory · muted wine
═══════════════════════════════════════════════ */

/* ─── Outer section ─── */
.word-rush-section {
  background: var(--bg);
  padding: 80px 0;
}

/* ─── THE SHELL ─── */
.word-rush-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 60px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 28px;
  box-shadow:
    0 2px 8px  rgba(30,20,10,0.04),
    0 12px 48px rgba(30,20,10,0.07),
    0 40px 96px rgba(30,20,10,0.04);
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* ══════════════════════════════
   TOP: INFO + GAME CARD
══════════════════════════════ */
.wr-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  align-items: center;
}

/* ── LEFT INFO ── */
.wr-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wr-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-mid);
  background: var(--accent-xlight);
  border: 1px solid rgba(107,74,74,0.15);
  border-radius: 100px;
  padding: 5px 14px;
  width: fit-content;
}

.wr-headline {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}

.wr-flash { font-style: normal; }

.wr-desc {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-2);
}

.wr-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0;
}

.wr-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wr-feature-num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  box-shadow: 0 2px 6px rgba(30,20,10,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wr-feature:hover .wr-feature-num {
  box-shadow: 0 4px 12px rgba(107,74,74,0.12);
  transform: translateY(-1px);
}

.wr-feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wr-feature-text strong {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.wr-feature-text span {
  font-family: var(--font-sans);
  font-size: 0.81rem;
  color: var(--text-3);
  line-height: 1.5;
}

/* Start button */
.wr-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-inv);
  background: var(--text);
  border: none;
  border-radius: 100px;
  padding: 15px 30px;
  cursor: pointer;
  width: fit-content;
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.wr-start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.wr-start-btn:hover {
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(107,74,74,0.3);
}

.wr-start-btn:active { transform: translateY(-1px); }

.wr-start-arrow {
  display: inline-block;
  transition: transform 0.22s ease;
}

.wr-start-btn:hover .wr-start-arrow { transform: translateX(5px); }

.wr-note {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: var(--text-3);
  margin-top: -8px;
}

/* ══════════════════════════════
   RIGHT: GAME CARD
══════════════════════════════ */
.wr-card {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  box-shadow:
    0 1px 4px  rgba(30,20,10,0.04),
    0 8px 28px rgba(30,20,10,0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 520px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.wr-card:not(.wr-card--idle-only):hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 8px  rgba(30,20,10,0.05),
    0 16px 48px rgba(30,20,10,0.11);
}

/* Zoom in when game starts */
@keyframes wr-card-in {
  0%   { transform: scale(0.97); opacity: 0.8; }
  60%  { transform: scale(1.012); }
  100% { transform: scale(1);    opacity: 1; }
}

.wr-card.is-starting { animation: wr-card-in 0.4s cubic-bezier(0.34,1.3,0.64,1) both; }

/* Correct flash */
@keyframes wr-correct-flash {
  0%   { box-shadow: 0 0 0 0 rgba(111,168,130,0); }
  40%  { box-shadow: 0 0 0 8px rgba(111,168,130,0.2); }
  100% { box-shadow: 0 0 0 0 rgba(111,168,130,0); }
}

.wr-card.is-correct-flash {
  animation: wr-correct-flash 0.55s ease both;
}

/* Wrong flash */
@keyframes wr-wrong-flash {
  0%,100% { border-color: var(--border-2); }
  30%     { border-color: rgba(139,58,58,0.4); }
  60%     { border-color: rgba(139,58,58,0.2); }
}

.wr-card.is-wrong-flash {
  animation: wr-wrong-flash 0.5s ease both;
}

/* ── TOP BAR ── */
.wr-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-2);
}

.wr-progress-wrap {
  flex: 1;
  height: 5px;
  background: var(--border-2);
  border-radius: 100px;
  overflow: hidden;
}

.wr-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-mid) 0%, #C9A8A8 100%);
  border-radius: 100px;
  transition: width 0.55s cubic-bezier(0.4,0,0.2,1);
}

.wr-counter {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

/* Timer pill */
.wr-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  padding: 4px 10px 4px 8px;
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.wr-timer.is-urgent {
  color: #8B3A3A;
  background: #FBF0F0;
  border-color: rgba(139,58,58,0.2);
}

/* ── BODY ── */
.wr-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Question area */
.wr-question-area {
  padding: 24px 28px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

/* Word — game interface, not poster */
.wr-word {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1;
  max-width: 100%;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.wr-word.is-changing {
  opacity: 0;
  transform: translateY(-10px);
}

.wr-transcription {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-3);
  font-style: italic;
  transition: opacity 0.2s ease;
  margin-top: 2px;
}

.wr-prompt {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 8px;
}

/* Answers */
.wr-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px 16px;
}

.wr-answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1.5px solid var(--border-2);
  border-radius: 14px;
  padding: 0 16px;
  height: 46px;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.wr-answer::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.wr-answer--idle {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.wr-answer:hover:not(.is-disabled):not(.wr-answer--idle) {
  background: var(--accent-xlight);
  border-color: var(--accent-light);
  color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 2px 10px rgba(107,74,74,0.08);
}

.wr-answer:hover:not(.is-disabled):not(.wr-answer--idle)::after {
  border-color: var(--accent-light);
  background: rgba(107,74,74,0.1);
}

.wr-answer.is-correct {
  background: #EDF5EF;
  border-color: #6FA882;
  color: #2C5C3D;
  font-weight: 500;
  transform: none;
}

.wr-answer.is-correct::after {
  background: #6FA882;
  border-color: #6FA882;
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: #fff;
  font-weight: 700;
}

.wr-answer.is-wrong {
  background: #F6EEEE;
  border-color: #C9A8A8;
  color: var(--accent-mid);
  opacity: 0.7;
  transform: none;
}

.wr-answer.is-wrong::after {
  background: #C9A8A8;
  border-color: #C9A8A8;
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  color: #fff;
  font-weight: 700;
}

.wr-answer.is-disabled { cursor: default; pointer-events: none; }

/* ── STREAK BADGE ── */
.wr-streak {
  position: absolute;
  top: 56px;
  right: 16px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 10px;
  box-shadow: 0 2px 8px rgba(30,20,10,0.1);
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

.wr-streak.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── START PROMPT — normal flow, sits at bottom of card ── */
.wr-start-prompt {
  background: var(--bg);
  border-top: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  margin-top: auto;
  transition: opacity 0.3s ease;
}

.wr-start-prompt.is-hidden {
  opacity: 0;
  pointer-events: none;
  /* keep in flow so layout stays stable — just invisible */
  visibility: hidden;
}

.wr-sp-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-3);
  flex: 1;
  white-space: normal;
  min-width: 0;
}

.wr-sp-btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-inv);
  background: var(--text);
  border: none;
  border-radius: 14px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wr-sp-btn:hover { background: var(--accent); transform: translateY(-1px); }

/* ── RESULT SCREEN ── */
.wr-result {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 36px 28px;
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 6;
  animation: wr-fade-up 0.42s ease both;
}

.wr-result.is-active { display: flex; }

@keyframes wr-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wr-result-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  text-align: left;
}

.wr-score-ring {
  position: relative;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
}

.wr-score-ring svg { display: block; transform: rotate(-90deg); }

.wr-ring-bg {
  fill: none;
  stroke: var(--border-2);
  stroke-width: 5;
}

.wr-ring-fill {
  fill: none;
  stroke: var(--accent-mid);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 207.3;
  stroke-dashoffset: 207.3;
  transition: stroke-dashoffset 0.95s cubic-bezier(0.34,1.1,0.64,1);
}

.wr-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
}

.wr-res-label {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.wr-res-sub {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
}

.wr-res-rec {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: var(--text-3);
  font-style: italic;
  margin-top: 5px;
}

.wr-replay-btn {
  font-family: var(--font-sans);
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 22px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.wr-replay-btn:hover { border-color: var(--text-2); color: var(--text-2); }

/* ══════════════════════════════
   BENEFITS — independent cards
══════════════════════════════ */
.wr-benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.wr-benefit {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.wr-benefit::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.45;
  transition: opacity 0.25s ease;
}

/* Subtle per-card tint */
.wr-benefit:nth-child(1)::before { background: linear-gradient(135deg, rgba(200,190,220,0.18) 0%, transparent 70%); }
.wr-benefit:nth-child(2)::before { background: linear-gradient(135deg, rgba(180,205,215,0.18) 0%, transparent 70%); }
.wr-benefit:nth-child(3)::before { background: linear-gradient(135deg, rgba(215,195,175,0.22) 0%, transparent 70%); }
.wr-benefit:nth-child(4)::before { background: linear-gradient(135deg, rgba(210,185,185,0.18) 0%, transparent 70%); }

.wr-benefit:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(30,20,10,0.09);
}

.wr-benefit:hover::before { opacity: 0.7; }

.wr-benefit-ico {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 2px;
  position: relative;
}

.wr-benefit strong {
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
}

.wr-benefit span {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.55;
  position: relative;
}

/* ══════════════════════════════
   BOTTOM: LEGEND + CTA
══════════════════════════════ */
.wr-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wr-legend-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.wr-legend-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

.wr-legend-sub {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-3);
}

.wr-grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: stretch;
}

/* Result cards */
.wr-lcard {
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.wr-lcard:not(.wr-lcard--cta):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30,20,10,0.07);
}

.wr-lcard--mid { border-color: var(--border); }

.wr-lcard--high {
  border-color: var(--accent-light);
  background: #FBF8F5;
}

.wr-lcard-score {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--accent-mid);
  line-height: 1;
}

.wr-lcard-label {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.wr-lcard-text {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.58;
}

/* ── DARK CTA CARD ── */
@keyframes wr-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

.wr-lcard--cta {
  background: var(--text);
  border-color: var(--text);
  gap: 10px;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(30,20,10,0.18), 0 2px 8px rgba(30,20,10,0.1);
  animation: wr-float 5s ease-in-out infinite;
}

/* Glowing accent line on top */
.wr-lcard--cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-mid), var(--accent-light), var(--accent-mid));
  background-size: 200% 100%;
  animation: wr-shimmer 3s linear infinite;
}

@keyframes wr-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* Subtle inner glow */
.wr-lcard--cta::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,168,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.wr-lcard-cta-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-light);
  position: relative;
}

.wr-lcard-cta-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-inv);
  line-height: 1.28;
  position: relative;
}

.wr-lcard-cta-text {
  font-family: var(--font-sans);
  font-size: 0.77rem;
  line-height: 1.58;
  color: rgba(248,245,240,0.6);
  position: relative;
}

.wr-lcard-cta-btn {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  background: var(--bg);
  border: none;
  border-radius: 100px;
  padding: 12px 18px;
  text-decoration: none;
  margin-top: auto;
  position: relative;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.wr-lcard-cta-btn:hover {
  background: var(--accent-xlight);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(30,20,10,0.15);
}

.wr-lcard-cta-note {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: rgba(248,245,240,0.32);
  text-align: center;
  position: relative;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 1140px) {
  .word-rush-shell { margin: 0 16px; padding: 52px 40px; }
}

@media (max-width: 960px) {
  .wr-grid4 { grid-template-columns: repeat(2, 1fr); }
  .wr-lcard--cta {
    grid-column: 1 / -1;
    animation: none; /* no float on tablet */
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }
  .wr-lcard--cta .wr-lcard-cta-text { display: none; }
  .wr-lcard--cta .wr-lcard-cta-btn  { margin-top: 0; white-space: nowrap; }
  .wr-lcard--cta .wr-lcard-cta-note { display: none; }
}

@media (max-width: 860px) {
  .wr-top      { grid-template-columns: 1fr; gap: 32px; }
  .wr-benefits { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .word-rush-shell { padding: 36px 20px; margin: 0 12px; gap: 36px; border-radius: 20px; }
  .wr-word { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .wr-question-area { padding: 18px 16px 8px; }
  .wr-answers { padding: 8px 14px 12px; gap: 7px; }
  .wr-answer { height: 46px; padding: 0 14px; font-size: 0.9rem; }
  .wr-benefits { grid-template-columns: 1fr; gap: 8px; }
  .wr-benefit { flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 14px; }
  .wr-benefit-ico { margin-bottom: 0; flex-shrink: 0; }
  .wr-grid4 { grid-template-columns: 1fr; }
  .wr-lcard--cta { animation: none; flex-direction: column; }
  .wr-lcard--cta .wr-lcard-cta-text { display: block; }
  .wr-lcard--cta .wr-lcard-cta-note { display: block; }
  .wr-result-inner { flex-direction: column; text-align: center; }
  .wr-score-ring { margin: 0 auto; }
  .wr-card { min-height: 460px; }
  /* Mobile prompt stacks */
  .wr-start-prompt { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px 14px; }
  .wr-sp-title { text-align: center; }
  .wr-sp-btn { text-align: center; border-radius: 12px; padding: 11px 16px; }
}
