/* =========================================================
   Tibiarok — Game Docs
   Layout for the Game Docs views only. The look itself (palette,
   gold frame, navbar, hr.stylish, .tr-panel, footer) comes from
   ../css/site.css on top of ../css/vendor/bootstrap.min.css — the
   same two files the landing page loads, so both pages read as one
   site. Relative URLs only: works at /docs/ under GitHub Pages or
   under a custom domain.
   ========================================================= */

/* ---------- Page ---------- */
/* the gutter keeps the frame and the menu still when a scrollbar comes and goes (the content rising from below brings one, for a moment) */
html { scroll-padding-top: 130px; scrollbar-gutter: stable; }
/* The Game Docs stand on the MatchMaker art in the site's blue: the image file is already toned (only the art's light and
   shade over --tr-navy #081929, baked in so it needs no blend-mode support) and a navy veil (--docs-bg-veil) keeps it behind
   the text. Fixed to the viewport on its own layer, so nothing repaints while scrolling and it also works on phones, where
   background-attachment: fixed does not. */
:root { --docs-bg-veil: 0.62; }
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(rgba(8, 25, 41, var(--docs-bg-veil)), rgba(8, 25, 41, var(--docs-bg-veil))),
        url(assets/img/backgrounds/matchmaker.webp) center 30% / cover no-repeat #081929;
}
body {
    color: var(--tr-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
img { max-width: 100%; }
/* A sticky bar never scrolls, so a tall open menu scrolls inside itself (landscape phones) */
@media (max-width: 1199.98px) { .docs-nav .navbar-collapse { max-height: calc(100vh - 100px); overflow-y: auto; } }
.docs-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    /* page text scrolls under the bar: the blur keeps the menu readable over it */
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.docs-main {
    flex: 1 0 auto;
    padding-top: 28px;
    padding-bottom: 40px;
    outline: none;
}

/* ---------- Titles (same pattern as the landing: h1 + h5 + hr.stylish) ---------- */
.docs-title { position: relative; margin-bottom: 20px; }
.docs-title-action { position: absolute; right: 0; top: 10px; } /* sits at the right of the title line, above the gold rule */
.docs-title h1 { margin-bottom: 0; }
.docs-title h5 { margin: 0; font-weight: 500; }
.docs-title .lead-text { margin: 14px 0 0; color: var(--tr-text-muted); font-size: .95rem; }

/* ---------- Panels ---------- */
.tr-panel { margin-bottom: 24px; }
.tr-panel-pad { padding: 16px 20px; }
.docs-h {
    margin: 4px 0 12px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tr-gold);
}
.docs-muted { color: var(--tr-text-muted); }
.docs-small { font-size: .85rem; }
.docs-eyebrow {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tr-gold);
}
.docs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .8rem;
    color: var(--tr-text);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(222, 168, 76, 0.5);
}

/* ---------- Section heads (home rails) ---------- */
.docs-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 32px 0 12px;
}
.docs-section-head h2 { margin: 0; font-size: 1.5rem; }
.docs-section-head a { font-size: .9rem; }

/* ---------- Card grids ---------- */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}
.docs-grid.lg { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.docs-card {
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--tr-text);
    text-decoration: none;
    background-color: var(--tr-panel-bg);
    border: 1px solid var(--tr-gold);
    border-radius: var(--tr-radius);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.docs-card:hover, .docs-card:focus {
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--tr-gold);
}
/* a lift for the mouse; with the focus it would leave the cursor behind (css/site.css), so there the art comes forward instead */
.docs-card:hover { transform: translateY(-3px); }
.docs-card:focus .docs-card-title { color: #ffe9a8; }
.docs-card-media {
    aspect-ratio: 3 / 4;
    background: #0d2237;
    overflow: hidden;
}
.docs-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.docs-card:hover .docs-card-media img, .docs-card:focus .docs-card-media img { transform: scale(1.05); }
/* God cards share the hero card box (3:4) and cover it, like heroes do. */
.docs-card-media.area { aspect-ratio: 16 / 10; }
.docs-card-body { padding: 10px 12px 12px; }
.docs-card-title { font-weight: 500; line-height: 1.25; }
.docs-card-sub { font-size: .8rem; color: var(--tr-text-muted); margin-top: 2px; }
.badge-status {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    font-weight: 500;
}
.badge-stub { margin-top: 6px; display: inline-block; }

/* ---------- Detail view ---------- */
.docs-splash {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: clamp(240px, 38vh, 420px);
    background: #050f1a;
}
.docs-splash img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}
.docs-splash::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(180deg, rgba(8, 25, 41, 0) 25%, rgba(8, 25, 41, 0.92) 100%);
}
.docs-splash-head {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 20px;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.docs-splash-head h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
.docs-splash-head .badge { margin-left: auto; align-self: flex-end; margin-bottom: 8px; font-weight: 500; }

.docs-card-slab { display: flex; justify-content: center; padding: 6px 0 10px; }
.docs-card-slab img { max-width: 240px; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.6)); }

.docs-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px 20px;
}
.docs-stats.one { grid-template-columns: 1fr; }
.docs-stats li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.docs-stats .k { flex: 1; color: var(--tr-text-muted); font-size: .8rem; }
.docs-stats .v { font-weight: 600; }
.docs-ico { width: 20px; height: 20px; image-rendering: pixelated; object-fit: contain; }

