/* OSRS style guide. Desktop only, like the rest of the site. */
@font-face { font-family: 'RuneScape UF'; src: url('/fonts/classic.ttf') format('truetype'); }
@font-face { font-family: 'RuneScape Plain 11'; src: url('/fonts/RuneScape-Plain-11.otf') format('opentype'); }
@font-face { font-family: 'RuneScape Plain 12'; src: url('/fonts/RuneScape-Plain-12.otf') format('opentype'); }
@font-face { font-family: 'RuneScape Bold 12'; src: url('/fonts/RuneScape-Bold-12.otf') format('opentype'); }

:root {
    --bg: #14130f;
    --raised: #1c1a17;
    --stone: #494034;
    --stone-2: #3a3329;
    --line: #3a3528;
    --line-2: #6b5f3e;
    --text: #e8e2d0;
    --muted: #a9a18a;
    --gold: #ffcc00;
    --orange: #ff981f;
    --parch: #cbba95;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--gold); }
code { background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }

.osrs { font-family: 'RuneScape Plain 12', sans-serif; font-size: 16px; line-height: 1.2; }
.osrs.sh { text-shadow: 1px 1px 0 #000001; }


/* ---------------------------------------------------------------- Info box look
   The same frame sprites, fill and shading as our Info Box Panel: a coloured fill with a
   little noise and shading, and the stone frame drawn over it (frame.png is the eight pieces
   of resources/frames/frame1 laid out for border-image). */
.sg-box {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.3) 100%),
        linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent 5%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 5%),
        var(--box, #cbba95);
}
.sg-box::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    mix-blend-mode: multiply;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.15' numOctaves='4' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix type='saturate' values='0' in='noise'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' fill='white'/%3E%3C/svg%3E") 0 0 / 400px 400px;
}
.sg-box::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 32px solid transparent;
    border-image: url('/osrs/styleguide/frame.png') 32 / 32px / 0 repeat;
    image-rendering: pixelated;
}
.sg-box > * { position: relative; z-index: 1; }
.sg-box.stone { --box: #494034; }

/* ---------------------------------------------------------------- top bar */
.sg-top {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 28px;
    background: rgba(20, 19, 15, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}
.sg-nav a.on { background: var(--stone); color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
.sg-back { color: var(--muted); text-decoration: none; font-size: 14px; }
.sg-back:hover { color: var(--gold); }
.sg-nav { display: flex; gap: 6px; }
.sg-nav a {
    padding: 6px 16px;
    background: var(--stone-2);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    color: var(--orange);
    text-decoration: none;
    font: 16px/1 'RuneScape Plain 12', sans-serif;
    text-shadow: 1px 1px 0 #000001;
}
.sg-nav a:hover { background: var(--stone); color: var(--gold); }

.sg-wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px 80px; }

/* ---------------------------------------------------------------- hero */
.sg-hero { padding: 22px 0 10px; text-align: center; }
.sg-kicker { margin: 0; color: var(--orange); font: 20px 'RuneScape Plain 12', sans-serif; text-shadow: 1px 1px 0 #000001; letter-spacing: 0.04em; }
.sg-hero h1 {
    margin: 2px 0 8px;
    font: 54px/1 'RuneScape UF', sans-serif;
    color: var(--gold);
    text-shadow: 3px 3px 0 #000001;
    font-weight: normal;
}
.sg-lead { max-width: 640px; margin: 0 auto 12px; color: var(--muted); font-size: 16px; }
.sg-stats { display: flex; justify-content: center; gap: 14px; margin: 0; padding: 0; list-style: none; }
.sg-stats li {
    min-width: 104px;
    padding: 9px 14px 6px;
    text-align: center;
}
.sg-stats b { display: block; font: 28px/1 'RuneScape UF', sans-serif; color: var(--gold); text-shadow: 2px 2px 0 #000001; font-weight: normal; }
.sg-stats span { font: 15px 'RuneScape Plain 12', sans-serif; color: var(--orange); text-shadow: 1px 1px 0 #000001; }
.sg-stamp { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.sg-cue {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 10px 6px 0;
    vertical-align: middle;
    color: var(--orange);
    text-decoration: none;
    font: 18px 'RuneScape Plain 12', sans-serif;
    text-shadow: 1px 1px 0 #000001;
    transition: opacity 0.3s;
}
.sg-cue i {
    width: 10px;
    height: 10px;
    margin-top: -4px;
    border-right: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
    transform: rotate(45deg);
    animation: sg-bob 1.2s ease-in-out infinite;
}
.sg-cue.gone { opacity: 0; pointer-events: none; }
@keyframes sg-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }

/* Things rise into place as they scroll into view. */
.sg-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.45s ease, transform 0.45s ease; transition-delay: var(--d, 0ms); }
.sg-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .sg-reveal { opacity: 1; transform: none; transition: none; }
    .sg-cue i { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- sections */
.sg-section { padding-top: 56px; }
#colours.sg-section { padding-top: 22px; }
/* the note and the notation switch share a line */
#colours > .sg-sub { display: inline-block; margin: 6px 18px 12px 0; vertical-align: middle; }
#colours > .sg-bar { margin-bottom: 12px; vertical-align: middle; }
.sg-section > h2 {
    margin: 0;
    font: 44px/1.1 'RuneScape UF', sans-serif;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000001;
    font-weight: normal;
}
.sg-sub { margin: 6px 0 22px; color: var(--muted); }
.sg-h3 { margin: 34px 0 12px; font: 26px 'RuneScape UF', sans-serif; color: var(--orange); text-shadow: 2px 2px 0 #000001; font-weight: normal; }

.sg-bar {
    position: sticky;
    top: 58px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 8px 14px;
    background: rgba(28, 26, 23, 0.96);
    border: 1px solid var(--line);
    border-radius: 4px;
    font: 16px 'RuneScape Plain 12', sans-serif;
    color: var(--orange);
    text-shadow: 1px 1px 0 #000001;
}
.sg-seg { display: flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.sg-seg button {
    padding: 5px 14px;
    background: var(--stone-2);
    border: 0;
    border-left: 1px solid var(--line-2);
    color: var(--text);
    font: 16px 'RuneScape Plain 12', sans-serif;
    cursor: pointer;
}
.sg-seg button:first-child { border-left: 0; }
.sg-seg button:hover { color: var(--gold); }
.sg-seg button.on { background: var(--stone); color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }

.sg-group { margin-bottom: 40px; }
.sg-group > h3 { margin: 0; font: 28px 'RuneScape UF', sans-serif; color: var(--orange); text-shadow: 2px 2px 0 #000001; font-weight: normal; }
.sg-group > p { margin: 2px 0 12px; color: var(--muted); max-width: 720px; }

/* ---------------------------------------------------------------- swatches */
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 16px; }
.sg-swatch {
    display: flex;
    flex-direction: column;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.sg-chip {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 96px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #000001;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.18), inset -2px -2px 0 rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font: 22px 'RuneScape UF', sans-serif;
    text-align: left;
}
.sg-chip:hover { filter: brightness(1.08); }
.sg-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.sg-swatch-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sg-swatch h4 { margin: 0; font: 20px 'RuneScape Plain 12', sans-serif; color: #fff; text-shadow: 1px 1px 0 #000001; font-weight: normal; }
.sg-swatch p { margin: 0; font-size: 14px; color: var(--muted); }
.sg-ratios { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.sg-ratio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sg-ratio i {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 20px;
    border: 1px solid #000001;
    font: 14px/1 'RuneScape Plain 12', sans-serif;
    font-style: normal;
}
.sg-used { display: flex; flex-wrap: wrap; gap: 5px; }
.sg-used a, .sg-used span {
    padding: 1px 8px;
    border: 1px solid var(--line-2);
    border-radius: 99px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
}
.sg-used a:hover { border-color: var(--gold); color: var(--gold); }
.sg-used .src { color: var(--muted); border-style: dashed; }

/* ---------------------------------------------------------------- blocks */
.sg-block { margin-top: 12px; }
.sg-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sg-block-head h3 { margin: 0; font: 26px 'RuneScape UF', sans-serif; color: var(--orange); text-shadow: 2px 2px 0 #000001; font-weight: normal; }
.sg-btn, .sg-snippet {
    padding: 6px 16px;
    background: var(--stone-2);
    border: 1px solid var(--line-2);
    border-radius: 3px;
    color: var(--orange);
    font: 16px 'RuneScape Plain 12', sans-serif;
    text-shadow: 1px 1px 0 #000001;
    cursor: pointer;
}
.sg-btn:hover, .sg-snippet:hover { background: var(--stone); color: var(--gold); }
.sg-code {
    margin: 0;
    padding: 16px 18px;
    max-height: 340px;
    overflow: auto;
    background: #0e0d0a;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: #cbba95;
    font: 13px/1.6 ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------------------------------------------------------------- fonts */
.sg-tester { background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.sg-tester-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.sg-tester-controls label { display: flex; align-items: center; gap: 8px; }
.sg-tester-controls input[type=text] { width: 300px; }
.sg-tester-controls input[type=text], .sg-tester-controls select {
    padding: 6px 8px;
    background: #0e0d0a;
    border: 1px solid var(--line-2);
    border-radius: 3px;
    color: var(--text);
    font: inherit;
}
.sg-font { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.sg-font:first-child { border-top: 0; }
.sg-font h4 { margin: 0; font: 20px 'RuneScape Plain 12', sans-serif; color: #fff; text-shadow: 1px 1px 0 #000001; font-weight: normal; }
.sg-font p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.sg-font-demo { padding: 14px 18px; background: var(--stone); border: 2px solid #000001; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.14), inset -2px -2px 0 rgba(0, 0, 0, 0.35); overflow: hidden; white-space: nowrap; }

/* ---------------------------------------------------------------- tips */
.sg-tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.sg-tip { display: flex; flex-direction: column; gap: 10px; padding: 26px 28px 28px; }
.sg-tip h3 { margin: 0; font: 22px/1.15 'RuneScape Bold 12', sans-serif; color: #800000; font-weight: normal; }
.sg-tip p { margin: 0; font: 17px/1.4 'RuneScape Plain 12', sans-serif; color: #000001; }
.sg-tip code { background: rgba(0, 0, 0, 0.12); color: #000001; }
.sg-demo { padding: 16px; border: 2px solid #000001; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.12), inset -2px -2px 0 rgba(0, 0, 0, 0.35); margin-top: 4px; }
.sg-tips { align-items: stretch; grid-auto-rows: 1fr; }
.sg-tip .sg-demo { margin-top: auto; }
.sg-demo .osrs { font-size: 20px; }
.sg-stone { background: var(--stone); }
.sg-parch { background: var(--parch); }
.sg-demo small { display: block; margin-top: 4px; font: 12px system-ui, sans-serif; color: rgba(255, 255, 255, 0.55); text-shadow: none; }
.sg-parch small { color: rgba(0, 0, 0, 0.55); }
.sg-pair, .sg-stacks, .sg-scales { display: flex; gap: 28px; align-items: flex-end; }
.sg-lines { display: flex; flex-direction: column; gap: 6px; }
.sg-scales img { display: block; }
.sg-scales img.crisp { image-rendering: pixelated; }
.sg-scales img.soft { image-rendering: auto; }
.sg-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sg-tags span { font: 16px 'RuneScape Plain 12', sans-serif; text-shadow: 1px 1px 0 #000001; }
.sg-two { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 10px; background: #000001; }
.sg-two > div { padding: 12px; }
.sg-snippet { align-self: flex-start; margin-top: 2px; font: 13px ui-monospace, 'SF Mono', Menlo, monospace; text-shadow: none; color: var(--text); text-align: left; }

/* ---------------------------------------------------------------- panels */
.sg-sources ul { margin: 10px 0 0; padding-left: 20px; }
.sg-sources li { margin-bottom: 6px; }
.sg-sources b { color: var(--gold); font-weight: normal; }
.sg-fine { margin-top: 18px; font-size: 13px; color: var(--muted); }

.sg-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    padding: 10px 20px;
    background: var(--stone);
    border: 2px solid #000001;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.14), inset -2px -2px 0 rgba(0, 0, 0, 0.35);
    color: var(--gold);
    font: 18px 'RuneScape Plain 12', sans-serif;
    text-shadow: 1px 1px 0 #000001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 50;
}
.sg-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 899px) {
    .sg-tips { grid-template-columns: 1fr; grid-auto-rows: auto; }
}

/* ---------------------------------------------------------------- right-click menu */
.sg-menu-grid { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: start; }
.sg-menu-wrap .sg-note { margin: 10px 0 0; }
/* The Choose Option menu, with the Option Panel's own measurements. --s is the whole-number scale. */
.sg-optpanel {
    --s: 2;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    background: #5d5447;
    border: calc(1px * var(--s)) solid #5d5447;
    font-family: 'RuneScape Bold 12', 'chat', sans-serif;
    font-size: calc(16px * var(--s));
    line-height: 1;
    image-rendering: pixelated;
    text-rendering: geometricPrecision;
}
.sg-optpanel-head {
    padding: calc(2px * var(--s)) calc(2px * var(--s)) 0;
    background: #000;
    color: #5d5447;
    border-bottom: calc(1px * var(--s)) solid #5d5447;
    font-weight: bold;
}
.sg-optpanel-lines { background: #5d5447; border: calc(1px * var(--s)) solid #000; }
.sg-optpanel-lines > div {
    display: flex;
    align-items: center;
    height: calc(16px * var(--s));
    padding: 0 calc(3px * var(--s)) 0 calc(1px * var(--s));
    color: #fff;
    text-shadow: calc(1px * var(--s)) calc(1px * var(--s)) 0 #000;
    white-space: nowrap;
}
.sg-menu-side .flush { margin-top: 0; }
.sg-calc { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 14px 16px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; }
.sg-calc label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sg-calc input { width: 76px; padding: 6px 8px; background: #0e0d0a; border: 1px solid var(--line-2); border-radius: 3px; color: var(--text); font: inherit; }
.sg-calc-out { flex: 1 1 100%; overflow-x: auto; }
.sg-calc-out .sg-optpanel { --s: 2; }
.sg-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sg-scale-head { display: flex; align-items: center; justify-content: space-between; margin-top: 30px; }
.sg-scale-head .sg-h3 { margin: 0; }
.sg-scale { display: grid; grid-template-columns: repeat(9, 1fr); margin-top: 12px; border: 2px solid #000001; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.18), inset -2px -2px 0 rgba(0, 0, 0, 0.3); }
.sg-band { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 96px; padding: 8px; border: 0; cursor: pointer; text-align: left; font: 16px/1.1 'RuneScape Plain 12', sans-serif; }
.sg-band:hover { filter: brightness(1.08); }
.sg-band b { font: 18px 'RuneScape UF', sans-serif; font-weight: normal; }
.sg-band span { font-size: 12px; font-family: system-ui, sans-serif; opacity: 0.8; }
.sg-band.now { outline: 3px solid #fff; outline-offset: -3px; }
.sg-cta { margin: 16px 0 0; color: var(--muted); }
.sources-link a { color: var(--gold); }

/* ---------------------------------------------------------------- sprites */
.sg-sprites-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.sg-lab { padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.sg-lab-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.sg-lab .sg-seg button { padding: 4px 10px; font-size: 15px; }
.sg-stage {
    display: grid;
    place-items: center;
    min-height: 280px;
    padding: 16px;
    overflow: auto;
    background-color: #a39b84;
    background-image:
        linear-gradient(45deg, #958d77 25%, transparent 25%), linear-gradient(-45deg, #958d77 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #958d77 75%), linear-gradient(-45deg, transparent 75%, #958d77 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    border: 2px solid #000001;
}
.sg-stage img { display: block; max-width: none; image-rendering: pixelated; }
.sg-stage img.smooth { image-rendering: auto; }
.sg-scale-row { display: flex; align-items: center; gap: 12px; font: 17px 'RuneScape Plain 12', sans-serif; color: var(--orange); text-shadow: 1px 1px 0 #000001; }
.sg-scale-row input { flex: 1; accent-color: #ffcc00; }
.sg-scale-row b { min-width: 44px; text-align: right; font-weight: normal; color: var(--gold); }
.sg-verdict { padding: 8px 12px; font: 18px 'RuneScape Plain 12', sans-serif; text-shadow: 1px 1px 0 #000001; border: 1px solid #000001; background: rgba(0, 0, 0, 0.3); }
.sg-verdict.ok { color: #0dc10d; }
.sg-verdict.bad { color: #ff5a3c; }
.sg-lab-meta { font: 13px system-ui, sans-serif; color: #d8cfb4; text-shadow: none; }
.sg-rules { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 12px; }
.sg-rules h3 { margin: 0; font: 22px 'RuneScape Bold 12', sans-serif; color: #800000; font-weight: normal; }
.sg-rules ol { margin: 0; padding-left: 22px; font: 17px/1.4 'RuneScape Plain 12', sans-serif; color: #000001; }
.sg-rules li { margin-bottom: 8px; }
.sg-rules li b { font-family: 'RuneScape Bold 12', sans-serif; font-weight: normal; color: #800000; }
.sg-dl { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 28px 34px; text-decoration: none; }
.sg-dl b { display: block; font: 26px 'RuneScape UF', sans-serif; font-weight: normal; color: var(--gold); text-shadow: 2px 2px 0 #000001; }
.sg-dl span { font-size: 15px; color: #e8e2d0; }
.sg-dl-btn { flex: none; padding: 10px 22px; background: var(--stone-2); border: 1px solid var(--line-2); border-radius: 3px; font: 18px 'RuneScape Plain 12', sans-serif; font-style: normal; color: var(--orange); text-shadow: 1px 1px 0 #000001; }
.sg-dl:hover .sg-dl-btn { background: var(--stone); color: var(--gold); }

.sg-check { display: flex; align-items: center; gap: 8px; font: 16px 'RuneScape Plain 12', sans-serif; color: var(--orange); text-shadow: 1px 1px 0 #000001; }
.sg-fine.dark { margin: 0; font: 15px/1.35 'RuneScape Plain 12', sans-serif; color: #000001; }
.sg-fine.dark code { background: rgba(0, 0, 0, 0.12); }
.sg-btn.dl { align-self: flex-start; text-decoration: none; display: inline-block; }

/* ---------------------------------------------------------------- fonts list, share, adverts */
.sg-tight { padding-top: 34px; }
.sg-getfonts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.sg-getfonts span { font-size: 14px; color: var(--muted); }
.sg-allfonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.sg-fontcard { padding: 16px 18px; background: var(--raised); border: 1px solid var(--line); border-radius: 4px; }
.sg-fontcard h4 { margin: 0; font: 20px 'RuneScape Plain 12', sans-serif; color: #fff; text-shadow: 1px 1px 0 #000001; font-weight: normal; }
.sg-fontcard p { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.sg-fontcard code { color: var(--orange); }
.sg-fontcard .prev { display: block; max-width: 100%; max-height: 150px; object-fit: contain; object-position: left top; background: #0e0d0a; border: 1px solid var(--line); image-rendering: pixelated; }
#sg-share { display: inline-block; margin: 10px 6px 0; vertical-align: middle; }
.sg-cta-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; padding: 40px 46px; }
.sg-cta-card h2 { margin: 0 0 10px; font: 40px/1.1 'RuneScape UF', sans-serif; font-weight: normal; color: var(--gold); text-shadow: 2px 2px 0 #000001; }
.sg-cta-card p { margin: 0 0 18px; font-size: 16px; color: #e8e2d0; }
.sg-cta-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.sg-cta-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-cta-shots img { width: 100%; height: 110px; object-fit: contain; image-rendering: pixelated; }
.sg-cta-block .sg-box { --box: #494034; }

/* ---------------------------------------------------------------- frames teaser */
.sg-frames-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; }
.sg-frames-img { width: 100%; max-height: 300px; object-fit: contain; image-rendering: pixelated; }
.sg-rules ul { margin: 0; padding-left: 22px; font: 17px/1.4 'RuneScape Plain 12', sans-serif; color: #000001; }
.sg-rules li { margin-bottom: 6px; }
.sg-rules p { margin: 0; font: 17px/1.4 'RuneScape Plain 12', sans-serif; color: #000001; }

/* ---------------------------------------------------------------- phones and small screens */
@media (max-width: 760px) {
    html { scroll-padding-top: 100px; }
    body { font-size: 15px; }
    .sg-wrap { padding: 0 16px 60px; }

    /* header: back link and the progress on one row, the sections scrolling underneath */
    .sg-top { flex-wrap: wrap; row-gap: 6px; padding: 8px 14px 10px; }
    .sg-back { flex: 1; font-size: 13px; white-space: nowrap; }
    .sg-xp { order: 2; width: 128px; }
    .sg-nav { order: 3; flex: 1 0 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
    .sg-nav::-webkit-scrollbar { display: none; }
    .sg-nav a { flex: none; padding: 6px 12px; font-size: 15px; }

    .sg-hero { padding: 22px 0 12px; }
    .sg-hero h1 { font-size: 44px; }
    .sg-lead { font-size: 16px; }
    .sg-stats { gap: 6px; }
    .sg-stats li { flex: 1 1 0; min-width: 0; padding: 8px 2px 6px; }
    .sg-stats b { font-size: 22px; }
    .sg-stats span { font-size: 13px; }

    .sg-section { padding-top: 40px; }
    .sg-section > h2 { font-size: 34px; }
    .sg-bar { top: 88px; }

    .sg-swatches { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .sg-chip { height: 78px; padding: 8px 10px; font-size: 18px; }
    .sg-swatch-body { padding: 10px; }

    .sg-menu-grid, .sg-sprites-grid, .sg-frames-card, .sg-cta-card, .sg-tips, .sg-allfonts { grid-template-columns: 1fr; }
    .sg-scale { grid-template-columns: repeat(3, 1fr); }
    .sg-band { height: 80px; }
    .sg-scale-head { flex-wrap: wrap; gap: 8px; }

    .sg-tester-controls input[type=text] { width: 100%; }
    .sg-font { grid-template-columns: 1fr; gap: 8px; }
    .sg-font-demo { padding: 10px 12px; white-space: normal; }

    .sg-tip { padding: 22px 20px 22px; }
    .sg-two { grid-template-columns: 1fr; }
    .sg-pair, .sg-stacks { flex-wrap: wrap; gap: 18px; }

    .sg-lab { padding: 22px 18px; }
    .sg-lab-head { gap: 8px; }
    .sg-lab .sg-seg { flex-wrap: wrap; }
    .sg-stage { min-height: 200px; padding: 10px; }
    .sg-rules { padding: 22px 20px 24px; }
    .sg-dl { flex-direction: column; align-items: flex-start; padding: 22px 20px; gap: 14px; }

    .sg-cta-card { padding: 28px 20px; }
    .sg-cta-card h2 { font-size: 32px; }
    .sg-cta-shots { grid-template-columns: 1fr 1fr; }
    .sg-block-head { flex-wrap: wrap; gap: 8px; }
    .sg-code { font-size: 12px; }
    .sg-hint { display: none; }
    .sg-hero .sg-btn, .sg-getfonts .sg-btn { text-align: center; }
}

@media (max-width: 760px) {
    .sg-menu-grid { grid-template-columns: 1fr; }
    .sg-optpanel, .sg-calc-out .sg-optpanel { --s: 1; }
}

/* ---------------------------------------------------------------- item icons */
.sg-stage.stone-stage {
    grid-auto-flow: column;
    gap: 36px;
    background: #494034;
    border: 2px solid #000001;
    align-content: center;
    justify-content: center;
}
.sg-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sg-fig img { display: block; max-width: none; }
.sg-fig img.crisp { image-rendering: pixelated; }
.sg-fig figcaption { font: 16px 'RuneScape Plain 12', sans-serif; color: #ff981f; text-shadow: 1px 1px 0 #000001; }
@media (max-width: 760px) { .sg-stage.stone-stage { gap: 18px; } }

/* ---------------------------------------------------------------- editors */
.sg-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.sg-app code { font: 14px ui-monospace, 'SF Mono', Menlo, monospace; background: rgba(0, 0, 0, 0.13); padding: 1px 5px; border-radius: 3px; color: #000001; }
#editors > .sg-note { margin-top: 14px; max-width: 760px; }
@media (max-width: 760px) { .sg-apps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- scroll progress bar
   Drawn like the Combat Achievements bar in the Combat Tasks panel: a grey metal trough, a green
   fill, and white text over the top. The 27 pixel rows are that panel's own (progressbargreen.png
   and the trough in its background). */
.sg-xp {
    position: relative;
    flex: none;
    width: 220px;
    height: 31px;
    box-sizing: border-box;
    padding: 2px;
    background: #474745;
    border: 1px solid #0e0e0c;
    outline: 0;
}
.sg-xp::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(to bottom, #2d2d2d 0px 1px, #333333 1px 2px, #333333 2px 3px, #3b3b3b 3px 4px, #3b3b3b 4px 5px, #434343 5px 6px, #434343 6px 7px, #4b4b4b 7px 8px, #4b4b4b 8px 9px, #555555 9px 10px, #555555 10px 11px, #5f5f5f 11px 12px, #5f5f5f 12px 13px, #636363 13px 14px, #5f5f5f 14px 15px, #5f5f5f 15px 16px, #555555 16px 17px, #555555 17px 18px, #4b4b4b 18px 19px, #4b4b4b 19px 20px, #434343 20px 21px, #434343 21px 22px, #3b3b3b 22px 23px, #3b3b3b 23px 24px, #333333 24px 25px, #333333 25px 26px, #2d2d2d 26px 27px);
}
.sg-xp-fill {
    position: relative;
    width: 0;
    height: 27px;
    background: linear-gradient(to bottom, #0f4a21 0px 1px, #125c28 1px 2px, #13642c 2px 3px, #167432 3px 4px, #187e37 4px 5px, #1b8b3d 5px 6px, #1b8b3d 6px 7px, #1e9b43 7px 8px, #1fa346 8px 9px, #20aa49 9px 10px, #22b74f 10px 11px, #24c153 11px 12px, #26ca57 12px 13px, #28d05a 13px 14px, #26ca57 14px 15px, #24c153 15px 16px, #22b74f 16px 17px, #20aa49 17px 18px, #1fa346 18px 19px, #1e9b43 19px 20px, #1b8b3d 20px 21px, #1b8b3d 21px 22px, #187e37 22px 23px, #167432 23px 24px, #13642c 24px 25px, #125c28 25px 26px, #0f4a21 26px 27px);
}
.sg-xp-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 16px/1 'RuneScape Plain 12', sans-serif;
    color: #fff;
    text-shadow: 1px 1px 0 #000001;
}

/* ---------------------------------------------------------------- FAQ */
.sg-faq { max-width: 820px; }
.sg-q { padding: 16px 0; border-top: 1px solid var(--line); }
.sg-q:first-child { border-top: 0; }
.sg-q h3 { margin: 0 0 6px; font: 24px/1.2 'RuneScape UF', sans-serif; font-weight: normal; color: var(--gold); text-shadow: 2px 2px 0 #000001; }
.sg-q p { margin: 0; font-size: 16px; color: var(--text); }
.sg-q p b { color: var(--orange); font-weight: normal; font-family: 'RuneScape Plain 12', sans-serif; font-size: 17px; }
.sg-fontcard p.use { color: var(--text); font-size: 14px; margin: 2px 0 4px; }
@media (max-width: 760px) { .sg-q h3 { font-size: 21px; } }

/* keep the back link on one line */
.sg-back { white-space: nowrap; }

/* ---------------------------------------------------------------- Fusion screenshot */
.sg-shot { margin: 14px 0 0; }
.sg-shot img { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto; border: 2px solid #000001; }
.sg-shot figcaption { margin-top: 6px; font: 15px/1.35 'RuneScape Plain 12', sans-serif; color: #000001; text-align: center; }
