:root {
  --ink: #eef2f7;
  --muted: #96a0af;
  --dim: #687181;
  --panel: rgba(19, 23, 31, .82);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --lime: #c8ff4d;
  --cyan: #6ce7e0;
  --bg: #090b0f;
  --radius: 22px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.ambient { position: fixed; z-index: -1; filter: blur(5px); border-radius: 50%; pointer-events: none; }
.ambient-one { width: 460px; height: 460px; right: -150px; top: 90px; background: radial-gradient(circle, rgba(200,255,77,.11), transparent 68%); }
.ambient-two { width: 540px; height: 540px; left: -250px; top: 720px; background: radial-gradient(circle, rgba(108,231,224,.08), transparent 70%); }

.site-header, main, footer { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 90px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 650; letter-spacing: .03em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(200,255,77,.6); color: var(--lime); font-family: ui-monospace, monospace; font-size: 15px; background: rgba(200,255,77,.05); clip-path: polygon(14% 0,100% 0,100% 86%,86% 100%,0 100%,0 14%); }
.header-tag { color: var(--dim); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-submit { padding: 9px 14px; border: 1px solid rgba(200,255,77,.38); border-radius: 9px; color: var(--lime); background: rgba(200,255,77,.045); font-size: 12px; text-decoration: none; }
.header-submit:hover { background: rgba(200,255,77,.1); }

.hero { min-height: 590px; padding: 112px 0 90px; position: relative; }
.hero::after { content: "HARNESS"; position: absolute; right: -12px; bottom: 44px; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.045); font: 800 clamp(65px, 12vw, 165px)/.8 ui-sans-serif, sans-serif; letter-spacing: -.08em; pointer-events: none; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--lime); font: 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
.eyebrow span { width: 34px; height: 1px; background: var(--lime); box-shadow: 0 0 10px rgba(200,255,77,.5); }
h1 { max-width: 920px; margin: 0; font-size: clamp(48px, 7.4vw, 98px); line-height: 1.03; letter-spacing: -.055em; font-weight: 760; }
h1 em { font-style: normal; color: var(--lime); text-shadow: 0 0 45px rgba(200,255,77,.12); }
.hero-copy { max-width: 600px; margin: 34px 0 32px; color: var(--muted); font-size: clamp(16px, 1.7vw, 19px); line-height: 1.9; }
.hero-link { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); font-size: 14px; text-decoration: none; border-bottom: 1px solid var(--line-strong); padding: 7px 0; }
.hero-link span { color: var(--lime); transition: transform .2s ease; }
.hero-link:hover span { transform: translateY(4px); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(120deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); backdrop-filter: blur(12px); overflow: hidden; }
.stats article { min-height: 132px; display: flex; flex-direction: column; justify-content: center; padding: 25px 38px; border-right: 1px solid var(--line); }
.stats article:last-child { border-right: 0; }
.stats strong { font: 520 clamp(30px, 4vw, 46px)/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.06em; }
.stats span { margin-top: 12px; color: var(--dim); font-size: 12px; letter-spacing: .12em; }

