/* AEDO Play / Classroom pack. Loads after /play/play.css.
   Page-local overrides keep this page on the AEDO palette:
   navy #1a3a5c, orange #e86100 (fills/rules), #c2410c (orange text),
   ink #0c1a2a, light bg #f3f6fb. */

:root {
  --bg: #f3f6fb;
  --ink: #0c1a2a;
  --text: #0c1a2a;
  --accent: #e86100;
  --accent2: #c2410c;
  --navy: #1a3a5c;
  --orange-text: #c2410c;
  --rule: rgba(12,26,42,0.14);
  --rule-soft: rgba(12,26,42,0.08);
  --tint-navy: rgba(26,58,92,0.06);
  --tint-orange: rgba(232,97,0,0.08);
}
body.play-body { background: var(--bg); color: var(--ink); }

/* 44 px tap targets on the shared shell */
.play-nav-links a { display: inline-flex; align-items: center; min-height: 44px; }
.play-nav-cta { justify-content: center; }
.play-nav-logo { min-height: 44px; }
@media (max-width: 760px) {
  .play-hamburger { width: 44px !important; height: 44px !important; padding: 0 7px !important; }
  .play-nav-links a { display: flex; }
}
.play-footer a { display: inline-block; padding: 12px 4px; }

/* ---------- page header ---------- */
.cr-head { position: relative; z-index: 1; padding: 46px 0 8px; }
.cr-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--orange-text);
  border-left: 3px solid var(--accent); padding-left: 10px; margin-bottom: 14px;
}
.cr-head h1 {
  font-family: var(--font2); font-size: clamp(30px, 5vw, 48px); line-height: 1.08;
  letter-spacing: -1px; margin: 0 0 14px; color: var(--ink); max-width: 760px;
}
.cr-lead { font-size: 17px; color: var(--ink); max-width: 700px; margin: 0 0 12px; }
.cr-byline { font-size: 13px; color: #4c6178; margin: 0 0 22px; }

.cr-facts { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.cr-facts li { position: relative; padding-left: 22px; font-size: 15px; }
.cr-facts li::before { content: ''; position: absolute; left: 0; top: 10px; width: 10px; height: 2px; background: var(--accent); }

.cr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.cr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 9px; cursor: pointer;
  font-family: var(--font); font-size: 15px; font-weight: 700; text-decoration: none;
  border: 1.5px solid var(--navy); background: #fff; color: var(--navy);
}
.cr-btn:hover { background: var(--tint-navy); }
.cr-btn:focus-visible, .cr-toc a:focus-visible, .cr-check:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.cr-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.cr-btn-primary:hover { background: var(--orange-text); border-color: var(--orange-text); }
.cr-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* contents */
.cr-toc { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 0; margin: 8px 0 0; }
.cr-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.cr-toc a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  text-decoration: none; color: var(--navy); font-weight: 600; font-size: 14px;
}
.cr-toc a span { font-family: var(--font-mono); font-size: 11px; color: var(--orange-text); }
.cr-toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- sections ---------- */
.cr-section { position: relative; z-index: 1; padding: 44px 0 6px; scroll-margin-top: 70px; }
.cr-sec-head { margin-bottom: 22px; }
.cr-sec-no { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--orange-text); letter-spacing: 1px; }
.cr-sec-no::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.cr-sec-head h2 { font-family: var(--font2); font-size: clamp(24px, 3.2vw, 32px); margin: 0 0 8px; letter-spacing: -0.5px; color: var(--ink); }
.cr-sec-head p { margin: 0; max-width: 680px; color: #33465b; }

.cr-prose { max-width: 760px; }
.cr-prose p { margin: 0 0 12px; }
.cr-prose ul, .cr-prose ol { margin: 0 0 14px; padding-left: 22px; }
.cr-prose li { margin-bottom: 6px; }

/* game blocks */
.cr-game {
  background: #fff; border: 1px solid var(--rule); border-top: 4px solid var(--navy);
  border-radius: 12px; padding: 24px 24px 18px; margin-bottom: 22px;
}
.cr-game-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.cr-game h3 { font-family: var(--font2); font-size: 23px; margin: 0; color: var(--ink); }
.cr-game-meta { font-family: var(--font-mono); font-size: 12px; color: var(--navy); }
.cr-game h4 { font-family: var(--font2); font-size: 16px; margin: 18px 0 8px; color: var(--navy); }
.cr-game p, .cr-game li { font-size: 15px; }
.cr-game ul, .cr-game ol { padding-left: 22px; margin: 0 0 12px; }
.cr-game li { margin-bottom: 6px; }
.cr-open { margin: 14px 0 4px; }

.cr-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 14px; border: 1px solid var(--rule); border-radius: 8px; }
.cr-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; background: #fff; }
.cr-table th, .cr-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.cr-table th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--navy); background: var(--tint-navy); }
.cr-table tr:last-child td { border-bottom: none; }
.cr-table td.num { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.cr-table .grp td { background: var(--tint-orange); font-weight: 700; color: var(--ink); }

/* teacher notes */
.cr-note {
  border-left: 4px solid var(--accent); background: var(--tint-orange);
  border-radius: 0 10px 10px 0; padding: 14px 18px 6px; margin: 14px 0 6px;
}
.cr-note-label { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--orange-text); margin-bottom: 6px; }
.cr-note dl { margin: 0; }
.cr-note dt { font-weight: 700; font-size: 14.5px; margin-top: 8px; }
.cr-note dd { margin: 3px 0 8px; font-size: 14.5px; color: #24364a; }

/* lesson plans */
.cr-lesson { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 22px 24px 14px; margin-bottom: 22px; }
.cr-lesson h3 { font-family: var(--font2); font-size: 21px; margin: 0 0 4px; }
.cr-lesson .cr-game-meta { display: block; margin-bottom: 12px; }
.cr-steps { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--rule-soft); }
.cr-steps li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); font-size: 15px; }
.cr-steps .t { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--navy); padding-top: 2px; }
@media (max-width: 520px) {
  .cr-steps li { grid-template-columns: 1fr; gap: 2px; }
}

