:root {
  --bg-1: #0f1722;
  --bg-2: #1f2a44;
  --bg-3: #16233a;
  --card: rgba(255, 255, 255, 0.92);
  --ink: #0c1826;
  --muted: #4f5f70;
  --line: #d8e0ea;
  --accent: #ff7a1a;
  --accent-strong: #d75d00;
  --accent-soft: #ffe3cf;
  --danger: #a92222;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 46px rgba(7, 16, 28, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Sora", "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 600px at 10% -15%, rgba(255, 122, 26, 0.32), rgba(255, 122, 26, 0) 52%),
    radial-gradient(900px 500px at 90% 0%, rgba(57, 156, 255, 0.24), rgba(57, 156, 255, 0) 56%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2) 52%, var(--bg-3));
}

.login-page {
  display: grid;
  place-items: center;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.container.narrow {
  width: min(920px, calc(100% - 2rem));
}

.hero {
  padding: 1.2rem 0 2.2rem;
}

.sub-header {
  padding: 1rem 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.topbar.compact {
  padding: 0;
}

.logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hero-content {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}

.hero-content h1 {
  color: #fff;
  margin: 0.3rem 0 0.7rem;
  line-height: 1.06;
  font-size: clamp(2rem, 4.8vw, 4rem);
}

.hero-text {
  color: rgba(242, 247, 255, 0.94);
  max-width: 58ch;
  line-height: 1.55;
  font-size: 1.02rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  color: #fff;
  backdrop-filter: blur(3px);
}

.hero-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-panel dl {
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.hero-panel dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.hero-panel dt {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
}

.hero-panel dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.64rem 1.06rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
}

.card .button.ghost,
.mod-card .button.ghost,
.login-card .button.ghost {
  background: #f4f8fc;
  border-color: #c5d3e2;
  color: #1f3f66;
}

.card .button.ghost:hover,
.mod-card .button.ghost:hover,
.login-card .button.ghost:hover {
  background: #e8f1fb;
  border-color: #a9bfd7;
}

.button.muted {
  background: rgba(9, 20, 35, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.button.danger {
  background: #b42929;
  border-color: #b42929;
}

.button.danger:hover {
  background: #931d1d;
  border-color: #931d1d;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

main.container,
main.container.narrow {
  padding-bottom: 2.2rem;
}

.card,
.mod-card,
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(10, 17, 30, 0.16);
}

.card {
  padding: 1.15rem;
  margin-bottom: 1rem;
}

.login-card {
  width: min(460px, 100%);
  margin: min(11vh, 7rem) auto 2rem;
  padding: 1.4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.mod-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  overflow: hidden;
}

.cover {
  width: 100%;
  height: 180px;
  background: linear-gradient(150deg, #112138, #273d69);
  position: relative;
}

.cover.big {
  width: 220px;
  min-width: 220px;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.06em;
}

.mod-content {
  padding: 1rem;
}

.mod-content h3 {
  margin: 0;
  font-size: 1.08rem;
}

.meta-line {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.89rem;
}

.description {
  margin: 0.75rem 0 0;
  line-height: 1.55;
}

.muted-text {
  color: var(--muted);
}

.mod-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.mod-meta {
  width: 100%;
}

.form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

label {
  display: grid;
  gap: 0.36rem;
  font-weight: 600;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid #cad5e2;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.74rem 0.84rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  border-color: #ff9a4a;
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16);
}

small {
  color: var(--muted);
  font-size: 0.8rem;
}

.notice,
.error {
  border-radius: var(--radius-sm);
  padding: 0.76rem 0.95rem;
  margin-bottom: 1rem;
}

.notice {
  border: 1px solid #ffd2af;
  background: #fff0e3;
}

.error {
  color: #851616;
  border: 1px solid #f0b0b0;
  background: #ffe7e7;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.link-list {
  display: grid;
  gap: 0.8rem;
}

.link-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
}

.mono {
  margin: 0;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}

.empty {
  text-align: center;
  padding: 1.45rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #10213a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.62rem 0.84rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.5s ease forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .mod-head {
    flex-direction: column;
  }

  .cover.big {
    width: 100%;
    min-width: 0;
    max-width: 320px;
    height: 200px;
  }
}

@media (max-width: 620px) {
  .container,
  .container.narrow {
    width: calc(100% - 1rem);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions form,
  .top-actions .button {
    width: 100%;
  }

  .top-actions .button {
    justify-content: center;
  }

  .card,
  .login-card {
    padding: 1rem;
  }
}
