/* ══════════════════ WOODPECKER METHOD & SPACED REPETITION CSS ══════════════════ */

/* ── Dashboard & Hub View ── */
.woodpecker-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
}

.woodpecker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 16px;
}

.woodpecker-title-area h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  margin: 0 0 6px 0;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.woodpecker-title-area p {
  margin: 0;
  font-size: 14px;
  color: var(--text2);
}

.wp-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
  transition: all 0.2s ease;
}

.wp-tab-badge.due {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
  animation: pulse-tab-badge 2s infinite;
}

.wp-tab-badge.pending {
  background: rgba(201, 168, 76, 0.2);
  color: #f6d87e;
  border: 1px solid rgba(201, 168, 76, 0.4);
}

@keyframes pulse-tab-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── Spaced Repetition & Reviews Section ── */
.woodpecker-reviews-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 32px;
  box-sizing: border-box;
}

.woodpecker-reviews-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.wp-reviews-tag {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.woodpecker-reviews-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.woodpecker-reviews-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  overflow-x: auto;
}

.wp-rev-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text2, #94a3b8);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.wp-rev-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.wp-rev-tab.active {
  background: rgba(201, 168, 76, 0.15);
  border-color: rgba(201, 168, 76, 0.4);
  color: #f6d87e;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.15);
}

.woodpecker-reviews-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.woodpecker-reviews-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.woodpecker-reviews-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.woodpecker-reviews-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.woodpecker-reviews-empty-box {
  text-align: center;
  padding: 36px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px dashed var(--border);
  margin-top: 10px;
}

.wp-due-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
}

.wp-due-pill.due-now {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
}

.wp-due-pill.scheduled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text2);
  border: 1px solid var(--border);
}

.wp-due-pill.graduated {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-weight: 600;
}

.wp-btn-start {
  white-space: nowrap !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
}

/* ── Active Trainer Split View ── */
.woodpecker-trainer-view {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 54px);
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.woodpecker-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
  box-sizing: border-box;
}

.woodpecker-trainer-split {
  display: flex;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* ── Left Column (Interactive Board) ── */
.woodpecker-board-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 12px;
  background: #18181b;
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

.woodpecker-board-container {
  width: 100%;
  max-width: min(720px, calc(100vw - 460px), calc(100vh - 170px));
  aspect-ratio: 1 / 1;
  position: relative;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
}

.woodpecker-board-container .cg-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 6px;
  overflow: hidden;
}

/* ── Action Controls Bar Directly Below Board ── */
.woodpecker-board-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: min(720px, calc(100vw - 460px), calc(100vh - 170px));
  gap: 8px;
  margin-top: 14px;
  box-sizing: border-box;
}

.wp-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.wp-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.wp-next-btn {
  flex: 1.5;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #ffffff !important;
  border: 1px solid #4ade80 !important;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
  font-weight: 700;
}

.wp-next-btn.auto-advancing {
  animation: next-btn-pulse 1s infinite alternate ease-in-out;
}

@keyframes next-btn-pulse {
  0% { transform: scale(1); box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35); }
  100% { transform: scale(1.02); box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6); }
}

/* Turn Banner Overlay */
.woodpecker-turn-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: min(720px, calc(100vw - 460px), calc(100vh - 170px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  box-sizing: border-box;
}

.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
}

.turn-pill.white {
  background: #ffffff;
  color: #000000;
}

.turn-pill.black {
  background: #27272a;
  color: #ffffff;
  border: 1px solid #3f3f46;
}

/* ── Right Column (Coach Notes & Move Tree) ── */
.woodpecker-info-pane {
  width: 440px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
  box-sizing: border-box;
}

.woodpecker-puzzle-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.woodpecker-puzzle-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.woodpecker-puzzle-subtitle {
  font-size: 12px;
  color: var(--text3);
  font-family: 'IBM Plex Mono', monospace;
}

.woodpecker-timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
}

.woodpecker-coach-box {
  background: rgba(212, 163, 89, 0.06);
  border: 1px solid rgba(212, 163, 89, 0.25);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
}

.woodpecker-moves-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  min-height: 75px;
  max-height: 150px;
  overflow-y: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wp-move-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.wp-move-chip:hover {
  background: rgba(212, 163, 89, 0.12);
  color: var(--text);
  border-color: rgba(212, 163, 89, 0.4);
  transform: translateY(-1px);
}

