/* "Digimon World 3" theme, the site's default: the whole site drawn like the game's PS1 status menu. theme.js
   sets data-style="dw3" on <html> (the inline script in <head> does it before first paint) and every rule here
   is scoped to that attribute, so the plain modern theme and the retro one never see them. dw3.js runs the
   header button that stops the drifting backdrop (data-motion="off").
   The look: navy windows with a pale blue double border on a tiled blue backdrop, white text with a hard
   shadow, orange stat numbers, a white ▶ cursor and cyan for the selected item. */
:root[data-style="dw3"] {
    color-scheme: dark;
    --bg: #071352;
    --panel: #08144f;
    --line: #2f55c4;
    --muted: #a9bcf2;
    --accent: #62d2ff;
    --text: #f4f6ff;
    --dw3-font: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
    --dw3-shadow: 2px 2px 0 #00041f;
    /* Every themed colour of the normal theme, mapped onto the menu's navy and blues by brightness. */
    --th-111713: #050d3f;
    --th-121611: #050d3f;
    --th-131813: #050d3f;
    --th-151b18: #071248;
    --th-171c14: #071248;
    --th-171d15: #071248;
    --th-171d19: #071248;
    --th-18201a: #08144f;
    --th-182112: #08144f;
    --th-191f1b: #08144f;
    --th-1b221e: #0b1a5e;
    --th-1b221ee8: #0b1a5ee8;
    --th-1b221ef2: #0b1a5ef2;
    --th-1b231e: #0b1a5e;
    --th-1b2410: #0b1a5e;
    --th-1c231e: #0b1a5e;
    --th-20271c: #0d1f6a;
    --th-202822: #0d1f6a;
    --th-203015: #0d1f6a;
    --th-222b25: #0d1f6a;
    --th-232d27: #0d1f6a;
    --th-233021: #122780;
    --th-242e24: #122780;
    --th-26331c: #122780;
    --th-283024: #122780;
    --th-283123: #122780;
    --th-283327: #122780;
    --th-293323: #122780;
    --th-2b362d: #172f90;
    --th-2e3a26: #172f90;
    --th-2f392c: #172f90;
    --th-2f3f22: #172f90;
    --th-30392d: #172f90;
    --th-30392df2: #172f90f2;
    --th-303c27: #172f90;
    --th-303d25: #172f90;
    --th-303e25: #172f90;
    --th-34432a: #1d3aa4;
    --th-344626: #1d3aa4;
    --th-344d38: #1d3aa4;
    --th-354137: #1d3aa4;
    --th-38463b: #2445b4;
    --th-3a4636: #2445b4;
    --th-3a4a2c: #2445b4;
    --th-3b4731: #2f55c4;
    --th-43503a: #2f55c4;
    --th-44523f: #2f55c4;
    --th-46513f: #2f55c4;
    --th-48513f: #2f55c4;
    --th-49533d: #3a62d0;
    --th-49533e: #3a62d0;
    --th-4d5b3a: #3a62d0;
    --th-4e613b: #3a62d0;
    --th-52634a: #4a72dc;
    --th-526449: #4a72dc;
    --th-52653e: #4a72dc;
    --th-53604a: #4a72dc;
    --th-586450: #4a72dc;
    --th-647b42: #5f86ea;
    --th-657055: #5f86ea;
    --th-65705b: #5f86ea;
    --th-65774b: #5f86ea;
    --th-6f8a4f: #6f94f2;
    --th-718064: #6f94f2;
    --th-788766: #7fa2f6;
    --th-7d9466: #7fa2f6;
    --th-94b85b: #8fb0ff;
    --th-accent-18: rgba(98, 210, 255, .2);
    --th-bcc7af: #c9d5ff;
    --th-c0cab6: #c9d5ff;
    --th-c8d1c0: #d3ddff;
    --th-ccfa70: #62d2ff;
    --th-ccfa700a: #62d2ff0a;
    --th-ccfa700b: #62d2ff0b;
    --th-ccfa700f: #62d2ff0f;
    --th-ccfa7018: #62d2ff18;
    --th-ccfa7026: #62d2ff26;
    --th-ccfa7030: #62d2ff30;
    --th-ddffa2: #9fe3ff;
    --th-e1ffaa: #a8e6ff;
    --th-e5eadf: #f4f6ff;
    --th-e6ebe3: #f4f6ff;
    --th-e7eddf: #f4f6ff;
    scrollbar-color: #5f86ea #050d3f;
}

