/* Oficina Criativa — cor da área: #e8590c */
:root { --oficina: #e8590c; --oficina-d: #b8430a; --oficina-bg: #fff1e6; }
body { background: var(--cream); }
.of-wrap { max-width: 1000px; margin: 0 auto; padding: clamp(14px, 3vw, 28px) max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left)); }
.of-h1 { margin: 0 0 6px; font-size: clamp(28px, 5vw, 42px); line-height: 1.05; color: var(--navy); letter-spacing: -.02em; }
.of-lead { margin: 0; font-size: 18px; color: var(--ink); }
.of-intro { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.of-intro img { flex: none; width: 96px; height: auto; }

/* ----- Índice de atividades ----- */
.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.of-card { display: flex; flex-direction: column; background: #fff; border: 3px solid var(--navy); border-radius: 18px; box-shadow: 0 5px 0 var(--navy); overflow: hidden; }
.of-card__thumb { background: #fff; border-bottom: 3px solid var(--navy); padding: 10px; height: 200px; display: flex; align-items: center; justify-content: center; }
.of-card__thumb svg { max-height: 100%; width: auto; max-width: 100%; }
.of-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.of-card__tag { align-self: flex-start; background: var(--oficina-bg); color: var(--oficina-d); border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 13px; }
.of-card h3 { margin: 0; font-size: 20px; color: var(--navy); line-height: 1.15; }
.of-card p { margin: 0; font-size: 16px; color: var(--ink-soft); flex: 1; }
.of-card__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.of-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 8px 16px; border: 3px solid var(--navy); border-radius: 14px; background: var(--oficina); color: #fff; font-weight: 900; font-size: 16px; line-height: 1.1; text-decoration: none; box-shadow: 0 4px 0 var(--navy); }
.of-btn:hover { background: #f06a1f; }
.of-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.of-btn--alt { background: #fff; color: var(--navy); }
.of-btn--alt:hover { background: var(--oficina-bg); }
.of-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.of-btn[disabled] { opacity: .5; cursor: not-allowed; }
.of-note { margin-top: 22px; padding: 14px 18px; background: var(--oficina-bg); border: 2px dashed var(--oficina); border-radius: 14px; font-size: 16px; }

/* ----- Visão de uma atividade ----- */
.view { margin-top: 4px; }
.view__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.view__tools .push { margin-left: auto; }
.view__instr { margin: 0 0 14px; padding: 12px 16px; background: #fff; border: 3px solid var(--navy); border-radius: 14px; font-size: 17px; }
.view__instr ol { margin: 6px 0 0 20px; padding: 0; }
.view__controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.view__controls label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 16px; font-weight: 700; }
.view__controls input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--oficina); }
.of-live { min-height: 28px; margin: 0 0 10px; font-weight: 800; color: var(--navy); font-size: 17px; }
.sheet { background: #fff; border: 3px solid var(--navy); border-radius: 16px; box-shadow: 0 5px 0 var(--navy); padding: clamp(10px, 3vw, 24px); }
.sheet__title { margin: 0 0 10px; font-size: 22px; color: var(--navy); }
.sheet__title:focus { outline: none; }
.sheet__title:focus-visible { outline: 4px solid var(--blue); }
.sheet__art { display: flex; justify-content: center; }
.sheet__art > svg { width: 100%; max-width: 760px; height: auto; }
.sheet__hint { margin: 10px 0 0; font-size: 16px; color: var(--ink-soft); text-align: center; }
.print-head, .print-foot { display: none; }
.answers { display: none; margin-top: 22px; }
.resp-tela .answers { display: block; }
.answers h3 { margin: 0 0 6px; color: var(--navy); }
.answers ul { margin: 6px 0 12px 20px; padding: 0; }

/* ----- Desenhos ----- */
svg.desenho, svg.labirinto { background: #fff; display: block; }
.area { fill: #fff; stroke: #111; stroke-width: 5; stroke-linejoin: round; }
.ln { fill: none; stroke: #111; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pt { fill: #111; stroke: none; pointer-events: none; }
.txt { font: 800 15px "Trebuchet MS", Verdana, sans-serif; fill: #111; pointer-events: none; }
svg.pares .txt { font-size: 21px; }
.num { font: 800 21px "Trebuchet MS", Verdana, sans-serif; fill: #111; }
.col { font: 900 26px "Trebuchet MS", Verdana, sans-serif; fill: #e8590c; }
.colorir .area { cursor: pointer; }
.colorir .area:hover { stroke-width: 6.5; }
.colorir .area:focus { outline: none; }
.colorir .area:focus-visible { stroke: #0957d8; stroke-width: 9; }
.colorir svg { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
svg.desenho, .parede, .sol, .area { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

/* Labirinto */
.parede { fill: none; stroke: #111; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.sol { display: none; fill: none; stroke: #e8590c; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: .85; stroke-dasharray: 1 14; }
.sol-on .sol { display: inline; }
.ln-fill { fill: #fff; stroke: #111; stroke-width: 4; stroke-linejoin: round; }
.ln-fill.cinza { fill: #d6dde6; }
.ln-thin { fill: none; stroke: #111; stroke-width: 3; stroke-linecap: round; }
.sol { stroke-dasharray: none; stroke-width: 8; }

/* Ligar os pontos */
.gabarito { display: none; fill: none; stroke: #e8590c; stroke-width: 4; stroke-dasharray: 10 8; stroke-linejoin: round; }
.mostra-gab .gabarito { display: inline; }
.pt.inicio { fill: #e8590c; }

/* Ligar os pares */
.caixa { fill: #fff; stroke: #111; stroke-width: 5; }
.conector { fill: #fff; stroke: #111; stroke-width: 4; }
.ligacao { stroke: #e8590c; stroke-width: 7; stroke-linecap: round; }
.par-item { cursor: pointer; }
.par-item:focus { outline: none; }
.par-item:focus-visible .caixa { stroke: #0957d8; stroke-width: 9; }
.par-item.sel .caixa { fill: #fff1e6; stroke: #e8590c; stroke-width: 8; }
.par-item.feito .caixa { fill: #e6f6ea; }
.par-item.feito .conector { fill: #e8590c; }

/* ----- Paleta ----- */
.paleta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.cor { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 66px; min-height: 66px; padding: 6px 6px 4px; background: #fff; border: 3px solid var(--navy); border-radius: 14px; color: var(--navy); font-size: 13px; font-weight: 800; line-height: 1.1; }
.cor i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #111; }
.cor[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px var(--yellow); }
.cor:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

@media (max-width: 520px) {
  .of-intro img { width: 72px; }
  .view__tools .push { margin-left: 0; }
  .cor { min-width: 60px; min-height: 60px; }
}

/* ============ IMPRESSÃO: só a folha da atividade aberta, A4 retrato ============ */
@page { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { background: #fff !important; margin: 0; padding: 0; color: #000; }
  .m-bar, .m-toast, .skip-link, .no-print, .of-intro, .of-grid, .of-note, #indice, .view__tools, .view__instr, .view__controls, .of-live, .sheet__hint-screen { display: none !important; }
  .view[hidden] { display: none !important; }
  .of-wrap { max-width: none; padding: 0; }
  .view { margin: 0; }
  .sheet { border: 0; box-shadow: none; border-radius: 0; padding: 0; break-inside: avoid; page-break-inside: avoid; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10mm; font-size: 10pt; color: #000; border-bottom: 1px solid #000; padding-bottom: 2mm; margin-bottom: 3mm; }
  .print-head b { font-weight: 800; }
  .sheet__title { font-size: 15pt; margin: 0 0 3mm; color: #000; }
  .sheet__art { display: block; }
  .sheet__art > svg { width: 100%; max-width: none; max-height: 205mm; margin: 0 auto; }
  .sheet__hint { font-size: 10.5pt; color: #000; margin: 3mm 0 0; }
  .print-foot { display: block; margin-top: 3mm; padding-top: 2mm; border-top: 1px solid #999; font-size: 8pt; color: #444; text-align: center; }
  .sheet .sol, .sheet .gabarito { display: none !important; }
  .sheet .parede { stroke-width: 7; }
  .sheet .par-item.sel .caixa, .sheet .par-item.feito .caixa { fill: #fff; stroke: #111; stroke-width: 5; }
  .sheet .par-item.feito .conector { fill: #fff; }
  .colorir .area:hover { stroke-width: 5; }
  .answers, .resp-tela .answers { display: none !important; }
  .resp-imp .answers { display: block !important; break-before: page; page-break-before: always; margin: 0; }
  .answers .sol { display: inline !important; }
  .answers h3 { font-size: 15pt; color: #000; }
}

.view__controls label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
