/* ====== Shoot the Verbs (stv) styles ====== */

.stv-container {
    /* keep tokens for colors */
    --stv-bg: #0b1020;
    --panel-bg: #ffffff;
    --panel-fg: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-weak: #e0e7ff;
    --success: #10b981;
    --danger: #ef4444;
  
    margin: 16px auto;
    padding: 8px 8px 20px;
    width: 100%;
    color: var(--panel-fg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Header with score + timer */
  .stv-header {
    position: relative;
    z-index: 2;
    background: var(--panel-bg);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow:
      0 1px 1px rgba(16, 24, 40, 0.04),
      0 8px 24px rgba(16, 24, 40, 0.06);
    margin-bottom: 12px;
  }
  
  .stv-title {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.2px;
  }
  
  .stv-stats {
    display: flex;
    gap: 12px;
  }
  
  .stv-stats .stat {
    display: grid;
    grid-template-columns: auto auto;
    gap: 6px;
    align-items: baseline;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 999px;
  }
  
  .stv-stats .label {
    color: var(--muted);
    font-size: 0.85rem;
  }
  
  .stv-stats .value {
    font-weight: 800;
    margin-left: 2px;
  }
  
  .stv-stats .value.warning {
    color: var(--danger);
    animation: stv-pulse 1s ease-in-out infinite;
  }
  
  @keyframes stv-pulse {
    0%, 100% { transform: none; opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.75; }
  }
  
  /* Stage hosting the canvas (95% width) */
  .stv-stage {
    position: relative;
    width: 100%;
    margin: 0 auto;
    /* background: linear-gradient(180deg, #0ea5e9 0%, #0ea5e9 15%, #0b1020 100%); */
    border-radius: 16px;
    padding: 10px; /* frame around the canvas */
    box-shadow:
      0 8px 24px rgba(2, 6, 23, 0.32),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden; /* keep overlay edges clean */
  }
  
  /* Canvas wrapper; p5 will inject a <canvas> inside */
  .stv-canvas {
    width: 100%;             /* <- requested fixed height */
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    overflow: hidden;
    background: url("/images/activities/shoot-the-verbs-backdrop.png")
    center / cover no-repeat;
  }
  
  /* Let the canvas scale to the wrapper (draw buffer is 900x900) */
  .stv-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
    outline: none;
    background: transparent !important;
  }
  
  /* Game Over overlay INSIDE stage so Offcanvas header is not blurred */
  .stv-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(
      to bottom,
      rgba(2, 6, 23, 0.75),
      rgba(2, 6, 23, 0.55)
    );
    backdrop-filter: blur(2px);
  }
  
  .stv-overlay .time-box {
    width: min(520px, 90%); /* slightly narrower as requested */
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 20px 22px;
    border: 1px solid #e5e7eb;
    box-shadow:
      0 8px 24px rgba(16, 24, 40, 0.18),
      0 2px 8px rgba(16, 24, 40, 0.06);
    text-align: left;
    color: white;
    background-color: rgba(255, 255, 255, 0.142);
  }
  
  .stv-overlay .time-box h3 {
    margin: 0 0 10px;
    font-size: 1.25rem;
  }
  
  .final-score {
    margin: 6px 0 16px;
    font-size: 1.05rem;
  }
  
  .actions {
    display: flex;
    gap: 10px;
  }
  
  /* Buttons */
  .stv-btn {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    transition: transform .04s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  }
  
  .stv-btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow:
      0 6px 16px rgba(37, 99, 235, 0.35),
      0 2px 6px rgba(37, 99, 235, 0.25);
  }
  
  .stv-btn.primary:hover {
    filter: brightness(1.05);
  }
  
  .stv-btn:active {
    transform: translateY(1px);
  }
  
  /* Accessibility: reduce motion users */
  @media (prefers-reduced-motion: reduce) {
    .stv-stats .value.warning { animation: none; }
    .stv-btn { transition: none; }
  }
  
  /* Small screens: stage still 95%, canvas keeps its 900px height (scrollable offcanvas) */
  @media (max-width: 980px) {
    .stv-container { padding-inline: 8px; }
  }
  
.activity-wrapper {
  min-height: 800px;
  margin: auto;
  margin: 20px;
  border-radius: 8px;
  position: relative;
  overflow: visible; 
  z-index: 5;
  padding: 20px 30px; 
}

/* Blurs and blocks the rest of the app so users can’t click sidebars, etc. */
.activity-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(7, 12, 20, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto; /* intercept clicks */
}

/* Ensures the activity content sits above the overlay */
.activity-root {
  position: relative;
  z-index: 1000;
}

/* Header row: title on the left, actions (Back) on the right */
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Keep title tight to the header row */
.activity-title {
  margin: 0;
}

/* Right-side buttons in the header */
.activity-actions {
  display: flex;
  gap: 8px;
}

/* Small helper line under header */
.activity-subtitle {
  margin-top: 6px;
}

/* Container for the game region (kept simple for layout hooks) */
.game-surface {
  width: 100%;
}

/* Background image + margin for the game area */
.game-body {
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Blur only the canvas area during countdown */
.stv-stage.blurred .stv-canvas {
  filter: blur(3px);
}

/* Countdown overlay lives inside the stage so the header isn't blurred */
.stv-countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: linear-gradient(
    to bottom,
    rgba(2, 6, 23, 0.55),
    rgba(2, 6, 23, 0.45)
  );
  pointer-events: none; /* avoid blocking header */
}

.stv-countdown-overlay .count-box {
  text-align: center;
  max-width: 560px;
  padding: 16px 20px;
  color: #fff;
}

.stv-countdown-overlay .count-number {
  font-size: clamp(56px, 10vw, 108px);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  animation: stv-pop 400ms ease;
}

.stv-countdown-overlay .count-label {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  margin-bottom: 10px;
  opacity: 0.95;
  letter-spacing: 0.5px;
}

.stv-countdown-overlay .count-desc {
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e5e7eb;
}

@keyframes stv-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* Correct after submit: stays bold/zoomed like hover */
.sentence-text .word.is-correct,
.sentence-text .word.is-correct:hover {
  background-color: #dcfce7;    /* green bg */
  border-color: #86efac;        /* optional if you show borders */
  color: rgb(35, 68, 105);      /* your blue text */
  border-radius: 4px;
  font-weight: bold;
  transform: scale(1.1);
}

/* Wrong pick after submit: also bold/zoomed so feedback is obvious */
.sentence-text .word.is-wrong,
.sentence-text .word.is-wrong:hover {
  background-color: #fee2e2;    /* red bg */
  border-color: #fecaca;
  color: rgb(35, 68, 105);
  border-radius: 4px;
  font-weight: bold;
  transform: scale(1.1);
}
