/* The Masala Chain (/chain) */
.mc { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.mc [hidden] { display: none !important; }
.mc section { margin-top: 30px; }
.mc h1, .mc h2 { font-family: var(--font-display); color: var(--text); line-height: 1.1; }
.mc h1 { font-size: clamp(36px, 8vw, 64px); letter-spacing: -0.03em; margin: 18px 0 8px; }
.mc h1 span { background: var(--hot); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mc h2 { font-size: clamp(21px, 4vw, 28px); margin: 0 0 8px; }
.mc h3 { color: var(--text); margin: 20px 0 4px; font-size: 16px; }
.mc p, .mc li { color: var(--muted); font-size: 15px; line-height: 1.6; }
.mc b { color: var(--text); }
.mc a { color: var(--brand-dark); }
.mc .mc-back { font-size: 13px; text-decoration: none; }
.mc .mc-lead { font-size: 17px; max-width: 620px; }
.mc .mc-fine { font-size: 12.5px; }
.mc code { color: var(--gold); overflow-wrap: anywhere; }
.mc .mc-status { font-weight: 700; color: var(--text); }
.mc .mc-status:empty { display: none; }
/* stays in view while the puzzle is taller than the screen */
.mc .mc-status { position: sticky; bottom: 10px; z-index: 6; padding: 10px 14px; border: 1px solid var(--gold); border-radius: 14px; background: #2f1a35; }
.mc .mc-status.error { color: #ffb1a3; }

.mc-btn, .mc-modes button { min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; color: #fff; background: var(--hot);
  font: 700 15px/1.2 "Plus Jakarta Sans", sans-serif; cursor: pointer; }
.mc-btn:disabled { opacity: 0.6; cursor: wait; }
.mc-btn.mc-ghost, .mc-modes button { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.mc-modes button[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.mc-link { background: none; border: 0; padding: 8px 4px; color: var(--brand-dark); text-decoration: underline; cursor: pointer; font: inherit; }
.mc button:focus-visible, .mc select:focus-visible, .mc input:focus-visible, .mc summary:focus-visible, .mc a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.mc-modes, .mc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

.mc-stats { display: grid; grid-template-columns: 0.7fr 1.6fr 1fr; gap: 10px; margin: 0; }
.mc-stats > div { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px; min-width: 0; }
.mc-stats dt { color: var(--muted); font-size: 12.5px; }
.mc-stats dd { margin: 2px 0 0; color: var(--gold); font: 800 clamp(16px, 4vw, 24px)/1.2 var(--font-display); overflow-wrap: anywhere; }

.mc-closed { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 22px 16px; }
.mc .mc-count { font: 800 54px/1.1 var(--font-display); color: var(--gold); margin: 0; font-variant-numeric: tabular-nums; }

/* stays on screen while you scroll through the ingredients */
.mc-meters { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: 10px 0; background: #2f1a35; border-radius: 0 0 14px 14px; }
.mc-meter { border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; background: var(--card); font-size: 13px; color: var(--muted); }
.mc-meter b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mc-meter i { display: block; height: 6px; border-radius: 6px; margin-top: 6px; background: var(--surface-2); overflow: hidden; }
.mc-meter i::after { content: ""; display: block; height: 100%; width: var(--fill, 0%); border-radius: 6px; background: var(--gold); transition: width 0.2s; }
.mc-meter.over i::after { background: #ff5a48; }
.mc-meter.match { border-color: #52d98b; }
.mc-meter.match i::after { background: #52d98b; }

.mc-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.mc-item { text-align: left; background: var(--card); border: 2px solid var(--border); border-radius: 16px; padding: 10px 12px; color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.mc-item[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 196, 77, 0.14); }
.mc-item b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.mc-item span { display: inline-block; margin: 5px 8px 0 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.mc-reactions { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.mc .mc-reactions li { border: 1px solid var(--border); border-radius: 12px; padding: 7px 10px; font-size: 13px; }
.mc .mc-reactions li.on { border-color: var(--gold); color: var(--text); background: rgba(255, 196, 77, 0.14); }

.mc-seal { border: 2px solid #52d98b; border-radius: 20px; padding: 14px 16px; margin-top: 18px; background: var(--card); }
.mc-seal label { color: var(--muted); font-size: 15px; }
.mc select, .mc input { min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: #2f1a35; color: var(--text); padding: 8px 12px; font: 16px "Plus Jakarta Sans", sans-serif; max-width: 100%; }
.mc-paste label { color: var(--muted); font-size: 14px; }
.mc-paste > div { display: flex; gap: 8px; margin-top: 6px; }
.mc-paste input { flex: 1; min-width: 0; }

.mc-blocks { list-style: none; padding: 0; }
.mc .mc-blocks li { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 22px; font-size: 14px; }
.mc-blocks li:not(:last-child)::after { content: ""; position: absolute; left: 28px; top: 100%; width: 4px; height: 22px; background: linear-gradient(#ffc44d, #ff5e3a); }
.mc-blocks code { display: block; font-size: 12px; margin-top: 4px; }
.mc-dev summary { color: var(--text); font-weight: 700; cursor: pointer; padding: 8px 0; }
.mc-dev pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; overflow: auto; font-size: 12.5px; color: var(--text); }

@media (max-width: 520px) {
  .mc-items { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mc-meters { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 6px 0; }
  .mc-meter { padding: 5px 7px; font-size: 11.5px; }
  .mc-meter b { font-size: 15px; }
  .mc-stats { grid-template-columns: 0.8fr 1.3fr 1fr; gap: 6px; }
  .mc-stats > div { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) { .mc-meter i::after { transition: none; } }
