/* Mini Crossword. Scoped to .mc. */
.mc { --line: #1c2b4a; --muted: #8aa3c4; --text: #dfe9ff; --accent: #55d6ff; --warm: #ffd166; --panel: #0b1328;
  --cell: #e9eef5; --ink: #0b1328; --sel: #ffd166; --word: #a9def2; --cross: #d6e9f3; --wrong: #e5484d; --rev: #2f7be0;
  --gs: 400px; --side: 360px;
  position: relative; max-width: 900px; margin: 0 auto; padding: 4px 0 12px; color: var(--text);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.mc [hidden] { display: none !important; }
.mc button { font-family: inherit; line-height: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mc :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-modes { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.mc-mode { border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13.5px; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: background-color .2s, color .2s; min-height: 34px; }
.mc-mode:hover { color: #fff; }
.mc-mode.is-on { background: #e8edf2; color: var(--ink); }
.mc-icons { display: flex; gap: 2px; }
.mc-ibtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: #c9d7ef; cursor: pointer; transition: background-color .2s, color .2s; }
.mc-ibtn:hover { background: rgba(255,255,255,0.07); color: #fff; }
.mc-ibtn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin: 6px 2px 8px; font-size: 13.5px; color: var(--muted); }
.mc-meta-main { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-meta-main b { color: #fff; font-weight: 700; }
.mc-link { border: 0; background: transparent; color: var(--accent); font-weight: 650; font-size: 13.5px; cursor: pointer; padding: 6px 6px 6px 2px; border-radius: 6px; }
.mc-link:hover { text-decoration: underline; }
.mc-timer { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.mc-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: #fff; min-width: 40px; text-align: right; }
.mc-pause { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #c9d7ef; cursor: pointer; display: grid; place-items: center; }
.mc-pause:hover { background: rgba(255,255,255,0.07); color: #fff; }
.mc-pause svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* ---------- layout ---------- */
.mc-play { display: flex; flex-direction: column; align-items: center; }
.mc-main { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.mc-left { display: flex; flex-direction: column; align-items: stretch; width: var(--gs); max-width: 100%; }
.mc.mc-wide .mc-main { flex-direction: row; align-items: stretch; justify-content: center; gap: 22px; }
.mc.mc-wide .mc-clues { display: grid; }
.mc-clues { display: none; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1 1 0; min-width: 0; max-width: 460px; height: var(--clh, auto); }

/* ---------- grid ---------- */
.mc-gridwrap { position: relative; width: var(--gs); max-width: 100%; }
.mc-grid { --n: 5; display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 2px; aspect-ratio: 1; width: 100%;
  background: #2b3f63; border: 2px solid #3d5a7a; border-radius: 10px; overflow: hidden; touch-action: none; cursor: pointer; container-type: inline-size; outline: none; }
.mc-grid:focus-visible { box-shadow: 0 0 0 3px rgba(85,214,255,0.55); }
.mc-cell { position: relative; background: var(--cell); min-width: 0; min-height: 0; transition: background-color .12s ease; }
.mc-cell.is-black { background: #0a1122; cursor: default; }
.mc-cell.is-word { background: var(--word); }
.mc-cell.is-sel { background: var(--sel); }
.mc-num { position: absolute; left: 4%; top: 2%; font-size: 3.6cqw; font-weight: 700; color: #2c3d5a; line-height: 1.1; pointer-events: none; }
.mc-let { position: absolute; inset: 14% 0 0 0; display: grid; place-items: center; font-size: 11.5cqw; font-weight: 750; color: var(--ink); line-height: 1; text-transform: uppercase; pointer-events: none; }
.mc-cell.is-pen .mc-let { color: #7a879c; font-weight: 500; font-style: italic; }
.mc-cell.is-wrong .mc-let { color: var(--wrong); }
.mc-cell.is-wrong::after { content: ''; position: absolute; left: 50%; top: -12%; width: 2.5px; height: 124%; background: var(--wrong); transform: rotate(45deg); opacity: 0.85; pointer-events: none; }
.mc-cell.is-rev::before { content: ''; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 13% 13% 0; border-width: 0 2.8cqw 2.8cqw 0; border-color: transparent var(--rev) transparent transparent; pointer-events: none; }
.mc-cell.is-rev .mc-let { color: var(--rev); }
.mc-grid.is-done { cursor: default; }
.mc-cell.is-solved { background: #dff4e8; }
.mc-cell.is-revealed-all { background: #e3e8ef; }
.mc-cell.pop .mc-let { animation: mc-pop .16s ease-out; }
.mc-cell.wave { animation: mc-wave .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes mc-pop { from { transform: scale(1.25); } }
@keyframes mc-wave { 0% { background: var(--cell); } 35% { background: var(--warm); transform: scale(1.06); } 100% { background: #dff4e8; transform: none; } }

.mc-paused { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(6,11,24,0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); z-index: 4; animation: mc-fade .2s ease; }
.mc-paused-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; }
.mc-paused-box b { font-size: 22px; color: #fff; }
.mc-paused-box span { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.mc.is-paused .mc-bar-text, .mc.is-paused .mc-clues .mc-ci-b span { filter: blur(6px); }

.mc-toast { position: absolute; left: 50%; top: 10px; transform: translate(-50%, -6px); background: #f4f7fb; color: var(--ink); font-weight: 750; font-size: 14px; padding: 9px 16px; border-radius: 999px; pointer-events: none; opacity: 0; z-index: 6; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.mc-toast.show { animation: mc-toast 1.7s ease forwards; }
@keyframes mc-toast { 0% { opacity: 0; transform: translate(-50%, -6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -4px); } }

/* ---------- clue bar ---------- */
.mc-bar { display: flex; align-items: stretch; gap: 0; margin-top: 10px; min-height: 56px; border-radius: 12px; background: #13213f; border: 1px solid #22345a; overflow: hidden; }
.mc-bar-arrow { flex: none; width: 44px; border: 0; background: transparent; color: #c9d7ef; cursor: pointer; display: grid; place-items: center; transition: background-color .15s; }
.mc-bar-arrow:hover { background: rgba(255,255,255,0.06); color: #fff; }
.mc-bar-arrow:active { background: rgba(255,255,255,0.1); }
.mc-bar-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mc-bar-clue { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px 4px; text-align: left; font-size: 15.5px; line-height: 1.3; }
.mc-bar-num { flex: none; font-size: 13px; font-weight: 800; color: var(--ink); background: var(--word); border-radius: 6px; padding: 2px 6px; min-width: 32px; text-align: center; }
.mc-bar-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-bar.is-done { opacity: 0.6; }

/* ---------- tools ---------- */
.mc-tools { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.mc-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 650; font-size: 13.5px; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
@media (hover: hover) { .mc-tool:hover { border-color: #3d5a7a; } }
.mc-tool:active { transform: translateY(1px); }
.mc-tool svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mc-tool.is-on { background: #ffd166; border-color: #ffd166; color: #1a1200; }
.mc-tool.is-open { border-color: var(--accent); }
.mc-menu { position: absolute; top: calc(100% + 6px); z-index: 20; min-width: 150px; padding: 6px; border-radius: 12px; background: #13213f; border: 1px solid #2b4470; box-shadow: 0 14px 40px rgba(0,0,0,0.55); display: grid; gap: 2px; animation: mc-fade .14s ease; }
.mc-menu.up { top: auto; bottom: calc(100% + 6px); }
.mc-mi { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 14.5px; font-weight: 600; text-align: left; cursor: pointer; }
.mc-mi:hover, .mc-mi:focus-visible { background: rgba(85,214,255,0.12); color: #fff; }
.mc-mi-auto { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 2px; font-weight: 500; color: var(--muted); }
.mc-mi-auto input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.mc-done { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mc-done-text { font-size: 14.5px; color: var(--muted); } .mc-done-text b { color: #fff; }
.mc-star { font-style: normal; color: var(--warm); }
.mc-done .mc-btn { min-height: 40px; padding: 0 16px; min-width: 0; }

/* ---------- buttons ---------- */
.mc-btn { min-height: 46px; min-width: 104px; padding: 0 20px; border-radius: 999px; border: 1px solid #2a3b5f; background: transparent; color: var(--text); font-weight: 700; font-size: 14.5px; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .12s; }
@media (hover: hover) { .mc-btn:hover { border-color: #5b7099; background: rgba(255,255,255,0.03); } }
.mc-btn:active { transform: scale(0.97); }
.mc-btn-primary { background: #ffd166; color: #1a1200; border-color: #ffd166; }
@media (hover: hover) { .mc-btn-primary:hover { background: #ffe08a; border-color: #ffe08a; } }
.mc-btn-danger { background: #e5484d; border-color: #e5484d; color: #fff; }
@media (hover: hover) { .mc-btn-danger:hover { background: #f05a5f; border-color: #f05a5f; } }
.mc-btn-sm { min-height: 38px; min-width: 0; padding: 0 16px; font-size: 13.5px; }

/* ---------- clue lists ---------- */
.mc-cl { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mc-cl-h { margin: 0; padding: 10px 14px 8px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 750; border-bottom: 1px solid var(--line); }
.mc-cl-list { list-style: none; margin: 0; padding: 4px; overflow: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; position: relative; }
.mc-ci-b { display: flex; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; border-left: 3px solid transparent; background: transparent; color: var(--text); font-size: 14.5px; line-height: 1.35; text-align: left; cursor: pointer; transition: background-color .15s, color .15s, opacity .15s; }
.mc-ci-b b { flex: none; min-width: 16px; color: #fff; font-weight: 800; }
@media (hover: hover) { .mc-ci-b:hover { background: rgba(255,255,255,0.04); } }
.mc-ci.is-full .mc-ci-b { opacity: 0.45; }
.mc-ci.is-cross .mc-ci-b { border-left-color: var(--word); }
.mc-ci.is-on .mc-ci-b { background: var(--word); color: var(--ink); opacity: 1; border-left-color: var(--word); }
.mc-ci.is-on .mc-ci-b b { color: var(--ink); }

/* ---------- on-screen keyboard ---------- */
.mc-kb { width: 100%; max-width: 560px; margin-top: 10px; display: grid; gap: 7px; touch-action: none; }
.mc-kb-row { display: flex; justify-content: center; gap: 5px; }
.mc-key { flex: 1 1 0; max-width: 52px; min-width: 0; height: var(--kh, 50px); padding: 0; border: 0; border-radius: 8px; background: #2a3a5c; color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; display: grid; place-items: center; touch-action: none; transition: background-color .08s; }
.mc-key-wide { flex: 1.5 1 0; max-width: 78px; background: #1c2b4a; }
.mc-key svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mc-key.is-down { background: #4a6290; }
.mc-kb-row:nth-child(2) { padding: 0 4.5%; }

/* ---------- archive & practice lists ---------- */
.mc-list { padding: 0 0 6px; }
.mc-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; color: var(--muted); font-size: 14px; }
.mc-h4 { margin: 14px 0 10px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mc-list > .mc-h4:first-child { margin-top: 4px; }
.mc-arch { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.mc-day { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s; }
@media (hover: hover) { .mc-day:hover { border-color: #3d5a7a; transform: translateY(-1px); } }
.mc-day-t { display: grid; gap: 2px; min-width: 0; }
.mc-day-n { font-weight: 750; font-size: 14.5px; color: #fff; }
.mc-day-d, .mc-day-s { font-size: 12.5px; color: var(--muted); }
.mc-day-s i { font-style: normal; margin-right: 4px; }
.mc-day.solved .mc-day-s, .mc-day.clean .mc-day-s { color: #2ec27e; }
.mc-day.clean .mc-day-s i { color: var(--warm); }
.mc-day.wip .mc-day-s { color: var(--accent); }
.mc-thumb { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; width: 36px; height: 36px; padding: 1px; border-radius: 5px; background: #2b3f63; }
.mc-thumb i { background: #c9d7e6; border-radius: 1px; }
.mc-thumb i.b { background: #0a1122; }
.mc-day.solved .mc-thumb i:not(.b), .mc-day.clean .mc-thumb i:not(.b) { background: #9fe0bd; }
.mc-day.wip .mc-thumb i:not(.b) { background: #a9def2; }

/* ---------- sheets ---------- */
.mc-scrim { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(2,4,10,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: mc-fade .2s ease; }
.mc-scrim.out { animation: mc-fade .17s ease reverse forwards; }
.mc-sheet { position: relative; width: 100%; max-width: 440px; max-height: min(86vh, 720px); overflow: auto; overscroll-behavior: contain; background: #0d1630; border: 1px solid #22345a; border-radius: 20px; padding: 22px 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); color: var(--text); animation: mc-sheet .26s cubic-bezier(.2,.8,.2,1); user-select: text; -webkit-user-select: text; }
.mc-scrim.out .mc-sheet { animation: mc-sheet .17s ease reverse forwards; }
.mc-sheet:focus { outline: none; }
.mc-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.08); color: #c9d7ef; font-size: 20px; line-height: 1; cursor: pointer; }
.mc-x:hover { background: rgba(255,255,255,0.14); color: #fff; }
.mc-sheet-title { margin: 0 40px 4px 0; font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.mc-sub { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.mc-sub2 { margin-top: 4px; color: var(--text); }
.mc-h4 + .mc-spark { margin-top: 0; }
.mc-fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 14px 0 0; }
.mc-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.mc-sheet-actions .mc-btn { flex: 1 1 0; min-width: 0; }
.mc-sheet-results .mc-sheet-actions .mc-btn-primary { flex-basis: 100%; }
.mc-res-top { display: flex; gap: 16px; align-items: center; }
.mc-res-time { flex: none; width: 92px; height: 92px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 25%, #ffe08a, #ffd166 60%, #e9b443); color: #1a1200; box-shadow: 0 8px 26px rgba(255,209,102,0.25); animation: mc-medal .5s cubic-bezier(.2,.9,.3,1.2); }
.mc-res-time b { font-size: 24px; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mc-res-time span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.mc-res-time.lost { background: #1c2b4a; color: var(--muted); box-shadow: none; }
.mc-res-stats, .mc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; margin-top: 18px; text-align: center; }
.mc-res-stats div, .mc-stats div { display: flex; flex-direction: column; gap: 2px; }
.mc-res-stats b, .mc-stats b { font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.mc-res-stats span, .mc-stats span { font-size: 11.5px; color: var(--muted); }
.mc-nextday { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.mc-nextday b { color: #fff; font-variant-numeric: tabular-nums; }
.mc-copy { width: 100%; margin-top: 10px; border-radius: 10px; border: 1px solid var(--line); background: #060b18; color: var(--text); padding: 10px; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; resize: none; }
.mc-spark { display: flex; align-items: flex-end; gap: 5px; height: 90px; padding: 0 2px; }
.mc-spark i { flex: 1 1 0; height: var(--h); min-height: 18px; border-radius: 5px 5px 2px 2px; background: #2ec27e; position: relative; display: flex; justify-content: center; }
.mc-spark i b { position: absolute; top: 3px; font-size: 9.5px; color: #02190d; font-weight: 800; writing-mode: vertical-rl; transform: rotate(180deg); }
.mc-spark i:last-child { background: var(--warm); }
.mc-help { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 9px; }
.mc-help li { font-size: 14px; line-height: 1.5; color: var(--text); }
.mc-set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mc-set span { display: grid; gap: 3px; } .mc-set b { font-size: 15px; color: #fff; } .mc-set small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.mc-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mc-sw { flex: none; width: 46px; height: 28px; border-radius: 14px; background: #2b3448; position: relative; transition: background-color .2s; }
.mc-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.2,.8,.2,1); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.mc-set input:checked + .mc-sw { background: #2ec27e; } .mc-set input:checked + .mc-sw::after { transform: translateX(18px); }
.mc-set input:focus-visible + .mc-sw { outline: 2px solid var(--accent); outline-offset: 2px; }

@keyframes mc-fade { from { opacity: 0; } }
@keyframes mc-sheet { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes mc-medal { from { transform: scale(0.6); opacity: 0; } }
@keyframes mc-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .mc *, .mc-scrim, .mc-sheet { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- phones ---------- */
@media (max-width: 560px) {
  .mc-mode { padding: 7px 11px; font-size: 13px; }
  .mc-ibtn { width: 38px; height: 38px; }
  .mc-tool span { font-size: 13px; }
  .mc-scrim { align-items: flex-end; padding: 0; }
  .mc-sheet { max-width: none; border-radius: 22px 22px 0 0; max-height: 88vh; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); animation-name: mc-up; border-bottom: 0; }
  .mc-scrim.out .mc-sheet { animation-name: mc-up; }
}
@media (max-width: 380px) {
  .mc-mode { padding: 7px 8px; font-size: 12.5px; }
  .mc-icons { gap: 0; } .mc-ibtn { width: 34px; }
  .mc-tool { gap: 4px; padding: 0 2px; } .mc-tool svg { display: none; }
  .mc-meta-date { display: none; }
  .mc-res-stats b, .mc-stats b { font-size: 19px; }
}
@media (max-width: 340px) { .mc-stats { grid-template-columns: repeat(3, 1fr); } }

/* ---------- full screen (.mc-fit, set by game.js inside the site's immersive stage) ---------- */
.mc.mc-fit { max-width: none; width: 100%; height: 100%; margin: 0; padding: 6px 6px 8px; display: flex; flex-direction: column; overflow: hidden; }
.mc-fit .mc-head, .mc-fit .mc-meta { flex: none; width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.mc-fit .mc-meta { margin-top: 2px; margin-bottom: 4px; min-height: 32px; }
.mc-fit .mc-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; width: 100%; max-width: 900px; margin: 0 auto; }
.mc-fit .mc-play { flex: 1 1 auto; min-height: 0; justify-content: center; }
.mc-fit .mc-main { flex: none; }
.mc-fit .mc-bar { margin-top: 6px; }
.mc-fit .mc-tools, .mc-fit .mc-done { margin-top: 6px; }
.mc-fit .mc-kb { margin-top: 6px; flex: none; }
/* portrait: one centred column; the clue bar stands in for the lists */
.mc-port .mc-clues { display: none; }
.mc-port .mc-kb { --kh: clamp(42px, 6.2vh, 56px); }
/* landscape: grid on the left; tabs, clue bar, tools, clue lists and keyboard in a column beside it */
.mc.mc-land { display: grid; grid-template-columns: var(--gs) var(--side); grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; column-gap: 16px; justify-content: center; }
.mc-land .mc-play, .mc-land .mc-main, .mc-land .mc-left { display: contents; }
.mc-land .mc-head, .mc-land .mc-meta { grid-column: 2; max-width: none; margin-left: 0; margin-right: 0; }
.mc-land .mc-head { grid-row: 1; } .mc-land .mc-meta { grid-row: 2; }
.mc-land .mc-gridwrap { grid-column: 1; grid-row: 1 / -1; align-self: center; }
.mc-land .mc-bar, .mc-land .mc-tools, .mc-land .mc-done, .mc-land .mc-clues, .mc-land .mc-kb { grid-column: 2; }
.mc-land .mc-bar { grid-row: 3; margin-top: 0; }
.mc-land .mc-tools, .mc-land .mc-done { grid-row: 4; }
.mc-land .mc-clues { grid-row: 5; display: grid; max-width: none; height: auto; min-height: 0; margin-top: 8px; }
.mc-land .mc-kb { grid-row: 6; max-width: none; --kh: clamp(34px, 11vh, 50px); gap: 5px; }
.mc.mc-land.is-listing { display: flex; }
@media (max-height: 500px) {
  .mc-land .mc-meta { min-height: 28px; margin: 0 0 2px; }
  .mc-land .mc-mode { min-height: 30px; padding: 4px 10px; }
  .mc-land .mc-ibtn { width: 34px; height: 34px; }
  .mc-land .mc-bar { min-height: 46px; }
  .mc-land .mc-bar-clue { font-size: 14.5px; }
  .mc-land .mc-tool { min-height: 36px; }
  .mc-land .mc-tool svg { display: none; }
  .mc-land .mc-kb { margin-top: 6px; }
  .mc-land:has(.mc-kb:not([hidden])) .mc-clues { display: none; }
}
.mc .mc-grid:focus-visible { outline: none; }
@media (pointer: coarse) { .mc-grid:focus-visible { box-shadow: none; } }
.mc-port .mc-head, .mc-port .mc-meta { max-width: max(var(--gs), 340px); }
/* narrow window without a touch screen: clue lists stack under the grid */
@media not all and (pointer: coarse) {
  .mc:not(.mc-wide):not(.mc-fit) .mc-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); width: var(--gs); max-width: 100%; flex: none; height: auto; }
  .mc:not(.mc-wide):not(.mc-fit) .mc-cl-list { max-height: 260px; }
}
/* touch: every control is at least 40px tall/wide */
@media (pointer: coarse) {
  .mc .mc-mode { min-height: 40px; }
  .mc .mc-ibtn, .mc .mc-pause { width: 40px; height: 40px; }
  .mc .mc-tool { min-height: 40px; }
  .mc .mc-x { width: 40px; height: 40px; top: 10px; right: 10px; }
  .mc .mc-bar-arrow { width: 44px; }
}
/* short landscape screens: compact sheets so the actions fit without scrolling */
@media (max-height: 500px) and (min-width: 561px) {
  .mc-sheet { max-height: 94vh; padding: 16px 18px 14px; }
  .mc-res-time { width: 72px; height: 72px; } .mc-res-time b { font-size: 19px; } .mc-res-time span { font-size: 9px; }
  .mc-res-stats, .mc-stats { margin-top: 10px; gap: 8px 6px; } .mc-res-stats b, .mc-stats b { font-size: 18px; }
  .mc-sheet-actions { margin-top: 12px; }
  .mc-btn { min-height: 42px; }
  .mc-nextday { margin-top: 8px; }
  .mc-set { padding: 9px 0; }
  .mc-fine { margin-top: 8px; }
  .mc-spark { height: 64px; }
}
