/* WhaleSMP site. Store rules copied from the PayNow Infinity template's app.css. */

:root {
    --primary: #1fa2ff;
    --bg: #0d1420;
    --content: #172131;
    --content-light: #223047;
    --text: #d7deea;
    --muted: #9fb0c8;
    --green: #4ade80;
    --red: #ef4444;
    --radius: 16px;
    --width: 1280px;
    --font-title: "Minecraft Title", "Minecraftia", sans-serif;
    --font-body: "Minecraftia", system-ui, sans-serif;
    --text-shadow: 3px 3px 0 #00000040;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex; flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--font-title);
    font-weight: normal;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.1;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.px { image-rendering: pixelated; }

#pixels { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
/* page shell sits above the background canvas */
.hero, .navtiles, .main, .footer { position: relative; z-index: 1; }
.container { width: 100%; max-width: var(--width); margin: 0 auto; padding: 0 24px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 72px; }
.panel { background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius); padding: 32px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary); color: #fff;
    border-radius: 12px; padding: 12px 18px;
    font-family: var(--font-title); font-size: 16px; text-transform: uppercase; text-shadow: var(--text-shadow);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover { opacity: 1; transform: translateY(-2px); box-shadow: inset 0 -5px 0 #00000052; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.alt { background: var(--content-light); }
.btn.discord { background: #5865f2; }

/* ---------- Header ---------- */

/* --logo-h comes from the Logo Height setting. The logo floats over the box (out of the layout),
   so its size never moves the side buttons; it sits high enough to leave room for the IP badge. */
.hero { --logo-h: var(--logo-setting, 200px); margin-top: calc(var(--logo-h) - 74px); }
.hero-box {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    height: 132px; padding: 20px; margin-bottom: 40px; /* room for the IP badge hanging off the bottom edge */
    background: var(--content);
    border: 2px solid #ffffff0f; border-radius: var(--radius);
    box-shadow: 0 25px 50px #00000060;
}
.hero-side { display: flex; gap: 14px; position: relative; z-index: 2; }
.hero-side.right { justify-content: flex-end; }

.hero-pill { flex: 1; min-width: 0; }

.hero-pill {
    display: flex; align-items: center; gap: 18px;
    height: 88px; padding: 0 20px 0 12px;
    background: var(--content-light); border-radius: var(--radius);
    text-align: left;
    transition: transform .2s ease, opacity .2s ease;
}
button.hero-pill:hover { transform: scale(1.03); opacity: .85; }
.sq {
    width: 64px; height: 64px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--radius); background: var(--primary); color: #fff;
    font-size: 28px; text-shadow: var(--text-shadow); box-shadow: 0 10px 25px #00000060;
}
.sq.avatar { object-fit: cover; image-rendering: pixelated; background: var(--content); }
.pill-text { min-width: 0; }
.pill-text small { display: block; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.pill-title { display: block; font-family: var(--font-title); font-size: 30px; line-height: 1; color: #fff; text-transform: uppercase; text-shadow: var(--text-shadow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-action { margin-left: auto; width: 40px; height: 40px; flex: none; border-radius: 10px; color: var(--muted); }
.pill-action:hover { background: var(--content); color: #fff; }
.hero-pill.account { gap: 14px; padding-right: 8px; }
.hero-pill.account .pill-title { font-size: 22px; }

.hero-logo { position: absolute; left: 50%; bottom: 30px; z-index: 1; transform: translateX(-50%); }
.hero-logo a { display: block; }
.hero-logo img { height: var(--logo-h); width: auto; max-width: none; object-fit: contain; filter: drop-shadow(0 10px 20px #00000080); transform-origin: 50% 60%; animation: bob 6s ease-in-out infinite; }
/* Floats up and down, growing slightly at the top of the rise */
@keyframes bob { 50% { transform: translateY(-6px) scale(1.035); } }

/* Server IP: white box straddling the bottom edge of the header box, centred */
.ip-badge {
    position: absolute; left: 50%; bottom: 0; z-index: 3; transform: translate(-50%, 50%);
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 30px; border-radius: 10px; background: #fff; color: #0d1420;
    font-family: var(--font-title); font-size: 15px; text-transform: uppercase; white-space: nowrap;
    box-shadow: 0 8px 20px #00000055;
    transition: transform .15s ease;
}
.ip-badge:hover { transform: translate(-50%, 50%) translateY(-2px); }
.ip-badge i { font-size: 11px; color: var(--primary); }
.ip-badge .ip-badge-copy { color: #8a96ab; }
.hero-mobile { display: none; }
.hero-pill { color: inherit; }
.sq.discord { background: #5865f2; }
.sq.online { background: #22c55e; }
.btn.online { background: #22c55e; }

/* ---------- Nav tiles (store tiles, small) ---------- */

.navtiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.nt {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
    height: 104px; padding: 18px 20px;
    border-radius: var(--radius); background: var(--c); color: #fff;
    box-shadow: 0 0 0 var(--d);
    transition: transform .12s ease, box-shadow .12s ease;
}
.nt:hover, .nt.is-current { opacity: 1; transform: translateY(-6px); box-shadow: 0 10px 0 var(--d); }
.nt.is-current::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 3px #ffffffaa; pointer-events: none; }
.nt h3 { position: relative; z-index: 2; font-size: 30px; text-shadow: var(--text-shadow); }
.nt small { position: relative; z-index: 2; font-size: 11px; text-transform: uppercase; text-shadow: var(--text-shadow); opacity: .9; }
.nt .ic { position: absolute; right: 14px; top: 12px; font-size: 46px; opacity: .3; }

.footer { background: var(--content); padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.footer h4 { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 22px; }
.footer h4 img { width: 36px; height: 36px; object-fit: contain; }
.footer-text { font-size: 13px; line-height: 1.9; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid #ffffff12; font-size: 11px; line-height: 2; color: #6f819b; }
.legal a { color: var(--muted); }

/* ---------- Wiki (layout A from the approved mockup) ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wiki-search {
    display: flex; align-items: center; gap: 12px;
    background: var(--content); border: 1px solid #ffffff14; border-radius: 12px;
    padding: 0 18px; color: var(--muted); font-size: 14px; cursor: text;
}
.wiki-search:focus-within { border-color: var(--primary); }
.wiki-search > i { color: var(--primary); }
.wiki-search input {
    flex: 1; min-width: 0; padding: 15px 0; background: none; border: 0; outline: 0;
    color: var(--text); font-size: 14px;
}
.wiki-search input::placeholder { color: var(--muted); opacity: 1; }
.wiki-search kbd { font-family: inherit; font-size: 11px; background: var(--content-light); border-radius: 6px; padding: 2px 8px; }

.wiki-cols { display: flex; gap: 16px; margin-top: 16px; }
.wiki-side {
    width: 230px; flex: none; align-self: flex-start;
    display: flex; flex-direction: column; gap: 4px;
    background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius); padding: 16px;
}
.wiki-side:empty { display: none; }
.wiki-browse summary { display: none; }
.wiki-groups { display: flex; flex-direction: column; gap: 4px; }
.wiki-group { display: flex; flex-direction: column; gap: 4px; }
.wiki-side h4 { font-size: 14px; color: var(--muted); margin: 10px 8px 4px; }
.wiki-group:first-child h4 { margin-top: 0; }
.wiki-side a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-size: 12px; }
.wiki-side a:hover { opacity: 1; background: var(--content-light); }
.wiki-side a.is-current { background: var(--primary); color: #fff; text-shadow: var(--text-shadow); }
.wiki-side a em { font-style: normal; color: var(--muted); font-size: 11px; }
.wiki-side a.is-current em { color: #fff; }

.wiki-main { flex: 1; min-width: 0; }
.wiki-title { font-size: 30px; margin-bottom: 4px; }
.wiki-lead { color: var(--muted); margin-bottom: 14px; }

/* cards */
.wk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wk-card {
    position: relative; display: flex; gap: 12px; align-items: center; min-width: 0;
    background: var(--content); border: 1px solid #ffffff0d; border-radius: 14px; padding: 14px;
    color: var(--text); transition: transform .12s ease, border-color .12s ease;
}
.wk-card:hover { opacity: 1; transform: translateY(-3px); border-color: #ffffff24; }
.wk-card-text { min-width: 0; }
.wk-card b { display: block; font-family: var(--font-title); font-weight: normal; color: #fff; font-size: 17px; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.wk-card-text > span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.wk-card-cat { display: inline-block; margin-top: 4px; font-style: normal; font-size: 10px; text-transform: uppercase; color: var(--primary); }
.wk-cmd { font-family: var(--font-body) !important; text-transform: none !important; }
.wk-card b.wk-cmd { font-size: 14px; }

.wk-slot {
    width: 50px; height: 50px; flex: none; display: grid; place-items: center;
    border-radius: 10px; background: var(--content-light); color: var(--primary); font-size: 22px;
}
.wk-slot img { width: 36px; height: 36px; object-fit: contain; }
.wk-slot.lg { width: 84px; height: 84px; border-radius: 14px; font-size: 34px; }
.wk-slot.lg img { width: 64px; height: 64px; }
.wk-slot.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }
.wk-slot.sm img { width: 24px; height: 24px; }
/* Rendered gear models are detailed 3D pictures: give them much more room than flat item icons. */
.wk-slot:has(> img[src^="/img/gear/"]) { width: 80px; height: 80px; border-radius: 12px; }
.wk-slot > img[src^="/img/gear/"] { width: 74px; height: 74px; }
.wk-slot.lg:has(> img[src^="/img/gear/"]) { width: 160px; height: 160px; border-radius: 16px; }
.wk-slot.lg > img[src^="/img/gear/"] { width: 150px; height: 150px; }
.wk-slot.sm:has(> img[src^="/img/gear/"]) { width: 48px; height: 48px; border-radius: 10px; }
.wk-slot.sm > img[src^="/img/gear/"] { width: 46px; height: 46px; }
/* custom mob models get the same room as gear */
.wk-slot:has(> img[src^="/img/mobs/"]) { width: 80px; height: 80px; border-radius: 12px; }
.wk-slot > img[src^="/img/mobs/"] { width: 76px; height: 76px; image-rendering: auto; }
.wk-slot.lg:has(> img[src^="/img/mobs/"]) { width: 200px; height: 200px; border-radius: 16px; }
.wk-slot.lg > img[src^="/img/mobs/"] { width: 192px; height: 192px; }
.wk-slot.sm:has(> img[src^="/img/mobs/"]) { width: 48px; height: 48px; border-radius: 10px; }
.wk-slot.sm > img[src^="/img/mobs/"] { width: 46px; height: 46px; }
/* the Realm Forge model */
.wk-slot > img[src^="/img/stations/"] { image-rendering: auto; }
.wk-slot.lg:has(> img[src^="/img/stations/"]) { width: 200px; height: 200px; border-radius: 16px; }
.wk-slot.lg > img[src^="/img/stations/"] { width: 188px; height: 188px; }
.cg-head a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.cg-head a:hover { color: var(--primary); }
.cg-slot > img[src^="/img/stations/"], .cg-tip-slot img[src^="/img/stations/"] { image-rendering: auto; width: 100%; height: 100%; }
/* An armour set's page shows a whole player wearing it. */
.wk-slot.lg:has(> img[src^="/img/gear/armour/"]) { width: 220px; height: 220px; }
.wk-slot.lg > img[src^="/img/gear/armour/"] { width: 214px; height: 214px; }
.wk-pieces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wk-piece-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.wk-piece-card:hover { transform: translateY(-3px); }
.wk-piece-card[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.wk-piece-more { display: inline-block; margin-left: 4px; font-size: 9px; color: var(--primary); transition: transform .15s ease; }
.wk-piece-card[aria-expanded="true"] .wk-piece-more { transform: rotate(180deg); }
.wk-piece-recipe { margin-top: 12px; padding: 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--primary); }
.wk-piece-recipe > .wk-piece-name { margin: 0 0 10px; font-size: 18px; }
.wk-pieces-hint { margin-top: 10px; }

/* crafting grids: a slot per square like the game, counts in the corner, the result beside it */
.cg { display: inline-block; margin: 6px 0 12px; padding: 12px 14px 14px; border-radius: 12px; background: var(--content-light); }
.cg-head { margin-bottom: 10px; font-family: var(--font-title); font-size: 14px; text-transform: uppercase; color: #fff; }
.cg-head i { color: var(--primary); margin-right: 4px; }
.cg-head .muted { font-family: var(--font-body); font-size: 11px; margin-left: 4px; }
.cg-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cg-grid { display: grid; grid-template-columns: repeat(var(--n), 44px); gap: 4px; }
.cg-slot {
    position: relative; width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 6px; background: var(--bg); box-shadow: inset 0 2px 0 #00000055, inset 0 -1px 0 #ffffff10;
}
.cg-slot img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
a.cg-slot:hover { opacity: 1; outline: 2px solid var(--primary); outline-offset: 1px; }
.cg-n {
    position: absolute; right: 3px; bottom: 1px; font-family: var(--font-title); font-weight: normal;
    font-size: 13px; color: #fff; text-shadow: 2px 2px 0 #000000aa; pointer-events: none;
}
.cg-arrow { color: var(--muted); font-size: 18px; }
/* hover card for a crafting slot, like an item's header */
.cg-tip {
    position: absolute; z-index: 60; display: flex; align-items: center; gap: 14px; max-width: 360px;
    padding: 12px 16px 12px 12px; border-radius: 14px; pointer-events: none;
    background: var(--bg); border: 1px solid #ffffff1f; box-shadow: 0 14px 34px #000000aa;
}
.cg-tip[hidden] { display: none; }
.cg-tip-slot { width: 64px; height: 64px; flex: none; border-radius: 12px; }
.cg-tip-slot img { width: 48px; height: 48px; }
.cg-tip-slot img[src^="/img/gear/"] { width: 60px; height: 60px; image-rendering: auto; }
.cg-tip-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cg-tip-text b { font-family: var(--font-title); font-weight: normal; font-size: 22px; color: #fff; text-transform: uppercase; line-height: 1.05; text-shadow: var(--text-shadow); }
.cg-tip-n { margin-left: 8px; font-size: 16px; color: var(--primary); }
.cg-tip-text .wk-tags { margin: 0; }
.cg-tip-text .muted { font-size: 12px; }
.cg-out .cg-slot { width: 60px; height: 60px; box-shadow: inset 0 0 0 2px var(--primary); }
.cg-out .cg-slot img { width: 44px; height: 44px; }
.cg-slot img[src^="/img/gear/"] { width: 40px; height: 40px; }
.cg-out .cg-slot img[src^="/img/gear/"] { width: 54px; height: 54px; }

/* farm plants: each growth stage, smallest to fully grown */
.plant-name { margin-bottom: 8px; }
.plant-name .muted { font-family: var(--font-body); font-size: 12px; margin-left: 6px; text-transform: none; }
.plant-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.plant-stage { margin: 0; text-align: center; }
.plant-stage figcaption { margin-top: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.wk-slot.plant { width: 120px; height: 120px; border-radius: 14px; }
.wk-slot.plant img { width: 112px; height: 112px; image-rendering: auto; }
.plant-arrow { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
/* missing picture: hide the badge strip in a square slot and show the badge's glyph */
.wk-fb { display: none; }
.wk-slot img.fb { display: none; }
.wk-slot img.fb + .wk-fb { display: block; }

.wk-ribbon {
    position: absolute; top: 8px; right: 8px;
    background: #f59e0b; color: #1b1203; border-radius: 6px; padding: 1px 7px;
    font-size: 10px; text-transform: uppercase; white-space: nowrap;
}
.wk-head .wk-ribbon { position: static; display: inline-block; }

/* entry page */
.wk-entry { display: flex; flex-direction: column; gap: 14px; }
.wk-head { display: flex; gap: 18px; align-items: center; }
.wk-head-text { min-width: 0; }
.wk-head h2 { font-size: 34px; text-shadow: var(--text-shadow); overflow-wrap: anywhere; }
.wk-head h2.wk-cmd { font-size: 26px; }
.wk-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
/* Breedable ✓ / ✗ on a mob's header */
.wk-fact { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 18px; }
.wk-fact.yes { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.wk-fact.no { color: var(--muted); background: #ffffff0d; }
.wk-tag { height: 14px; width: auto; } /* the badge art's own size: as tall as the text, pixels crisp */
.wk-desc { font-size: 14px; }
.wk-sec { background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius); padding: 20px 22px; }
.wk-sec > h3 { font-size: 20px; margin-bottom: 10px; }
.wk-sec p + p, .wk-sec p + .wk-sub, .wk-sub + .wk-sub, .wk-sub + .wk-piece, .wk-piece + .wk-piece, .wk-piece + .wk-sub, .wk-sec p + .wk-piece { margin-top: 14px; }
.wk-sub h4, .wk-piece-name { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.wk-sub > p { margin-bottom: 8px; }
.wk-piece-name { color: #fff; }
.wk-piece .wk-sub + .wk-sub { margin-top: 10px; }
.wk-sec code, .wk-empty code { background: var(--content-light); border-radius: 6px; padding: 1px 6px; font-family: inherit; overflow-wrap: anywhere; }
.wk-code { color: #fff; }

.wk-items { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.wk-item {
    display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%;
    padding: 6px 10px 6px 6px; border-radius: 10px; background: var(--content-light); color: var(--text); font-size: 12px;
}
a.wk-item:hover { opacity: 1; background: #2b3b57; }
a.wk-item .wk-item-name { color: #fff; }
.wk-item-name { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.wk-item-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.wk-num { color: var(--primary); white-space: nowrap; font-weight: normal; }

.wk-stats { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.wk-stats li { position: relative; padding-left: 18px; }
.wk-stats li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; background: var(--primary); }

.wk-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wk-chain-sep { color: var(--muted); font-size: 11px; }
.wk-chip {
    display: inline-flex; flex-direction: column; padding: 8px 14px; border-radius: 10px;
    background: var(--content-light); color: #fff; font-size: 12px; line-height: 1.3;
    border: 2px solid transparent;
}
.wk-chip small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.wk-chip:hover { opacity: 1; border-color: #ffffff30; }
.wk-chip.is-current { background: var(--primary); text-shadow: var(--text-shadow); border-color: #ffffffaa; }
.wk-chip.is-current small { color: #fff; }

.wk-rewards { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.wk-reward { display: grid; grid-template-columns: 1fr auto 64px; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--content-light); }
.wk-reward-name { color: #fff; min-width: 0; overflow-wrap: anywhere; }
a.wk-reward-name { text-decoration: underline dotted; text-underline-offset: 3px; }
a.wk-reward-name:hover { color: var(--primary); }
.wk-reward .wk-tag { height: 14px; }
.wk-reward .wk-num { text-align: right; }

.wk-prevnext { display: flex; justify-content: space-between; gap: 12px; }
.wk-prevnext .btn { font-size: 14px; text-align: left; }
.wk-prevnext .wk-next { text-align: right; margin-left: auto; }
.wk-prevnext small { display: block; font-family: var(--font-body); font-size: 10px; text-shadow: none; opacity: .8; }

.wk-empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wk-empty > i { font-size: 34px; color: var(--primary); }
.wk-empty h2 { font-size: 26px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
    .wk-grid, .wk-pieces { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .wiki-cols { flex-direction: column; }
    .wiki-side { width: auto; align-self: stretch; padding: 0; }
    /* phones: the category list folds away behind "Browse: <current>" */
    .wiki-browse summary {
        display: flex; align-items: center; gap: 8px; padding: 14px 16px; cursor: pointer;
        list-style: none; font-size: 13px; color: var(--muted);
    }
    .wiki-browse summary::-webkit-details-marker { display: none; }
    .wiki-browse summary b { color: #fff; font-weight: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .wiki-browse summary i { margin-left: auto; color: var(--primary); transition: transform .15s ease; }
    .wiki-browse[open] summary i { transform: rotate(180deg); }
    .wiki-browse[open] .wiki-groups { padding: 0 16px 16px; }
    .wiki-group { display: grid; grid-template-columns: 1fr 1fr; }
    .wiki-group h4 { grid-column: 1 / -1; }
    .wk-head h2 { font-size: 26px; }
    .wk-sec { padding: 16px; }
}
@media (max-width: 600px) {
    .wk-grid { grid-template-columns: 1fr; }
    .wk-slot.lg { width: 64px; height: 64px; }
    .wk-slot.lg img { width: 48px; height: 48px; }
    .wk-slot.lg:has(> img[src^="/img/gear/"]) { width: 112px; height: 112px; }
    .wk-slot.lg > img[src^="/img/gear/"] { width: 104px; height: 104px; }
    .wk-slot.lg:has(> img[src^="/img/gear/armour/"]) { width: 150px; height: 150px; }
    .wk-slot.lg > img[src^="/img/gear/armour/"] { width: 146px; height: 146px; }
    .cg-grid { grid-template-columns: repeat(var(--n), 36px); }
    .wk-slot.plant { width: 84px; height: 84px; }
    .wk-slot.plant img { width: 78px; height: 78px; }
    .cg-slot { width: 36px; height: 36px; }
    .cg-slot img { width: 26px; height: 26px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .navtiles { grid-template-columns: repeat(3, 1fr); }
}

/* Too narrow for login | logo | cart: logo in the box, buttons underneath; the IP badge stays on the box edge */
@media (max-width: 860px) {
    .hero { --logo-h: min(var(--logo-setting, 200px), 170px); margin-top: calc(var(--logo-h) * .45 + 24px); }
    .hero-box { height: auto; min-height: 96px; justify-content: center; padding: 12px 12px 30px; }
    .hero-side { display: none; }
    .hero-logo { position: relative; left: auto; bottom: auto; transform: none; margin-top: calc(var(--logo-h) * -.45); }
    .hero-logo img { max-width: 80vw; }
    .ip-badge { font-size: 13px; padding: 5px 22px; }
    .hero-mobile { display: flex; gap: 8px; margin-top: 4px; margin-bottom: 16px; }
    .hero-mobile > *, .hero-mobile form .btn { flex: 1; width: 100%; font-size: 14px; padding: 12px 10px; }
    .hero-mobile form { flex: 1; }
}

@media (max-width: 860px) {
    .container { padding: 0 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
    .navtiles { grid-template-columns: 1fr 1fr; }
    .panel { padding: 22px; }
}

/* ---------- Join page ---------- */

.join-title { font-size: 44px; text-align: center; text-shadow: var(--text-shadow); margin-bottom: 20px; }
.join-ip {
    display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
    margin: 0 auto 28px;
}
.join-ip-text {
    font-family: var(--font-title); font-size: 34px; text-transform: uppercase; color: #fff;
    background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius);
    padding: 12px 24px; text-shadow: var(--text-shadow); overflow-wrap: anywhere;
}
.join-copy { font-size: 16px; min-width: 130px; }
.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.join-panel h2 { font-size: 24px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.join-ver { margin-bottom: 14px; color: var(--text); }
.join-steps { margin: 0 0 18px 22px; display: grid; gap: 6px; }
.join-steps strong, .join-ver strong { color: #fff; }
.join-panel code { font-family: var(--font-body); color: #fff; background: var(--content-light); padding: 2px 8px; border-radius: 8px; }
.join-field {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
.join-label { color: var(--muted); font-size: 12px; text-transform: uppercase; min-width: 56px; }
.join-panel .join-field code { flex: 1; font-size: 15px; overflow-wrap: anywhere; background: none; padding: 0; }
.join-field .join-copy { min-width: 0; font-size: 14px; padding: 8px 14px; }
.join-next { text-align: center; margin: 28px 0 18px; font-size: 16px; }
.join-next strong { color: #fff; }
.join-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.join-big { font-size: 22px; padding: 16px 32px; }

@media (max-width: 860px) {
    .join-grid { grid-template-columns: 1fr; }
    .join-title { font-size: 34px; }
    .join-ip-text { font-size: 24px; padding: 10px 16px; }
}
@media (max-width: 600px) {
    .join-actions .btn, .join-ip .btn { width: 100%; }
    .join-big { font-size: 18px; padding: 14px 18px; }
}
@media (max-width: 600px) {
    .join-field { gap: 8px; }
    .join-label { min-width: 0; font-size: 11px; }
    .join-panel .join-field code { font-size: 13px; min-width: 0; overflow-wrap: normal; }
    .join-field .join-copy { padding: 8px 10px; font-size: 13px; }
}

/* ---------- Guide (the wiki's two columns: chapter list left, chapters right) ---------- */

.guide-cols { display: flex; gap: 16px; align-items: flex-start; }
.guide-side {
    width: 250px; flex: none; position: sticky; top: 16px; z-index: 5;
    max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius); padding: 16px;
}
.guide-side h4 { font-size: 14px; color: var(--muted); margin: 0 8px 8px; }
.guide-toc { list-style: none; counter-reset: ch; display: flex; flex-direction: column; gap: 4px; }
.guide-toc li { counter-increment: ch; }
.guide-toc a {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
    color: var(--text); font-size: 12px; line-height: 1.3;
}
.guide-toc a::before {
    content: counter(ch); flex: none; display: grid; place-items: center; width: 22px; height: 22px;
    border-radius: 6px; background: var(--content-light); color: var(--primary); font-size: 11px;
}
.guide-toc a:hover { opacity: 1; background: var(--content-light); }
.guide-toc a.is-current { background: var(--primary); color: #fff; text-shadow: var(--text-shadow); }
.guide-toc a.is-current::before { background: #ffffff30; color: #fff; }

.guide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: chapter; }
.guide-intro .wiki-lead { margin-bottom: 0; }
.guide-ch {
    counter-increment: chapter; scroll-margin-top: 16px;
    background: var(--content); border: 1px solid #ffffff0d; border-radius: var(--radius); padding: 26px 28px;
}
.guide-ch:focus { outline: none; }
.guide-ch::before { content: "Chapter " counter(chapter); display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; margin-bottom: 8px; }
.guide-ch h2 { display: flex; align-items: center; gap: 14px; font-size: 28px; text-shadow: var(--text-shadow); margin-bottom: 14px; }
.guide-ch h2 i {
    flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
    background: var(--primary); box-shadow: 0 4px 0 #0b5b9c; color: #fff; font-size: 18px;
}
.guide-ch h3 { font-size: 17px; margin: 22px 0 8px; }
.guide-ch p + p, .guide-ch ul + p, .guide-ch ol + p, .guide-ch p + ul, .guide-ch p + ol { margin-top: 10px; }
.guide-ch strong { color: #fff; font-weight: normal; }
.guide-ch code {
    background: var(--content-light); border-radius: 6px; padding: 1px 6px;
    font-family: inherit; color: #fff; white-space: nowrap;
}
.guide-list, .guide-steps { margin-left: 20px; display: grid; gap: 6px; }
.guide-list li::marker, .guide-steps li::marker { color: var(--primary); }

.guide-tip {
    display: flex; gap: 12px; align-items: flex-start; margin-top: 14px !important;
    background: #1fa2ff14; border: 1px solid #1fa2ff40; border-radius: 12px; padding: 12px 14px;
}
.guide-tip > i { color: var(--primary); margin-top: 3px; }

.guide-roles { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide-roles li { background: var(--content-light); border-radius: 12px; padding: 12px 14px; }
.guide-roles b { display: block; font-family: var(--font-title); font-weight: normal; text-transform: uppercase; color: #fff; font-size: 16px; margin-bottom: 4px; }
.guide-roles + p { margin-top: 12px; }

.guide-phases { list-style: none; counter-reset: phase; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin-top: 12px; }
.guide-phases li { counter-increment: phase; }
.guide-phase {
    display: flex; align-items: center; gap: 10px; height: 100%;
    padding: 6px 10px 6px 6px; border-radius: 10px; background: var(--content-light); color: #fff; font-size: 12px;
    border-left: 3px solid var(--k);
}
.guide-phase::before { content: counter(phase); flex: none; width: 20px; text-align: right; color: var(--muted); font-size: 10px; }
.guide-phase:hover { opacity: 1; background: #2b3b57; }
.guide-phase img { width: 28px; height: 28px; flex: none; }
.guide-phase-name { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.guide-phase small { color: var(--muted); font-size: 10px; }

.guide-oddses { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.guide-odds { display: flex; align-items: center; gap: 12px; background: var(--content-light); border-radius: 12px; padding: 12px 14px; border-left: 4px solid var(--k); }
.guide-odds > i { color: var(--k); font-size: 20px; }
.guide-odds b { display: block; font-family: var(--font-title); font-weight: normal; text-transform: uppercase; color: #fff; font-size: 14px; line-height: 1.2; }
.guide-odds small { color: var(--muted); font-size: 11px; }

.guide-raws, .guide-finds { margin-top: 10px; }
.guide-finds .wk-item, .guide-raws .wk-item { padding: 6px 10px 6px 6px; }

.guide-key { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.guide-key li { display: flex; align-items: center; gap: 8px; background: var(--content-light); border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.guide-key li::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--k); }

.guide-ranks { list-style: none; display: grid; gap: 8px; margin: 12px 0 14px; }
.guide-ranks li { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 14px; background: var(--content-light); border-radius: 12px; padding: 10px 14px; }
.guide-ranks b {
    font-family: var(--font-title); font-weight: normal; text-transform: uppercase; color: #fff; text-align: center;
    background: var(--c); box-shadow: 0 4px 0 var(--d); border-radius: 8px; padding: 6px 10px; text-shadow: var(--text-shadow);
}
.guide-ranks span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.guide-ranks code { background: var(--bg); }

.guide-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #ffffff12; }
.guide-more > span { width: 100%; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.guide-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
    background: var(--content-light); color: #fff; font-size: 12px; border: 2px solid transparent;
}
.guide-link i { color: var(--primary); }
.guide-link:hover { opacity: 1; border-color: #ffffff30; }

@media (max-width: 1000px) {
    .guide-oddses { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    /* phones: the chapter list becomes a sticky row of chips across the top */
    .guide-cols { flex-direction: column; align-items: stretch; gap: 12px; }
    .guide-side { width: auto; top: 0; max-height: none; overflow: visible; padding: 8px; border-radius: 12px; }
    .guide-side h4 { display: none; }
    .guide-toc { flex-direction: row; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
    .guide-toc::-webkit-scrollbar { display: none; }
    .guide-toc li { flex: none; }
    .guide-toc a { white-space: nowrap; background: var(--content-light); padding: 7px 12px 7px 8px; }
    .guide-ch { scroll-margin-top: 72px; padding: 20px 16px; }
    .guide-ch h2 { font-size: 22px; gap: 12px; }
    .guide-ch h2 i { width: 36px; height: 36px; font-size: 16px; }
    .guide-roles { grid-template-columns: 1fr; }
    .guide-phases { grid-template-columns: 1fr 1fr; }
    .guide-phase { gap: 8px; padding-right: 8px; }
    .guide-phase::before { display: none; }
    .guide-phase img { width: 24px; height: 24px; }
    .guide-ranks li { grid-template-columns: 1fr; gap: 10px; }
    .guide-ranks b { justify-self: start; }
}
@media (max-width: 420px) {
    .guide-oddses { grid-template-columns: 1fr; }
}

/* ---------- Vote page ---------- */

.vt-intro { margin-bottom: 22px; text-align: center; }
.vt-intro > p { font-size: 20px; margin-bottom: 18px; }
.vt-intro strong { color: var(--primary); }
.vt-rewards { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 20px; padding: 0; text-align: left; }
.vt-rewards li { display: flex; align-items: center; gap: 10px; background: var(--content-light); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.vt-rewards img { height: 14px; width: auto; image-rendering: pixelated; flex: none; }
.vt-rewards span { flex: 1; min-width: 0; }
.vt-rewards small { color: var(--muted); }
.vt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vt {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
    min-height: 150px; padding: 20px; border-radius: var(--radius); background: var(--c); color: #fff;
    box-shadow: 0 0 0 var(--d); transition: transform .12s ease, box-shadow .12s ease;
}
.vt:hover { transform: translateY(-6px); box-shadow: 0 10px 0 var(--d); }
.vt h3 { font-size: 26px; text-shadow: var(--text-shadow); }
.vt small { position: absolute; right: 16px; top: 12px; font-size: 34px; opacity: .3; text-shadow: var(--text-shadow); }
.vt .btn { align-self: flex-start; background: #00000040; }
.vt-soon { align-self: flex-start; font-size: 12px; text-transform: uppercase; opacity: .9; }
.vt--soon { opacity: .55; }
.vt--soon:hover { transform: none; box-shadow: 0 0 0 var(--d); }
.vt--soon h3 { color: #ffffffb0; }

@media (max-width: 900px) {
    .vt-grid { grid-template-columns: 1fr 1fr; }
    .vt-rewards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .vt-grid, .vt-rewards { grid-template-columns: 1fr; }
}