.wp-move-chip.played {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.wp-move-chip.correct {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.wp-move-chip.active {
  background: rgba(212, 163, 89, 0.22) !important;
  color: #f6d89e !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px rgba(212, 163, 89, 0.4);
  font-weight: 700;
}

.wp-move-chip.start-chip {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text3);
  font-size: 11px;
}

.wp-move-chip.start-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.woodpecker-move-step {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px;
  font-weight: 600;
}

.woodpecker-move-step.correct {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.woodpecker-feedback-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.woodpecker-feedback-alert.success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.woodpecker-feedback-alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Ladder Steps Visualizer ── */
.woodpecker-ladder-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.wp-status-chip {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  font-weight: 600;
}

.woodpecker-ladder-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.ladder-pill {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.ladder-pill .pill-stage {
  font-size: 10px;
  opacity: 0.6;
}

.ladder-pill .pill-days {
  font-size: 11px;
  font-weight: 600;
}

.ladder-pill.active {
  background: rgba(217, 119, 6, 0.2);
  color: var(--accent);
  border-color: var(--accent);
}

.ladder-pill.active .pill-stage {
  opacity: 0.9;
}

.ladder-pill.graduated {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: #22c55e;
}

/* ── Responsive Mobile & Tablet Layout ── */
@media (max-width: 900px) {
  .woodpecker-trainer-view {
    height: auto;
    min-height: calc(100vh - 54px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .woodpecker-trainer-split {
    flex-direction: column;
    overflow: visible;
    flex: none;
    width: 100%;
  }

  .woodpecker-board-pane {
    padding: 12px 8px 16px;
    flex: none;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  .woodpecker-board-container {
    max-width: min(calc(100vw - 16px), 440px, 58vh);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  .woodpecker-turn-indicator {
    max-width: min(calc(100vw - 16px), 440px, 58vh);
    margin: 0 auto 10px auto;
    padding: 6px 12px;
    font-size: 12px;
  }

  .woodpecker-board-actions {
    max-width: min(calc(100vw - 16px), 440px, 58vh);
    margin: 10px auto 0 auto;
    gap: 8px;
  }

  .wp-action-btn {
    min-height: 44px; /* Ergonomic touch target */
    font-size: 13px;
  }

  .woodpecker-info-pane {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: none;
    flex: none;
    overflow: visible;
    padding: 16px 14px 40px;
    box-sizing: border-box;
    gap: 14px;
  }

  .woodpecker-topbar {
    padding: 8px 12px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .woodpecker-board-pane {
    padding: 8px 4px 12px;
  }

  .woodpecker-board-container {
    max-width: min(calc(100vw - 10px), 380px, 52vh);
  }

  .woodpecker-turn-indicator {
    max-width: min(calc(100vw - 10px), 380px, 52vh);
    font-size: 11px;
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  .woodpecker-board-actions {
    max-width: min(calc(100vw - 10px), 380px, 52vh);
    margin: 8px auto 0 auto;
    gap: 6px;
  }

  .wp-action-btn {
    min-height: 42px;
    font-size: 12px;
    padding: 6px 8px;
  }

  .woodpecker-info-pane {
    padding: 14px 10px 48px;
  }

  .woodpecker-puzzle-title {
    font-size: 15px;
  }

  .woodpecker-topbar {
    font-size: 12px;
  }
}

/* ── Woodpecker Stage Hero & Status Badges ── */
.wp-stage-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  white-space: nowrap;
}

.wp-stage-status-badge.mastered {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.wp-stage-status-badge.unfinished {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.wp-stage-status-badge.in-progress {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ══════════════════ WOODPECKER EXERCISE READER MODAL ══════════════════ */
.wp-reader-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.wp-reader-modal-card {
  width: 100%;
  max-width: 1060px;
  max-height: 94vh;
  background: #0f111a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wpModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wpModalPop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.wp-reader-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #141824;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.wp-reader-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wp-reader-icon {
  font-size: 24px;
}

.wp-reader-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-reader-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
}

.wp-reader-sub {
  font-size: 12px;
  color: #94a3b8;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 2px;
}

.wp-reader-quick-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wp-reader-select {
  background: #1e2433;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.wp-reader-select:focus {
  border-color: #8b5cf6;
}

.wp-reader-jump-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e2433;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px 6px 2px 10px;
}

.wp-jump-lbl {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.wp-reader-jump-input {
  width: 58px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  outline: none;
  padding: 4px 0;
}

.wp-header-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.wp-header-btn-group .btn {
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 12px;
}

/* ── Body 2-Column Grid ── */
.wp-reader-body {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.wp-reader-status-row {
  width: 100%;
  max-width: 420px;
  height: 34px;
  min-height: 34px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wp-reader-feedback-badge {
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.wp-reader-feedback-badge.default {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.wp-reader-feedback-badge.correct {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.wp-reader-feedback-badge.wrong {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
  animation: wpStatusShake 0.3s ease-in-out;
}

@keyframes wpStatusShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.wp-reader-feedback-badge.complete {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.wp-reader-board-wrapper {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  position: relative;
  background: #2b2b36;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.wp-reader-board-wrapper .cg-wrap {
  width: 100%;
  height: 100%;
}

.wp-reader-player-bar {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: #161a29;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  box-sizing: border-box;
}
.wp-reader-player-bar.top { margin-bottom: 8px; }
.wp-reader-player-bar.bot { margin-top: 8px; }

.wp-player-indicator.active {
  color: #38bdf8;
}

.wp-player-tomove {
  color: #64748b;
  font-size: 10px;
}
.wp-player-tomove.active {
  color: #22c55e;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.wp-reader-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin-top: 12px;
}

.wp-step-btn {
  flex: 1;
  height: 38px;
  background: #1e2433;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.wp-step-btn:hover {
  background: #2a3449;
  border-color: #8b5cf6;
  color: #fff;
}

.wp-step-btn.wp-step-play {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}
.wp-step-btn.wp-step-play:hover {
  background: rgba(139, 92, 246, 0.35);
  color: #fff;
}

.wp-step-btn.wp-step-flip {
  flex: 0 0 42px;
}

.wp-reader-fen-bar {
  width: 100%;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: #64748b;
  margin-top: 10px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.wp-reader-fen-bar:hover {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Info Column Cards ── */
.wp-reader-info-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wp-reader-card {
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
}

.wp-reader-match-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid #f59e0b;
}

.wp-match-icon {
  font-size: 22px;
}

.wp-match-players {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}

.wp-match-meta {
  font-size: 12px;
  color: #f59e0b;
  font-weight: 600;
  margin-top: 2px;
}

.wp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.wp-moves-ply-badge {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

.wp-reader-moves-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
}

.wp-reader-move-token {
  background: #1e2433;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.12s ease;
}

.wp-reader-move-token:hover {
  border-color: #8b5cf6;
  color: #c4b5fd;
  transform: translateY(-1px);
}

.wp-reader-move-token.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: #8b5cf6;
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.wp-reader-comment-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wp-reader-comment-content {
  font-size: 13.5px;
  line-height: 1.65;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

.wp-reader-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
}

.wp-reader-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

/* Hide mobile reader nav on desktop screens */
.wp-reader-mobile-nav {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS (<= 768px)
   Strictly mobile-only: Desktop PC browser layout is 100% untouched
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 1. Woodpecker Hub Header: 2x2 grid so Refresh & Reader drop to a clean second line */
  .woodpecker-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .wp-header-btn-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
  }

  .wp-header-btn-group .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    font-size: 12px;
    white-space: normal;
  }

  /* 2. Woodpecker Reader: Full-page experience with board top first and unmovable */
  .wp-reader-backdrop {
    padding: 0 !important;
    background: var(--bg, #0b0f19) !important;
  }

  .wp-reader-modal-card {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .wp-reader-header {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg2, #131b2e);
    border-bottom: 1px solid var(--border);
    gap: 8px;
  }

  .wp-reader-quick-toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .wp-reader-select {
    font-size: 11px;
    padding: 5px 8px;
    max-width: 130px;
  }

  .wp-reader-jump-wrap {
    padding: 2px 4px 2px 8px;
  }

  .wp-reader-jump-input {
    width: 44px;
    font-size: 12px;
  }

  .wp-reader-body {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 10px 24px !important;
    gap: 12px;
  }

  /* Board is top first, unmovable and sticky */
  .wp-reader-board-col {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--bg2, #131b2e) !important;
    padding: 4px 4px 6px !important;
    margin: 0 -10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: calc(100% + 20px) !important;
    box-sizing: border-box !important;
  }

  /* Hide calculation hint status row on mobile */
  .wp-reader-status-row {
    display: none !important;
  }

  /* Hide chapter match header card on mobile */
  .wp-reader-match-card {
    display: none !important;
  }

  /* Hide Woodpecker Method tagline on mobile */
  #page-woodpecker-hub .hunt-subtitle,
  .woodpecker-header .hunt-subtitle {
    display: none !important;
  }

  .wp-reader-board-wrapper {
    max-width: min(calc(100vw - 12px), 440px, 48vh) !important;
    aspect-ratio: 1 / 1;
    width: 100%;
  }

  .wp-reader-player-bar {
    max-width: min(calc(100vw - 12px), 440px, 48vh) !important;
    padding: 2px 6px;
    font-size: 11px;
  }

  /* Stepper arrows right under board */
  .wp-reader-stepper-bar {
    max-width: min(calc(100vw - 12px), 440px, 48vh) !important;
    margin-top: 4px;
    gap: 4px;
    width: 100%;
  }

  .wp-step-btn {
    height: 38px;
    font-size: 15px;
  }

  /* Next / previous exercise buttons right under arrows */
  .wp-reader-mobile-nav {
    display: flex !important;
    width: 100%;
    max-width: min(calc(100vw - 12px), 440px, 48vh) !important;
    margin-top: 6px;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .wp-reader-mobile-nav .btn {
    flex: 1;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
    justify-content: center;
  }

  .wp-reader-mobile-nav .wp-reader-counter {
    font-size: 11px;
    white-space: nowrap;
    padding: 0 4px;
  }

  /* Hide desktop footer nav on mobile */
  .wp-reader-desktop-nav {
    display: none !important;
  }

  .wp-reader-fen-bar {
    display: none !important;
  }

  /* Under that: all the rest (match info, moves, GM commentary) */
  .wp-reader-info-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    padding-top: 4px !important;
  }
}

/* ── Tier Selector Scrollbar & Sizing Fix ── */
.woodpecker-container .kw-tier-selector {
  overflow-x: auto;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding-bottom: 2px !important;
  margin-bottom: 14px !important;
  gap: 8px !important;
}

.woodpecker-container .kw-tier-selector::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.woodpecker-container .kw-tier-btn {
  padding: 8px 14px !important;
  font-size: 13.5px !important;
  border-radius: 10px !important;
}

/* ── Hero Cycle Card Compaction ── */
.woodpecker-container .kw-hero-cycle-card {
  padding: 12px 18px !important;
  gap: 16px !important;
  border-radius: 14px !important;
}

#wp-hero-desc {
  display: none !important;
}

/* ── Woodpecker Easy Stages (8 Progressive Stages - Compact Layout) ── */
#wp-easy-stages-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 14px;
}

#wp-easy-stages-grid .kw-stage-card {
  min-height: 86px !important;
  padding: 8px 10px !important;
  gap: 4px !important;
  border-radius: 10px !important;
}

#wp-easy-stages-grid .kw-stage-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#wp-easy-stages-grid .kw-stage-num-pill {
  font-size: 9.5px !important;
  padding: 1px 6px !important;
}

#wp-easy-stages-grid .kw-stage-puzzles-pill {
  font-size: 10px !important;
}

#wp-easy-stages-grid .kw-stage-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

#wp-easy-stages-grid .kw-stage-icon {
  font-size: 13px;
  line-height: 1;
}

#wp-easy-stages-grid .kw-stage-title {
  font-size: 13px !important;
  margin: 0 !important;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

#wp-easy-stages-grid .kw-stage-cycle-time {
  margin-top: 2px !important;
  padding: 2px 4px !important;
  font-size: 10.5px !important;
}

#wp-easy-stages-grid .kw-stage-footer {
  margin-top: 2px;
}

#wp-easy-stages-grid .kw-stage-btn {
  padding: 3px 6px !important;
  font-size: 11px !important;
  height: 24px !important;
  line-height: 1;
  border-radius: 6px !important;
}

#wp-easy-stages-grid .stage-1 { --st-color: #10b981; --st-rgb: 16, 185, 129; }
#wp-easy-stages-grid .stage-2 { --st-color: #0ea5e9; --st-rgb: 14, 165, 233; }
#wp-easy-stages-grid .stage-3 { --st-color: #6366f1; --st-rgb: 99, 102, 241; }
#wp-easy-stages-grid .stage-4 { --st-color: #a855f7; --st-rgb: 168, 85, 247; }
#wp-easy-stages-grid .stage-5 { --st-color: #ec4899; --st-rgb: 236, 72, 153; }
#wp-easy-stages-grid .stage-6 { --st-color: #f97316; --st-rgb: 249, 115, 22; }
#wp-easy-stages-grid .stage-7 { --st-color: #eab308; --st-rgb: 234, 179, 8; }
#wp-easy-stages-grid .stage-8 { --st-color: #f59e0b; --st-rgb: 245, 158, 11; }

@media (max-width: 1100px) {
  #wp-easy-stages-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }
}

@media (max-width: 600px) {
  #wp-easy-stages-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .woodpecker-container .kw-tier-selector {
    gap: 6px !important;
  }
  .woodpecker-container .kw-tier-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  #wp-easy-stages-grid .kw-stage-card {
    min-height: 80px !important;
    padding: 6px 8px !important;
  }
}