.docs-table { width: 100%; font-size: .9rem; border-collapse: collapse; }
.docs-table th, .docs-table td { padding: .4rem .5rem; text-align: left; vertical-align: middle; }
.docs-table th {
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tr-gold);
    border-bottom: 1px solid rgba(222, 168, 76, 0.4);
}
.docs-table td { border-bottom: 1px solid rgba(222, 168, 76, 0.12); }
.docs-table img { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: middle; margin-right: 8px; }
.docs-table .pos { color: #ffe3a2; }
.docs-table .neg { color: #ff9a9a; }

.docs-abilities { display: grid; gap: 10px; }
.docs-ability {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(222, 168, 76, 0.25);
}
.docs-ability-ico { width: 32px; height: 32px; image-rendering: pixelated; object-fit: contain; } /* Tibia icons are 32px; shown 1:1 */
.docs-ability-name { font-weight: 600; }
.docs-ability-meta { font-size: .8rem; color: var(--tr-text-muted); margin-top: 2px; }
.docs-ability-effect { font-size: .875rem; margin-top: 4px; }
.docs-ability-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.docs-ability-side .docs-icon-btn { width: 32px; height: 32px; }
.docs-ability-cost { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: .8rem; color: var(--tr-gold); }
.docs-ability-cost small { color: var(--tr-text-muted); }
.docs-ability-cost .mana { color: #7cc4ff; }

/* Each arena as a row: the HD splash at a size that shows it, the details beside it (stacked on a phone) */
.docs-skins {
    display: grid;
    gap: 14px;
}
.docs-skin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(222, 168, 76, 0.25);
    text-align: center;
}
.docs-skin img { width: 140px; height: 140px; object-fit: contain; image-rendering: pixelated; }
.docs-skin.wide { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: center; gap: 16px; text-align: left; }
.docs-skin.wide img { width: 100%; height: auto; aspect-ratio: 1024 / 614; image-rendering: auto; object-fit: cover; border-radius: 6px; }
.docs-arena-info .name { font-size: 1.1rem; }
.docs-arena-modes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
@media (max-width: 640px) { .docs-skin.wide { grid-template-columns: 1fr; gap: 10px; text-align: center; } .docs-arena-modes { justify-content: center; } }
.docs-arena-modes .docs-chip { font-size: .68rem; padding: 1px 7px; }
.docs-skin .name { font-weight: 600; font-size: .9rem; }
.docs-skin .rarity { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-text-muted); }
.docs-skin.uncommon  .rarity { color: #9ad9ff; }
.docs-skin.rare      .rarity { color: #c89bff; }
.docs-skin.epic      .rarity { color: #ffb168; }
.docs-skin.legendary .rarity { color: #ffc107; }

.docs-prose { color: rgba(255, 255, 255, 0.85); }
.docs-prose p { margin: 0 0 10px; }
.docs-prose h2, .docs-prose h3, .docs-prose h4 {
    margin: 16px 0 6px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tr-gold);
}
.docs-prose ul, .docs-prose ol { padding-left: 20px; }
.docs-prose hr { border-color: rgba(222, 168, 76, 0.3); }
.docs-prose code { color: #ffe3a2; }

.docs-share-url { margin-top: 10px; }
.docs-share-url .form-control { background: rgba(0, 0, 0, 0.4); border-color: rgba(222, 168, 76, 0.5); color: #fff; }

/* ---------- História timeline ---------- */
/* Chapters on a timeline: the node on the spine, then the chapter's art + shards (a spoiler). The full chapter has its own page. */
.docs-chapters { list-style: none; margin: 24px 0 0; padding: 0 0 0 48px; position: relative; }
.docs-chapters::before { content: ""; position: absolute; left: 16px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(180deg, transparent, var(--tr-gold) 6%, var(--tr-gold) 94%, transparent); }
.docs-chapter { position: relative; margin-bottom: 28px; }
.docs-chapter .node { position: absolute; left: -48px; top: 2px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: #1b1408; background: var(--tr-gold); box-shadow: 0 0 0 3px #050f1a, 0 0 14px rgba(222, 168, 76, 0.6); }
.docs-chapter-head { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.docs-chapter-head h3 { margin: 0; font-size: 1.25rem; }
.docs-chapter-head .subtitle { color: var(--tr-text-muted); font-style: italic; margin-top: 2px; }
.docs-chapter-head .docs-chapter-link { margin-left: auto; }
.docs-side { padding: 14px 18px; display: flex; flex-direction: column; }
/* Shard card: the chapter art (smaller, never upscaled) on the left, the shards on the right (~60%); stacked when narrow */
.docs-side.left .docs-spoiler .body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px; align-items: start; }
@media (max-width: 760px) { .docs-side.left .docs-spoiler .body { grid-template-columns: 1fr; } }
.docs-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.docs-side-head h4 { margin: 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tr-gold); }
.docs-side .docs-prose { font-size: .95rem; }
.docs-chapter-page { margin-top: 8px; }
.docs-chapter-page .docs-chapter-text { max-width: 72ch; font-size: 1.02rem; line-height: 1.7; }
.docs-chapter-page .docs-chapter-text p { text-align: justify; hyphens: auto; }
.docs-chapter-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
/* Each panel is a game spoiler: blurred until the reader chooses to reveal it. */
.docs-spoiler { position: relative; margin-top: 12px; flex: 1; }
.docs-side.spoiler .docs-spoiler .body { filter: blur(7px); user-select: none; pointer-events: none; max-height: 420px; overflow: hidden; }
.docs-spoiler-cover {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border-radius: 8px;
}
.docs-spoiler-cover .hint { font-size: .85rem; color: var(--tr-text-muted); max-width: 36ch; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.docs-side:not(.spoiler) .docs-spoiler-cover { display: none; }
.docs-side .hide-link { margin-top: 8px; font-size: .85rem; align-self: flex-start; }
.docs-side.spoiler .hide-link { display: none; }
@media (max-width: 600px) {
    .docs-chapters { padding-left: 36px; }
    .docs-chapters::before { left: 10px; }
    .docs-chapter .node { left: -36px; width: 26px; height: 26px; font-size: .7rem; }
}

/* ---------- Mechanics ---------- */
.docs-mech { display: grid; grid-template-columns: 72px 1fr; gap: 16px; }
.docs-mech img { width: 64px; height: 64px; image-rendering: pixelated; object-fit: contain; }
.docs-mech h3 { margin: 0 0 2px; font-size: 1.25rem; }

/* ---------- Boot / errors / utilities ---------- */
.docs-boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 50vh;
    color: var(--tr-text-muted);
}
.docs-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(222, 168, 76, 0.25);
    border-top-color: var(--tr-gold);
    animation: docs-spin 1s linear infinite;
}
@keyframes docs-spin { to { transform: rotate(360deg); } }
.docs-empty {
    padding: 32px;
    text-align: center;
    color: var(--tr-text-muted);
    border: 1px dashed rgba(222, 168, 76, 0.5);
    border-radius: var(--tr-radius);
}
.docs-error pre {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    color: #ffe3a2;
    font-size: .9rem;
    white-space: pre-wrap;
}
.docs-error code { color: #ffe3a2; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
}
@media (max-width: 767.98px) {
    .docs-era-head { grid-template-columns: 1fr; }
    .docs-era-head .cover { max-width: 200px; }
    .docs-stats { grid-template-columns: 1fr; }
    .docs-ability { grid-template-columns: 32px minmax(0, 1fr); }
    .docs-splash-head .badge { margin-left: 0; }
    .docs-mech { grid-template-columns: 56px 1fr; }
    .docs-mech img { width: 48px; height: 48px; }
}
@media (max-width: 575.98px) {
    .docs-main.container { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Docs hub (home) + hero "special mechanic" panel
   Appended by the i18n / hub change. Layout only: the look
   (panel, gold border, palette) still comes from css/site.css.
   ========================================================= */
.docs-hub {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 8px;
}
@media (min-width: 768px) {
    .docs-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.docs-hub-tile {
    position: relative;
    display: block;
    height: clamp(250px, 30vw, 300px);
    padding: 0;
    overflow: hidden;
    color: var(--tr-text);
    text-decoration: none;
    background: #050f1a;
    transition: transform .2s ease, box-shadow .2s ease;
}
.docs-hub-tile:hover, .docs-hub-tile:focus {
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--tr-gold);
}
.docs-hub-tile:hover { transform: translateY(-3px); }
.docs-hub-tile:focus h2 { color: #ffe9a8; }
.docs-hub-tile img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    transition: transform .4s ease;
}
.docs-hub-tile:hover img, .docs-hub-tile:focus img { transform: scale(1.04); }
/* Portrait god card: show it whole instead of cropping a band out of it */
.docs-hub-tile.god img { object-fit: contain; object-position: center; padding: 14px 0 0; }
/* Small pixel-art region maps scale up crisp */
.docs-hub-tile.area img { image-rendering: pixelated; }
/* Same dark gradient as .docs-splash so the heading reads over any art */
.docs-hub-tile::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(180deg, rgba(8, 25, 41, 0) 30%, rgba(8, 25, 41, 0.92) 100%);
}
.docs-hub-copy {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 16px;
    z-index: 1;
}
.docs-hub-copy h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}
.docs-hub-copy p {
    margin: 2px 0 0;
    font-size: .9rem;
    color: var(--tr-text-muted);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
/* Hero page: special mechanic panel (the .docs-mech grid is defined above) */
.docs-mech h4 { margin: 0 0 2px; font-size: 1.15rem; }

/* =========================================================
   Detail page: skins as rows, sound buttons, voice lines,
   compact side-column lists. Home: rotation panel, wide hub
   tile. Spells reference: filters + table.
   ========================================================= */
.docs-skin-list { display: grid; gap: 8px; }
.docs-skin-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(222, 168, 76, 0.25);
}
.docs-skin-row img, .docs-skin-blank {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
}
.docs-skin-row .name { font-weight: 600; }
.docs-skin-row .rarity { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tr-text-muted); }
.docs-skin-row.uncommon .rarity { color: #9ad9ff; }
.docs-skin-row.rare .rarity { color: #c89bff; }
.docs-skin-row.epic .rarity { color: #ffb168; }
.docs-skin-row.legendary .rarity { color: #ffc107; }
.docs-skin-row.unattainable .rarity { color: #ff9a9a; }

/* Play/stop state of the icon button */
.docs-play .ico-stop { display: none; }
.docs-play.is-playing .ico-play { display: none; }
.docs-play.is-playing .ico-stop { display: inline; }
.docs-play.lg { width: 44px; height: 44px; margin-left: 14px; vertical-align: 8px; }
.docs-voice { display: grid; gap: 8px; }
.docs-voice-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(222, 168, 76, 0.2);
}
.docs-voice-case { flex: none; min-width: 9em; }
.docs-voice-text { opacity: .8; font-style: italic; }
.docs-abilities.compact .docs-ability { gap: 10px; padding: 8px 10px; }
.docs-abilities.compact .docs-ability-name { font-size: .95rem; }
.col-lg-4 .docs-table { font-size: .82rem; }
.col-lg-4 .docs-table th, .col-lg-4 .docs-table td { padding: .3rem .35rem; }
a.docs-ability-link { color: var(--tr-text); text-decoration: none; }
a.docs-ability-link:hover { color: #fff; border-color: var(--tr-gold); text-decoration: none; }

/* Free Week: hovers over the page in the bottom-right corner as a pill with the free heroes' faces; hover (or a tap)
   grows it up and left into the showcase. The pill's width is --fw-closed; the panel's is --fw-open. */
.docs-fw {
    --fw-closed: 228px;
    --fw-open: min(420px, calc(100vw - 32px));
    position: fixed;
    right: 24px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 1025;
    width: var(--fw-open);
    max-width: var(--fw-closed);
    overflow: hidden;
    background: rgba(5, 15, 26, 0.95);
    border: 1px solid var(--tr-gold);
    border-radius: 27px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 14px rgba(222, 168, 76, 0.25);
    transition: max-width .24s ease, border-radius .24s ease, box-shadow .2s ease, bottom .2s ease;
}
/* While the Tiblia invitation is up the widget waits above it, so both can be seen and clicked */
body:has(.docs-toast) .docs-fw { bottom: calc(172px + env(safe-area-inset-bottom, 0px)); }
body:has(.docs-toast) .docs-fw-inner { max-height: calc(100vh - 380px); }
@media (max-width: 480px) { body:has(.docs-toast) .docs-fw { bottom: calc(196px + env(safe-area-inset-bottom, 0px)); } }
.docs-fw:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 18px rgba(222, 168, 76, 0.45); }
.docs-fw.is-open { max-width: var(--fw-open); border-radius: 15px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6), 0 0 20px rgba(222, 168, 76, 0.35); }
.docs-fw-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 7px 16px 7px 8px; background: none; border: 0; color: var(--tr-text); text-align: left; white-space: nowrap; cursor: pointer; }
.docs-fw-faces { display: flex; flex: none; width: calc(36px + (var(--n, 3) - 1) * 24px); overflow: hidden; transition: width .24s ease, opacity .15s ease; }
.docs-fw-faces img { flex: none; width: 36px; height: 36px; margin-left: -12px; border-radius: 50%; object-fit: cover; background: #050f1a; border: 2px solid rgba(222, 168, 76, 0.75); }
.docs-fw-faces img:first-child { margin-left: 0; }
.docs-fw-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.docs-fw-title b { font-size: 1rem; font-weight: 600; }
.docs-fw-title small { display: none; margin: 0; }
.docs-fw-caret { flex: none; margin-left: auto; color: var(--tr-gold); transition: transform .24s ease; }
.docs-fw.is-open .docs-fw-head { padding-left: 16px; gap: 0; }
.docs-fw.is-open .docs-fw-faces { width: 0; opacity: 0; }
.docs-fw.is-open .docs-fw-title { flex-direction: column; align-items: flex-start; gap: 0; }
.docs-fw.is-open .docs-fw-title small { display: block; line-height: 1.25; white-space: normal; }
.docs-fw.is-open .docs-fw-caret { transform: rotate(180deg); }
/* The height opens with the grid row, so it animates to whatever the showcase needs */
.docs-fw-body { display: grid; grid-template-rows: 0fr; width: var(--fw-open); transition: grid-template-rows .24s ease; }
.docs-fw.is-open .docs-fw-body { grid-template-rows: 1fr; }
.docs-fw-inner { min-height: 0; max-height: calc(100vh - 210px); overflow: hidden auto; } /* short screens: the head stays below the nav */
.docs-rot-groups { display: grid; gap: 12px; padding: 0 16px 14px; }
@media (max-width: 480px) { .docs-fw { right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .docs-fw, .docs-fw * { transition: none !important; } }
.docs-rot-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tr-gold); margin-bottom: 6px; }
/* Three equal columns in every group, so each circle sits on the centre line of the arena picture below it */
.docs-rot-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.docs-rot-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; color: var(--tr-text); text-decoration: none; text-align: center; }
.docs-rot-tile img, .docs-rot-blank { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(222, 168, 76, 0.55); background: #050f1a; box-shadow: 0 0 0 2px #050f1a, 0 0 10px rgba(222, 168, 76, 0.25); transition: transform .15s ease, box-shadow .15s ease; display: block; }
.docs-rot-tile.wide img { width: 100%; height: auto; aspect-ratio: 1024 / 614; border-radius: 8px; }
.docs-rot-tile .name { font-size: .72rem; line-height: 1.15; color: var(--tr-text); }
.docs-rot-tile:hover { text-decoration: none; color: #fff; }
.docs-rot-tile:hover img { transform: translateY(-2px); box-shadow: 0 0 0 2px #050f1a, 0 0 16px rgba(222, 168, 76, 0.6); border-color: var(--tr-gold); }
a.docs-chip { text-decoration: none; }
a.docs-chip:hover { color: #fff; border-color: var(--tr-gold); text-decoration: none; }
.docs-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: #28a745; box-shadow: 0 0 6px #28a745; flex: 0 0 auto; }



/* =========================================================
   Round 3: skin rows select a skin (shine sweep on hover, like
   the old wiki cards), linked-spell words + sheet icons, god
   level ladder.
   ========================================================= */
.shine { position: relative; overflow: hidden; }
.shine::after {
    content: "";
    position: absolute;
    left: -20%; right: -20%; top: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255, 236, 190, 0.28) 50%, rgba(255,255,255,0) 100%);
    transform: translateY(130%) rotate(-6deg);
    opacity: 0;
    pointer-events: none;
    transition: transform .75s ease, opacity .75s ease;
}
.shine:hover::after, .shine:focus::after { transform: translateY(-140%) rotate(-6deg); opacity: 1; }
.docs-skin-row { color: var(--tr-text); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.docs-skin-row:hover, .docs-skin-row:focus { color: #fff; text-decoration: none; border-color: var(--tr-gold); background: rgba(222, 168, 76, 0.08); }
.docs-skin-row.is-selected { border-color: var(--tr-gold); background: rgba(222, 168, 76, 0.14); box-shadow: inset 3px 0 0 var(--tr-gold); }
.docs-ability-words { font-size: .75rem; letter-spacing: .06em; color: #f6d57a; font-style: italic; margin-top: 1px; }
.docs-spell-sprite {
    display: inline-block;
    width: 32px; height: 32px;
    margin: 4px;
    background-image: url(assets/img/spells/defaultspells.png);
    background-repeat: no-repeat;
    image-rendering: pixelated;
    border-radius: 4px;
}
.docs-levels { display: grid; gap: 6px; }
.docs-level { display: flex; align-items: center; gap: 10px; font-size: .9rem; padding: 4px 6px; }
.docs-level .k { color: var(--tr-text-muted); font-size: .8rem; min-width: 64px; }
.docs-level .v { font-weight: 600; }
.docs-level .docs-ico { width: 20px; height: 20px; image-rendering: pixelated; object-fit: contain; display: inline-block; }
.docs-level.is-spell { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; padding: 8px 6px; border-top: 1px solid rgba(222, 168, 76, 0.2); border-bottom: 1px solid rgba(222, 168, 76, 0.2); }
.docs-level.is-spell .k { padding-top: 12px; }
.docs-card.shine::after { z-index: 2; }

/* Starter-god badge (gold) and the badge group in the splash header */
.badge-gold { background: var(--tr-gold); color: #1b1408; }
.docs-splash-badges { display: inline-flex; gap: 6px; align-items: center; }

/* Entity without art yet (e.g. a new god): the splash panel shrinks to its title */
.docs-splash.no-art { min-height: 0; }
.docs-splash.no-art .docs-splash-head { position: static; padding: 28px 24px; }


/* Share panel: round icon buttons (Phosphor), link box always visible for copy-by-hand */
.docs-share-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-bottom: 10px; }
/* one line always: the buttons shrink together when the panel is narrow, so the last one never leaves the panel */
.docs-share-row .docs-icon-btn { flex: 0 1 34px; width: auto; min-width: 0; height: auto; aspect-ratio: 1 / 1; }
.docs-share-row .docs-icon-btn svg { width: 18px; height: 18px; }
.docs-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(222, 168, 76, 0.45); background: rgba(255, 255, 255, 0.03); color: var(--tr-gold); display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; transition: background .15s ease, color .15s ease, transform .15s ease; }
.docs-icon-btn:hover, .docs-icon-btn:focus-visible { background: var(--tr-gold); color: #1b1408; text-decoration: none; }
.docs-icon-btn:hover { transform: translateY(-1px); }
.docs-share-url input { font-size: .78rem; }

/* Blessings of the god: a timeline from the bond (1) to 30; spells are the big gold nodes, potion rungs the green ones */
.docs-godline { list-style: none; margin: 0; padding: 0 0 0 46px; position: relative; display: grid; gap: 4px; }
.docs-godline::before { content: ""; position: absolute; left: 15px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, transparent, var(--tr-gold) 8%, var(--tr-gold) 92%, transparent); }
.docs-godline-item { position: relative; min-height: 32px; display: flex; align-items: center; }
.docs-godline-item .node { position: absolute; left: -46px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--tr-text-muted); background: #0b1b2c; border: 1px solid rgba(222, 168, 76, 0.35); box-shadow: 0 0 0 3px #050f1a; }
.docs-godline-item .body { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 8px; width: 100%; }
.docs-godline-item .b { font-size: .85rem; font-weight: 600; }
.docs-godline-item .docs-ico { width: 20px; height: 20px; image-rendering: pixelated; object-fit: contain; }
.docs-godline-item.is-item .node { border-color: rgba(120, 200, 120, 0.6); color: #9be09b; }
.docs-godline-item.is-empty { opacity: .45; }
.docs-godline-item.is-spell { min-height: 56px; }
.docs-godline-item.is-spell .node { background: var(--tr-gold); color: #1b1408; border-color: var(--tr-gold); box-shadow: 0 0 0 3px #050f1a, 0 0 14px rgba(222, 168, 76, 0.6); }
.docs-godline-item.is-spell .body { background: rgba(222, 168, 76, 0.09); border: 1px solid rgba(222, 168, 76, 0.5); padding: 8px 12px; }
.docs-godline-item.is-spell .b { font-size: 1rem; display: block; }

/* Lore: a chapter's art and its shards (one shard = one bullet, earned one per battle in the game) */
/* The chapter art is shown at its own pixel size (never upscaled) and the shard card hugs it. */
.docs-chapter-art { margin: 0; width: fit-content; max-width: 100%; border: 1px solid var(--tr-gold); border-radius: var(--tr-radius); overflow: hidden; background: #050f1a; }
.docs-chapter-art img { display: block; width: auto; max-width: 100%; height: auto; }
.docs-shards ul { list-style: none; padding-left: 0; counter-reset: shard; }
.docs-shards li { position: relative; padding-left: 36px; margin-bottom: 8px; counter-increment: shard; }
.docs-shards li::before { content: counter(shard); position: absolute; left: 0; top: 0; width: 26px; height: 26px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: rgba(222, 168, 76, 0.22); color: var(--tr-gold); font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.docs-shards li::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: inset 0 0 0 1px rgba(222, 168, 76, 0.8); pointer-events: none; }

/* Era tabs: Genesis (left) and Apocalipse (right); the active one glows */
.docs-era-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 4px 0 8px; }
.docs-era-tab { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; text-decoration: none; color: var(--tr-text); opacity: .55; transition: opacity .15s ease, box-shadow .15s ease, transform .15s ease; }
.docs-era-tab:last-child { text-align: right; align-items: flex-end; }
.docs-era-tab .title { font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.docs-era-tab .by { font-style: italic; color: var(--tr-text-muted); }
.docs-era-tab:hover { opacity: .85; text-decoration: none; color: #fff; }
/* the tab the cursor is on is never the dim one */
.docs-era-tab:focus { opacity: 1; text-decoration: none; color: #fff; }
.docs-era-tab:focus .title { color: #ffe9a8; }
.docs-era-tab.is-active { opacity: 1; box-shadow: 0 0 0 1px var(--tr-gold), 0 0 22px rgba(222, 168, 76, 0.35); background: rgba(222, 168, 76, 0.06); }
.docs-era { margin: 8px 0 40px; }
/* Reading column (chapter page, the Tiblia) */
.docs-reading { max-width: 78ch; margin: 0 auto; }
.docs-book-era { margin: 28px 0 10px; text-align: center; }
.docs-book-era h2 { margin: 2px 0; }
.docs-book-era .by { font-style: italic; color: var(--tr-text-muted); }
.docs-book-chapter { margin: 22px 0 30px; }
.docs-book-chapter h3 { margin: 2px 0 4px; }
.docs-book-chapter .subtitle { color: var(--tr-text-muted); font-style: italic; }
/* The reading invitation (toast, bottom-right) */
.docs-toast { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1050; width: min(360px, calc(100vw - 32px)); padding: 14px 16px; background: #0b1b2c; border: 1px solid var(--tr-gold); border-radius: var(--tr-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 18px rgba(222, 168, 76, 0.25); transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
.docs-toast.is-in { transform: none; opacity: 1; }
.docs-toast.is-leaving { transform: translateY(16px); opacity: 0; }
.docs-toast-title { font-weight: 600; color: var(--tr-gold); margin-bottom: 4px; }
.docs-toast p { margin: 0 0 10px; font-size: .9rem; color: var(--tr-text); }
.docs-toast-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
    .docs-era-tabs { grid-template-columns: 1fr; }
    .docs-era-tab:last-child { text-align: left; align-items: flex-start; }
    .docs-era-tab .title { font-size: 1.5rem; }
}

/* Item slots on the hero page */
.docs-slots { display: grid; gap: 14px; }
.docs-slot-head { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tr-gold); margin-bottom: 6px; }
/* Every page is at least one screen tall, so the footer always sits below the fold */
.docs-main { min-height: 100vh; }
/* Where a god's potion lands (default vault chip on the ladder) and the no-potions note under the slots */
.docs-godline-item .vault { margin-left: auto; font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: var(--tr-gold); border: 1px solid rgba(222, 168, 76, 0.45); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.docs-slot-note { margin: 10px 0 0; font-size: .82rem; color: var(--tr-text-muted); }
/* site.css squares every <button> with !important; the round icon button must look the same as a link or as a button */
button.docs-icon-btn, button.docs-icon-btn:hover, button.docs-icon-btn:focus { border-radius: 50% !important; border-color: rgba(222, 168, 76, 0.45) !important; }
/* The hide link of a spoiler card, in the palette instead of bootstrap blue */
.docs-side .hide-link { color: var(--tr-text-muted); }
.docs-side .hide-link:hover, .docs-side .hide-link:focus { color: var(--tr-gold); text-decoration: none; }

/* Arena rows are links to the arena page; the arena page: game modes with the client's icons, and the top-down map */
a.docs-skin { color: var(--tr-text); text-decoration: none; transition: border-color .15s ease, background .15s ease; }
a.docs-skin:hover, a.docs-skin:focus { color: #fff; text-decoration: none; border-color: var(--tr-gold); background: rgba(222, 168, 76, 0.08); }
.docs-modes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs-modes li { display: flex; align-items: center; gap: 12px; font-size: .95rem; min-width: 0; }
.docs-mode-ico { width: 48px; height: 48px; flex: 0 0 auto; image-rendering: pixelated; object-fit: contain; }
.docs-modes li > div { min-width: 0; }
.docs-mode-name { font-weight: 600; }
.docs-mode-pays { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(222, 168, 76, 0.2); }
.docs-mode-pays ul { margin: 0; padding-left: 18px; }
.docs-mode-pays li { margin-bottom: 3px; }
a.docs-mode-name { color: inherit; text-decoration: none; }
a.docs-mode-name:hover { color: var(--tr-gold); }

/* Modos (#/modos): one card per mode the server runs, its arenas as small art you can open, and what a match pays. Two columns from a wide window. */
.docs-modes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 18px; }
.docs-mode-card { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.docs-mode-head { display: flex; align-items: center; gap: 12px; }
.docs-mode-head .docs-h { margin: 0; }
.docs-mode-summary { margin: 0; }
.docs-mode-card .docs-slot-head { margin-bottom: 0; }
.docs-mode-card .docs-mode-pays { margin-top: auto; }
.docs-mode-card .docs-mode-pays p { margin: 4px 0 0; }
.docs-mode-where { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.docs-mode-arena { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; border-radius: 6px; padding: 4px; }
.docs-mode-arena img { width: 100%; height: auto; aspect-ratio: 220 / 132; object-fit: cover; border-radius: 4px; border: 1px solid rgba(222, 168, 76, 0.25); }
.docs-mode-arena .name { font-weight: 600; line-height: 1.2; margin-top: 4px; }
.docs-mode-arena:hover .name { color: var(--tr-gold); }
.docs-modes-foot { text-align: center; margin: 4px 0 24px; }
/* What a form names of its own: under the form's row, set in from it */
.docs-form-own { margin: 2px 0 6px 18px; padding: 10px 0 2px 14px; border-left: 2px solid rgba(222, 168, 76, 0.35); }
.docs-form-own .docs-slot-note { margin: 0 0 10px; }
/* a form's own numbers, as chips under its row (heroes.json params.stats) */
.docs-form-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 8px 18px; padding-left: 14px; }
.docs-arena-map { text-align: center; }
.docs-arena-map img { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid rgba(222, 168, 76, 0.25); }
.docs-stats .v[href] { color: var(--tr-gold); }
/* An arena's modifier: its name over the description */
.docs-arena-mod { margin: 0 0 6px; font-size: 1.15rem; color: var(--tr-gold); }
.docs-arena-mod-line { color: var(--tr-gold); }

/* ROUTE TRANSITIONS — the page slides with the menu (route() in app.js). Only #app moves: the frame and the navbar stay. */
#app {
    view-transition-name: docs-page;
}
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
}
::view-transition-group(docs-page) {
    animation-duration: .36s;
    animation-timing-function: cubic-bezier(.22, .8, .24, 1);
}
::view-transition-old(docs-page),
::view-transition-new(docs-page) {
    animation-duration: .36s;
    animation-timing-function: cubic-bezier(.22, .8, .24, 1);
    mix-blend-mode: normal;
    /* each page keeps its own height instead of being stretched into the other's */
    height: auto;
    width: 100%;
    top: 0;
}
:root[data-route-motion="next"]::view-transition-old(docs-page) { animation-name: page-out-left; }
:root[data-route-motion="next"]::view-transition-new(docs-page) { animation-name: page-in-right; }
:root[data-route-motion="previous"]::view-transition-old(docs-page) { animation-name: page-out-right; }
:root[data-route-motion="previous"]::view-transition-new(docs-page) { animation-name: page-in-left; }
:root[data-route-motion="deeper"]::view-transition-old(docs-page) { animation-name: page-sink; }
:root[data-route-motion="deeper"]::view-transition-new(docs-page) { animation-name: page-rise; }
:root[data-route-motion="shallower"]::view-transition-old(docs-page) { animation-name: page-drop; }
:root[data-route-motion="shallower"]::view-transition-new(docs-page) { animation-name: page-surface; }
@keyframes page-out-left { to { transform: translateX(-100vw); } }
@keyframes page-in-right { from { transform: translateX(100vw); } }
@keyframes page-out-right { to { transform: translateX(100vw); } }
@keyframes page-in-left { from { transform: translateX(-100vw); } }
@keyframes page-sink { to { opacity: 0; transform: scale(.97); } }
@keyframes page-rise { from { opacity: 0; transform: translateY(46px); } }
@keyframes page-drop { to { opacity: 0; transform: translateY(46px); } }
@keyframes page-surface { from { opacity: 0; transform: scale(.97); } }

/* THE APP ON THE HANDHELDS — the same site (TibiarokClient/ports/anbernic/grimorio). It has no way to the outside, no keyboard for a search,
   and it draws in software: blurs cost more than they give there. */
.in-app [data-releases-link],
.in-app .site-logo-link,
.in-app .nav-search,
.in-app .site-foot,
.in-app .docs-fw,
.in-app .tr-panel:has(.docs-share-row) {
    display: none !important;
}
/* with no blur behind it, the bar would have the page's text legible through it */
.in-app .site-nav.navbar {
    background: rgba(6, 18, 31, .94);
}
.in-app {
    scrollbar-gutter: auto;
}
.in-app::-webkit-scrollbar {
    display: none;
}
.in-app * {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
/* The cursor's glide and glow cost next to nothing there, so they stay. These do not, measured on the device on 2026-11-02: an animation with
   steps still ticks every frame, so the idle blink alone kept 38% of a core busy against 12% without it, parked or not; the strike and the zoom
   were what dropped frames (13% against 4% of them late). */
.in-app body::after,
.in-app :focus {
    animation: none !important;
}
.in-app .docs-card:focus .docs-card-media img,
.in-app .docs-hub-tile:focus img {
    transform: none;
}

/* ARRIVING — from outside the Grimório the content rises from below (riseIntoFrame() in app.js) */
.docs-arriving {
    animation: docs-arrive .85s cubic-bezier(.16, .84, .28, 1) both;
}
@keyframes docs-arrive {
    from { opacity: 0; transform: translateY(70vh); }
}

/* GAMEPAD — the ring and the legend exist only while the pad is what is being used (pad.js) */
.pad-legend {
    display: none;
}
.pad-mode .pad-legend {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 1040;
    display: flex;
    gap: 14px;
    padding: 6px 14px;
    border: 1px solid var(--tr-gold);
    border-radius: var(--tr-radius);
    background: rgba(4, 13, 24, .92);
    color: var(--tr-text);
    font-size: .8rem;
    white-space: nowrap;
}
.pad-legend-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
/* A face button is its position in the diamond; a pad's own labels differ between makers. */
.pad-glyph {
    position: relative;
    display: inline-block;
    width: 15px;
    height: 15px;
}
.pad-glyph::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 14%, var(--n, #54606e) 0 2.4px, transparent 2.9px),
        radial-gradient(circle at 50% 86%, var(--s, #54606e) 0 2.4px, transparent 2.9px),
        radial-gradient(circle at 14% 50%, var(--w, #54606e) 0 2.4px, transparent 2.9px),
        radial-gradient(circle at 86% 50%, var(--e, #54606e) 0 2.4px, transparent 2.9px);
}
.pad-north { --n: #f2c566; }
.pad-south { --s: #f2c566; }
.pad-west { --w: #f2c566; }
.pad-east { --e: #f2c566; }
.pad-dpad-x::before,
.pad-dpad-y::before {
    background:
        linear-gradient(#54606e, #54606e) center / 5px 100% no-repeat,
        linear-gradient(#54606e, #54606e) center / 100% 5px no-repeat;
}
.pad-dpad-x::before {
    background:
        linear-gradient(#54606e, #54606e) center / 5px 100% no-repeat,
        linear-gradient(#f2c566, #f2c566) center / 100% 5px no-repeat;
}
.pad-dpad-y::before {
    background:
        linear-gradient(#54606e, #54606e) center / 100% 5px no-repeat,
        linear-gradient(#f2c566, #f2c566) center / 5px 100% no-repeat;
}
/* with no anchor positioning there is only the plain ring (css/site.css), and the Free Week clips what falls outside it */
@supports not (anchor-name: --tr-cursor) {
    .docs-fw-head:focus-visible, .pad-mode .docs-fw-head:focus,
    .docs-rot-tile:focus-visible, .pad-mode .docs-rot-tile:focus {
        outline-offset: -3px;
    }
}
/* the legend keeps the bottom of the screen: what the ring must reach waits above it */
.pad-mode .docs-toast {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}
.pad-mode body:has(.docs-toast) .docs-fw {
    bottom: calc(208px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 900px) {
    .pad-mode .docs-fw { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
    .pad-mode .pad-legend { gap: 9px; padding: 5px 9px; font-size: .68rem; }
}

/* Segredos (#/segredos): achievements behind their spoilers, every avatar and how it is earned. The blank medal stands in a card's head until it is revealed. */
.docs-secrets-lead { color: var(--tr-text-muted); margin: 4px 0 14px; }
.docs-secrets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 28px; }
.docs-secret .docs-secret-blank { width: 40px; height: 40px; }
.docs-secret:not(.spoiler) .docs-secret-blank { display: none; }
.docs-medal-row { display: flex; gap: 14px; align-items: center; }
.docs-medal { width: 64px; height: 64px; flex: none; }
.docs-medal-title { margin: 0 0 4px; font-size: 1rem; color: var(--tr-gold); }
.docs-medal-text { margin: 0; font-size: .9rem; }
.docs-medal-reward { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: .88rem; }
.docs-avatar-small { width: 40px; height: 40px; border-radius: 50%; }
.docs-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.docs-avatar-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px; gap: 6px; }
.docs-avatar-card h4 { margin: 4px 0 0; font-size: .95rem; }
.docs-avatar { width: 124px; height: 124px; border: 2px solid var(--tr-gold); }
.docs-rarity-edge-common { border-color: #e8e8ee; }
.docs-rarity-edge-rare { border-color: #5a9ae0; }
.docs-rarity-edge-epic { border-color: #e8c35a; }
.docs-rarity-edge-legend { border-color: #ffd94a; box-shadow: 0 0 14px rgba(255, 217, 74, .45); }
.docs-rarity-common { color: #e8e8ee; }
.docs-rarity-rare { color: #5a9ae0; border-color: #5a9ae0; }
.docs-rarity-epic { color: #e8c35a; border-color: #e8c35a; }
.docs-rarity-legend { color: #ffd94a; border-color: #ffd94a; }
.docs-avatar-how { margin: 4px 0 0; font-size: .85rem; color: var(--tr-text-muted); display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.docs-skull { width: 30px; height: 30px; image-rendering: pixelated; }
.docs-secret-inline { width: 100%; padding: 8px 10px; margin-top: 6px; }
/* A Segredos spoiler's cover can be taller than the one line it hides (an avatar's card): body and cover share one grid cell, so the panel grows to the taller of the two
   and the cover never spills over its heading or under the border (verifier, 2026-11-09). The Lore's spoilers keep the absolute cover. */
.docs-secret .docs-spoiler { display: grid; }
.docs-secret .docs-spoiler > .body, .docs-secret .docs-spoiler > .docs-spoiler-cover { grid-area: 1 / 1; }
.docs-secret .docs-spoiler-cover { position: static; padding: 4px 0; }
.docs-secret-inline .docs-side-head h4 { font-size: .7rem; }
.docs-secrets-links { display: flex; gap: 10px; flex-wrap: wrap; }
