/* bedrockadvancements.com: shared design system. Pages add their own sheet on top. */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/assets/fonts/outfit-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/assets/fonts/outfit-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Monocraft (SIL OFL 1.1): Minecraft-style lettering for labels and the in-game preview. */
@font-face { font-family: "Monocraft"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/monocraft.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0c0f15;
  --bg-2: #10141c;
  --panel: #161c27;
  --panel-2: #1c2431;
  --panel-3: #232d3d;
  --line: #2a3546;
  --line-2: #364357;
  --text: #e9eef6;
  --text-2: #c3cddc;
  --muted: #8d9ab0;
  --green: #62e16f;
  --green-2: #3fb94d;
  --green-ink: #07210b;
  --gold: #f6c445;
  --purple: #c48cff;
  --blue: #5aa8ff;
  --red: #ff6b6b;
  --amber: #ffb547;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Monocraft", ui-monospace, monospace;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --width: 1180px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; }
pre { background: #0a0d12; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }
kbd { background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
::selection { background: rgba(98, 225, 111, 0.35); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.pixel { font-family: var(--pixel); letter-spacing: 0; }
.muted { color: var(--muted); }
.site-width { width: min(var(--width), 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--green); color: var(--green-ink); padding: 8px 12px; border-radius: 6px; font-weight: 700; }
.skip-link:focus { top: 12px; }

/* --- Header ---------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: rgba(12, 15, 21, 0.82); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(54, 67, 87, 0.6); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; margin: -3px 0; }
.brand b { color: var(--green); font-weight: 800; }
/* The name wherever it's written: white Bedrock, green Advancements, as in the header. */
span.ba-name { color: var(--text); white-space: nowrap; }
span.ba-name > b { color: var(--green); font-weight: inherit; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a { color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; white-space: nowrap; }
.main-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.button.menu-toggle { display: none; }
/* Narrow desktops: the nav needs the room, and "Start creating" repeats its Creator link. */
@media (max-width: 1040px) { .header-actions > .button-primary { display: none; } }
@media (max-width: 860px) {
  .main-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; margin: 0; }
  .main-nav.open { display: flex; }
  .button.menu-toggle { display: inline-flex; }
  .header-actions .hide-small { display: none; }
}

/* Account menu */
.account { position: relative; }
.account-button { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; font-size: 0.92rem; }
.account-button img, .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-3); object-fit: cover; flex: none; }
.avatar.placeholder { display: inline-grid; place-items: center; font-weight: 700; font-size: 0.8rem; color: var(--green-ink); background: var(--green); }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; }
.account-menu.open { display: block; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--panel-2); text-decoration: none; }