.submit-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(35px, 7vw, 90px); margin-top: 110px; padding: clamp(32px, 5vw, 65px); border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(135deg, rgba(200,255,77,.045), rgba(15,19,26,.9) 42%, rgba(108,231,224,.025)); scroll-margin-top: 25px; }
.submit-copy h2 { margin: 13px 0 26px; font-size: clamp(34px, 4.3vw, 56px); line-height: 1.06; letter-spacing: -.05em; }
.submit-copy > p:not(.section-index) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; }
.submit-copy ul { margin: 26px 0 0; padding: 0; list-style: none; color: #788291; font-size: 12px; line-height: 2; }
.submit-copy li::before { content: "◇"; margin-right: 9px; color: var(--lime); }
.upload-form { display: flex; flex-direction: column; gap: 17px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.upload-form label { display: flex; flex-direction: column; gap: 8px; color: #cbd2db; font-size: 12px; }
.upload-form label > span { margin-left: 5px; color: var(--dim); font: 9px ui-monospace, monospace; text-transform: uppercase; }
.upload-form input[type="text"], .upload-form input:not([type]), .upload-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: rgba(5,7,10,.55); padding: 13px 14px; resize: vertical; transition: border-color .2s; }
.upload-form input:focus, .upload-form textarea:focus { border-color: rgba(200,255,77,.48); }
.file-picker { min-height: 125px; display: grid !important; grid-template-columns: 46px 1fr; align-content: center; column-gap: 15px !important; padding: 20px; border: 1px dashed rgba(200,255,77,.25); border-radius: 14px; background: rgba(200,255,77,.02); cursor: pointer; }
.file-picker:hover { border-color: rgba(200,255,77,.5); background: rgba(200,255,77,.045); }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 !important; border: 1px solid rgba(200,255,77,.3); border-radius: 12px; color: var(--lime) !important; font-size: 22px !important; }
.file-picker strong { align-self: end; overflow-wrap: anywhere; font-size: 13px; }
.file-picker small { align-self: start; color: var(--dim); font-size: 10px; }
.upload-progress { padding: 13px 14px 14px; border: 1px solid rgba(200,255,77,.2); border-radius: 12px; background: rgba(200,255,77,.035); }
.upload-progress[hidden] { display: none; }
.upload-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; color: #aeb7c3; font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.upload-progress-meta strong { flex: 0 0 auto; color: var(--lime); font-size: 12px; }
.upload-progress-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,.07); overflow: hidden; }
.upload-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--cyan)); box-shadow: 0 0 15px rgba(200,255,77,.42); transition: width .18s linear; }
.upload-progress.is-complete { border-color: rgba(108,231,224,.35); background: rgba(108,231,224,.045); }
.upload-progress.is-complete .upload-progress-meta strong { color: var(--cyan); }
.upload-progress.is-error { border-color: rgba(255,107,130,.35); background: rgba(255,107,130,.045); }
.upload-progress.is-error .upload-progress-meta strong { color: #ff8da1; }
.upload-progress.is-error .upload-progress-track span { background: #ff6b82; box-shadow: 0 0 15px rgba(255,107,130,.35); }
.form-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-submit-row p { flex: 1; margin: 0; color: var(--dim); font-size: 10px; line-height: 1.6; }
.form-submit-row button { min-height: 44px; flex: 0 0 auto; padding: 0 18px; border: 0; border-radius: 10px; color: #090b0f; background: var(--lime); font-size: 12px; font-weight: 700; cursor: pointer; }
.form-submit-row button:disabled { opacity: .55; cursor: wait; }

.collection { padding: 128px 0 100px; scroll-margin-top: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 36px; }
.section-heading h2 { margin: 8px 0 0; font-size: clamp(34px, 5vw, 56px); line-height: 1; letter-spacing: -.045em; }
.section-index { margin: 0; color: var(--lime); font: 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; }
.section-heading > p { max-width: 320px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; text-align: right; }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; margin-bottom: 34px; }
.search-box, .sort-box { display: flex; align-items: center; min-height: 58px; border: 1px solid var(--line); border-radius: 15px; background: rgba(17,20,27,.75); transition: border-color .2s, background .2s; }
.search-box:focus-within, .sort-box:focus-within { border-color: rgba(200,255,77,.48); background: rgba(22,26,34,.92); }
.search-box svg { width: 19px; margin-left: 19px; fill: none; stroke: var(--dim); stroke-width: 1.7; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; padding: 0 15px; }
.search-box input::placeholder { color: #606977; }
kbd { margin-right: 15px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--dim); background: rgba(255,255,255,.025); font: 11px ui-monospace, monospace; }
.sort-box { padding: 0 10px 0 18px; gap: 12px; }
.sort-box span { color: var(--dim); font-size: 12px; }
.sort-box select { min-width: 125px; border: 0; outline: 0; color: var(--ink); background: #11141b; padding: 10px 28px 10px 8px; border-radius: 9px; cursor: pointer; }
.status { color: var(--dim); font-size: 13px; min-height: 22px; margin-bottom: 12px; }
.status:empty { display: none; }

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; }
.work-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); overflow: hidden; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.work-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 18px 48px rgba(0,0,0,.24); }
.cover { position: relative; min-height: 205px; display: flex; align-items: end; padding: 22px; overflow: hidden; background: linear-gradient(135deg, hsl(var(--hue) 47% 20%), #0d1117 72%); border-bottom: 1px solid var(--line); }
.cover::before { content: ""; position: absolute; width: 210px; height: 210px; right: -50px; top: -85px; border: 1px solid hsla(var(--hue), 80%, 70%, .34); border-radius: 50%; box-shadow: 0 0 0 25px hsla(var(--hue),80%,70%,.025), 0 0 0 55px hsla(var(--hue),80%,70%,.018); }
.cover::after { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(90deg, transparent 49.5%, white 50%, transparent 50.5%), linear-gradient(transparent 49.5%, white 50%, transparent 50.5%); background-size: 40px 40px; mask-image: linear-gradient(to bottom, #000, transparent 75%); }
.cover-code { position: absolute; top: 17px; left: 19px; color: hsla(var(--hue), 90%, 80%, .72); font: 10px/1 ui-monospace, monospace; letter-spacing: .12em; }
.cover-title { position: relative; z-index: 1; max-width: 92%; font-size: 27px; line-height: 1.1; font-weight: 720; letter-spacing: -.035em; overflow-wrap: anywhere; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.author { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.author-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--lime); background: rgba(200,255,77,.09); font: 11px ui-monospace, monospace; }
.community-badge { margin-left: auto; padding: 3px 7px; border: 1px solid rgba(108,231,224,.2); border-radius: 6px; color: var(--cyan); background: rgba(108,231,224,.04); font: normal 9px ui-monospace, monospace; letter-spacing: .06em; }
.description { min-height: 66px; margin: 16px 0 20px; color: #aab2bf; font-size: 14px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; margin-top: auto; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta div { min-width: 0; }
.meta span { display: block; margin-bottom: 4px; color: #5f6876; font: 9px/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.meta strong { display: block; color: #c3cad3; font: 11px/1.4 ui-monospace, monospace; font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reactions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; }
.reaction { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: #aeb7c3; background: rgba(255,255,255,.015); font-size: 10px; cursor: pointer; }
.reaction b { color: var(--ink); font: 11px ui-monospace, monospace; }
.reaction.god:hover, .reaction.god.active { border-color: rgba(200,255,77,.52); color: var(--lime); background: rgba(200,255,77,.07); }
.reaction.meh:hover, .reaction.meh.active { border-color: rgba(255,107,119,.48); color: #ff8a95; background: rgba(255,107,119,.065); }
.reaction:disabled { opacity: .55; cursor: wait; }
.card-downloads { grid-column: 1 / -1; padding: 5px 2px 1px; color: var(--dim); font: 10px ui-monospace, monospace; text-align: right; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 18px; }
.action { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: transparent; text-decoration: none; font-size: 12px; cursor: pointer; transition: .2s ease; }
.action:hover { border-color: rgba(200,255,77,.45); background: rgba(200,255,77,.05); }
.action.primary { border-color: var(--lime); color: #090b0f; background: var(--lime); font-weight: 650; }
.action.primary:hover { background: #d4ff72; box-shadow: 0 0 22px rgba(200,255,77,.15); }

.empty-state { padding: 90px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.012); }
.empty-symbol { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid rgba(200,255,77,.3); border-radius: 50%; color: var(--lime); font-size: 30px; background: rgba(200,255,77,.04); }
.empty-state h3 { margin: 0 0 10px; font-size: 21px; }
.empty-state p { max-width: 500px; margin: auto; color: var(--muted); font-size: 14px; line-height: 1.8; }

.rankings { padding: 35px 0 120px; scroll-margin-top: 30px; }
.ranking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.ranking-panel { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,18,25,.78); overflow: hidden; }
.ranking-panel > header { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding: 23px; border-bottom: 1px solid var(--line); }
.ranking-panel header span { color: var(--dim); font: 9px ui-monospace, monospace; letter-spacing: .14em; }
.ranking-panel h3 { margin: 7px 0 0; font-size: 25px; letter-spacing: -.04em; }
.ranking-panel header > b { padding: 5px 8px; border-radius: 6px; font: 9px ui-monospace, monospace; }
.god-panel header > b { color: var(--lime); background: rgba(200,255,77,.08); }
.meh-panel header > b { color: #ff8a95; background: rgba(255,107,119,.08); }
.download-panel header > b { color: var(--cyan); background: rgba(108,231,224,.08); }
.ranking-panel ol { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.ranking-panel li { counter-increment: rank; border-bottom: 1px solid rgba(255,255,255,.055); }
.ranking-panel li:last-child { border-bottom: 0; }
.ranking-panel li a { min-height: 68px; display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px 19px; text-decoration: none; }
.ranking-panel li a::before { content: counter(rank, decimal-leading-zero); color: #525b68; font: 10px ui-monospace, monospace; }
.ranking-panel li a:hover { background: rgba(255,255,255,.025); }
.ranking-panel li div { min-width: 0; }
.ranking-panel li strong, .ranking-panel li span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-panel li strong { font-size: 12px; }
.ranking-panel li span { margin-top: 4px; color: var(--dim); font-size: 9px; }
.ranking-panel li a > b { font: 9px ui-monospace, monospace; font-weight: 500; white-space: nowrap; }
.god-score { color: var(--lime); }
.meh-score { color: #ff8a95; }
.download-score { color: var(--cyan); }
.ranking-empty { margin: 0; padding: 34px 20px; color: var(--dim); font-size: 11px; text-align: center; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 35px 0 55px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; line-height: 1.6; }
footer p { margin: 0; }
footer p:last-child { font-family: ui-monospace, monospace; letter-spacing: .08em; text-align: right; }

.preview-dialog { width: min(1180px, calc(100% - 32px)); height: min(840px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--ink); background: #0d1016; box-shadow: 0 30px 100px rgba(0,0,0,.7); overflow: hidden; }
.preview-dialog::backdrop { background: rgba(2,4,7,.82); backdrop-filter: blur(10px); }
.dialog-shell { height: 100%; display: flex; flex-direction: column; }
.dialog-shell > header { min-height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 10px 15px 10px 22px; border-bottom: 1px solid var(--line); }
.dialog-shell > header div { display: flex; align-items: baseline; min-width: 0; gap: 13px; }
.dialog-shell > header span { flex: 0 0 auto; color: var(--lime); font: 10px ui-monospace, monospace; letter-spacing: .12em; }
.dialog-shell > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
#preview-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; font-size: 24px; line-height: 1; cursor: pointer; }
#preview-close:hover { color: var(--ink); border-color: var(--line-strong); }
.sandbox-note { padding: 8px 20px; color: #788391; background: rgba(200,255,77,.035); border-bottom: 1px solid rgba(200,255,77,.08); font-size: 10px; letter-spacing: .04em; }
.sandbox-note span { color: var(--lime); margin-right: 6px; }
.frame-wrap { flex: 1; min-height: 0; background: #fff; }
.frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 920px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 520px; padding-top: 92px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats article:nth-child(2) { border-right: 0; }
  .stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .submit-section { grid-template-columns: 1fr; }
  .ranking-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header, main, footer { width: min(100% - 28px, 1180px); }
  .site-header { height: 72px; }
  .header-tag { display: none; }
  .hero { min-height: auto; padding: 80px 0 75px; }
  .hero::after { bottom: 22px; }
  h1 { font-size: clamp(43px, 13vw, 66px); }
  .hero-copy { margin-top: 28px; font-size: 15px; }
  .stats { grid-template-columns: 1fr; }
  .stats article { min-height: 94px; padding: 21px 25px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stats article:last-child { border-bottom: 0; }
  .stats article:nth-child(2) { border-bottom: 1px solid var(--line); }
  .submit-section { margin-top: 75px; padding: 26px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .form-submit-row { align-items: stretch; flex-direction: column; }
  .form-submit-row button { width: 100%; }
  .collection { padding: 90px 0 70px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .toolbar { grid-template-columns: 1fr; }
  .sort-box { justify-content: space-between; }
  .sort-box select { flex: 1; }
  .work-grid { grid-template-columns: 1fr; }
  .cover { min-height: 190px; }
  footer { flex-direction: column; }
  footer p:last-child { text-align: left; }
  .preview-dialog { width: calc(100% - 12px); height: calc(100% - 12px); border-radius: 14px; }
  .dialog-shell > header { padding-left: 14px; }
  .dialog-shell > header span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