:root[data-style="dw3"] ::selection {
    background: #62d2ff;
    color: #050d3f;
    text-shadow: none
}

:root[data-style="dw3"] body {
    background: #0a1b66;
    color: var(--text);
    font-family: var(--dw3-font);
    text-shadow: 1px 1px 0 #00041f
}

/* The tiled backdrop: rounded panes with dotted diagonals and a faint Digivice ring, as behind the game menu.
   It drifts from the top right to the bottom left; the layer is one tile larger on every side and moves by
   exactly one tile per loop, so the pattern never shows a seam or an edge. */
:root[data-style="dw3"] body::before {
    content: "";
    position: fixed;
    inset: -160px;
    z-index: -1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Crect width='160' height='160' fill='%230a1b66'/%3E%3Crect x='5' y='5' width='150' height='150' rx='12' fill='%230c2174' stroke='%231a3a9e' stroke-width='2'/%3E%3Cpath d='M5 5l150 150M155 5L5 155' stroke='%23264cbc' stroke-width='2' stroke-dasharray='2 6'/%3E%3Ccircle cx='80' cy='80' r='30' fill='%230a1d6c' stroke='%231a3a9e' stroke-width='4'/%3E%3Ccircle cx='80' cy='80' r='17' fill='none' stroke='%231a3a9e' stroke-width='2'/%3E%3Cpath d='M72 74h16v12H72z' fill='none' stroke='%231a3a9e' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 160px 160px;
    pointer-events: none;
    will-change: transform;
    animation: dw3-backdrop 12s linear infinite
}

@keyframes dw3-backdrop {
    to { transform: translate(-160px, 160px) }
}

:root[data-style="dw3"][data-motion="off"] body::before {
    animation-play-state: paused
}

:root[data-style="dw3"] .space-bg {
    display: none
}

:root[data-style="dw3"] .site,
:root[data-style="dw3"] .space-on .site {
    background: transparent;
    border: 0;
    box-shadow: none
}

:root[data-style="dw3"] :is(h1, h2, h3, h4) {
    font-family: var(--dw3-font);
    letter-spacing: 0;
    text-shadow: var(--dw3-shadow)
}

