:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --panel: #151924;
  --panel-2: #1b2030;
  --line: #262d3d;
  --text: #e7ebf3;
  --muted: #8b94a8;
  --accent: #4ade80;
  --accent-2: #38bdf8;
  --accent-warm: #f59e0b;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .9);
  --font-display: 'Irish Grover', 'Manrope', Georgia, cursive;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(620px 420px at 12% -8%, rgba(74, 222, 128, .16), transparent 70%),
    radial-gradient(700px 460px at 88% 4%, rgba(56, 189, 248, .13), transparent 72%),
    radial-gradient(500px 380px at 50% 110%, rgba(245, 158, 11, .08), transparent 70%);
}

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 26px;
  background: rgba(11, 13, 18, .82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 400; letter-spacing: .3px; font-size: 22px; white-space: nowrap; }
.logo-cube {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), #22c55e);
  color: #06230f; font-size: 15px;
  box-shadow: 0 0 22px rgba(74, 222, 128, .35);
}
.logo-text em { font-style: normal; color: var(--accent); }

.search-wrap { position: relative; flex: 1; max-width: 640px; margin: 0 auto; }
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
#search {
  width: 100%;
  padding: 11px 40px 11px 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: .18s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, .13); background: var(--panel-2); }
#search::placeholder { color: #6b7488; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 6px 8px;
}
.search-clear:hover { color: var(--text); }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 340px; overflow-y: auto;
}
.suggest-item { display: flex; align-items: center; gap: 11px; padding: 10px 13px; cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: rgba(74, 222, 128, .1); }
.suggest-item .ico { font-size: 17px; }
.suggest-item .st { font-weight: 700; font-size: 14px; }
.suggest-item .sm { color: var(--muted); font-size: 12px; }
.suggest-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; }

.top-actions { display: flex; gap: 9px; }

/* ---------- BUTTONS ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 17px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #22c55e);
  color: #05230f;
  box-shadow: 0 10px 26px -12px rgba(74, 222, 128, .8);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(74, 222, 128, .95); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.wide { width: 100%; margin-top: 10px; }

.back {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 13px; padding: 4px 0; margin-bottom: 10px;
}
.back:hover { color: var(--accent); }

/* ---------- LAYOUT ---------- */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 26px 26px 70px; }
.view-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 4px 0 22px; letter-spacing: .4px; }

.hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 28px;
  align-items: center;
  padding: 34px 32px;
  background: linear-gradient(150deg, #131a26, #0e1219 62%);
  border: 1px solid var(--line);
  border-radius: 22px;
  margin-bottom: 34px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(420px 220px at 78% 20%, rgba(74, 222, 128, .14), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  display: inline-block;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--accent); font-weight: 800; margin-bottom: 12px;
}
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: 42px; line-height: 1.12; margin: 0 0 12px; letter-spacing: .6px; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 0 0 18px; max-width: 540px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .28); color: #b9f4cf;
  cursor: pointer; transition: .15s;
}
.chip:hover { background: rgba(74, 222, 128, .2); transform: translateY(-1px); }

