.ms { max-width: 520px; margin: 0 auto; padding-bottom: 60px; --gold: #D4AF7C; --ok: #538d4e; }
.ms-top { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; margin-bottom: 8px; }
.ms .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.ms .ms-levels { justify-content: center; margin: 4px 0 6px; }
.ms .chip { font-family: inherit; }
.ms .chip[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ms-sub { color: var(--muted); text-align: center; font-size: .95rem; margin: 8px 0 8px; min-height: 1.4em; }
.ms-bar { display: flex; justify-content: space-between; max-width: 400px; margin: 0 auto 6px; color: var(--muted); font-size: .95rem; }
.ms-timer { font-variant-numeric: tabular-nums; font-weight: 600; }
.ms-toast { min-height: 34px; text-align: center; padding-top: 2px; }
.ms-toast span { display: inline-block; background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem; padding: 6px 14px; border-radius: 8px; }
.ms-grid { display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 400px); margin: 4px auto 14px; border: 3px solid #8b7a5a; border-radius: 6px; background: #8b7a5a; gap: 1px; }
.ms-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: #24231f; color: var(--text); font: 600 clamp(1.1rem, 5.4vw, 1.6rem)/1 var(--font-body, inherit); cursor: pointer; user-select: none; }
.ms-cell.br { box-shadow: 2px 0 0 #b8a27a; z-index: 1; }
.ms-cell.bb { box-shadow: 0 2px 0 #b8a27a; z-index: 1; }
.ms-cell.br.bb { box-shadow: 2px 0 0 #b8a27a, 0 2px 0 #b8a27a, 2px 2px 0 #b8a27a; }
.ms-cell.given { color: var(--gold); font-weight: 700; background: #2b2a27; }
.ms-cell.peer { background: #2f2d27; }
.ms-cell.given.peer { background: #35322b; }
.ms-cell.same { background: #4a4234; }
.ms-cell.sel { background: var(--gold); color: #1a1408; }
.ms-cell.wrong { color: #ff8b7e; }
.ms-cell.sel.wrong { color: #8b1f12; }
.ms-cell.hinted { color: #9fd49a; }
.ms-cell.sel.hinted { color: #1f5a1b; }
.ms-notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); font: 600 clamp(.5rem, 2.3vw, .7rem)/1 var(--font-body, inherit); color: var(--muted); text-align: center; align-items: center; }
.ms-cell.sel .ms-notes { color: #4a3a1a; }
.ms-grid.done .ms-cell { background: #2d4a2a; color: #fff; cursor: default; }
.ms-grid.done .ms-cell.given { color: #cfe8cb; }
.ms-pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; max-width: 400px; margin: 0 auto 10px; }
.ms-num { position: relative; height: 54px; border: 0; border-radius: 7px; background: #4a4742; color: #fff; font: 700 1.25rem/1 var(--font-body, inherit); cursor: pointer; padding: 0; }
.ms-num small { position: absolute; bottom: 3px; right: 5px; font: 600 .6rem/1 var(--font-body, inherit); color: #bdb7a8; }
.ms-num:active { transform: scale(.96); }
.ms-num.full { opacity: .3; }
.ms-result { margin: 4px auto 18px; padding: 16px 18px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.ms-result strong { display: block; font-size: 1.2rem; margin-bottom: 4px; }
.ms-result span { color: var(--muted); }
.ms-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 14px; }
.ms-actions .btn-ghost { margin-left: 0; padding-left: 16px; padding-right: 16px; }
.ms button.btn { cursor: pointer; font-family: inherit; }
.ms button.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.ms button.btn-ghost[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ms-panel { margin: 22px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.ms-panel[hidden], .ms [hidden] { display: none !important; }
.ms-panel h2 { font-family: var(--font-heading, inherit); font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.ms-panel p, .ms-panel li { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }
.ms-panel ul { padding-left: 20px; }
.ms-statmode { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.ms-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; text-align: center; }
.ms-numbers b { display: block; font-size: 1.5rem; line-height: 1.1; }
.ms-numbers span { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 460px) { .ms-num { height: 48px; font-size: 1.1rem; } .ms-pad { gap: 4px; } }
