.mechanism-app .game { padding: 28px; }
.mechanism-app h2 { text-align: center; font-size: clamp(21px,3vw,26px); }
#m-progress { height: 100%; background: #163d68; }
#m-diagram { min-height: 180px; display: grid; place-items: center; margin: 18px auto; }
.mechanism-structure { display: block; height: auto; margin: auto; overflow: visible; font-family: Arial,sans-serif; }
.mechanism-bond { stroke: #172532; stroke-width: 2; fill: none; stroke-linecap: butt; }
.mechanism-atom { font: 26px Arial,sans-serif; fill: #172532; }
.mechanism-charge { stroke: #172532; stroke-width: 1.4; fill: white; }
.mechanism-charge path { fill: none; }
.marked-site-arrow { stroke: #c54c19; stroke-width: 2.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.mechanism-pair { display: flex; justify-content: center; width: fit-content; max-width: 100%; gap: 24px; align-items: center; margin-inline: auto; }
.mechanism-pair > div { min-width: 0; flex: 0 1 auto; }
.site-target { cursor: pointer; }
.atom-hit { fill: transparent; }
.pi-hit { fill: none; stroke: transparent; stroke-width: 20; }
.atom-selection { fill: none; stroke-width: 2; pointer-events: none; }
.pi-selection { stroke-width: 13; opacity: .25; pointer-events: none; }
.site-nucleophilic .atom-selection, .site-nucleophilic .pi-selection { stroke: #1265c6; }
.site-electrophilic .atom-selection, .site-electrophilic .pi-selection { stroke: #b34614; }
.site-caption { font: bold 15px Arial,sans-serif; text-anchor: middle; pointer-events: none; }
.site-nucleophilic .site-caption { fill: #1265c6; }
.site-electrophilic .site-caption { fill: #b34614; }
.site-target:focus-visible { outline: none; }
.site-target:focus-visible .atom-hit { stroke: #163d68; stroke-width: 1; stroke-dasharray: 3 3; }
.site-target:focus-visible .pi-hit { stroke-opacity: 1; stroke: #163d6818; }
#m-tools, #m-choice { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; border: 0; padding: 0; margin: 20px auto; }
#m-tools button { min-width: 145px; border-radius: 4px; }
#m-tools button[aria-pressed=true] { background: #163d68; color: white; border-color: #163d68; }
#m-choice legend { margin: 0 auto 16px; text-align: center; font-weight: 600; }
#m-choice label { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border: 1px solid #a9bed7; border-radius: 4px; cursor: pointer; }
#m-choice label:has(input:checked) { background: #e6eef7; border-color: #163d68; }
#m-choice label:focus-within { outline: 2px solid #1265c6; outline-offset: 3px; }
#m-choice input, #m-none { accent-color: #163d68; width: 18px; height: 18px; }
#m-help { text-align: center; font-size: 14px; color: #52657c; }
#m-help:empty, #m-feedback:empty { display: none; }
#m-none-wrap { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 20px auto; }
#m-feedback { padding: 14px 18px; margin-top: 24px; border: 2px solid transparent; border-radius: 4px; line-height: 1.6; background: #f0f5fb; }
#m-feedback[data-state=correct] { background: #e9f7ed; border-color: #228443; color: #166534; }
#m-feedback[data-state=incorrect] { background: #fff0f0; border-color: #c8323e; color: #a51c26; }
.mechanism-app .bottom { margin-top: 36px; padding-top: 24px; border-top: 1px solid #d8e2ee; }
@media(max-width:620px) { .mechanism-app .game { padding: 22px 12px; } .mechanism-pair { flex-direction: column; gap: 20px; } #m-diagram { min-height: 150px; } }

.mechanism-topics { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 24px auto; }
.mechanism-topics a { padding: 12px 18px; min-height: 46px; border: 1px solid #a9bed7; border-radius: 4px; color: #163d68; text-decoration: none; font-weight: 600; background: white; }
.mechanism-topics a[aria-current=page] { background: #163d68; color: white; border-color: #163d68; }
.mechanism-topics a:focus-visible { outline: 3px solid #1265c6; outline-offset: 3px; }
