/* ═══════════════════════════════════════════════════════════════
   Word Herd — shared styles for teacher and student pages
   Matches Lingadoo design tokens (Nunito, #0F172A base, radius-20px cards)
═══════════════════════════════════════════════════════════════ */

/* ── Page base ── */
body.wc-page {
  /* background intentionally omitted (was #F8FAFC) — falls through to
     base.css's site-wide background rule; revert by restoring the value */
  font-family: "Nunito", system-ui, -apple-system, Arial, sans-serif;
  height: auto;
  min-height: 100vh;
}

/* ── Hero — base rules first, then active-state overrides ── */
.wc-hero {
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding-top: 60px;  /* sit flush under fixed nav */
  padding-bottom: 0;
}


.wc-hero-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 10px;
}

/* Logo + title on one compact row */
.wc-hero-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wc-hero-logo {
  height: 38px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.wc-hero-text { display: flex; flex-direction: column; gap: 0; }

.wc-hero-title {
  font-size: 19px;
  font-weight: 900;
  color: #0F172A;
  margin: 0;
  line-height: 1.15;
}

.wc-hero-sub {
  font-size: 12px;
  font-weight: 600;
  color: #94A3B8;
  margin: 0;
}

/* Hide hero entirely when room is live — nav is enough context */
.wc-hero.wc-hero-active { display: none; }

/* Compact catalog hero — less vertical bulk */
.wc-hero--compact .wc-hero-layout {
  padding-top: 3px;
  padding-bottom: 4px;
}
.wc-hero--compact .wc-hero-logo { height: 28px; }

/* ── Main container ── */
.wc-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── Page head (logo + title in catalog view, replaces external hero) ── */
.wc-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.wc-page-head__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
}

.wc-page-head__title {
  margin: 0;
  font-size: 20px;
  font-weight: 1000;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.wc-page-head__sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

/* ── Card head (logo + title inside setup card, matches tt-setup-head) ── */
.wc-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

/* ── Card panel ── */
.wc-card {
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(15,23,42,0.05);
  padding: 20px 24px;
  margin-bottom: 14px;
}

.wc-setup-card {
  width: min(100%, 640px);
  margin-left: auto;
  margin-right: auto;
}

/* ── Form label ── */
.wc-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.wc-helper {
  font-size: 13px;
  font-weight: 600;
  color: #94A3B8;
  margin: 6px 0 0;
}

/* ── Textarea ── */
.wc-textarea {
  width: 100%;
  min-height: 96px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #0F172A;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.14s, box-shadow 0.14s;
  line-height: 1.6;
}

.wc-textarea:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}

