/* Playable samples on the website. Uses the tokens from style.css (navy, copper, cream, serif, rounded). */

.wrap-play { max-width: 760px; }
nav a[aria-current="page"] { color: var(--navy); font-weight: 600; }

.pg-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 8px; }
.pg-tab {
  font-family: var(--rounded); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  color: var(--navy); background: var(--card); border: 1px solid var(--rule); border-radius: 999px;
  padding: 8px 16px; min-height: 40px; display: inline-flex; align-items: center;
}
.pg-tab:hover { border-color: var(--navy); }
.pg-tab[aria-current="true"] { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.pg-tab:focus-visible, .pg-btn:focus-visible, .pg-store:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

.pg-title { font-family: var(--serif); font-size: 28px; color: var(--navy); margin: 22px 0 0; }
.pg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }
.pg-label { font-family: var(--rounded); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.pg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pg-btn {
  font: inherit; font-size: 15px; font-weight: 600; font-family: var(--rounded);
  color: var(--navy); background: var(--card); border: 1px solid var(--rule); border-radius: 999px;
  padding: 9px 18px; min-height: 44px; cursor: pointer;
}
.pg-btn:hover { border-color: var(--navy); }
.pg-btn:active { transform: scale(0.96); }
.pg-btn-primary { background: var(--copper); border-color: var(--copper); color: var(--navy); }
.pg-btn.is-on { background: var(--navy); color: var(--cream); border-color: var(--navy); }
.pg-note { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; }

.pg-host { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: 0 1px 3px rgba(10, 47, 82, 0.06); }
.pg-status { min-height: 1.5em; text-align: center; color: var(--ink-soft); font-size: 15px; margin: 8px 0 0; }
.pg-hint { color: var(--ink-soft); font-size: 14px; text-align: center; margin: 0; }

/* Shared grid look */
.pg-svg { width: 100%; max-width: 420px; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; display: block; }
.pg-grid { display: grid; gap: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.pg-cell { appearance: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; color: var(--navy); }
.pg-cell:focus-visible { outline: 3px solid var(--copper); outline-offset: -3px; z-index: 2; }

/* Regions */
.rg-grid { width: min(100%, 372px); }
.rg-cell { aspect-ratio: 1; border: 1px solid rgba(10, 47, 82, 0.25); font-size: 26px; color: var(--navy); }
.rg-cell.is-bad { color: var(--warning); background-image: linear-gradient(rgba(163, 58, 40, 0.22), rgba(163, 58, 40, 0.22)); }
.rg-mark { width: 46%; height: 46%; background: currentColor; transform: rotate(45deg); border-radius: 3px; }

/* Balance */
.bl-grid { gap: 8px; width: min(100%, 372px); }
.bl-cell { aspect-ratio: 1; background: #fbfaf6; border: 1px solid var(--rule); border-radius: 8px; }
.bl-cell.is-given { background: #ece8dc; cursor: default; }
.bl-cell.is-bad { box-shadow: inset 0 0 0 3px rgba(163, 58, 40, 0.65); }
.bl-circle { width: 56%; height: 56%; border-radius: 50%; background: var(--navy); }
.bl-square { width: 52%; height: 52%; border-radius: 6px; background: var(--copper); }
.bl-sign { position: absolute; z-index: 1; font-family: var(--rounded); font-weight: 700; font-size: 17px; line-height: 1; color: var(--navy); background: var(--card); border: 1px solid var(--rule); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bl-sign.h { right: -16px; top: 50%; transform: translateY(-50%); }
.bl-sign.v { bottom: -16px; left: 50%; transform: translateX(-50%); }
.bl-sign.is-bad { color: var(--warning); border-color: var(--warning); }

/* Numbers */
.nb-grid { width: min(100%, 372px); border: 2px solid var(--navy); }
.nb-cell { aspect-ratio: 1; border: 1px solid var(--rule); font-family: var(--serif); font-weight: 700; font-size: 26px; background: #fbfaf6; }
.nb-cell.is-given { background: #ece8dc; cursor: default; }
.nb-cell.is-sel { background: rgba(193, 121, 59, 0.2); }
.nb-cell.is-bad { color: var(--warning); background: rgba(163, 58, 40, 0.14); }
.nb-cell.thick-r { border-right: 2px solid var(--navy); }
.nb-cell.thick-b { border-bottom: 2px solid var(--navy); }
.nb-cell.is-mine { color: var(--copper); }
.nb-keys { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nb-key { min-width: 48px; }

/* Mosaic */
.mz-wrap { display: grid; gap: 0; width: min(100%, 420px); touch-action: none; user-select: none; -webkit-user-select: none; }
.mz-clue { font-family: var(--rounded); font-size: 12px; line-height: 1.15; color: var(--navy); display: flex; justify-content: center; text-align: center; }
.mz-clue.col { flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 4px; }
.mz-clue.row { align-items: center; justify-content: flex-end; gap: 4px; padding-right: 6px; }
.mz-clue.is-done { opacity: 0.35; }
.mz-clue.is-bad { color: var(--warning); }
.mz-cell { aspect-ratio: 1; border: 1px solid var(--rule); background: #fbfaf6; }
.mz-cell.is-fill { background: var(--navy); }
.mz-cell.is-cross::after { content: '\00d7'; color: #9aa3ad; font-size: 16px; line-height: 1; }
.mz-cell.edge-r { border-right: 2px solid rgba(10, 47, 82, 0.5); }
.mz-cell.edge-b { border-bottom: 2px solid rgba(10, 47, 82, 0.5); }
.mz-modes { display: flex; gap: 8px; }

/* Result + rules */
.pg-result { margin-top: 20px; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 24px 22px; text-align: center; }
.pg-rule { width: 44px; height: 2px; background: var(--copper); margin: 0 auto 14px; }
.pg-solved { font-family: var(--serif); font-weight: 700; font-size: 28px; color: var(--navy); margin: 0 0 6px; }
.pg-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.pg-cta { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 16px; }
.pg-cta p { margin: 0 0 12px; }
.pg-cta-title { font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--navy); }
.pg-store { display: inline-block; background: var(--navy); color: var(--cream); text-decoration: none; font-weight: 600; padding: 13px 26px; border-radius: 999px; min-height: 44px; }
.pg-store:hover { background: var(--navy-lift); }
.pg-fine { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0 !important; }
.pg-rules { margin-top: 26px; }
.pg-rules h2 { font-family: var(--serif); font-size: 20px; color: var(--navy); margin: 0 0 8px; }
.pg-rules ol { margin: 0; padding-left: 22px; }
.pg-rules li { margin: 6px 0; }
[hidden] { display: none !important; }
@media (max-width: 480px) { .pg-tab { padding: 7px 13px; font-size: 14px; } .pg-title { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .pg-btn:active { transform: none; } }
