/* Player. Board look and colour tokens come from style.css; this file only lays out the player. */
body.player { padding-block: 0 32px; }
.p-top {
  max-width: 1100px; margin: 0 auto; padding-block: 18px 14px;
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
}
.p-brand { display: flex; flex-direction: column; gap: 2px; }
.p-wordmark { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.015em; }
.p-sub { color: var(--muted); font-size: 13.5px; }
.p-back { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; }
.p-back:hover { border-color: var(--faint); }
.p-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; flex: 1 1 14rem; min-width: 0; }
.p-level { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.p-pair { color: var(--muted); font-size: 14px; overflow-wrap: break-word; min-width: 0; }
.p-timer { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; margin-left: auto; }

main { max-width: 1100px; margin: 0 auto; }

/* Home */
.p-home { display: flex; flex-direction: column; gap: 14px; }
.p-home-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.p-progress { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.p-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.p-card { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.p-card-top { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.p-card-top svg { width: 96px; height: 96px; display: block; }
.p-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.p-card-pair { font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; }
.p-card-why { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: flex; flex-direction: column; gap: 4px; }
.p-card-why b { color: var(--ink); font-weight: 600; }
/* Cards in a row share a height; the levels sit at the bottom so they line up across the row. */
.p-lvs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: auto; }
.p-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.p-groups button {
  flex: 0 0 auto; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; cursor: pointer;
}
.p-groups button span { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; color: var(--muted); }
.p-groups button[aria-selected="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.p-groups button[aria-selected="true"] span { color: var(--panel); opacity: 0.75; }
.p-card-rules { font-size: 12.5px; color: var(--ink); opacity: 0.75; overflow-wrap: anywhere; }
.p-lv {
  border: 1px solid var(--rule); background: var(--panel-2); border-radius: 8px; padding: 7px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 13px; line-height: 1.25;
  border-top: 3px solid var(--lv, var(--rule));
}
.p-lv:hover:not(:disabled) { background: var(--panel); border-color: var(--ink); border-top-color: var(--lv); }
.p-lv b { font-weight: 600; }
.p-lv span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.p-lv.solved span { color: var(--good); }
.p-lv.started span { color: var(--pen); }
.p-lv:disabled { opacity: 0.45; cursor: not-allowed; }
.p-note { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.p-primary { background: var(--ink); color: var(--panel); border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 600; font-size: 14px; }

/* Play */
.p-play { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .p-play { grid-template-columns: minmax(0, 1fr); } }
.p-board-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.p-board-wrap { position: relative; width: 100%; max-width: 680px; margin: 0 auto; }
.p-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.p-side .keypad { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 52px; }
.p-side .keypad button { font-size: 22px; }
@media (max-width: 860px) { .p-side .keypad { grid-template-columns: repeat(9, 1fr); grid-auto-rows: 46px; } .p-side .keypad button { font-size: 19px; } }
.p-rules, .p-settings {
  background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 14px;
}
.p-rules summary, .p-settings summary { cursor: pointer; font-weight: 600; font-size: 14px; }
#rules-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; font-size: 14px; line-height: 1.5; max-width: 65ch; }
#rules-body p { margin: 0; }
#rules-body b { font-weight: 600; }
.p-settings { display: flex; flex-direction: column; gap: 6px; }
.p-settings[open] { padding-bottom: 12px; }
.p-settings label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin-top: 6px; }
.p-settings .link { align-self: flex-start; margin-top: 8px; color: var(--bad); }

.p-done {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center; max-width: 680px; margin: 0 auto; width: 100%;
}
.p-done-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--good); }
.p-done-time { margin: 0; color: var(--muted); font-family: var(--font-mono); }
.p-done-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.p-done-actions button:not(.p-primary) { border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 9px 14px; }
@media (prefers-reduced-motion: no-preference) {
  .p-done:not([hidden]) { animation: p-rise 320ms ease-out; }
  @keyframes p-rise { from { transform: translateY(6px); opacity: 0.4; } to { transform: none; opacity: 1; } }
}

/* Pen and shortcuts */
.p-side .modes button { font-size: 12.5px; padding: 6px 2px; }
.hint-box .hint-actions { display: flex; gap: 16px; align-items: baseline; }
.hint-box .link.quiet { color: var(--muted); }
#report-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
#report-form textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--rule); border-radius: 8px; padding: 8px; resize: none; width: 100%; box-sizing: border-box; }
#report-form button { align-self: flex-start; border: 1px solid var(--rule); background: var(--panel); border-radius: 8px; padding: 6px 14px; font-size: 13.5px; color: var(--ink); }
.report-msg { margin: 0; color: var(--ink); }
