/* Math Cages */
.mc-help { margin-top: 14px; }
.mc-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.mc-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px; padding: 6px 2px; border-radius: 12px; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: inherit; font: 800 16px system-ui, sans-serif; cursor: pointer; }
.mc-item small { font-size: 10px; font-weight: 600; white-space: nowrap; }
.mc-item:hover { border-color: #67e8f9; }
.mc-item.is-done { border-color: rgba(74,222,128,.6); }
.mc-wrap { width: 100%; max-width: 560px; margin: 0 auto; align-self: stretch; box-sizing: border-box; }
.mc-hud { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font: 800 15px system-ui, sans-serif; }
.mc-title { flex: 1; min-width: 0; }
.mc-tb { display: flex; gap: 6px; flex-shrink: 0; }
.mc-tb button { background: rgba(15,23,42,.7); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 6px 10px; font: 700 14px system-ui, sans-serif; cursor: pointer; }
.mc-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 100%; max-width: min(100%, calc(100vh - 290px)); min-width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; background: #fffdf5; border: 3px solid #0f172a; border-radius: 6px; overflow: hidden; box-sizing: border-box; }
.mc-cell { position: relative; min-width: 0; padding: 0; border: 1px solid #cbd5e1; background: transparent; color: #0f172a; cursor: pointer; font-family: system-ui, sans-serif; }
.mc-cell.e-t { border-top: 3px solid #0f172a; }
.mc-cell.e-r { border-right: 3px solid #0f172a; }
.mc-cell.e-b { border-bottom: 3px solid #0f172a; }
.mc-cell.e-l { border-left: 3px solid #0f172a; }
.mc-cell.is-sel { background: #bae6fd; }
.mc-cell.is-badcage { background: #fee2e2; }
.mc-cell.is-sel.is-badcage { background: #fecaca; }
.mc-cell.is-flash { background: #fde047; }
.mc-cell:focus-visible { outline: 3px solid #0284c7; outline-offset: -3px; }
.mc-tag { position: absolute; left: 3px; top: 1px; font-size: clamp(10px, calc(16vw / var(--n)), 15px); font-weight: 800; line-height: 1.15; color: #1e293b; }
.mc-v { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10%; font-size: clamp(18px, calc(36vw / var(--n)), 34px); font-weight: 800; color: #1d4ed8; }
.mc-cell.is-clash .mc-v { color: #dc2626; }
.mc-notes { position: absolute; left: 3px; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; color: #64748b; text-align: right; letter-spacing: 1px; overflow: hidden; white-space: nowrap; }
.mc-grid.is-done .mc-v { color: #15803d; }
.mc-pad { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.mc-pad button { flex: 1 1 0; max-width: 64px; min-height: 50px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: inherit; font: 800 20px system-ui, sans-serif; cursor: pointer; }
.mc-pad button:hover { border-color: #67e8f9; }
.mc-pad.is-noting button { border-style: dashed; color: #fde047; }
.mc-msg { min-height: 22px; margin: 8px 0; text-align: center; font-weight: 700; color: #fde047; }
.mc-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mc-btns .btn { min-height: 44px; padding-left: 14px; padding-right: 14px; }
.mc-res { margin-top: 4px; padding: 10px; border-radius: 14px; background: rgba(15,23,42,.6); border: 1px solid rgba(255,255,255,.14); text-align: center; }
.mc-res h3 { margin: 0 0 4px; font-size: 22px; }
.mc-stars { font-size: 28px; letter-spacing: 3px; margin-bottom: 8px; }
@media (max-width: 560px) { .mc-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
