/* Football Connections v2. Scoped to .cn2 / body.cn2-page so nothing leaks into other pages. */
body.cn2-page {
  background:
    radial-gradient(70% 38% at 12% 0%, rgba(176, 124, 255, 0.13), transparent 70%),
    radial-gradient(70% 38% at 88% 0%, rgba(245, 197, 66, 0.10), transparent 70%),
    #060a12;
  background-attachment: fixed;
}
@media (max-width: 640px) { body.cn2-page .site-header, body.cn2-page .circuit-bar { position: static; } }
.cn2-h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.cn2, .cn2-modal {
  --panel: #0e1424; --panel2: #141c32; --line: rgba(255, 255, 255, .12);
  --txt: #f3f5fa; --dim: #9aa6bd; --acc: #f5b83d; --bad: #e5484d;
  --t0: #f5c542; --t1: #38c977; --t2: #4aa3ff; --t3: #b07cff; --ink: #0a0d14;
  color: var(--txt);
}
body.cn2-cb .cn2, body.cn2-cb .cn2-modal { --t0: #f2d03b; --t1: #4aa3ff; --t2: #ff8a3d; --t3: #c3b0ff; }
.cn2 { max-width: 440px; margin: 0 auto; padding: 6px 0 90px; }
.cn2 button { font-family: inherit; }
.cn2 [hidden] { display: none !important; }
.cn2-preview { background: rgba(245, 184, 61, .1); border: 1px dashed rgba(245, 184, 61, .6); color: #ffe2a8; border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.4; margin: 4px 0 10px; }

/* HUD */
.cn2-hud { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 2px 10px; position: relative; }
.cn2-brand { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 30px; line-height: 1; text-align: center; }
.cn2-brand small { display: block; font-family: var(--font-body, Inter, sans-serif); font-size: 9.5px; letter-spacing: .22em; font-weight: 700; color: var(--acc); margin-top: 5px; }
.cn2-datenav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.cn2-datenav button, .cn2-icons button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--txt); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cn2-datenav button:disabled { opacity: .3; cursor: not-allowed; }
.cn2-datenav button:not(:disabled):hover, .cn2-icons button:hover { border-color: var(--acc); }
.cn2-datenav span { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 15px; color: var(--acc); min-width: 110px; text-align: center; }
.cn2-icons { position: absolute; right: 2px; bottom: 10px; display: flex; gap: 6px; }

.cn2-sub { text-align: center; font-size: 12.5px; color: var(--dim); margin: 0 0 8px; }
.cn2-status { min-height: 22px; text-align: center; font-size: 14px; font-weight: 800; margin: 2px 0 8px; opacity: 0; transition: opacity .2s; }
.cn2-status.on { opacity: 1; } .cn2-status.good { color: var(--t1); } .cn2-status.warn { color: var(--acc); } .cn2-status.bad { color: #f0868a; }

/* Solved bars */
.cn2-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cn2-bar { width: 100%; border: 0; border-radius: 10px; padding: 11px 12px 10px; text-align: center; cursor: pointer; color: var(--ink); background: var(--c); animation: cnBar .45s ease backwards; }
.cn2-bar.t0 { --c: var(--t0); } .cn2-bar.t1 { --c: var(--t1); } .cn2-bar.t2 { --c: var(--t2); } .cn2-bar.t3 { --c: var(--t3); }
.cn2-bar .cat { display: block; font-weight: 900; font-size: 13.5px; letter-spacing: .02em; text-transform: uppercase; line-height: 1.2; }
.cn2-bar .names { display: block; font-size: 13px; font-weight: 600; margin-top: 3px; line-height: 1.25; }
.cn2-bar .tag { display: block; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; opacity: .7; margin-bottom: 3px; }
.cn2-bar .det { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, .22); text-align: left; font-size: 12.5px; line-height: 1.5; }
.cn2-bar[aria-expanded="true"] .det { display: block; }
.cn2-bar .det b { font-weight: 800; } .cn2-bar .det em { font-style: normal; opacity: .75; }
.cn2-bar.reveal { animation: cnBar .5s ease backwards; opacity: .92; }

/* Grid */
.cn2-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.cn2-tile {
  min-height: 68px; border: 2px solid transparent; border-radius: 10px; background: #1a2238; color: var(--txt); padding: 6px 4px; cursor: pointer;
  font-weight: 800; font-size: 13.5px; line-height: 1.15; text-align: center; display: flex; align-items: center; justify-content: center; hyphens: auto; overflow-wrap: anywhere;
  transition: background .12s, color .12s, transform .08s; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.cn2-tile.sm { font-size: 12px; } .cn2-tile.xs { font-size: 10.5px; }
.cn2-tile:hover { background: #222c47; }
.cn2-tile:active { transform: scale(.96); }
.cn2-tile.sel { background: #f3f5fa; color: var(--ink); border-color: #f3f5fa; transform: scale(1.03); }
.cn2-tile.sel:hover { background: #fff; }
.cn2-tile.shake { animation: cnShake .45s; }
.cn2-tile.hop { animation: cnHop .5s ease both; animation-delay: var(--d, 0s); background: var(--hc, #f3f5fa); color: var(--ink); border-color: transparent; }
.cn2-tile.gone { visibility: hidden; }
.cn2-grid.lock .cn2-tile { pointer-events: none; }

/* Mistakes + buttons */
.cn2-lives { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--dim); margin-bottom: 12px; font-weight: 700; }
.cn2-dots { display: flex; gap: 6px; }
.cn2-dots i { width: 13px; height: 13px; border-radius: 50%; background: #f3f5fa; transition: transform .3s, background .3s, opacity .3s; }
.cn2-dots i.lost { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); transform: scale(.8); }
.cn2-dots i.pulse { animation: cnPulse .5s; }
.cn2-btns { display: flex; gap: 8px; justify-content: center; }
.cn2-btn { font-weight: 800; font-size: 14px; padding: 13px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); cursor: pointer; background: transparent; color: var(--txt); }
.cn2-btn:hover:not(:disabled) { border-color: #fff; }
.cn2-btn.primary { background: #f3f5fa; color: var(--ink); border-color: #f3f5fa; }
.cn2-btn:disabled { opacity: .4; cursor: not-allowed; }
.cn2-btns .cn2-btn { flex: 1; max-width: 140px; }

/* Result */
.cn2-result { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; text-align: center; margin: 4px 0 14px; animation: cnRise .5s ease backwards; }
.cn2-kicker { font-size: 10.5px; letter-spacing: .22em; font-weight: 800; color: var(--acc); text-transform: uppercase; }
.cn2-grade { font-family: var(--font-display, 'Jersey 15', sans-serif); font-size: 32px; line-height: 1.1; margin: 6px 0 4px; }
.cn2-rsub { font-size: 13px; color: var(--dim); margin: 0 0 12px; }
.cn2-emoji { font-size: 22px; line-height: 1.35; letter-spacing: 1px; margin: 6px 0 12px; white-space: pre-line; }
.cn2-rh { text-align: left; font-size: 12.5px; line-height: 1.45; color: #cdd5e6; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; background: var(--panel2); }
.cn2-rh > b { color: var(--acc); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; display: block; margin-bottom: 3px; }
.cn2-minstats { display: flex; justify-content: center; gap: 18px; margin: 0 0 12px; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.cn2-minstats b { display: block; font-size: 20px; color: var(--txt); letter-spacing: 0; }
.cn2-acts { display: flex; gap: 8px; }
.cn2-acts .cn2-btn { flex: 1; max-width: none; border-radius: 10px; }
.cn2-acts .cn2-btn.primary { background: var(--acc); border-color: var(--acc); }
.cn2-report { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--dim); text-decoration: underline; }
.cn2-lbnote { color: var(--dim); font-size: 12px; margin: 0 0 8px; }

/* Modal */
.cn2-modal { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cn2-modal > div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 380px; padding: 18px 16px 16px; max-height: 90vh; overflow: auto; position: relative; }
.cn2-modal h3 { margin: 0 0 12px; font-family: var(--font-display, 'Jersey 15', sans-serif); font-weight: 400; font-size: 24px; text-align: center; }
.cn2-x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--txt); cursor: pointer; }
.cn2-sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-bottom: 14px; }
.cn2-sgrid b { display: block; font-size: 26px; font-family: var(--font-display, 'Jersey 15', sans-serif); font-weight: 400; } .cn2-sgrid span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.cn2-dist { display: flex; flex-direction: column; gap: 5px; }
.cn2-dist div { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; min-width: 0; }
.cn2-dist span { width: 64px; flex: none; color: var(--dim); font-size: 11px; }
.cn2-dist i { display: block; box-sizing: border-box; min-width: 22px; height: 20px; border-radius: 4px; background: #29324a; color: #fff; font-style: normal; text-align: right; padding: 0 6px; line-height: 20px; }
.cn2-dist i.hit { background: var(--t1); color: var(--ink); } .cn2-dist i.lossbar { background: #6b3040; }
.cn2-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 12px; font-size: 13px; }
.cn2-opt small { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.cn2-sw { flex: none; width: 44px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: #1a2136; position: relative; cursor: pointer; padding: 0; }
.cn2-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #9aa6bd; transition: transform .2s, background .2s; }
.cn2-sw[aria-checked="true"] { background: rgba(74, 163, 255, .25); } .cn2-sw[aria-checked="true"]::after { transform: translateX(18px); background: var(--t2); }

/* Example rows inside the shared how-to modal */
.cn2.cn2-exwrap { padding: 0; margin: 0; max-width: none; color: inherit; }
.cn2-ex { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
.cn2-ex i { font-style: normal; font-weight: 800; font-size: 12px; text-align: center; padding: 10px 2px; border-radius: 8px; background: #1a2238; color: #f3f5fa; }
.cn2-ex.solved i { background: var(--t1); color: var(--ink); }

/* Preview tools */
.cn2-tools { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 14px; font-size: 12.5px; color: var(--dim); }
.cn2-tools label { display: block; margin: 8px 0 4px; font-weight: 700; color: var(--txt); }
.cn2-tools input[type=date] { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 14px; }
.cn2-tools button { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; margin: 6px 6px 0 0; }
.cn2-tools code { display: block; margin-top: 8px; white-space: pre-wrap; font-size: 11.5px; }

@keyframes cnShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes cnHop { 0% { transform: translateY(0); } 40% { transform: translateY(-12px); } 70% { transform: translateY(2px); } 100% { transform: translateY(0); } }
@keyframes cnBar { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cnRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cnPulse { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(.8); } }
@media (max-width: 380px) { .cn2-tile { font-size: 12.5px; min-height: 62px; } .cn2-tile.sm { font-size: 11px; } .cn2-tile.xs { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .cn2 *, .cn2 *::before { animation: none !important; transition: none !important; } }