/* ---------- Windows: navy fill, pale blue line, a darker rim inside and out ---------- */
:root[data-style="dw3"] :is(header, .current-projects, .current-project, .section-heading, .game-card, .visitor-counter, .collection-filters, .empty, .donation, .donation-leaderboard.is-floating, footer, .post-dialog, .theme-menu, .comment-bubble) {
    border: 2px solid #8fb0ff;
    border-radius: 8px;
    background: linear-gradient(#0a1858f2, #050d3ff2);
    box-shadow: 0 0 0 2px #020830, inset 0 0 0 2px #050d3f, inset 0 0 0 3px #2c4fb8, 5px 6px 0 2px #00031a80
}

/* The section titles sit in a tab like "Digivolve" and "Equip", with the window line running on to the right. */
:root[data-style="dw3"] h2 {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 2px 30px 3px 14px;
    border: 2px solid #8fb0ff;
    border-radius: 4px 16px 16px 4px;
    background: linear-gradient(#13268a, #0a1760);
    box-shadow: 0 0 0 2px #020830, inset 0 0 0 1px #2c4fb8;
    color: #fff;
    font: 600 22px/1.3 var(--dw3-font);
    letter-spacing: .5px;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] h2 > span:not(#collection-title) {
    margin: 4px 0 0 12px;
    padding: 0 8px;
    border: 2px solid #5f86ea;
    border-radius: 4px;
    background: #050d3f;
    color: #ffb534;
    font: 700 14px/1.4 var(--dw3-font);
    text-shadow: var(--dw3-shadow)
}

/* Small orange labels, like "LV", "HP" and "EXP". */
:root[data-style="dw3"] .eyebrow {
    color: #ffb534;
    font: 700 13px var(--dw3-font);
    letter-spacing: 2px;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] .eyebrow > span {
    width: 0;
    height: 0;
    margin-right: 8px;
    border: 6px solid transparent;
    border-left: 9px solid #fff;
    border-right: 0;
    background: none;
    filter: drop-shadow(1px 1px 0 #00041f)
}

/* ---------- Header ---------- */
:root[data-style="dw3"] header {
    margin-top: 18px;
    padding: 14px 18px
}

:root[data-style="dw3"] .brand {
    color: #fff;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] .brand-mark {
    border: 2px solid #8fb0ff;
    border-radius: 6px;
    background: #030a36;
    box-shadow: 0 0 0 2px #020830, inset 0 0 0 2px #2c4fb8;
    color: #ffb534
}

:root[data-style="dw3"] .brand-mark span {
    color: #62d2ff
}

:root[data-style="dw3"] .brand-sub {
    color: #ffb534;
    font-weight: 700
}

:root[data-style="dw3"] .lang-note {
    color: #c9d5ff
}

/* ---------- Buttons: menu plates that light up cyan when chosen ---------- */
:root[data-style="dw3"] :is(.theme-toggle, .motion-toggle, .lang-toggle button, .page-button, .current-projects-arrow, .current-projects-toggle, .post-open-button, .minigame-play-button, .post-dialog-close, .modal-close, .post-dialog-link, .comment-form button, .current-project-link, .link-button, .media-nav-button, .post-share, .collection-filters > summary) {
    border: 2px solid #5f86ea !important;
    border-radius: 6px !important;
    background: linear-gradient(#13268a, #08155a) !important;
    box-shadow: 0 0 0 1px #020830 !important;
    color: #fff !important;
    font-family: var(--dw3-font);
    font-weight: 600;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] :is(.theme-toggle, .motion-toggle, .lang-toggle button, .page-button, .current-projects-arrow, .current-projects-toggle, .post-open-button, .minigame-play-button, .post-dialog-close, .modal-close, .post-dialog-link, .comment-form button, .current-project-link, .link-button, .media-nav-button, .post-share, .collection-filters > summary):hover {
    border-color: #a8c2ff !important;
    color: #62d2ff !important
}

:root[data-style="dw3"] :is(.lang-toggle button[aria-pressed="true"], .page-button[aria-current="page"], .motion-toggle[aria-pressed="true"], .theme-toggle[aria-expanded="true"]) {
    border-color: #a8c2ff !important;
    background: linear-gradient(#2445b4, #13268a) !important;
    color: #62d2ff !important
}

/* The starfield never shows here, so its toggle makes way for the backdrop motion one (dw3.js): its icon is
   the drift arrow while the backdrop moves and pause bars while it is stopped. */
:root[data-style="dw3"] .space-toggle {
    display: none
}

.motion-toggle {
    display: none
}

:root[data-style="dw3"] .motion-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer
}

.motion-toggle .motion-pause {
    display: none
}

.motion-toggle[aria-pressed="false"] .motion-pause {
    display: inline
}

.motion-toggle[aria-pressed="false"] .motion-arrow {
    display: none
}

.motion-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

:root[data-style="dw3"] .lang-toggle {
    gap: 4px;
    padding: 0;
    border: 0;
    background: none
}

/* The colour dot becomes a small D-crest badge, like the equipment icons. */
:root[data-style="dw3"] .theme-dot {
    display: none
}

:root[data-style="dw3"] .theme-toggle::after {
    content: "D";
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d23a2a;
    color: #fff;
    font: 900 12px/1 var(--dw3-font);
    text-shadow: none
}

/* ---------- The white ▶ cursor in front of the chosen item ---------- */
:root[data-style="dw3"] :is(.collection-tabs button, .theme-option) {
    position: relative
}

:root[data-style="dw3"] .collection-tabs button[aria-selected="true"]::before,
:root[data-style="dw3"] .theme-option:is(:hover, :focus-visible):not(:disabled)::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 4px;
    border: 7px solid transparent;
    border-left: 11px solid #fff;
    border-right: 0;
    transform: translateY(-50%);
    filter: drop-shadow(1px 1px 0 #00041f);
    animation: dw3-cursor .6s steps(2) infinite alternate
}

@keyframes dw3-cursor {
    to { translate: 3px 0 }
}

:root[data-style="dw3"] .collection-bar {
    border: 0
}

:root[data-style="dw3"] .collection-tabs {
    gap: 2px;
    padding: 4px 6px;
    border: 2px solid #8fb0ff;
    border-radius: 8px;
    background: linear-gradient(#0a1858f2, #050d3ff2);
    box-shadow: 0 0 0 2px #020830, inset 0 0 0 1px #2c4fb8
}

:root[data-style="dw3"] .collection-tabs button {
    padding: 8px 18px 8px 24px;
    border: 0;
    color: #fff;
    font-weight: 600;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] .collection-tabs button[aria-selected="true"] {
    color: #62d2ff
}

:root[data-style="dw3"] .collection-tabs button:hover {
    color: #a8e6ff
}

:root[data-style="dw3"] :is(.collection, .donation, footer) {
    border-top: 0
}

/* ---------- Sections and cards ---------- */
:root[data-style="dw3"] .section-heading {
    padding: 14px 18px
}

:root[data-style="dw3"] .section-heading p:last-child {
    color: #c9d5ff
}

:root[data-style="dw3"] .current-projects {
    margin-top: 18px;
    padding: 16px
}

:root[data-style="dw3"] .current-projects-head {
    padding: 0;
    border: 0;
    background: none
}

:root[data-style="dw3"] .current-projects-dot[aria-current="true"],
:root[data-style="dw3"] .current-projects-dot[aria-selected="true"] {
    background: #62d2ff
}

:root[data-style="dw3"] :is(.cover, .current-project-image) {
    border-bottom: 2px solid #8fb0ff
}

@media(min-width:641px) {
    :root[data-style="dw3"] .current-project:only-child .current-project-image {
        border-bottom: 0;
        border-right: 2px solid #8fb0ff
    }
}

:root[data-style="dw3"] .media-stage {
    background: #030a36
}

:root[data-style="dw3"] .media-controls {
    background: transparent
}

:root[data-style="dw3"] .card-meta {
    color: #ffb534;
    font-weight: 700
}

:root[data-style="dw3"] :is(.post-title-button, .current-project-title) {
    color: #fff;
    text-shadow: var(--dw3-shadow)
}

:root[data-style="dw3"] .post-title-button:hover {
    color: #62d2ff
}

:root[data-style="dw3"] :is(.game-card p, .current-project-description, .project-taxonomy, .publish-date, .post-subtitle) {
    color: #d3ddff
}

:root[data-style="dw3"] .current-project-status {
    border: 2px solid #8fb0ff;
    border-radius: 4px;
    background: #050d3f;
    color: #62d2ff
}

/* Orange stat numbers with a hard shadow, like "HP9999/9999". */
:root[data-style="dw3"] :is(.current-project-percent, .visitor-metric strong, h2 > #total) {
    background: linear-gradient(#ffe27a 20%, #ffa01e 70%, #ff7a10);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: var(--dw3-font);
    font-weight: 700;
    text-shadow: none;
    filter: drop-shadow(2px 2px 0 #00041f)
}

:root[data-style="dw3"] h2 > #total {
    border: 0;
    padding: 0;
    font-size: 22px
}

/* Progress bar as a HP gauge: an orange bar in a dark trough. */
:root[data-style="dw3"] .current-project-bar {
    height: 14px;
    padding: 2px;
    border: 2px solid #8fb0ff;
    border-radius: 4px;
    background: #020830;
    box-shadow: 0 0 0 1px #020830
}

:root[data-style="dw3"] .current-project-fill {
    border-radius: 2px;
    background: linear-gradient(#ffe27a, #ff9a1a 60%, #e5640c);
    box-shadow: none;
    animation: none
}

:root[data-style="dw3"] .visitor-counter :is(.visitor-label, .visitor-caption, #visitor-status) {
    color: #c9d5ff
}

:root[data-style="dw3"] .visitor-counter .visitor-label {
    color: #ffb534;
    font-weight: 700;
    letter-spacing: 1px
}

:root[data-style="dw3"] .visitor-icon {
    border: 2px solid #8fb0ff;
    border-radius: 6px;
    background: #030a36;
    color: #62d2ff
}

:root[data-style="dw3"] .collection-filters > .toolbar {
    border: 0;
    background: transparent
}

:root[data-style="dw3"] .filter-caption {
    color: #ffb534;
    font-weight: 700
}

:root[data-style="dw3"] .filter-control {
    border: 2px solid #5f86ea;
    border-radius: 6px;
    background: #030a36;
    color: #fff;
    box-shadow: none
}

:root[data-style="dw3"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color: #030a36;
    color: #fff;
    font-family: var(--dw3-font)
}

:root[data-style="dw3"] option {
    background: #08144f;
    color: #fff
}

:root[data-style="dw3"] :is(input, textarea)::placeholder {
    color: #7f9bdc
}

:root[data-style="dw3"] :is(.pin-filter, .results) {
    color: #c9d5ff
}

:root[data-style="dw3"] .donation {
    margin-top: 18px;
    padding: 22px
}

:root[data-style="dw3"] .donation p:last-child {
    color: #d3ddff
}

:root[data-style="dw3"] :is(.donation-button, .donation-floating) {
    border: 2px solid #ffd27a;
    border-radius: 6px;
    background: linear-gradient(#ffb534, #e5640c);
    box-shadow: 0 0 0 2px #020830, 3px 4px 0 1px #00031a80;
    color: #fff;
    font-family: var(--dw3-font);
    font-weight: 700;
    text-shadow: 2px 2px 0 #6a2400
}

:root[data-style="dw3"] footer {
    margin: 18px 0 24px;
    padding: 14px 18px;
    color: #d3ddff
}

:root[data-style="dw3"] footer a {
    color: #62d2ff
}

/* ---------- Post window ---------- */
:root[data-style="dw3"] .post-dialog {
    font-family: var(--dw3-font)
}

:root[data-style="dw3"] .post-dialog::backdrop {
    background: #020830b3;
    backdrop-filter: none
}

:root[data-style="dw3"] .post-dialog-header {
    border-bottom: 2px solid #8fb0ff;
    background: linear-gradient(#13268a, #0a1760);
    color: #fff
}

:root[data-style="dw3"] .post-dialog .game-card {
    border: 0;
    background: transparent;
    box-shadow: none
}

:root[data-style="dw3"] :is(.post-content, .post-description) a {
    color: #62d2ff
}

:root[data-style="dw3"] :is(.post-comments, .post-side, .minigame-play) {
    background: #050d3f
}

/* ---------- The theme picker, DW3 edition ---------- */
:root[data-style="dw3"] .theme-menu {
    padding: 8px
}

:root[data-style="dw3"] .theme-menu-title {
    color: #ffb534;
    font: 700 12px var(--dw3-font)
}

:root[data-style="dw3"] .theme-option {
    padding-left: 26px;
    color: #fff;
    font-family: var(--dw3-font);
    font-weight: 600
}

:root[data-style="dw3"] .theme-option:hover:not(:disabled),
:root[data-style="dw3"] .theme-option:focus-visible {
    background: transparent;
    color: #62d2ff;
    outline: 0
}

:root[data-style="dw3"] .theme-option[aria-checked="true"]::after {
    color: #62d2ff
}

.theme-swatch.is-dw3 {
    background: radial-gradient(circle, #62d2ff 0 3px, #0a1b66 3.5px 5px, #8fb0ff 5.5px)
}

@media(max-width:560px) {
    :root[data-style="dw3"] .motion-toggle {
        width: 32px;
        height: 32px
    }
}

@media(max-width:400px) {
    :root[data-style="dw3"] .motion-toggle {
        width: 30px;
        height: 30px
    }
}

@media(max-width:640px) {
    :root[data-style="dw3"] header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-top: 12px;
        padding: 10px
    }

    :root[data-style="dw3"] .lang-switch {
        align-items: center
    }

    :root[data-style="dw3"] h2 {
        font-size: 19px
    }

    :root[data-style="dw3"] .collection-tabs button {
        padding: 6px 8px 6px 20px;
        font-size: 14px
    }

    :root[data-style="dw3"] .collection-tabs button[aria-selected="true"]::before {
        left: 2px;
        border-width: 5px;
        border-left-width: 8px
    }
}

@media(prefers-reduced-motion:reduce) {
    :root[data-style="dw3"] *,
    :root[data-style="dw3"] *::before,
    :root[data-style="dw3"] *::after {
        animation: none !important
    }
}