.wc-textarea::placeholder { color: #CBD5E1; }

/* ── Word preview chips (setup phase) ── */
.wc-preview-wrap {
  margin-top: 20px;
}

.wc-preview-heading {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.wc-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wc-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F1F5F9;
  border: 1.5px solid #E2E8F0;
  border-radius: 999px;
  padding: 5px 10px 5px 13px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.wc-preview-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #CBD5E1;
  color: #475569;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.1s;
}

.wc-preview-chip-remove:hover { background: #94A3B8; color: #fff; }

.wc-word-count {
  font-size: 13px;
  font-weight: 700;
  color: #94A3B8;
  margin-top: 10px;
}

.wc-word-count.wc-at-limit { color: #DC2626; }

/* ── Buttons ── */
.wc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.13s, transform 0.1s, opacity 0.12s;
  text-decoration: none;
}

.wc-btn:active { transform: scale(0.97); }
.wc-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.wc-btn-primary {
  background: #0F172A;
  color: #fff;
  padding: 14px 28px;
  font-size: 15px;
}

.wc-btn-primary:hover:not(:disabled) { background: #1E293B; }

.wc-btn-danger {
  background: #FEE2E2;
  color: #DC2626;
  padding: 10px 20px;
  font-size: 14px;
  border: 1.5px solid #FECACA;
}

.wc-btn-danger:hover:not(:disabled) { background: #FECACA; }

.wc-btn-copy {
  background: #F1F5F9;
  color: #334155;
  padding: 8px 16px;
  font-size: 13px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
}

.wc-btn-copy:hover { background: #E2E8F0; }

.wc-setup-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wc-setup-error {
  font-size: 13px;
  font-weight: 700;
  color: #DC2626;
}

/* ═══════════════════════════════════════════
   OPENING CATALOG — ready-made vocab sets
═══════════════════════════════════════════ */

.wc-catalog-main {
  padding-top: 18px;
}

/* Single centred row: [search] [pills] [create] — wraps on narrow screens */
.wc-catalog-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.wc-catalog-search {
  width: 220px;
  flex-shrink: 0;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  background: #fff;
  color: #0F172A;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  padding: 10px 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.wc-catalog-search:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}

.wc-catalog-search::placeholder {
  color: #94A3B8;
  font-weight: 800;
}

/* Level pill filter buttons */
.wc-level-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.wc-lvl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  background: #F1F5F9;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.wc-lvl-btn:hover:not(.is-active) { background: #E2E8F0; color: #334155; }
.wc-lvl-btn:active { transform: scale(0.95); }

.wc-lvl-btn--all.is-active                 { background: #0F172A; color: #fff; }
.wc-lvl-btn.is-active[data-level="A1"]     { background: #4DA9E6; color: #0b1220; }
.wc-lvl-btn.is-active[data-level="A2"]     { background: #2EC4C6; color: #0b1220; }
.wc-lvl-btn.is-active[data-level="B1"]     { background: #F2C94C; color: #0b1220; }
.wc-lvl-btn.is-active[data-level="B2"]     { background: #F2994A; color: #0b1220; }
.wc-lvl-btn.is-active[data-level="C1"]     { background: #977DB9; color: #fff; }

.wc-catalog-custom-btn {
  flex-shrink: 0;
  padding: 9px 18px;
  font-size: 14px;
}

.wc-catalog-status {
  min-height: 22px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #64748B;
  text-align: center;
}

.wc-catalog-status.wc-catalog-status-error {
  color: #B91C1C;
}

.wc-catalog-status[hidden] {
  display: none;
}

/* Set card grid */
.wc-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* Vertical card: badge + title on one row, word preview below */
.wc-set-card {
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.1s;
}

.wc-set-card:hover,
.wc-set-card:focus-visible {
  border-color: #2563EB;
  box-shadow: 0 4px 14px rgba(15,23,42,0.10);
  transform: translateY(-1px);
  outline: none;
}

.wc-set-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.22), 0 4px 14px rgba(15,23,42,0.10);
}

/* Title row: [level badge] [title] */
.wc-set-titlerow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wc-set-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
  color: #0F172A;
}

.wc-set-level {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
  color: #0b1220;
}

.wc-set-level-A1 { background: #4DA9E6; color: #0b1220; }
.wc-set-level-A2 { background: #2EC4C6; color: #0b1220; }
.wc-set-level-B1 { background: #F2C94C; color: #0b1220; }
.wc-set-level-B2 { background: #F2994A; color: #0b1220; }
.wc-set-level-C1 { background: #977DB9; color: #0b1220; }

/* Word preview — secondary, max 2 lines */
.wc-set-preview {
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  text-align: left;
}

.wc-setup-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wc-selected-set-note {
  min-width: 0;
  color: #64748B;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.wc-admin-import {
  margin-top: 26px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.wc-admin-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.wc-admin-kicker {
  margin: 0 0 2px;
  color: #64748B;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wc-admin-title {
  margin: 0;
  color: #0F172A;
  font-size: 17px;
  font-weight: 900;
}

.wc-admin-email {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.wc-import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.wc-file-input {
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  background: #F8FAFC;
  color: #0F172A;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px;
  box-sizing: border-box;
}

.wc-import-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.wc-import-check input {
  width: 16px;
  height: 16px;
}

.wc-import-submit {
  padding: 10px 18px;
  min-height: 40px;
}

.wc-import-result {
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.wc-import-result.wc-import-ok {
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  color: #166534;
}

.wc-import-result.wc-import-error {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  color: #991B1B;
}

.wc-import-result ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* ═══════════════════════════════════════════
   ACTIVE ROOM — compact single-row bar
═══════════════════════════════════════════ */

.wc-room-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 48px 14px 18px; /* right pad leaves room for X */
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ── X close button — top-right corner of bar ── */
.wc-close-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #F1F5F9;
  color: #64748B;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.wc-close-x:hover { background: #FEE2E2; color: #DC2626; }
.wc-close-x:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.wc-room-bar-code {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}

.wc-room-bar-link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wc-room-bar-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ── QR expand button ── */
.wc-qr-expand {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 3px 8px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.12s;
}
.wc-qr-expand:hover { background: #E2E8F0; color: #0F172A; }

/* ── QR fullscreen modal ── */
.wc-qr-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: wcFadeIn 0.15s ease;
}

@keyframes wcFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wc-qr-modal-inner {
  background: #fff;
  border-radius: 24px;
  padding: 20px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  box-shadow: 0 24px 64px rgba(15,23,42,0.28);
  max-width: 95vw;
  max-height: 97vh;
  box-sizing: border-box;
}

.wc-qr-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #F1F5F9;
  color: #64748B;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.12s;
}
.wc-qr-modal-close:hover { background: #E2E8F0; color: #0F172A; }

.wc-qr-modal-canvas {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wc-qr-modal-code {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #0F172A;
}

.wc-qr-modal-url {
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  word-break: break-all;
  text-align: center;
  max-width: 320px;
}

.wc-meta-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
}

.wc-room-code-display {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #0F172A;
  line-height: 1;
}

.wc-join-url-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wc-join-url-row .wc-btn-copy {
  min-width: 160px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 800;
}

.wc-join-url {
  font-size: 13px;
  font-weight: 700;
  color: #2563EB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  max-width: 44ch;
}

.wc-join-url:hover { text-decoration: underline; }

/* Inline stats under the join link */
.wc-stats-inline {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wc-stat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* QR wrap — compact */
.wc-qr-wrap {
  width: 82px;
  height: 82px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.wc-qr-wrap canvas,
.wc-qr-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ═══════════════════════════════════════════
   BOARD — word position tracks
═══════════════════════════════════════════ */

.wc-board-card {
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(15,23,42,0.05);
  overflow: hidden;
  margin-bottom: 20px;
}

/* Zone header — rich gradient that bleeds across zone boundaries */
.wc-board-zones {
  display: flex;
  flex-direction: row;
  border-bottom: 2px solid #E2E8F0;
  background: linear-gradient(to right,
    #EF4444 0%, #F87171 20%,
    #F59E0B 38%, #FBBF24 50%, #F59E0B 62%,
    #22C55E 80%, #16A34A 100%
  );
}

.wc-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  background: transparent;
}

.wc-zone-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
  background: transparent;
}

.wc-zone-red    { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.wc-zone-yellow { color: #78350F; }
.wc-zone-green  { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }

/* Tracks container */
/* Pack canvas — one row per word, stacked vertically */
.wc-pack-canvas {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 60px;
  background: linear-gradient(to right,
    rgba(239,68,68,0.72) 0%,
    rgba(239,68,68,0.35) 22%,
    rgba(245,158,11,0.55) 38%,
    rgba(251,191,36,0.55) 50%,
    rgba(34,197,94,0.35) 72%,
    rgba(22,163,74,0.70) 100%
  );
}

/* One dedicated horizontal row per word */
.wc-word-track {
  position: relative;
  width: 100%;
  height: 54px;
  flex-shrink: 0;
}

/* Board chip — absolutely positioned within its row */
.wc-board-chip {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  background: #fff;
  border: 2px solid #CBD5E1; /* grey until all students respond */
  border-radius: 999px;
  font-family: inherit;
  font-size: 23px;
  font-weight: 800;
  color: #0F172A;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 4px rgba(15,23,42,0.08);
  z-index: 2;
}

.wc-board-chip:hover {
  background: #0F172A;
  color: #fff;
  border-color: #0F172A;
  box-shadow: 0 3px 10px rgba(15,23,42,0.18);
}

/* All students have responded for this word — border goes dark */
.wc-board-chip.wc-chip-all-done {
  border-color: #0F172A;
  box-shadow: 0 2px 6px rgba(15,23,42,0.14);
}

/* No responses yet — very muted */
.wc-board-chip.wc-chip-no-data {
  border-color: #E2E8F0;
  color: #94A3B8;
  box-shadow: none;
}

.wc-board-chip.wc-chip-no-data:hover {
  background: #F1F5F9;
  color: #64748B;
  border-color: #CBD5E1;
}

/* ── Worm movement keyframes ──────────────────────────────────
   --wc-dx / --wc-dy  pixel deltas set by JS (old pos – new pos).
   The animation starts at the chip's old visual location and
   wiggles to its new resting place with squash, stretch, and bounce.
──────────────────────────────────────────────────────────────── */
@keyframes wc-worm-move {
  /* 0 %  Anticipation: coil/squash before launching */
  0% {
    transform: translate(-50%, -50%)
               translateX(var(--wc-dx)) translateY(var(--wc-dy, 0px))
               scaleX(0.62) scaleY(1.42);
  }
  /* 8 %  Launch: extreme stretch, chip barely moved yet */
  8% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * 0.92)) translateY(calc(var(--wc-dy, 0px) - 3px))
               scaleX(1.58) scaleY(0.65) rotate(-2.5deg);
  }
  /* 20 %  Wiggle 1 — first undulation through 40 % of journey */
  20% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * 0.60)) translateY(calc(var(--wc-dy, 0px) + 3px))
               scaleX(1.20) scaleY(0.86) rotate(3.5deg);
  }
  /* 36 %  Wiggle 2 — second undulation, now 65 % done */
  36% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * 0.35)) translateY(calc(var(--wc-dy, 0px) - 3px))
               scaleX(1.35) scaleY(0.77) rotate(-3.5deg);
  }
  /* 52 %  Wiggle 3 — nearly there, 87 % done */
  52% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * 0.13)) translateY(calc(var(--wc-dy, 0px) + 2px))
               scaleX(1.18) scaleY(0.88) rotate(2.5deg);
  }
  /* 65 %  Overshoot — lands 9 % past target */
  65% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * -0.09)) translateY(var(--wc-dy, 0px))
               scaleX(0.80) scaleY(1.26) rotate(-1deg);
  }
  /* 78 %  Bounce 1 — snaps back, small rebound stretch */
  78% {
    transform: translate(-50%, -50%)
               translateX(calc(var(--wc-dx) * 0.04)) translateY(calc(var(--wc-dy, 0px) - 1px))
               scaleX(1.08) scaleY(0.94) rotate(0.5deg);
  }
  /* 90 %  Settle — almost at rest */
  90% {
    transform: translate(-50%, -50%) translateX(0) translateY(0)
               scaleX(0.98) scaleY(1.01);
  }
  /* 100 %  Final resting position */
  100% {
    transform: translate(-50%, -50%) translateX(0) translateY(0)
               scaleX(1) scaleY(1) rotate(0deg);
  }
}

.wc-chip-moving {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .wc-chip-moving {
    animation: none;
    will-change: auto;
  }
}

/* ── Board waiting state ── */
.wc-board-waiting {
  text-align: center;
  padding: 36px 24px;
  color: #94A3B8;
  font-size: 14px;
  font-weight: 700;
}

/* ── Chip detail popup ── */
.wc-popup {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.14);
  padding: 16px 18px;
  min-width: 180px;
  max-width: 240px;
}

.wc-popup-word {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: 10px;
  line-height: 1.2;
}

.wc-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 5px;
}

.wc-popup-row b { color: #0F172A; }

.wc-popup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wc-popup-dot-red    { background: #DC2626; }
.wc-popup-dot-yellow { background: #D97706; }
.wc-popup-dot-green  { background: #16A34A; }

.wc-popup-total {
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  margin-top: 8px;
  border-top: 1px solid #F1F5F9;
  padding-top: 8px;
}

/* ═══════════════════════════════════════════
   STUDENT VIEW
═══════════════════════════════════════════ */

.wc-student-page { padding-bottom: 60px; }

/* Privacy note */
.wc-privacy-note {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #1E40AF;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.wc-privacy-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Code entry form */
.wc-code-form { max-width: 380px; margin: 0 auto; }

.wc-code-input {
  display: block;
  width: 100%;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  font-family: inherit;
  color: #0F172A;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.14s, box-shadow 0.14s;
  margin-bottom: 14px;
}

.wc-code-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}

.wc-code-error {
  font-size: 13px;
  font-weight: 700;
  color: #DC2626;
  text-align: center;
  margin-top: 8px;
}

/* Staging area (unsorted words) */
.wc-staging-area {
  background: #F8FAFC;
  border: 1.5px dashed #CBD5E1;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  min-height: 60px;
}

.wc-staging-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  margin-bottom: 10px;
}

.wc-staging-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.wc-staging-empty {
  font-size: 13px;
  font-weight: 700;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  height: 40px;
}

/* Tap hint */
.wc-tap-hint {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  text-align: center;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: #FFFBEB;
  border-radius: 10px;
  border: 1px solid #FDE68A;
}

/* Three columns layout */
.wc-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.wc-col {
  border-radius: 16px;
  border: 2px solid #E2E8F0;
  overflow: hidden;
  min-height: 140px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wc-col.wc-col-red    { border-color: #FECACA; }
.wc-col.wc-col-yellow { border-color: #FDE68A; }
.wc-col.wc-col-green  { border-color: #BBF7D0; }

.wc-col.wc-drop-active {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.22);
  border-color: #2563EB;
}

/* Column receives tap-selected chip */
.wc-col.wc-tap-target-active {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.3);
  border-color: #2563EB;
  cursor: pointer;
}

.wc-col-header {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wc-col-red    .wc-col-header { background: #FEF2F2; }
.wc-col-yellow .wc-col-header { background: #FFFBEB; }
.wc-col-green  .wc-col-header { background: #F0FDF4; }

.wc-col-label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wc-col-red    .wc-col-label { color: #DC2626; }
.wc-col-yellow .wc-col-label { color: #D97706; }
.wc-col-green  .wc-col-label { color: #16A34A; }

.wc-col-count {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
}

.wc-col-body {
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 70px;
  align-content: flex-start;
}

/* Student word chips */
.wc-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: grab;
  user-select: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  border: 0;
  white-space: nowrap;
}

.wc-chip:active { cursor: grabbing; }

/* Chip in staging area */
.wc-staging-chips .wc-chip {
  background: #F1F5F9;
  color: #334155;
  border: 1.5px solid #E2E8F0;
}

.wc-staging-chips .wc-chip:hover {
  background: #E2E8F0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15,23,42,0.1);
}

/* Selected chip (tap mode) */
.wc-chip.wc-chip-selected {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
  box-shadow: 0 3px 10px rgba(37,99,235,0.3);
  transform: translateY(-2px);
}

/* Chips inside columns */
.wc-col-body .wc-chip {
  font-size: 12px;
  padding: 5px 10px;
}

.wc-col-red    .wc-col-body .wc-chip { background: #FEE2E2; color: #991B1B; border: 1.5px solid #FECACA; }
.wc-col-yellow .wc-col-body .wc-chip { background: #FEF3C7; color: #92400E; border: 1.5px solid #FDE68A; }
.wc-col-green  .wc-col-body .wc-chip { background: #DCFCE7; color: #166534; border: 1.5px solid #BBF7D0; }

.wc-col-body .wc-chip:hover { filter: brightness(0.95); transform: translateY(-1px); }

/* Dragging state */
.wc-chip.wc-dragging {
  opacity: 0.4;
}

/* Done banner */
.wc-done-banner {
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 800;
  color: #166534;
  text-align: center;
  margin-top: 20px;
}

/* Room closed banner */
.wc-closed-banner {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 800;
  color: #991B1B;
  text-align: center;
  margin-top: 20px;
}

/* ── Loading / spinner ── */
.wc-loading {
  text-align: center;
  padding: 40px;
  font-size: 15px;
  font-weight: 700;
  color: #94A3B8;
}

/* ─ Tools landing page ─ */
.tools-page-head {
  margin: 0 0 22px;
  text-align: center;
}

.tools-page-head h1 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

.tools-page-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

/* Two short paragraphs saying what the toolkit is for. Width-constrained so
   the page keeps its centred, card-first look rather than reading as an
   article. Matches .gp-page-intro on the Games hub. */
.tools-page-intro {
  max-width: 620px;
  margin: 12px auto 0;
}

.tools-page-intro p {
  margin: 0 0 7px;
  color: #5b6b7c;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  text-align: justify;
  text-justify: inter-word;
}

.tools-page-intro p:last-child { margin-bottom: 0; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 8px;
}

.tool-card {
  --tool-wash: url('/img/games_preview/games_bg_1.png');
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid #E2E8F0;
  padding: 24px 24px 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 3px 15px rgba(15,23,42,0.13);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.12s, background-color 0.15s;
}

.tool-card:nth-child(1) { --tool-wash: url('/img/games_preview/games_bg_4.png'); }
.tool-card:nth-child(2) { --tool-wash: url('/img/games_preview/games_bg_5.png'); }
.tool-card:nth-child(3) { --tool-wash: url('/img/games_preview/games_bg_1.png'); }
.tool-card:nth-child(4) { --tool-wash: url('/img/games_preview/games_bg_3.png'); }
.tool-card:nth-child(5) { --tool-wash: url('/img/games_preview/games_bg_6.png'); }
.tool-card:nth-child(6) { --tool-wash: url('/img/games_preview/games_bg_2.png'); }

.tool-card:hover {
  box-shadow: 0 8px 25px rgba(15,23,42,0.17);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.tool-card-icon {
  width: calc(100% + 48px);
  height: 112px;
  margin: -24px -24px 4px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: var(--tool-wash);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  overflow: hidden;
}

.tool-card-icon svg    { width: 32px; height: 32px; }
.tool-card-icon-img    { width: 84px !important; height: 84px !important; object-fit: contain; display: block; }
.tool-card-icon-img--whiteboard { transform: scale(1.12); filter: contrast(1.06) saturate(1.05); }

.tool-card-title {
  font-size: 19px;
  font-weight: 900;
  color: #0F172A;
  margin: 0;
  line-height: 1.2;
}

.tool-card-sub {
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  margin: 0;
  line-height: 1.45;
}

.tools-coming-note {
  width: min(100%, 360px);
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(100, 116, 139, 0.16);
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  .wc-hero-layout       { padding: 6px 16px 8px; }
  .wc-hero-logo         { height: 30px; }
  .wc-hero-title        { font-size: 16px; }
  .wc-main              { padding: 10px 14px 48px; }
  .tools-page .wc-main  { padding-top: 18px; }
  .wc-card              { padding: 16px 16px; }
  .wc-catalog-search    { width: 100%; }
  .wc-catalog-custom-btn { width: 100%; justify-content: center; }
  .wc-set-grid          { grid-template-columns: minmax(0, 1fr); }
  .wc-import-form       { grid-template-columns: 1fr; align-items: stretch; }
  .wc-import-check      { white-space: normal; min-height: 0; }
  .wc-setup-topline     { align-items: flex-start; flex-direction: column; }
  .wc-selected-set-note { text-align: left; }

  .wc-room-bar          { gap: 12px; padding: 12px 14px; }
  .wc-room-code-display { font-size: 24px; }
  .wc-join-url          { max-width: 28ch; }

  .wc-columns { gap: 8px; }
  .wc-col-label { font-size: 10px; }
  .wc-chip { font-size: 12px; padding: 6px 10px; }

  .wc-word-track  { height: 44px; }
  .wc-board-chip { font-size: 18px; padding: 4px 10px; }
}

@media (max-width: 600px) {
  .wc-room-bar { flex-direction: column; align-items: flex-start; }
  .wc-room-bar-actions { align-self: stretch; justify-content: space-between; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tools-page-head { margin-bottom: 18px; }
  .tools-page-head h1 { font-size: 24px; }
  .wc-columns { grid-template-columns: 1fr; gap: 10px; }
}

/* ═══════════════════════════════════════════
   ROUND TITLE INPUT (setup card)
═══════════════════════════════════════════ */

.wc-input {
  display: block;
  width: 100%;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #0F172A;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.14s, box-shadow 0.14s;
  background: #fff;
}
.wc-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}
.wc-input::placeholder { color: #CBD5E1; }

/* ═══════════════════════════════════════════
   LOBBY VIEW
═══════════════════════════════════════════ */

/* Compact header row (sits just below fixed nav) */
.wc-compact-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 60px; /* clear fixed nav */
}
.wc-compact-header-title {
  font-size: 15px;
  font-weight: 900;
  color: #0F172A;
}

.wc-lobby-body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.wc-lobby-left  { flex: 1; min-width: 260px; }
.wc-lobby-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.wc-lobby-centered {
  display: block;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.wc-lobby-code-big {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #0F172A;
  line-height: 1;
  margin: 4px 0 0;
}

.wc-lobby-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
}

.wc-lobby-qr-wrap:focus-visible {
  outline: 3px solid rgba(37,99,235,0.28);
  outline-offset: 5px;
}

#wc-lobby-qr,
#wc-lobby-qr canvas,
#wc-lobby-qr img,
#wc-lobby-qr table {
  display: block;
}

.wc-lobby-round-title {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  padding: 6px 12px;
  background: #F1F5F9;
  border-radius: 8px;
  display: inline-block;
}

/* ═══════════════════════════════════════════
   BOARD VIEW
═══════════════════════════════════════════ */

.wc-board-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  box-sizing: border-box;
  overflow: hidden;
}

/* ── Toolbar ── */
.wc-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  gap: 12px;
}

.wc-board-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.wc-board-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wc-board-code-badge {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.10em;
  color: #0F172A;
  background: #F1F5F9;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.wc-board-round-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  background: #F1F5F9;
  color: #334155;
  white-space: nowrap;
}

/* ── Info panel (collapsible) ── */
#wc-board-info-panel { flex-shrink: 0; }

/* ── Info toggle strip ── */
.wc-board-info-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 3px 18px;
  background: #F1F5F9;
  border: none;
  border-bottom: 1px solid #E2E8F0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: #94A3B8;
  cursor: pointer;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: background 0.12s, color 0.12s;
}
.wc-board-info-toggle:hover { background: #E2E8F0; color: #475569; }

.wc-toggle-chevron { transition: transform 0.2s ease; flex-shrink: 0; }

/* ── Action buttons row ── */
.wc-board-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.wc-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.wc-btn-sm:hover { background: #F1F5F9; border-color: #CBD5E1; color: #0F172A; }
.wc-btn-sm:active { transform: scale(0.97); }
.wc-btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }

.wc-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #94A3B8;
}
.wc-btn-ghost:hover { background: #F1F5F9; border-color: #E2E8F0; color: #475569; }

/* ── Board canvas ── */
.wc-board-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px 20px;
}

.wc-board-canvas .wc-board-card { margin-bottom: 0; }

/* ── Chip states for teacher board ── */
.wc-board-chip.wc-chip-board-selected {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.20), 0 2px 6px rgba(15,23,42,0.12);
  background: #EFF6FF;
  color: #1E40AF;
}

.wc-board-chip.wc-chip-dimmed {
  opacity: 0.22;
  pointer-events: none;
}

/* ── Selection bar (inline, below action buttons) ── */
.wc-selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: #0F172A;
  border-top: 2px solid #1E293B;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.wc-sel-count {
  font-size: 13px;
  font-weight: 800;
  color: #94A3B8;
  margin-right: 4px;
  white-space: nowrap;
}

.wc-selection-bar .wc-btn-sm {
  background: #1E293B;
  border-color: #334155;
  color: #E2E8F0;
}
.wc-selection-bar .wc-btn-sm:hover {
  background: #334155;
  border-color: #475569;
  color: #fff;
}
.wc-selection-bar .wc-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #64748B;
}
.wc-selection-bar .wc-btn-ghost:hover {
  background: #1E293B;
  color: #94A3B8;
}

/* ═══════════════════════════════════════════
   MODALS (shared overlay + panel)
═══════════════════════════════════════════ */

.wc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
  animation: wcFadeIn 0.15s ease;
}

.wc-modal-panel {
  background: #fff;
  border-radius: 20px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(15,23,42,0.22);
  animation: wcSlideUp 0.18s ease;
}

@keyframes wcSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.wc-modal-panel-wide { max-width: 640px; }

.wc-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: #F1F5F9;
  color: #64748B;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.12s;
}
.wc-modal-close:hover { background: #E2E8F0; color: #0F172A; }

.wc-modal-heading {
  font-size: 17px;
  font-weight: 900;
  color: #0F172A;
  margin: 0 0 16px;
}

.wc-modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Join info modal code display */
.wc-mjoin-code {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #0F172A;
  margin: 4px 0 8px;
}

/* Story modal — wide reading pane */
.wc-modal-panel-story {
  max-width: 760px;
}

/* Story loading state */
.wc-story-loading {
  text-align: center;
  padding: 48px 24px;
  font-size: 20px;
  font-weight: 700;
  color: #64748B;
}

/* Story result */
#wc-story-result {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.75;
  color: #0F172A;
}

#wc-story-result p {
  margin: 0 0 1.2em;
}

#wc-story-result p:last-child { margin-bottom: 0; }

/* Keyword highlight */
.wc-story-kw {
  background: #FDE68A;
  color: #0F172A;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 800;
}

/* Error state */
.wc-story-error {
  color: #DC2626;
  font-size: 16px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════════ */

.wc-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0F172A;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-family: "Nunito", system-ui, sans-serif;
  padding: 10px 20px;
  border-radius: 99px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.24);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

.wc-toast.wc-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════
   NEW ROUND BANNER (student side)
═══════════════════════════════════════════ */

.wc-new-round-banner {
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #1E40AF;
  text-align: center;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE ADDITIONS
═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .wc-lobby-code-big { font-size: 36px; }
  .wc-board-actions  { padding: 6px 12px; gap: 6px; }
  .wc-btn-sm         { font-size: 12px; padding: 5px 10px; }
  .wc-board-canvas   { padding: 8px 12px 20px; }
  .wc-mjoin-code     { font-size: 30px; }
}

@media (max-width: 480px) {
  .wc-board-toolbar       { padding: 6px 12px; }
  .wc-lobby-code-big      { font-size: 28px; }
  .wc-lobby-body          { flex-direction: column; }
  .wc-modal-panel         { padding: 20px 18px 18px; border-radius: 16px; }
  .wc-selection-bar       { padding: 10px 14px; }
}

/* ═══════════════════════════════════════════
   TEACHER PAGE READABILITY — projected classroom view
═══════════════════════════════════════════ */

body.wc-page:not(.wc-student-page) .wc-hero-title {
  font-size: 28px;
}

body.wc-page:not(.wc-student-page) .wc-hero-sub {
  font-size: 18px;
  font-weight: 700;
}

body.wc-page:not(.wc-student-page) .wc-label,
body.wc-page:not(.wc-student-page) .wc-preview-heading,
body.wc-page:not(.wc-student-page) .wc-meta-label {
  font-size: 16px;
}

body.wc-page:not(.wc-student-page) .wc-helper,
body.wc-page:not(.wc-student-page) .wc-word-count,
body.wc-page:not(.wc-student-page) .wc-setup-error,
body.wc-page:not(.wc-student-page) .wc-selected-set-note,
body.wc-page:not(.wc-student-page) .wc-catalog-status,
body.wc-page:not(.wc-student-page) .wc-stats-inline,
body.wc-page:not(.wc-student-page) .wc-sel-count {
  font-size: 18px;
}

body.wc-page:not(.wc-student-page) .wc-input,
body.wc-page:not(.wc-student-page) .wc-textarea,
body.wc-page:not(.wc-student-page) .wc-catalog-search {
  font-size: 19px;
}

body.wc-page:not(.wc-student-page) .wc-btn-primary {
  font-size: 20px;
}

body.wc-page:not(.wc-student-page) .wc-btn-copy,
body.wc-page:not(.wc-student-page) .wc-btn-danger,
body.wc-page:not(.wc-student-page) .wc-btn-sm,
body.wc-page:not(.wc-student-page) .wc-qr-expand {
  font-size: 18px;
}

body.wc-page:not(.wc-student-page) .wc-set-title,
body.wc-page:not(.wc-student-page) .wc-set-preview,
body.wc-page:not(.wc-student-page) .wc-preview-chip,
body.wc-page:not(.wc-student-page) .wc-file-input,
body.wc-page:not(.wc-student-page) .wc-import-check,
body.wc-page:not(.wc-student-page) .wc-import-result {
  font-size: 18px;
}

body.wc-page:not(.wc-student-page) .wc-lvl-btn {
  font-size: 17px;
  height: 42px;
  padding: 0 18px;
}

body.wc-page:not(.wc-student-page) .wc-set-level {
  min-width: 34px;
  height: 24px;
  font-size: 14px;
}

body.wc-page:not(.wc-student-page) .wc-lobby-code-big {
  font-size: 72px;
}

body.wc-page:not(.wc-student-page) .wc-lobby-round-title,
body.wc-page:not(.wc-student-page) .wc-join-url {
  font-size: 22px;
}

body.wc-page:not(.wc-student-page) .wc-board-toolbar {
  padding: 10px 18px;
}

body.wc-page:not(.wc-student-page) .wc-board-code-badge {
  font-size: 24px;
}

body.wc-page:not(.wc-student-page) .wc-board-round-label {
  font-size: 22px;
}

body.wc-page:not(.wc-student-page) .wc-stat-chip {
  font-size: 19px;
}

body.wc-page:not(.wc-student-page) .wc-board-actions {
  padding: 10px 18px;
}

body.wc-page:not(.wc-student-page) .wc-zone {
  padding: 10px 8px;
  font-size: 22px;
  font-weight: 900;
}

body.wc-page:not(.wc-student-page) .wc-zone-icon {
  width: 80px;
  height: 80px;
}

body.wc-page:not(.wc-student-page) .wc-board-chip {
  padding: 5px 18px;
  font-size: 30px;
  line-height: 1.1;
}

body.wc-page:not(.wc-student-page) .wc-board-waiting {
  font-size: 24px;
}

body.wc-page:not(.wc-student-page) .wc-popup-word {
  font-size: 22px;
}

body.wc-page:not(.wc-student-page) .wc-popup-row,
body.wc-page:not(.wc-student-page) .wc-popup-total {
  font-size: 18px;
}

body.wc-page:not(.wc-student-page) .wc-modal-heading {
  font-size: 26px;
}

body.wc-page:not(.wc-student-page) .wc-mjoin-code {
  font-size: 56px;
}

body.wc-page:not(.wc-student-page) .wc-qr-modal-code {
  font-size: 52px;
}

body.wc-page:not(.wc-student-page) .wc-qr-modal-url,
body.wc-page:not(.wc-student-page) .wc-toast {
  font-size: 18px;
}

@media (max-width: 768px) {
  body.wc-page:not(.wc-student-page) .wc-hero-title { font-size: 24px; }
  body.wc-page:not(.wc-student-page) .wc-hero-sub { font-size: 16px; }
  body.wc-page:not(.wc-student-page) .wc-lobby-code-big { font-size: 54px; }
  body.wc-page:not(.wc-student-page) .wc-zone { font-size: 18px; }
  body.wc-page:not(.wc-student-page) .wc-zone-icon { width: 64px; height: 64px; }
  body.wc-page:not(.wc-student-page) .wc-board-chip { font-size: 26px; }
  body.wc-page:not(.wc-student-page) .wc-btn-sm { font-size: 17px; }
}

@media (max-width: 480px) {
  body.wc-page:not(.wc-student-page) .wc-lobby-code-big { font-size: 40px; }
  body.wc-page:not(.wc-student-page) .wc-zone { font-size: 15px; }
  body.wc-page:not(.wc-student-page) .wc-zone-icon { width: 52px; height: 52px; }
  body.wc-page:not(.wc-student-page) .wc-board-chip { font-size: 23px; }
  body.wc-page:not(.wc-student-page) .wc-board-code-badge { font-size: 19px; }
  body.wc-page:not(.wc-student-page) .wc-board-round-label { font-size: 18px; }
  body.wc-page:not(.wc-student-page) .wc-stat-chip { font-size: 16px; }
}