/* options list */
.cr-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cr-option { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; }
.cr-option h3 { font-family: var(--font2); font-size: 17px; margin: 0 0 6px; color: var(--navy); }
.cr-option p { margin: 0; font-size: 14.5px; }

/* ---------- worksheet ---------- */
.ws-controls { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.ws-controls p { margin: 0 0 8px; font-size: 14.5px; }
.ws-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.cr-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; font-weight: 600; border-radius: 6px; }
.cr-check input { width: 22px; height: 22px; accent-color: var(--navy); margin: 0; }

.ws-sheet {
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 10px 30px rgba(12,26,42,0.08); padding: 32px 34px; color: #000;
}
.ws-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.ws-title { font-family: var(--font2); font-size: 22px; margin: 0; color: var(--ink); }
.ws-sub { font-size: 12.5px; color: #33465b; margin: 2px 0 0; }
.ws-brand { font-family: var(--font-mono); font-size: 11px; color: var(--navy); text-align: right; white-space: nowrap; }
.ws-id { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 10px 18px; margin-bottom: 16px; }
.ws-field { display: flex; align-items: flex-end; gap: 8px; font-size: 13px; font-weight: 700; }
.ws-field span { flex: 1; border-bottom: 1px solid #000; height: 22px; }
.ws-part { margin-bottom: 18px; }
.ws-part h3 { font-family: var(--font2); font-size: 16px; margin: 0 0 4px; color: var(--ink); border-left: 4px solid var(--accent); padding-left: 8px; }
.ws-part .ws-task { font-size: 13px; margin: 0 0 8px; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.ws-table th, .ws-table td { border: 1px solid #000; padding: 4px 6px; text-align: left; vertical-align: top; }
.ws-table th { font-size: 11px; font-weight: 700; background: #eef2f7; }
.ws-table td { height: 30px; }
.ws-q { margin: 0 0 10px; font-size: 13px; break-inside: avoid; }
.ws-q b { display: block; margin-bottom: 2px; }
.ws-line { border-bottom: 1px solid #000; height: 24px; }
.ws-foot { font-size: 10.5px; color: #33465b; border-top: 1px solid #999; padding-top: 6px; margin-top: 8px; }
@media (max-width: 640px) {
  .ws-sheet { padding: 20px 16px; }
  .ws-id { grid-template-columns: 1fr; }
  .ws-top { flex-direction: column; }
  .ws-brand { text-align: left; }
  .ws-scroll { overflow-x: auto; }
  .ws-scroll .ws-table { min-width: 520px; }
}

/* scope */
.cr-scope { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--navy); border-radius: 0 12px 12px 0; padding: 18px 22px; }
.cr-scope p { margin: 0 0 10px; font-size: 15px; }
.cr-scope p:last-child { margin-bottom: 0; }

.cr-cta { position: relative; z-index: 1; margin: 46px 0 50px; padding: 26px 24px; border-radius: 14px; background: var(--navy); color: #fff; }
.cr-cta h2 { font-family: var(--font2); margin: 0 0 8px; font-size: 22px; }
.cr-cta p { margin: 0 0 14px; color: #dbe4ef; max-width: 640px; }
.cr-cta .cr-btn { border-color: #fff; background: transparent; color: #fff; }
.cr-cta .cr-btn:hover { background: rgba(255,255,255,0.1); }
.cr-cta .cr-btn-primary { background: var(--accent); border-color: var(--accent); }

@media (max-width: 640px) {
  .play-container { padding: 0 16px; }
  .cr-game, .cr-lesson { padding: 18px 16px 12px; }
}

/* ---------- print ----------
   Default print (Ctrl+P or "Print worksheet") = student worksheet only.
   body.print-teacher = the teacher guide without the worksheet. */
@page { size: A4; margin: 13mm 13mm 14mm; }
@media print {
  html, body.play-body { background: #fff !important; color: #000; font-size: 12pt; }
  .play-nav, .play-footer, .play-bg-fx, .cr-noprint, .cr-cta { display: none !important; }
  .play-container { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }

  /* worksheet mode */
  body:not(.print-teacher) .cr-teacher { display: none !important; }
  body:not(.print-teacher) .cr-section#worksheet { padding: 0; }
  body:not(.print-teacher) #worksheet .cr-sec-head,
  body:not(.print-teacher) #worksheet .ws-controls { display: none !important; }
  .ws-sheet { border: none; box-shadow: none; padding: 0; border-radius: 0; }
  .ws-part.is-off { display: none !important; }
  .ws-part { break-inside: avoid; }
  .ws-table, .ws-table tr { break-inside: avoid; }
  .ws-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ws-scroll { overflow: visible; }
  .ws-scroll .ws-table { min-width: 0; }

  /* teacher mode */
  body.print-teacher #worksheet { display: none !important; }
  body.print-teacher .cr-head { padding-top: 0; }
  body.print-teacher .cr-section { padding-top: 18px; }
  body.print-teacher .cr-game, body.print-teacher .cr-lesson, body.print-teacher .cr-option, body.print-teacher .cr-scope { border-color: #888; break-inside: auto; }
  body.print-teacher .cr-note { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
  body.print-teacher .cr-table-wrap { overflow: visible; border-color: #888; }
  body.print-teacher .cr-table { min-width: 0; font-size: 10pt; }
  body.print-teacher .cr-table tr { break-inside: avoid; }
  body.print-teacher h2, body.print-teacher h3, body.print-teacher h4 { break-after: avoid; }
}