/* --- Buttons ------------------------------------------------------------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 0.95rem/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.05s; }
.button:hover { background: var(--panel-3); border-color: #4a5a72; text-decoration: none; }
.button:active { transform: translateY(1px); }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.button-primary { background: var(--green); border-color: var(--green); color: var(--green-ink); box-shadow: 0 0 0 0 rgba(98, 225, 111, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.button-primary:hover { background: #7aec86; border-color: #7aec86; }
.button-gold { background: var(--gold); border-color: var(--gold); color: #2a1c00; }
.button-ghost { background: transparent; border-color: transparent; }
.button-ghost:hover { background: var(--panel-2); border-color: var(--line); }
.button-danger { color: var(--red); }
.button-small { padding: 6px 12px; font-size: 0.88rem; }
.button-large { padding: 14px 26px; font-size: 1.05rem; border-radius: 10px; }
.button-icon { padding: 8px; width: 38px; height: 38px; }
.text-link { font-weight: 600; }

/* --- Forms -------------------------------------------------------------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(98, 225, 111, 0.18); }
textarea { width: 100%; resize: vertical; }
label { font-weight: 500; }
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field > span { font-weight: 600; font-size: 0.92rem; }
.field small { color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); width: 16px; height: 16px; }
.search { position: relative; }
.search input { padding-left: 38px; width: 100%; }
.search::before { content: ""; position: absolute; left: 13px; top: 50%; width: 13px; height: 13px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-62%); }
.search::after { content: ""; position: absolute; left: 25px; top: 58%; width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg); }

/* --- Cards, chips, badges ------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
a.chip:hover { border-color: var(--green); color: var(--text); text-decoration: none; }
.chip.active { background: rgba(98, 225, 111, 0.14); border-color: var(--green); color: var(--green); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.badge-green { background: rgba(98, 225, 111, 0.15); color: var(--green); }
.badge-gold { background: rgba(246, 196, 69, 0.15); color: var(--gold); }
.badge-purple { background: rgba(196, 140, 255, 0.15); color: var(--purple); }
.badge-blue { background: rgba(90, 168, 255, 0.15); color: var(--blue); }
.eyebrow { display: inline-block; font-family: var(--pixel); font-size: 0.8rem; color: var(--green); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 12px; }
.notice { border: 1px solid var(--line-2); background: var(--panel); border-left: 4px solid var(--blue); border-radius: var(--radius-sm); padding: 12px 16px; margin: 16px 0; }
.notice.tip { border-left-color: var(--green); }
.notice.warn { border-left-color: var(--amber); }
.notice > :last-child { margin-bottom: 0; }
.stars { display: inline-flex; gap: 1px; color: var(--gold); letter-spacing: 0; }
.stars .off { color: #3a465a; }

/* Pack cards (community listings, landing page) */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.pack-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.pack-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); text-decoration: none; }
.pack-art { position: relative; height: 132px; background-color: #3b3b3b; background-size: 48px 48px; image-rendering: pixelated; overflow: hidden; }
.pack-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45)); }
.pack-art .nodes { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; z-index: 1; }
.pack-art .node { width: 46px; height: 46px; position: relative; flex: none; }
.pack-art .node img { position: absolute; image-rendering: pixelated; }
.pack-art .node .frame { inset: 0; width: 46px; height: 46px; }
.pack-art .node .icon { left: 9px; top: 9px; width: 28px; height: 28px; }
.pack-art .featured { position: absolute; z-index: 2; top: 10px; left: 10px; }
.pack-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pack-body h3 { font-size: 1.08rem; margin: 0; }
.pack-body p { color: var(--text-2); font-size: 0.92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-meta { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.84rem; flex-wrap: wrap; }
.pack-meta .by { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pack-meta .by .avatar { width: 20px; height: 20px; font-size: 0.6rem; }
.pack-meta .stat { display: inline-flex; align-items: center; gap: 4px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 270px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Toasts (site notifications, in the advancement toast style) ------------------------ */
.toasts { position: fixed; right: 16px; top: calc(var(--header-h) + 12px); z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 360px; background: #212121; border: 2px solid #000; box-shadow: inset 0 0 0 2px #555, var(--shadow); border-radius: 4px; padding: 10px 14px; animation: toast-in 0.25s ease-out; }
.toast img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.toast b { display: block; font-family: var(--pixel); font-weight: 400; color: #ffff55; font-size: 0.82rem; }
.toast span { color: #fff; font-size: 0.92rem; }
.toast.error b { color: #ff7777; }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } }

/* --- Dialogs ------------------------------------------------------------------ */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.dialog-head h2 { font-size: 1.3rem; margin: 0; flex: 1; }
.dialog-body { padding: 16px 22px; overflow: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; flex-wrap: wrap; }

/* --- Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 48px 0 32px; margin-top: 80px; color: var(--muted); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: var(--text); font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--text); }
.footer-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; font-size: 0.82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* --- Page scaffolding -------------------------------------------------------------- */
.page-head { padding: 56px 0 28px; }
.page-head p { color: var(--text-2); font-size: 1.1rem; max-width: 720px; }
.section { padding: 72px 0; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--text-2); font-size: 1.08rem; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-state img { width: 64px; height: 64px; image-rendering: pixelated; opacity: 0.8; margin-bottom: 12px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 32px 0 0; }
