:root {
  color-scheme: light;
  --paper: #f5f7fc;
  --white: #fff;
  --ink: #171d36;
  --muted: #545d76;
  --line: #dce1ed;
  --brand: #3835b5;
  --brand-dark: #29248d;
  --soft: #edebff;
  --danger: #9c282c;
  font: 16px/1.5 "Segoe UI", "Arial", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 280px; }
a { color: var(--brand); }
button, select, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #625bf4; outline-offset: 3px; }
form, p { margin: 0; }
h1, h2 { margin: 0; line-height: 1.14; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.1rem, 5vw, 3.65rem); font-weight: 750; }
h2 { font-size: 1.24rem; font-weight: 700; }

.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; gap: .64rem; align-items: center; font-size: 1.18rem; font-weight: 750; letter-spacing: -.035em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 35px; height: 35px; padding: 8px; border-radius: 11px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; background: var(--brand); }
.brand-mark i { border-radius: 2px; background: #e9eaff; }
.brand-mark i:last-child { background: #b6f1dc; }
.top-nav { display: flex; align-items: center; gap: .85rem; }
.nav-link, .back { font-size: .92rem; font-weight: 650; color: var(--brand-dark); text-decoration: none; }
.nav-link:hover, .back:hover { text-decoration: underline; }
.back { display: inline-block; margin-bottom: 1rem; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: 10px; font-size: .92rem; line-height: 1.25; font-weight: 690; text-decoration: none; text-align: center; }
.primary { color: #fff; background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.outline { border-color: #bac0db; color: var(--brand-dark); background: var(--white); }
.outline:hover, .subtle:hover { background: #e2dfff; }
.subtle { color: var(--brand-dark); background: var(--soft); }
.danger { color: var(--danger); background: #fff1f0; border-color: #f1cbc8; }
.danger:hover { background: #ffe2df; }
.button:disabled { opacity: .65; cursor: progress; }

.catalog-hero { position: relative; overflow: hidden; margin-top: 2rem; min-height: 285px; display: flex; align-items: center; border-radius: 24px; color: #fff; background: radial-gradient(ellipse at 75% 100%, #352c7e, transparent 62%), #171642; }
.hero-copy { position: relative; z-index: 1; padding: 2.8rem clamp(1.4rem, 5.5vw, 4.1rem); }
.hero-copy h1 { font-size: clamp(3rem, 8vw, 5.35rem); line-height: .96; letter-spacing: -.073em; }
.hero-copy p { margin-top: 1.15rem; color: #dbdafa; }
.hero-grid { position: absolute; inset: 0 0 0 42%; display: grid; place-items: center; background-image: linear-gradient(#ffffff16 1px, transparent 1px), linear-gradient(90deg, #ffffff16 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(90deg, transparent, #000 45%); }
.hero-grid i { width: clamp(100px, 23vw, 235px); aspect-ratio: 1.25; grid-area: 1/1; border-radius: 19px; border: 1px solid #c1beff8b; background: #7567fa36; transform: translate(32px, -38px) rotate(-17deg); }
.hero-grid i:nth-child(2) { border-color: #a3fbd9a8; background: #a3fbd931; transform: translate(2px, 1px) rotate(-17deg); }
.hero-grid i:nth-child(3) { border-color: #dddaffb8; background: #4034aaf2; transform: translate(-29px, 41px) rotate(-17deg); }
.hero-grid i:nth-child(3)::before { content: ""; display: block; position: absolute; inset: 22% 23%; opacity: .85; background: linear-gradient(90deg, #d7d4ff 75%, transparent 75%) 0 20% / 100% 3px no-repeat, linear-gradient(90deg, #a3fbd9 90%, transparent 90%) 0 50% / 100% 3px no-repeat, linear-gradient(90deg, #d7d4ff 55%, transparent 55%) 0 80% / 100% 3px no-repeat; }
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.catalog-tabs { margin-top: 1.85rem; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: .48rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-weight: 650; text-decoration: none; background: var(--white); }
.tabs a:hover { border-color: #9696bd; }
.tabs [aria-current] { background: var(--soft); color: var(--brand-dark); border-color: #cac4ff; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; padding-bottom: 3rem; }
.card { min-width: 0; padding: 1.35rem; background: var(--white); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 16px #22215b06; }
.project-card { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; }
.card-footer { width: 100%; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; padding-top: .9rem; }
.category, .status { display: inline-flex; align-items: center; width: fit-content; padding: .29rem .58rem; border-radius: 6px; background: #edf0f7; color: #444e65; font-size: .85rem; line-height: 1.2; font-weight: 680; }
.category.projects { background: #eeebff; color: #432b91; }
.category.games, .status.public { background: #dcf5ea; color: #195744; }
.status.deleted { background: #ffebe8; color: var(--danger); }
.muted { color: var(--muted); }
.description, .address { overflow-wrap: anywhere; }
.address { font-size: .92rem; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 1rem; padding: 3rem 1rem; border: 1px dashed #bfc5dc; border-radius: 17px; text-align: center; }
.empty p { max-width: 28rem; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.page-heading { padding-top: 2.6rem; margin-bottom: 1.35rem; }
.heading p { margin-top: .5rem; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.narrow { max-width: 560px; margin-inline: auto; }
.narrow h1 { margin-bottom: 1rem; }
.login { padding-top: clamp(2rem, 9vh, 6rem); }
.form-card, .form { display: grid; gap: 1rem; align-content: start; }
.form-card > .button, .form > .button { justify-self: start; }
.field { display: grid; gap: .34rem; min-width: 0; }
.field label { font-size: .94rem; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; min-height: 44px; padding: .55rem .65rem; color: var(--ink); background: #fcfcff; border: 1px solid #b9c1d6; border-radius: 9px; }
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 48%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 52%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input[type="file"] { padding: .35rem; }
.field input::file-selector-button { padding: .42rem .65rem; margin-right: .55rem; background: var(--soft); color: var(--brand-dark); border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
.field small { color: var(--muted); font-size: .86rem; }
.messages { margin-top: 1rem; border: 1px solid #a6d7c6; border-radius: 10px; padding: .7rem 1rem; background: #ecf8f2; color: #195744; }
.errorlist { margin: 0; padding: .6rem .8rem; list-style: none; background: #fff1f0; color: var(--danger); border-radius: 8px; }
.errorlist li + li { margin-top: .35rem; }
.upload-info { display: grid; gap: .3rem; color: var(--muted); }
progress { width: 100%; accent-color: var(--brand); }
.badge-row, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.detail-heading { margin-bottom: 1.15rem; }
.detail-heading h1 { margin-top: .5rem; }
.link-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem; margin-bottom: 1rem; }
.link-card p { margin-top: .35rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 1rem; }
.version-list { display: grid; gap: .7rem; list-style: none; padding: 0; margin: .9rem 0 0; }
.version-list li { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.version-list time { display: block; font-size: .87rem; }
.version-list p { overflow-wrap: anywhere; }
.manage { margin-top: 1rem; }
.confirmation { margin-top: .65rem; display: grid; justify-items: start; gap: .55rem; }

@media (max-width: 660px) {
  .shell { width: calc(100% - 32px); }
  .topbar-inner { height: 62px; }
  .top-nav { gap: .55rem; }
  .catalog-hero { min-height: 230px; margin-top: 1.15rem; border-radius: 17px; }
  .hero-grid { inset-inline-start: 49%; opacity: .54; }
  .catalog-tabs { margin-top: 1.2rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .heading { align-items: flex-start; flex-direction: column; }
  .page-heading { padding-top: 1.65rem; }
  .page { padding-top: 1.4rem; }
  .card { padding: 1rem; }
}