.hero-art { position: relative; height: 190px; }
.cube {
  position: absolute; display: grid; place-items: center;
  width: 76px; height: 76px; font-size: 30px;
  border-radius: 18px;
  background: linear-gradient(150deg, #1d2534, #131822);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}
.cube.c1 { top: 6px; left: 28%; }
.cube.c2 { top: 62px; left: 6%; animation-delay: -1.5s; }
.cube.c3 { top: 96px; left: 58%; animation-delay: -3s; }
.cube.c4 { top: 26px; left: 74%; animation-delay: -4.2s; width: 58px; height: 58px; font-size: 23px; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 23px; margin: 0; letter-spacing: .4px; }
.section-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; margin: 0; letter-spacing: .3px; }
.section-head.small { margin-top: 26px; }
.link { color: var(--accent); font-size: 13.5px; font-weight: 700; }
.link:hover { text-decoration: underline; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter {
  font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: .15s;
}
.filter:hover { color: var(--text); border-color: #37415a; }
.filter.active { background: rgba(74, 222, 128, .14); border-color: rgba(74, 222, 128, .45); color: var(--accent); }

/* ---------- MOD GRID ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 34px; }

.mod-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px;
  cursor: pointer;
  transition: .18s;
  overflow: hidden;
}
.mod-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--mc, var(--accent)); opacity: .85;
}
.mod-card:hover { transform: translateY(-3px); border-color: #38425c; box-shadow: var(--shadow); background: var(--panel-2); }
.mod-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.mod-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--mc) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent);
}
.mod-name { font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: .3px; }
.mod-tag { font-size: 12px; color: var(--muted); }
.mod-desc { font-size: 13px; color: #a7b0c2; margin: 0 0 12px; min-height: 38px; }
.mod-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.mod-meta b { color: var(--text); font-weight: 700; }
.badge {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  padding: 3px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--mc) 16%, transparent);
  color: var(--mc);
}
.stars { color: var(--accent-warm); font-weight: 700; }

/* ---------- FEED ---------- */
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 15px; margin-bottom: 34px; }

.guide-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: .18s;
  display: flex; flex-direction: column;
}
.guide-card:hover { transform: translateY(-3px); border-color: #38425c; box-shadow: var(--shadow); }
.guide-thumb {
  position: relative;
  aspect-ratio: 16 / 8.4;
  background: linear-gradient(140deg, #1e2637, #121722);
  background-size: cover; background-position: center;
  display: grid; place-items: center;
  font-size: 34px;
}
.guide-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(10, 12, 17, .92)); }
.guide-thumb .play {
  position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(239, 68, 68, .92); display: grid; place-items: center; font-size: 16px; color: #fff;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .9);
}
.guide-thumb .mod-pin { position: absolute; z-index: 2; top: 10px; left: 10px; font-size: 11px; font-weight: 800;
  padding: 4px 9px; border-radius: 7px; background: rgba(10, 12, 17, .82); border: 1px solid var(--line); color: #cfd8e8; }
.guide-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.guide-title { font-family: var(--font-display); font-weight: 400; font-size: 17.5px; line-height: 1.3; letter-spacing: .3px; margin: 0; }
.guide-sum { font-size: 13px; color: var(--muted); margin: 0; flex: 1; }
.guide-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); }
.guide-foot .author { color: #b9c2d4; font-weight: 700; }

/* ---------- QUESTIONS ---------- */
.q-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.q-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px;
  transition: .15s;
}
.q-item:hover { border-color: #38425c; background: var(--panel-2); }
.q-score { text-align: center; min-width: 46px; }
.q-score .n { font-size: 16px; font-weight: 800; color: var(--accent); }
.q-score .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.q-main { flex: 1; min-width: 0; }
.q-title { font-family: var(--font-display); font-weight: 400; font-size: 16px; margin: 0 0 3px; letter-spacing: .3px; }
.q-body { font-size: 12.8px; color: var(--muted); margin: 0; }
.q-meta { display: flex; gap: 9px; flex-wrap: wrap; font-size: 11px; color: #6f7889; margin-top: 7px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: #9fb0c9; }
.tag.solved { background: rgba(74, 222, 128, .13); border-color: rgba(74, 222, 128, .35); color: var(--accent); }
.tag.mod-tag-pill { color: var(--mc, #cfd8e8); border-color: color-mix(in srgb, var(--mc, #cfd8e8) 35%, transparent); background: color-mix(in srgb, var(--mc, #cfd8e8) 12%, transparent); }

/* ---------- CARDS / SIDE ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h4 { font-family: var(--font-display); font-weight: 400; margin: 0 0 6px; font-size: 17px; letter-spacing: .3px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 86px; }
.cta-card { background: linear-gradient(150deg, #16241c, #131822); border-color: rgba(74, 222, 128, .25); }

input, textarea, select {
  width: 100%; font: inherit; font-size: 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 12px; outline: none; transition: .16s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, .12); }
textarea { resize: vertical; min-height: 70px; }
.ask-card input, .ask-card textarea, .ask-card select { margin-bottom: 9px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b94a8 50%), linear-gradient(135deg, #8b94a8 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ---------- MOD PAGE ---------- */
.mod-header {
  display: flex; gap: 18px; align-items: center;
  padding: 22px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(140deg, #141a26, #0f131b);
  margin-bottom: 22px;
}
.mod-header .big-ico {
  width: 66px; height: 66px; border-radius: 17px; display: grid; place-items: center; font-size: 32px;
  background: color-mix(in srgb, var(--mc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 42%, transparent);
}
.mod-header h2 { margin: 0 0 3px; font-family: var(--font-display); font-weight: 400; font-size: 29px; letter-spacing: .4px; }
.mod-header .tagline { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.stat-row b { color: var(--text); }

/* ---------- ARTICLE ---------- */
.article {
  max-width: 820px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 34px;
}
.article h1 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.18; letter-spacing: .5px; margin: 8px 0 10px; }
.article .lead { color: #b0bacd; font-size: 15.5px; margin: 0 0 18px; }
.article .meta-bar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.article .hero-media { border-radius: 14px; overflow: hidden; margin: 0 0 22px; border: 1px solid var(--line); background: #0d1017; }
.article .hero-media img { width: 100%; display: block; }
.article .hero-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.article .body p { margin: 0 0 14px; color: #d3dae7; }
.article .body ul { margin: 0 0 16px; padding-left: 20px; color: #d3dae7; }
.article .body li { margin-bottom: 6px; }
.article .actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.like-btn { display: inline-flex; align-items: center; gap: 7px; }
.like-btn.liked { background: rgba(74, 222, 128, .14); border-color: rgba(74, 222, 128, .4); color: var(--accent); }
.comment-box { margin-top: 22px; }
.comment {
  display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px;
}
.comment .av { width: 30px; height: 30px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; flex: none; }
.comment b { font-size: 13px; }

/* ---------- EDITOR ---------- */
.editor { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.editor-main, .editor-side {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.editor-side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 12px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 700; color: #9aa4b8; margin-bottom: 6px; letter-spacing: .2px; }
.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.media-box { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; }
.media-label { display: block; font-size: 12px; font-weight: 700; color: #9aa4b8; margin-bottom: 8px; }
.media-preview {
  margin-top: 9px; height: 96px; border-radius: 9px; background: #0d1017; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11.5px; color: #6b7488; overflow: hidden;
}
.media-preview img, .media-preview iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.editor-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }

.footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  max-width: 1180px; margin: 0 auto; padding: 22px 26px 40px;
  font-size: 12px; color: #6f7889; border-top: 1px solid var(--line);
}
.footer b { color: #b9c2d4; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 14px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid rgba(74, 222, 128, .4); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow); z-index: 100; animation: pop .25s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 29px; }
  .two-col, .editor { grid-template-columns: 1fr; }
  .side, .editor-side { position: static; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  main { padding: 18px 16px 60px; }
  .article { padding: 22px 20px; }
  .article h1 { font-size: 23px; }
  .media-row { grid-template-columns: 1fr; }
  .top-actions { margin-left: auto; }
}
