/* s1ber CTF Arena (s1-arena.v1.js). Uses the site's tokens (--bg, --panel, --line, --text, --muted, --accent, --ok, --bad). */
html.s1a-open, html.s1a-open body { overflow: hidden; }
.s1a-layer { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; color: var(--text);
  background: radial-gradient(900px 500px at 10% -10%, rgb(var(--accent-rgb) / .14), transparent 60%), radial-gradient(800px 500px at 100% 0, rgb(245 184 75 / .08), transparent 60%), var(--bg); }
.s1a-top { display: flex; align-items: center; gap: 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: #070b12f0; }
.s1a-brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 17px; }
.s1a-pro { font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 2px 7px; border-radius: 6px; background: linear-gradient(90deg, #f5b84b, #e05aa8); color: #111; }
.s1a-exit { margin-left: auto; }
.s1a-view { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px clamp(14px, 3vw, 40px) 60px; }
.s1a-view > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.s1a-muted { color: var(--muted); }
.s1a-loading { padding: 60px; text-align: center; color: var(--muted); }
.s1a-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.s1a-lock { max-width: 560px; margin: 60px auto; text-align: center; display: grid; gap: 12px; padding: 36px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.s1a-lock-ic { font-size: 44px; }
.s1a-lock h1 { margin: 0; font-size: 24px; }

.s1a-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; padding: 26px 28px; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--accent-rgb) / .18), transparent 55%), radial-gradient(100% 120% at 100% 100%, rgb(245 184 75 / .14), transparent 60%), var(--panel); }
.s1a-hero h1 { margin: 10px 0 4px; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.02em; }
.s1a-hero p { margin: 0; }
.s1a-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); }
.s1a-state i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgb(239 68 68 / .2); animation: s1aPulse 1.4s ease-in-out infinite; }
.s1a-live { color: #fecaca; border-color: rgb(239 68 68 / .5); background: rgb(239 68 68 / .1); }
.s1a-test { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: #c4b5fd; border: 1px dashed rgb(167 139 250 / .55); background: rgb(167 139 250 / .08); }
.s1a-upcoming { color: #fde68a; border-color: rgb(245 184 75 / .5); background: rgb(245 184 75 / .08); }
.s1a-ended { color: var(--muted); }
@keyframes s1aPulse { 50% { opacity: .35; } }
.s1a-count { margin-top: 10px !important; font: 700 22px/1.2 ui-monospace, Menlo, Consolas, monospace; color: var(--accent); font-variant-numeric: tabular-nums; }
.s1a-prizes { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.s1a-me { display: flex; gap: 10px; margin: 0; flex-wrap: wrap; }
.s1a-me > div { padding: 12px 18px; border-radius: 12px; background: rgb(0 0 0 / .25); border: 1px solid var(--line); min-width: 110px; display: flex; flex-direction: column-reverse; }
.s1a-me dd { margin: 0; font-size: 26px; font-weight: 800; }
.s1a-me dt { color: var(--muted); font-size: 12px; }

.s1a-tabs { display: flex; gap: 6px; margin-top: 22px !important; margin-bottom: 18px !important; border-bottom: 1px solid var(--line); }
.s1a-tabs button { padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.s1a-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.s1a-empty { padding: 50px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; }
.s1a-empty h2 { margin: 0 0 6px; font-size: 20px; }
.s1a-group { margin-bottom: 26px; }
.s1a-group h2 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.s1a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: start; }
.s1a-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.s1a-card.open { grid-column: 1 / -1; border-color: rgb(var(--accent-rgb) / .6); }
.s1a-card.solved { border-color: rgb(52 211 153 / .45); background: linear-gradient(180deg, rgb(52 211 153 / .07), var(--panel)); }
.s1a-card-h { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.s1a-pts { flex: none; display: grid; place-items: center; min-width: 54px; height: 40px; padding: 0 8px; border-radius: 10px; font-weight: 800; color: #111; background: linear-gradient(135deg, #ffe08a, #f5b84b); }
.s1a-card-t { display: grid; gap: 2px; min-width: 0; }
.s1a-card-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s1a-card-t small { color: var(--muted); }
.s1a-ok { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #04121a; font-weight: 800; }
.s1a-card-b { padding: 4px 18px 18px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.s1a-desc p { margin: 10px 0 0; line-height: 1.6; }
.s1a-desc a, .s1a-card-b a:not(.btn) { color: var(--accent); overflow-wrap: anywhere; }
.s1a-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.s1a-flag { display: flex; gap: 8px; flex-wrap: wrap; }
.s1a-flag .input { flex: 1 1 260px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.s1a-msg { margin: 0; min-height: 1.4em; font-weight: 600; }
.s1a-msg.good { color: var(--ok); }
.s1a-msg.bad { color: var(--bad, #ff8a7a); }

.s1a-boardwrap { display: grid; gap: 22px; }
.s1a-board { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.s1a-board th, .s1a-board td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.s1a-board th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.s1a-board tr.top1 { background: rgb(245 184 75 / .1); }
.s1a-board tr.top2 { background: rgb(200 214 232 / .06); }
.s1a-board tr.top3 { background: rgb(208 139 91 / .07); }
.s1a-fb h2 { font-size: 16px; margin: 0 0 8px; }
.s1a-fb ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.s1a-rules { display: grid; gap: 14px; }
.s1a-rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.s1a-rule { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.s1a-rule h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.s1a-rule h2 span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgb(var(--accent-rgb) / .12); font-size: 16px; }
.s1a-rule ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; line-height: 1.55; }
.s1a-rule li::marker { color: var(--accent); }
.s1a-rule code { padding: 1px 6px; border-radius: 6px; background: rgb(0 0 0 / .3); font: 13px ui-monospace, Menlo, Consolas, monospace; }
.s1a-rule-ban { border-color: rgb(239 68 68 / .4); background: linear-gradient(180deg, rgb(239 68 68 / .06), var(--panel)); }
.s1a-rule-ban h2 span { background: rgb(239 68 68 / .15); }
.s1a-rule-ban li::marker { color: #ef4444; }
.s1a-rule-note .s1a-desc p:first-child { margin-top: 0; }

@media (max-width: 640px) {
  .s1a-top { gap: 8px; padding: 8px 12px; }
  .s1a-hero { padding: 20px; }
  .s1a-board th:nth-child(5), .s1a-board td:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .s1a-state i { animation: none; } }

/* status */
.s1a-small { font-size: 15px !important; font-weight: 700; color: var(--muted); }
.s1a-target a { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.s1a-msg { display: grid; gap: 2px; }
.s1a-msg span { font-weight: 500; color: var(--muted); }
.s1a-lockb { margin-left: auto; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.s1a-card.is-locked { opacity: .55; filter: grayscale(.6); }
.s1a-card.is-locked .s1a-card-h { cursor: not-allowed; }
.s1a-card.is-locked .s1a-pts { background: #3a4456; color: var(--muted); }
.s1a-shake { animation: s1aShake .5s; border-color: rgb(239 68 68 / .7) !important; }
@keyframes s1aShake { 15%, 55% { transform: translateX(-7px); } 35%, 75% { transform: translateX(7px); } }
.s1a-hint summary { cursor: pointer; color: var(--muted); font-weight: 600; width: fit-content; }
.s1a-hint p { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid #f5b84b; background: rgb(245 184 75 / .07); border-radius: 0 10px 10px 0; }
.s1a-after { padding: 12px 16px; border: 1px solid rgb(52 211 153 / .35); border-radius: 12px; background: rgb(52 211 153 / .06); }
.s1a-after .s1a-desc p:first-child { margin-top: 6px; }

/* story: case file + chapter path */
.s1a-case { position: relative; margin-bottom: 22px; padding: 22px 26px 20px; border-radius: 4px 18px 18px 18px; border: 1px solid #5b4a2e;
  background: linear-gradient(180deg, rgb(245 184 75 / .09), rgb(245 184 75 / .02)), repeating-linear-gradient(0deg, transparent 0 27px, rgb(255 255 255 / .025) 27px 28px), var(--panel); }
.s1a-case-tab { position: absolute; top: 18px; right: 22px; transform: rotate(8deg); padding: 3px 12px; border: 2px solid #ef4444; border-radius: 6px; color: #ef4444; font: 800 13px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .2em; opacity: .75; }
.s1a-case-h { margin: 0; font: 700 15px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: #fcd34d; padding-right: 90px; }
.s1a-case .s1a-desc p { max-width: 78ch; }
.s1a-prog { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; }
.s1a-prog-bar { flex: 1; height: 8px; border-radius: 99px; background: rgb(255 255 255 / .08); overflow: hidden; }
.s1a-prog-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5b84b, #34d399); transition: width .8s ease; }
.s1a-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.s1a-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; }
.s1a-step .s1a-card.open { grid-column: 2; }
.s1a-step:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 46px; bottom: -14px; width: 2px; background: var(--line); }
.s1a-step.done:not(:last-child)::before { background: linear-gradient(#34d399, var(--line)); }
.s1a-node { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-weight: 800; }
.s1a-step.now .s1a-node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px rgb(var(--accent-rgb) / .12); animation: s1aGlow 2s ease-in-out infinite; }
.s1a-step.done .s1a-node { border-color: #34d399; background: #34d399; color: #04121a; }
.s1a-step.locked .s1a-node { font-size: 16px; opacity: .6; }
@keyframes s1aGlow { 50% { box-shadow: 0 0 0 10px rgb(var(--accent-rgb) / .04); } }

/* solve celebration */
.s1a-win { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: rgb(2 5 10 / .78); backdrop-filter: blur(4px); animation: s1aFade .25s ease; }
.s1a-win-box { width: min(100%, 520px); max-height: calc(100vh - 32px); overflow-y: auto; text-align: center; padding: 26px 26px 24px; border-radius: 20px; border: 1px solid rgb(52 211 153 / .45);
  background: radial-gradient(120% 80% at 50% 0%, rgb(52 211 153 / .14), transparent 60%), var(--panel); box-shadow: 0 30px 80px rgb(0 0 0 / .5); animation: s1aPop .45s cubic-bezier(.2, 1.4, .4, 1); }
.s1a-win-k { margin: 6px 0 0; font: 800 13px/1 ui-monospace, Menlo, monospace; letter-spacing: .3em; color: #34d399; animation: s1aRise .5s 1.5s both; }
.s1a-win-box h2 { margin: 8px 0 2px; font-size: 26px; animation: s1aRise .5s 1.6s both; }
.s1a-win-pts { margin: 0; font-size: 20px; font-weight: 800; color: #fcd34d; animation: s1aRise .5s 1.7s both; }
.s1a-win-after { margin: 14px 0 0; text-align: left; padding: 4px 16px 12px; border-radius: 12px; background: rgb(0 0 0 / .25); border: 1px solid var(--line); animation: s1aRise .5s 1.9s both; }
.s1a-win-moti { margin: 14px 0 16px; color: var(--muted); font-style: italic; animation: s1aRise .5s 2s both; }
.s1a-win .btn { animation: s1aRise .5s 2.1s both; }
@keyframes s1aFade { from { opacity: 0; } }
@keyframes s1aPop { from { transform: scale(.85); opacity: 0; } }
@keyframes s1aRise { from { transform: translateY(10px); opacity: 0; } }

.s1a-scene { position: relative; height: 170px; display: grid; place-items: center; perspective: 700px; }
.s1a-spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #fcd34d; opacity: 0;
  animation: s1aSpark var(--d) 1.25s ease-out both; transform: rotate(var(--a)) translateY(0); }
.s1a-spark:nth-child(3n) { background: #34d399; } .s1a-spark:nth-child(4n) { background: #7dd3fc; }
@keyframes s1aSpark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-95px) scale(.3); } }

/* kapı: the door swings open, light spills out */
.s1a-door-frame { position: relative; width: 92px; height: 150px; border: 6px solid #6b7280; border-bottom: 0; border-radius: 6px 6px 0 0; background: #04070d; transform-style: preserve-3d; }
.s1a-door-light { position: absolute; inset: 0; background: radial-gradient(80% 90% at 50% 60%, #fff7d6, #f5b84b 45%, transparent 80%); opacity: 0; animation: s1aOn .8s 1s forwards; }
.s1a-door { position: absolute; inset: 0; transform-origin: left center; border-radius: 2px; background: linear-gradient(90deg, #2a3a52, #1d2a3d); border: 1px solid #3c506e;
  box-shadow: inset 0 0 0 8px rgb(255 255 255 / .03); animation: s1aDoor 1.1s .55s cubic-bezier(.5, 0, .2, 1) forwards; }
.s1a-door-knob { position: absolute; right: 10px; top: 52%; width: 10px; height: 10px; border-radius: 50%; background: #fcd34d; animation: s1aKnob .4s .1s 2 alternate; }
@keyframes s1aDoor { to { transform: rotateY(-108deg); } }
@keyframes s1aKnob { to { transform: rotate(-60deg) translateY(2px); } }
@keyframes s1aOn { to { opacity: 1; } }

/* kasa: the wheel spins, the round door swings open */
.s1a-vault { position: relative; width: 150px; height: 150px; border-radius: 50%; background: #04070d; border: 8px solid #4b5563; transform-style: preserve-3d; }
.s1a-vault-glow { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #fff7d6, #f5b84b 40%, transparent 75%); opacity: 0; animation: s1aOn .7s 1.6s forwards; }
.s1a-vault-door { position: absolute; inset: -4px; border-radius: 50%; display: grid; place-items: center; transform-origin: right center;
  background: radial-gradient(circle at 35% 30%, #9ca3af, #4b5563 70%); box-shadow: inset 0 0 0 10px rgb(0 0 0 / .18); animation: s1aVault 1s 1.45s cubic-bezier(.5, 0, .2, 1) forwards; }
.s1a-wheel { position: relative; width: 74px; height: 74px; border-radius: 50%; border: 6px solid #e5e7eb; animation: s1aWheel 1.3s .15s cubic-bezier(.4, 0, .2, 1) both; }
.s1a-wheel::before, .s1a-wheel::after { content: ""; position: absolute; left: 50%; top: -14px; bottom: -14px; width: 6px; margin-left: -3px; background: #e5e7eb; border-radius: 3px; }
.s1a-wheel::after { transform: rotate(90deg); }
.s1a-wheel-hub { position: absolute; inset: 22px; border-radius: 50%; background: #e5e7eb; }
@keyframes s1aWheel { to { transform: rotate(540deg); } }
@keyframes s1aVault { to { transform: rotateY(115deg); } }

/* kargo: the flaps open, the lost cargo rises out glowing */
.s1a-box { position: relative; width: 150px; height: 150px; transform-style: preserve-3d; }
.s1a-box-body { position: absolute; left: 0; right: 0; bottom: 0; height: 90px; border-radius: 4px; background: linear-gradient(180deg, #c08a4e, #9a6a35); box-shadow: inset 0 -10px 0 rgb(0 0 0 / .12); }
.s1a-box-body::after { content: "SV-7••93"; position: absolute; left: 50%; top: 34px; transform: translateX(-50%); font: 800 11px ui-monospace, monospace; color: #3b2410; letter-spacing: .1em; }
.s1a-flap { position: absolute; top: 60px; width: 75px; height: 30px; background: #b07b42; border: 1px solid #8a5a2b; }
.s1a-flap-l { left: 0; transform-origin: left top; animation: s1aFlapL .6s .45s ease-out forwards; }
.s1a-flap-r { right: 0; transform-origin: right top; animation: s1aFlapR .6s .55s ease-out forwards; }
.s1a-box-item { position: absolute; left: 50%; top: 66px; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: radial-gradient(circle, #e0f2fe 18%, #38bdf8 20%, #0e7490 60%, #164e63);
  box-shadow: 0 0 30px #38bdf8; animation: s1aItem .9s 1s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes s1aFlapL { to { transform: rotate(-150deg); } }
@keyframes s1aFlapR { to { transform: rotate(150deg); } }
@keyframes s1aItem { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: translateY(-36px) scale(1); opacity: 1; } }

/* dosya: the case folder opens, the photo comes out, the lens finds the clue */
.s1a-folder { position: relative; width: 170px; height: 120px; transform-style: preserve-3d; }
.s1a-folder-back { position: absolute; inset: 0; border-radius: 4px 10px 6px 6px; background: #b8862f; }
.s1a-folder-back::before { content: ""; position: absolute; left: 0; top: -12px; width: 62px; height: 14px; border-radius: 6px 6px 0 0; background: #b8862f; }
.s1a-folder-photo { position: absolute; left: 30px; top: 14px; width: 110px; height: 78px; background: linear-gradient(135deg, #e2e8f0, #94a3b8); border: 5px solid #f8fafc; box-shadow: 0 4px 10px rgb(0 0 0 / .3);
  animation: s1aPhoto .8s .9s cubic-bezier(.2, 1.2, .4, 1) both; }
.s1a-folder-pin { position: absolute; right: 12px; bottom: 10px; width: 16px; height: 16px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgb(239 68 68 / .35); opacity: 0; animation: s1aOn .3s 2s forwards; }
.s1a-folder-front { position: absolute; inset: 0; border-radius: 4px 4px 6px 6px; background: linear-gradient(180deg, #d9a441, #c08f35); transform-origin: bottom center; animation: s1aFolder .8s .35s ease-in forwards; }
.s1a-lens { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; border: 5px solid #e5e7eb; background: rgb(186 230 253 / .25); opacity: 0;
  animation: s1aLens 1s 1.2s ease-in-out forwards; }
.s1a-lens::after { content: ""; position: absolute; right: -16px; bottom: -14px; width: 20px; height: 6px; border-radius: 3px; background: #e5e7eb; transform: rotate(45deg); }
@keyframes s1aFolder { to { transform: rotateX(-75deg) translateY(8px); } }
@keyframes s1aPhoto { from { transform: translateY(26px); } to { transform: translateY(-26px) rotate(-4deg); } }
@keyframes s1aLens { 0% { opacity: 0; transform: translate(-60px, 20px); } 30% { opacity: 1; } 100% { opacity: 1; transform: translate(34px, -18px); } }

@media (prefers-reduced-motion: reduce) {
  .s1a-win *, .s1a-win, .s1a-shake, .s1a-step.now .s1a-node { animation-duration: .01s !important; animation-delay: 0s !important; }
  .s1a-spark { display: none; }
}
@media (max-width: 640px) { .s1a-case { padding: 18px 16px; } .s1a-case-h { padding-right: 70px; } .s1a-step { grid-template-columns: 34px 1fr; gap: 10px; } .s1a-node { width: 34px; height: 34px; } .s1a-step:not(:last-child)::before { left: 16px; top: 36px; } }
