@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;700&family=Ubuntu:wght@300;400;500;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root,
[data-theme='aoc'] {
    --background: #0f0f23;
    --panel: #10101a;
    --hover: #1a1a30;
    --lightgreen: #00cc00;
    --linkgreen: #009900;
    --highlightlinkgreen: #99ff99;
    --staryellow: #ffff66;
    --unclaimedstar: #9999cc;
    --disabled: #333333;
    --offwhite: #cccccc;
    --dim: #666688;
    --red: #ff5555;
    --border: #333355;
    --card-border: #cccccc;
    --snow: #ffffff;
    --app-bg: var(--background);
    --glow-accent: 0 0 2px var(--lightgreen), 0 0 5px var(--lightgreen);
    --glow-star: 0 0 2px var(--staryellow), 0 0 5px var(--staryellow);
    --font-ui: 'Source Code Pro', monospace;
    --font-mono: 'Source Code Pro', monospace;
    --radius: 0px;
    --panel-blur: none;
}

/* everybody.codes: near-black teal, gold headings, bright green actions, ubuntu + jetbrains mono */
[data-theme='ec'] {
    --background: #01070a;
    --panel: #021218;
    --hover: #06222b;
    --lightgreen: #eed699;
    --linkgreen: #00db43;
    --highlightlinkgreen: #33da67;
    --staryellow: #eed699;
    --unclaimedstar: #3f4d52;
    --disabled: #2b3438;
    --offwhite: #c9c6bc;
    --dim: #68726f;
    --red: #f87171;
    --border: #12303a;
    --card-border: #1d4450;
    --snow: #eed699;
    --app-bg: radial-gradient(ellipse at 50% -20%, #06222b 0%, #01070a 60%) fixed;
    --glow-accent: 0 0 10px rgba(238, 214, 153, 0.35);
    --glow-star: 0 0 6px rgba(238, 214, 153, 0.55);
    --font-ui: 'Ubuntu', sans-serif;
    --font-mono: 'JetBrains Mono', 'Source Code Pro', monospace;
    --radius: 6px;
    --panel-blur: none;
}

/* every theme has a light and a dark mode: the block without [data-mode] is its native one */
[data-theme='aoc'][data-mode='light'] {
    --background: #f4f6fa;
    --panel: #ffffff;
    --hover: #e8ecf4;
    --lightgreen: #0a7a0a;
    --linkgreen: #0b6b0b;
    --highlightlinkgreen: #12a112;
    --staryellow: #b58a00;
    --unclaimedstar: #8a8ab8;
    --disabled: #b8bcc8;
    --offwhite: #222633;
    --dim: #6e7385;
    --red: #c62828;
    --border: #d0d4e0;
    --card-border: #b0b6c8;
    --snow: #9ec3ee;
    --app-bg: var(--background);
    --glow-accent: none;
    --glow-star: none;
}

[data-theme='hacker'] {
    --background: #000000;
    --panel: #040804;
    --hover: #0a1a0a;
    --lightgreen: #00ff41;
    --linkgreen: #00cc33;
    --highlightlinkgreen: #aaffaa;
    --staryellow: #ffff33;
    --unclaimedstar: #1f8f1f;
    --disabled: #0f3f0f;
    --offwhite: #33ff33;
    --dim: #1f8f1f;
    --red: #ff3333;
    --border: #0f3f0f;
    --card-border: #1f8f1f;
    --snow: #00ff41;
    --app-bg: var(--background);
    --glow-accent: 0 0 4px var(--lightgreen), 0 0 12px var(--lightgreen);
    --glow-star: 0 0 4px var(--staryellow), 0 0 12px var(--staryellow);
}

[data-theme='aero'] {
    --background: rgba(255, 255, 255, 0.28);
    --panel: rgba(255, 255, 255, 0.5);
    --hover: rgba(255, 255, 255, 0.8);
    --lightgreen: #1a8f3a;
    --linkgreen: #0b74d1;
    --highlightlinkgreen: #1e90ff;
    --staryellow: #f0a500;
    --unclaimedstar: #8fb3d9;
    --disabled: #b5c9dd;
    --offwhite: #1a2a3a;
    --dim: #5f7f9f;
    --red: #d1301b;
    --border: rgba(120, 170, 220, 0.5);
    --card-border: rgba(255, 255, 255, 0.9);
    --snow: rgba(255, 255, 255, 0.95);
    --app-bg: linear-gradient(160deg, #a6d8ff 0%, #d9f0ff 35%, #e9fff3 70%, #b9f0d2 100%) fixed;
    --glow-accent: 0 1px 0 rgba(255, 255, 255, 0.8);
    --glow-star: 0 0 6px rgba(255, 190, 0, 0.6);
    --font-ui: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --radius: 10px;
    --panel-blur: blur(3px) saturate(125%);
}

[data-theme='dracula'] {
    --background: #282a36;
    --panel: #21222c;
    --hover: #343746;
    --lightgreen: #50fa7b;
    --linkgreen: #8be9fd;
    --highlightlinkgreen: #ff79c6;
    --staryellow: #f1fa8c;
    --unclaimedstar: #6272a4;
    --disabled: #44475a;
    --offwhite: #f8f8f2;
    --dim: #6272a4;
    --red: #ff5555;
    --border: #44475a;
    --card-border: #6272a4;
    --snow: #f8f8f2;
    --app-bg: var(--background);
    --glow-accent: none;
    --glow-star: 0 0 4px rgba(241, 250, 140, 0.5);
}

[data-theme='nord'] {
    --background: #2e3440;
    --panel: #3b4252;
    --hover: #434c5e;
    --lightgreen: #a3be8c;
    --linkgreen: #88c0d0;
    --highlightlinkgreen: #8fbcbb;
    --staryellow: #ebcb8b;
    --unclaimedstar: #4c566a;
    --disabled: #4c566a;
    --offwhite: #d8dee9;
    --dim: #7b88a1;
    --red: #bf616a;
    --border: #434c5e;
    --card-border: #4c566a;
    --snow: #eceff4;
    --app-bg: var(--background);
    --glow-accent: none;
    --glow-star: none;
}

[data-theme='synthwave'] {
    --background: #241b2f;
    --panel: #2a2139;
    --hover: #3a2d4d;
    --lightgreen: #ff7edb;
    --linkgreen: #36f9f6;
    --highlightlinkgreen: #fede5d;
    --staryellow: #fede5d;
    --unclaimedstar: #7a6b8f;
    --disabled: #4a3b63;
    --offwhite: #e0d6ff;
    --dim: #7a6b8f;
    --red: #f97e72;
    --border: #4a3b63;
    --card-border: #7a6b8f;
    --snow: #ff7edb;
    --app-bg: linear-gradient(180deg, #241b2f 0%, #2b1f3f 60%, #3b1f52 100%) fixed;
    --glow-accent: 0 0 4px var(--lightgreen), 0 0 14px rgba(255, 126, 219, 0.7);
    --glow-star: 0 0 4px var(--staryellow), 0 0 12px rgba(254, 222, 93, 0.7);
}

/* dockview chrome follows the palette (the id selector beats dockview's own theme class rules) */
#workspace .dv-shell,
#workspace.dockview-theme-dark,
#workspace.dockview-theme-light {
    --dv-group-view-background-color: var(--background);
    --dv-tabs-and-actions-container-background-color: var(--panel);
    --dv-activegroup-visiblepanel-tab-background-color: var(--background);
    --dv-activegroup-hiddenpanel-tab-background-color: var(--panel);
    --dv-inactivegroup-visiblepanel-tab-background-color: var(--hover);
    --dv-inactivegroup-hiddenpanel-tab-background-color: var(--panel);
    --dv-activegroup-visiblepanel-tab-color: var(--lightgreen);
    --dv-activegroup-hiddenpanel-tab-color: var(--dim);
    --dv-inactivegroup-visiblepanel-tab-color: var(--offwhite);
    --dv-inactivegroup-hiddenpanel-tab-color: var(--dim);
    --dv-separator-border: var(--border);
    --dv-tab-divider-color: var(--border);
    --dv-paneview-active-outline-color: var(--lightgreen);
    --dv-drag-over-background-color: rgba(128, 128, 128, 0.2);
    --dv-drag-over-border-color: var(--lightgreen);
    --dv-tabs-container-scrollbar-color: var(--border);
    --dv-icon-hover-background-color: var(--hover);
    --dv-background-color: var(--background);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
    color: var(--offwhite);
    font-family: var(--font-ui);
    font-size: 14px;
}

pre,
code,
textarea,
.tests-input,
.monaco-editor {
    font-family: var(--font-mono);
}

a,
button.link {
    color: var(--linkgreen);
    text-decoration: none;
    outline: 0;
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

a:hover,
a:focus,
button.link:hover,
button.link:focus {
    color: var(--highlightlinkgreen);
}

/* the terminal look wraps actions in brackets; themes that want plain buttons turn these off */
button.link::before,
a.bracket::before {
    content: '[';
}

button.link::after,
a.bracket::after {
    content: ']';
}

a.disabled,
button.link:disabled {
    color: var(--disabled);
    pointer-events: none;
    text-shadow: none;
}

.header {
    color: var(--lightgreen);
    text-shadow: var(--glow-accent);
}

.claimed-stars {
    color: var(--staryellow);
    text-shadow: var(--glow-star);
}

.unclaimed-stars {
    color: var(--unclaimedstar);
}

.dim {
    color: var(--dim);
}

.error {
    color: var(--red);
}

.ok {
    color: var(--lightgreen);
}

select,
input[type='text'],
input[type='password'],
input[type='number'],
textarea {
    background: var(--panel);
    color: var(--offwhite);
    border: 1px solid var(--border);
    font: inherit;
    padding: 2px 6px;
    border-radius: 2px;
}

select:focus,
input:focus,
textarea:focus {
    outline: 1px solid var(--linkgreen);
}

input[type='checkbox'] {
    accent-color: var(--lightgreen);
}

/* top bar */
#topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

#topbar .brand {
    font-size: 16px;
    white-space: nowrap;
}

#topbar .nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

#topbar .puzzle-title {
    flex: 1;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#topbar .status {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--staryellow);
    box-shadow: var(--glow-star);
}

.spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid var(--border);
    border-top-color: var(--lightgreen);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* dropdown menus */
.menu {
    position: relative;
}

.menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    padding: 6px 0;
    z-index: 20;
}

.menu.open .dropdown {
    display: block;
}

.dropdown .item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    white-space: nowrap;
    cursor: pointer;
    color: var(--offwhite);
}

.dropdown .item:hover {
    background: var(--hover);
    color: var(--highlightlinkgreen);
}

.dropdown .item.disabled {
    color: var(--disabled);
    pointer-events: none;
}

.dropdown .separator {
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.dropdown .label {
    padding: 2px 12px;
    color: var(--dim);
    font-size: 12px;
}

/* workspace */
#workspace {
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    color: var(--offwhite);
}

.panel .toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    font-size: 13px;
}

.panel .toolbar .group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel .toolbar .spacer {
    flex: 1;
}

.panel .body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px;
}

.panel .body.tight {
    padding: 0;
}

.panel .fill {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.panel iframe {
    background: var(--background);
}

.panel pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13px;
}

.panel textarea.fill {
    resize: none;
    padding: 10px;
    border: 0;
    background: var(--background);
}

.empty {
    padding: 20px;
    text-align: center;
    color: var(--dim);
}

/* tables */
table.results {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.results th,
table.results td {
    text-align: left;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

table.results th {
    color: var(--lightgreen);
    font-weight: normal;
}

table.results td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.result-answer {
    color: var(--staryellow);
    font-weight: bold;
    user-select: all;
}

details summary {
    cursor: pointer;
    color: var(--linkgreen);
}

/* settings form */
.settings-form {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 14px;
    align-items: center;
    max-width: 640px;
}

.settings-form h3 {
    grid-column: 1 / -1;
    margin: 12px 0 2px;
    font-size: 14px;
    color: var(--lightgreen);
    border-bottom: 1px solid var(--border);
}

.settings-form label {
    color: var(--offwhite);
}

.settings-form input[type='text'],
.settings-form input[type='password'],
.settings-form input[type='number'] {
    width: 100%;
    max-width: 320px;
    min-width: 0;
}

.settings-form .hint {
    grid-column: 2;
    color: var(--dim);
    font-size: 12px;
    margin-top: -6px;
}

/* puzzles grid */
.year-selector-row {
    text-align: center;
    font-size: 18px;
    margin: 6px 0 10px;
}

.year-selector {
    font-weight: normal;
}

.year-selector.current {
    font-weight: bold;
    text-shadow: var(--glow-accent);
}

.star-count {
    text-align: center;
    font-size: 20px;
    margin: 10px 0;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.day {
    padding: 6px;
    border: 1px solid var(--card-border);
    box-shadow: 0 0 4px var(--card-border);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: var(--panel-blur);
    text-align: center;
    cursor: pointer;
    font-size: 13px;
}

.day.active {
    border-color: var(--lightgreen);
    box-shadow: 0 0 6px var(--lightgreen);
}

.day .title {
    display: block;
    min-height: 2.6em;
}

/* snowflakes (ported from the old site): an overlay above the views that each theme restyles */
#snowflakes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 40;
}

#snowflakes.hidden {
    display: none;
}

.snowflake {
    position: absolute;
    top: -2em;
    color: var(--snow);
    opacity: 0.4;
    font-size: calc(0.9em * var(--size, 1));
    text-shadow: 0 0 4px var(--snow);
    animation: fall linear infinite;
    will-change: transform;
}

.snowflake-0 {
    animation-duration: 14s;
}

.snowflake-1 {
    animation-duration: 18s;
}

.snowflake-2 {
    animation-duration: 22s;
}

.snowflake-3 {
    animation-duration: 26s;
}

@keyframes fall {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(1.5vw, 55vh, 0);
    }
    100% {
        transform: translate3d(-1vw, 110vh, 0);
    }
}

/* hacker: glyph rain */
[data-theme='hacker'] .snowflake {
    opacity: 0.35;
    font-weight: bold;
    text-shadow: 0 0 6px var(--lightgreen);
    animation-name: rain;
}

@keyframes rain {
    to {
        transform: translate3d(0, 110vh, 0);
    }
}

/* aero: rising bubbles */
[data-theme='aero'] .snowflake {
    top: auto;
    bottom: -60px;
    width: calc(26px * var(--size, 1));
    height: calc(26px * var(--size, 1));
    border-radius: 50%;
    opacity: 0.8;
    text-shadow: none;
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 22%, rgba(150, 205, 255, 0.18) 55%, rgba(255, 255, 255, 0) 72%);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75), inset -3px -4px 8px rgba(80, 150, 220, 0.25), 0 2px 10px rgba(80, 150, 220, 0.18);
    animation-name: rise;
}

@keyframes rise {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(2vw, -55vh, 0) scale(1.05);
    }
    100% {
        transform: translate3d(-1.5vw, -115vh, 0);
    }
}


/* views */
.view.hidden {
    display: none !important;
}

body.view-dashboard .editor-only,
body.view-notice .editor-only {
    display: none !important;
}

#topbar .views,
#topbar .menus {
    display: flex;
    gap: 10px;
    align-items: center;
}

body.view-dashboard .view-link-dashboard,
body.view-editor .view-link-editor {
    font-weight: bold;
    text-shadow: var(--glow-accent);
}

#dashboard {
    flex: 1;
    min-height: 0;
    overflow: auto;
    position: relative;
    z-index: 1;
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px 40px;
}

.dashboard-title {
    font-size: 30px;
    margin: 10px 0 4px;
}

.dashboard .totals {
    font-size: 18px;
    margin: 0 0 10px;
}

.dashboard .day-grid {
    grid-template-columns: repeat(5, 1fr);
}

.dashboard .day-grid.days-12 {
    grid-template-columns: repeat(4, 1fr);
}

@media screen and (max-width: 900px) {
    .dashboard .day-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.dashboard .tools {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: var(--panel-blur);
    padding: 10px 14px;
}

.dashboard .tools p.header {
    margin: 0 0 6px;
}

.dashboard .tools .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.dashboard .tools label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bulk-progress {
    margin-top: 8px;
    font-size: 13px;
}

/* puzzle text */
.description h2 {
    color: var(--lightgreen);
    text-shadow: 0 0 2px var(--lightgreen), 0 0 5px var(--lightgreen);
    font-size: 16px;
    font-weight: normal;
    margin: 14px 0 8px;
}

.description h2:first-child {
    margin-top: 0;
}

.description p,
.description li {
    line-height: 1.5;
}

.description code {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 0 3px;
    color: var(--offwhite);
}

.description pre {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 8px 10px;
    margin: 8px 0;
    overflow: auto;
    white-space: pre;
}

.description pre code {
    border: 0;
    padding: 0;
}

.description em {
    color: var(--offwhite);
    font-weight: bold;
    font-style: normal;
    text-shadow: var(--glow-accent);
}

.description em.star {
    color: var(--staryellow);
    text-shadow: 0 0 5px var(--staryellow);
}

.description table {
    border-collapse: collapse;
}

.description th,
.description td {
    border: 1px solid var(--border);
    padding: 2px 8px;
}

/* per panel zoom controls in the group tab bar */
.dv-zoom-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    font-size: 12px;
    white-space: nowrap;
    color: var(--dim);
}

.dv-zoom-actions button.link {
    color: var(--dim);
}

.dv-zoom-actions button.link:hover {
    color: var(--highlightlinkgreen);
}

/* tests panel */
.tests {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tests-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    font-size: 13px;
}

.tests-fields label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--dim);
}

.tests-fields input {
    width: 130px;
}

.tests-input {
    flex: 0 0 auto;
    min-height: 60px;
    max-height: 45%;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: pre;
    overflow: auto;
    background: var(--background);
    border: 1px solid var(--border);
}

.tests-result {
    flex: 1;
    min-height: 0;
}

.tests-result table {
    margin-top: 4px;
}

button.link.current {
    color: var(--highlightlinkgreen);
    text-shadow: var(--glow-accent);
}

/* theme specific flourishes */
[data-theme='hacker'] body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

[data-theme='hacker'] a,
[data-theme='hacker'] button.link {
    text-shadow: 0 0 3px rgba(0, 255, 65, 0.5);
}

[data-theme='aero'] #topbar,
[data-theme='aero'] .panel .toolbar,
[data-theme='aero'] .menu .dropdown {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(230, 243, 255, 0.6) 50%, rgba(205, 230, 252, 0.55) 51%, rgba(240, 250, 255, 0.7) 100%);
    backdrop-filter: var(--panel-blur);
}

[data-theme='aero'] #topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(80, 140, 200, 0.25);
}

[data-theme='aero'] .dv-tabs-and-actions-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(220, 238, 255, 0.5) 100%) !important;
}

[data-theme='aero'] .dv-tab {
    border-radius: var(--radius) var(--radius) 0 0;
}

[data-theme='aero'] .dv-groupview {
    backdrop-filter: var(--panel-blur);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 4px 18px rgba(60, 120, 180, 0.18);
}

[data-theme='aero'] select,
[data-theme='aero'] input[type='text'],
[data-theme='aero'] input[type='password'],
[data-theme='aero'] input[type='number'],
[data-theme='aero'] textarea {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    border-color: rgba(120, 170, 220, 0.7);
}

[data-theme='aero'] .dropdown,
[data-theme='aero'] .settings-form h3,
[data-theme='aero'] .tests-section {
    border-radius: var(--radius);
}

[data-theme='aero'] .snowflake {
    color: #fff;
    opacity: 0.9;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

[data-theme='aero'] .description em,
[data-theme='aero'] .header {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme='synthwave'] .day,
[data-theme='synthwave'] .dashboard .tools {
    box-shadow: 0 0 8px rgba(255, 126, 219, 0.35);
}

.theme-light .monaco-editor .margin,
.theme-light .monaco-editor-background {
    background-color: transparent;
}

/* ---- frutiger aero gimmicks ------------------------------------------------ */
[data-theme='aero'] body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 38% 22% at 18% 24%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(ellipse 30% 18% at 70% 14%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(ellipse 45% 20% at 85% 40%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%),
        radial-gradient(ellipse 60% 25% at 40% 105%, rgba(90, 200, 120, 0.55) 0%, rgba(120, 220, 150, 0.25) 45%, rgba(120, 220, 150, 0) 100%),
        radial-gradient(circle at 92% 6%, rgba(255, 255, 230, 0.9) 0%, rgba(255, 250, 200, 0.35) 12%, rgba(255, 250, 200, 0) 30%);
    animation: aero-drift 70s ease-in-out infinite alternate;
}

@keyframes aero-drift {
    from {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
    }
    to {
        background-position: 6vw 1vh, -5vw 2vh, 4vw -1vh, 0 0, 0 0;
    }
}

[data-theme='aero'] #topbar,
[data-theme='aero'] #dashboard,
[data-theme='aero'] #workspace {
    position: relative;
    z-index: 1;
}

[data-theme='aero'] #topbar {
    overflow: hidden;
}

/* a glint sweeping across the top bar now and then */
[data-theme='aero'] #topbar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 30%;
    pointer-events: none;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 50%, rgba(255, 255, 255, 0) 100%);
    animation: aero-shine 9s ease-in-out infinite;
}

@keyframes aero-shine {
    0%,
    70% {
        left: -40%;
    }
    100% {
        left: 120%;
    }
}

/* glossy aqua buttons and links */
[data-theme='aero'] button.link,
[data-theme='aero'] #topbar a,
[data-theme='aero'] .day a,
[data-theme='aero'] .year-selector {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    color: #0b5fb0;
    background: linear-gradient(180deg, #ffffff 0%, #e4f2ff 48%, #c2e3ff 52%, #e9f7ff 100%);
    border: 1px solid rgba(110, 165, 220, 0.75);
    box-shadow: 0 1px 2px rgba(20, 60, 110, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    margin: 1px 0;
    line-height: 1.4;
}

[data-theme='aero'] button.link:hover,
[data-theme='aero'] #topbar a:hover,
[data-theme='aero'] .day a:hover,
[data-theme='aero'] .year-selector:hover {
    color: #0a4f94;
    background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 48%, #d6ecff 52%, #f4fbff 100%);
    box-shadow: 0 2px 6px rgba(20, 60, 110, 0.25), inset 0 1px 0 #fff, 0 0 0 3px rgba(120, 190, 255, 0.25);
}

[data-theme='aero'] button.link:disabled,
[data-theme='aero'] a.disabled {
    background: linear-gradient(180deg, #f4f6f8, #e4e8ec);
    color: #9aa7b4;
    box-shadow: none;
}

[data-theme='aero'] .year-selector.current,
[data-theme='aero'] button.link.current,
[data-theme='aero'] body.view-dashboard .view-link-dashboard,
[data-theme='aero'] body.view-editor .view-link-editor {
    background: linear-gradient(180deg, #8fd0ff 0%, #4aa9f5 48%, #1f8ae8 52%, #6cc0ff 100%);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 40, 90, 0.5);
    border-color: #1f78c8;
}

[data-theme='aero'] .brand.header,
[data-theme='aero'] .dashboard-title {
    background: linear-gradient(180deg, #2fa64a 0%, #1a8f3a 50%, #0e6f2c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    border: 0;
    box-shadow: none;
    text-shadow: none;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

/* glossy tabs */
[data-theme='aero'] .dv-tab {
    margin: 3px 2px 0;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(220, 238, 255, 0.7)) !important;
    box-shadow: inset 0 1px 0 #fff;
}

[data-theme='aero'] .dv-tab.dv-active-tab {
    background: linear-gradient(180deg, #ffffff 0%, #eaf6ff 60%, #d8eeff 100%) !important;
    box-shadow: inset 0 1px 0 #fff, 0 -2px 8px rgba(60, 140, 220, 0.25);
}

/* glass panels with a top highlight */
[data-theme='aero'] .dv-groupview::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 40%;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
    z-index: 1;
}

[data-theme='aero'] .dv-groupview {
    position: relative;
}

[data-theme='aero'] .day,
[data-theme='aero'] .dashboard .tools {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(235, 247, 255, 0.5) 50%, rgba(215, 238, 255, 0.45) 51%, rgba(245, 252, 255, 0.6) 100%);
    box-shadow: 0 4px 14px rgba(60, 120, 180, 0.2), inset 0 1px 0 #fff;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

[data-theme='aero'] .day.active {
    box-shadow: 0 0 0 3px rgba(80, 180, 255, 0.45), 0 4px 14px rgba(60, 120, 180, 0.25);
}

[data-theme='aero'] .day:hover {
    transform: translateY(-2px);
    transition: transform 0.15s ease;
}

[data-theme='aero'] table.results th {
    color: #0b5fb0;
}

[data-theme='aero'] .panel .toolbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
}

[data-theme='aero'] ::selection {
    background: rgba(90, 180, 255, 0.45);
}

[data-theme='aero'] .claimed-stars {
    color: #ff9f1a;
    text-shadow: 0 1px 0 #fff, 0 0 8px rgba(255, 170, 0, 0.6);
}

/* aero reads like a normal application: no brackets, sentence case, no ascii decoration */
[data-theme='aero'] button.link::before,
[data-theme='aero'] button.link::after,
[data-theme='aero'] a.bracket::before,
[data-theme='aero'] a.bracket::after {
    content: none;
}

[data-theme='aero'] .deco {
    display: none;
}

[data-theme='aero'] label,
[data-theme='aero'] .toolbar > span.dim,
[data-theme='aero'] .toolbar .group > span.dim,
[data-theme='aero'] .dropdown .item,
[data-theme='aero'] .dropdown .label {
    display: inline-block;
}

[data-theme='aero'] button.link::first-letter,
[data-theme='aero'] a.bracket::first-letter,
[data-theme='aero'] label::first-letter,
[data-theme='aero'] th::first-letter,
[data-theme='aero'] h3::first-letter,
[data-theme='aero'] .toolbar > span.dim::first-letter,
[data-theme='aero'] .toolbar .group > span.dim::first-letter,
[data-theme='aero'] .dropdown .item::first-letter,
[data-theme='aero'] .dropdown .label::first-letter,
[data-theme='aero'] .tests-section::first-letter,
[data-theme='aero'] .settings-form .hint::first-letter,
[data-theme='aero'] .empty::first-letter,
[data-theme='aero'] .dashboard .tools p.header::first-letter,
[data-theme='aero'] .bulk-progress::first-letter,
[data-theme='aero'] .panel .body > p::first-letter {
    text-transform: uppercase;
}

[data-theme='aero'] select,
[data-theme='aero'] option {
    text-transform: capitalize;
}

[data-theme='aero'] .dropdown .item {
    width: 100%;
    box-sizing: border-box;
}

[data-theme='aero'] a.bracket {
    display: inline-block;
}

[data-theme='aero'] .path::first-letter,
[data-theme='aero'] .toolbar > span.dim.path::first-letter,
[data-theme='aero'] .toolbar .group > span.dim.path::first-letter {
    text-transform: none;
}

/* small screens: the dashboard adapts, the editor shows a notice */
.mobile-notice {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.mobile-notice p {
    max-width: 420px;
    margin: 0;
    line-height: 1.5;
}

@media screen and (max-width: 820px) {
    body {
        font-size: 13px;
    }

    #topbar {
        gap: 8px 12px;
        padding: 6px 10px;
    }

    #topbar .brand {
        font-size: 13px;
        white-space: normal;
    }

    #topbar .puzzle-title {
        min-width: 0;
        flex-basis: 100%;
    }

    .dashboard {
        padding: 8px 10px 30px;
    }

    .dashboard-title {
        font-size: 20px;
        margin: 6px 0 2px;
    }

    .dashboard .totals {
        font-size: 15px;
    }

    .year-selector-row {
        font-size: 15px;
        line-height: 1.9;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .star-count {
        font-size: 17px;
        margin: 6px 0;
    }

    .dashboard .day-grid,
    .dashboard .day-grid.days-12 {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .day {
        font-size: 12px;
        padding: 5px;
    }

    .day .title {
        min-height: 0;
    }

    .dashboard .tools {
        margin-top: 14px;
        padding: 8px 10px;
    }

    .dashboard .tools .toolbar {
        gap: 8px 12px;
    }

    .snowflake {
        opacity: 0.3;
    }
}

@media screen and (max-width: 420px) {
    .dashboard .day-grid,
    .dashboard .day-grid.days-12 {
        grid-template-columns: 1fr;
    }
}

/* live console output and the debugger hand-off */
.runner {
    display: flex;
    flex-direction: column;
}

.run-summary {
    padding: 10px;
    flex: 0 0 auto;
}

.run-summary:empty {
    display: none;
}

.live-log-wrapper {
    flex: 1;
    min-height: 60px;
    overflow: auto;
    border-top: 1px solid var(--border);
    background: var(--background);
}

.live-log {
    padding: 8px 10px;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--offwhite);
}

.live-log:empty::before {
    content: 'console output appears here while the solution runs';
    color: var(--dim);
}

.tests .live-log-wrapper {
    flex: 0 0 auto;
    max-height: 40%;
    border: 1px solid var(--border);
}

.debug-box {
    border: 1px solid var(--lightgreen);
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: var(--radius);
}

.debug-box p {
    margin: 4px 0;
    line-height: 1.5;
}

.devtools-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}

.devtools-url {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* debugger: editor decorations */
.bp-glyph {
    background: radial-gradient(circle at 50% 50%, #e5484d 0 42%, transparent 46%);
    cursor: pointer;
}

.debug-current-glyph::before {
    content: '\25B6';
    color: var(--staryellow);
    font-size: 10px;
    position: absolute;
    left: 4px;
}

.debug-current-line {
    background: rgba(255, 255, 102, 0.14);
    box-shadow: inset 2px 0 0 var(--staryellow);
}

.monaco-editor .margin-view-overlays .cgmr:hover {
    background: rgba(229, 72, 77, 0.35);
    border-radius: 50%;
}

/* debugger panel */
.debugger {
    display: flex;
    flex-direction: column;
}

.dbg-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 0 12px;
    padding: 8px 10px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    font-size: 13px;
}

.dbg-column {
    min-width: 0;
}

.dbg-column h4 {
    margin: 6px 0 4px;
    font-size: 12px;
    font-weight: normal;
    color: var(--lightgreen);
    border-bottom: 1px solid var(--border);
}

.dbg-list {
    margin-bottom: 6px;
}

.dbg-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 1px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dbg-frame {
    cursor: pointer;
}

.dbg-frame:hover {
    background: var(--hover);
}

.dbg-frame.active {
    color: var(--highlightlinkgreen);
    background: var(--hover);
}

.dbg-scope-title {
    color: var(--dim);
    margin: 4px 0 2px;
    text-transform: lowercase;
}

.dbg-prop {
    padding-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dbg-toggle {
    width: 14px;
    display: inline-block;
}

[data-theme='aero'] .dbg-toggle {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.dbg-name {
    color: var(--offwhite);
}

.dbg-value {
    color: var(--staryellow);
}

.dbg-children {
    padding-left: 18px;
}

.dbg-eval {
    width: 100%;
    margin: 2px 0 4px;
}

.dbg-eval-output {
    min-height: 1.4em;
}

.debugger .live-log-wrapper {
    flex: 0 0 auto;
    max-height: 35%;
}

/* ---- everybody codes -------------------------------------------------------- */
/* the site uses plain rounded buttons rather than the terminal brackets */
[data-theme='ec'] button.link::before,
[data-theme='ec'] button.link::after,
[data-theme='ec'] a.bracket::before,
[data-theme='ec'] a.bracket::after {
    content: none;
}

[data-theme='ec'] .deco {
    display: none;
}

[data-theme='ec'] button.link,
[data-theme='ec'] a.bracket {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1px 9px;
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

[data-theme='ec'] button.link:hover,
[data-theme='ec'] a.bracket:hover {
    border-color: var(--linkgreen);
    background: rgba(0, 219, 67, 0.1);
}

[data-theme='ec'] .year-selector.current,
[data-theme='ec'] button.link.current,
[data-theme='ec'] body.view-dashboard .view-link-dashboard,
[data-theme='ec'] body.view-editor .view-link-editor {
    border-color: var(--lightgreen);
    color: var(--lightgreen);
    background: rgba(238, 214, 153, 0.08);
}

[data-theme='ec'] .header {
    font-weight: 500;
    letter-spacing: 0.02em;
}

[data-theme='ec'] .brand.header,
[data-theme='ec'] .dashboard-title {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

[data-theme='ec'] .day,
[data-theme='ec'] .dashboard .tools {
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

[data-theme='ec'] .day:hover {
    border-color: var(--lightgreen);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(238, 214, 153, 0.15);
}

[data-theme='ec'] .day.active {
    border-color: var(--linkgreen);
    box-shadow: 0 0 12px rgba(0, 219, 67, 0.25);
}

[data-theme='ec'] pre,
[data-theme='ec'] code,
[data-theme='ec'] .result-answer,
[data-theme='ec'] .tests-input,
[data-theme='ec'] textarea {
    font-family: var(--font-mono);
}

[data-theme='ec'] .description em.star,
[data-theme='ec'] .description strong {
    color: var(--lightgreen);
}

/* slow drifting gold motes instead of snow */
[data-theme='ec'] .snowflake {
    color: var(--snow);
    opacity: 0.35;
    text-shadow: 0 0 6px rgba(238, 214, 153, 0.8);
}

/* the source tabs on the dashboard */
.source-row {
    margin-bottom: 6px;
}

.source-selector .claimed-stars {
    font-size: 0.85em;
}

.tests-expected input {
    width: 9em;
}

/* layout helpers and the platform switch */
.text-center {
    text-align: center;
}

/* the platform switch and menus sit on the right in both views (the puzzle title takes the slack in the editor) */
#topbar .status {
    margin-left: auto;
}

body.view-editor #topbar .status {
    margin-left: 0;
}

.menu.platform .platform-name {
    color: var(--lightgreen);
    text-shadow: var(--glow-accent);
    font-weight: bold;
}

.menu.platform .dropdown .item {
    justify-content: flex-start;
}

.menu.platform .dropdown .item.current {
    color: var(--lightgreen);
}

.menu.platform .platform-item-name {
    flex: 1;
    margin-right: 18px;
}

.source-row {
    margin: 2px 0 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.platform-heading {
    font-size: 20px;
    text-decoration: none;
}

.platform-hint {
    font-size: 12px;
}

/* ============================================================================================
   light / dark variants of each theme (the native mode of a theme is defined further up)
   ============================================================================================ */
[data-theme='ec'][data-mode='light'] {
    --background: #ffffff;
    --panel: #fffdf8;
    --hover: #f3efe2;
    --lightgreen: #8f6b0c;
    --linkgreen: #087a37;
    --highlightlinkgreen: #055d2a;
    --staryellow: #b8891a;
    --unclaimedstar: #c9c4b4;
    --disabled: #c4c4c0;
    --offwhite: #1e1e1e;
    --dim: #68726f;
    --red: #c62828;
    --border: #e3dcc8;
    --card-border: #cfc6ab;
    --snow: #d9b95a;
    --app-bg: radial-gradient(ellipse at 50% -20%, #fff3d6 0%, #ffffff 60%) fixed;
    --glow-accent: none;
    --glow-star: none;
}

[data-theme='ec'][data-mode='light'] button.link,
[data-theme='ec'][data-mode='light'] a.bracket {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme='ec'][data-mode='light'] button.link:hover,
[data-theme='ec'][data-mode='light'] a.bracket:hover {
    background: rgba(8, 122, 55, 0.08);
}

[data-theme='ec'][data-mode='light'] .day,
[data-theme='ec'][data-mode='light'] .dashboard .tools {
    background: linear-gradient(180deg, #ffffff, #fffaf0);
}

[data-theme='ec'][data-mode='light'] .day:hover {
    box-shadow: 0 6px 18px rgba(120, 90, 10, 0.18);
}

[data-theme='ec'][data-mode='light'] .snowflake {
    opacity: 0.6;
    text-shadow: none;
}

[data-theme='hacker'][data-mode='light'] {
    --background: #eef6ea;
    --panel: #e4f0df;
    --hover: #d5e8cf;
    --lightgreen: #0a6b1e;
    --linkgreen: #0e7a25;
    --highlightlinkgreen: #064d14;
    --staryellow: #8a6d00;
    --unclaimedstar: #9cc49c;
    --disabled: #b5cfb0;
    --offwhite: #0b3d0b;
    --dim: #5f8f5f;
    --red: #b3261e;
    --border: #b5cfb0;
    --card-border: #7fae7f;
    --snow: #0e7a25;
    --glow-accent: none;
    --glow-star: none;
}

[data-theme='hacker'][data-mode='light'] body::after {
    background: repeating-linear-gradient(0deg, rgba(0, 60, 0, 0.07) 0 1px, transparent 1px 3px);
}

[data-theme='hacker'][data-mode='light'] a,
[data-theme='hacker'][data-mode='light'] button.link {
    text-shadow: none;
}

[data-theme='hacker'][data-mode='light'] .snowflake {
    opacity: 0.35;
}

[data-theme='dracula'][data-mode='light'] {
    --background: #fffbeb;
    --panel: #f5f0dc;
    --hover: #e8e2c9;
    --lightgreen: #14710a;
    --linkgreen: #036a96;
    --highlightlinkgreen: #a3144d;
    --staryellow: #846e15;
    --unclaimedstar: #b8b29a;
    --disabled: #cfc9b0;
    --offwhite: #1f1f1f;
    --dim: #6c664b;
    --red: #cb3a2a;
    --border: #dcd6bd;
    --card-border: #b8b29a;
    --snow: #644ac9;
    --glow-accent: none;
    --glow-star: none;
}

[data-theme='nord'][data-mode='light'] {
    --background: #eceff4;
    --panel: #e5e9f0;
    --hover: #d8dee9;
    --lightgreen: #4f7a3a;
    --linkgreen: #5e81ac;
    --highlightlinkgreen: #3f6490;
    --staryellow: #b57f14;
    --unclaimedstar: #c2cad8;
    --disabled: #c2cad8;
    --offwhite: #2e3440;
    --dim: #6b7689;
    --red: #bf616a;
    --border: #d3dae6;
    --card-border: #b9c2d2;
    --snow: #88c0d0;
}

[data-theme='synthwave'][data-mode='light'] {
    --background: #fdf4ff;
    --panel: #fffaff;
    --hover: #f6e1fb;
    --lightgreen: #d6249f;
    --linkgreen: #0e8f96;
    --highlightlinkgreen: #b07a00;
    --staryellow: #d99a00;
    --unclaimedstar: #d9c4e8;
    --disabled: #dccbe8;
    --offwhite: #3b2a55;
    --dim: #9a84b5;
    --red: #e0553f;
    --border: #ecd3f3;
    --card-border: #d9b3e6;
    --snow: #ff7edb;
    --app-bg: linear-gradient(180deg, #fdf4ff 0%, #ffeefa 60%, #ffe3f1 100%) fixed;
    --glow-accent: 0 0 6px rgba(255, 126, 219, 0.35);
    --glow-star: none;
}

[data-theme='synthwave'][data-mode='light'] .day,
[data-theme='synthwave'][data-mode='light'] .dashboard .tools {
    box-shadow: 0 0 10px rgba(214, 36, 159, 0.15);
}

/* ---- frutiger aero at night: dark glass over an aurora ------------------------------------- */
[data-theme='aero'][data-mode='dark'] {
    --background: rgba(8, 22, 42, 0.35);
    --panel: rgba(12, 30, 55, 0.55);
    --hover: rgba(40, 80, 130, 0.6);
    --lightgreen: #5fe08a;
    --linkgreen: #6cc0ff;
    --highlightlinkgreen: #a6dcff;
    --staryellow: #ffc233;
    --unclaimedstar: #3f6690;
    --disabled: #35506e;
    --offwhite: #e2f1ff;
    --dim: #86a9cc;
    --red: #ff7a66;
    --border: rgba(110, 170, 230, 0.35);
    --card-border: rgba(160, 210, 255, 0.35);
    --snow: rgba(190, 225, 255, 0.8);
    --app-bg: linear-gradient(160deg, #050f22 0%, #0b2a4d 40%, #0d3b4a 75%, #0a3a2c 100%) fixed;
    --glow-accent: 0 0 8px rgba(110, 190, 255, 0.45);
    --glow-star: 0 0 8px rgba(255, 190, 0, 0.6);
}

[data-theme='aero'][data-mode='dark'] body::before {
    background:
        radial-gradient(ellipse 45% 26% at 20% 18%, rgba(80, 220, 190, 0.28) 0%, rgba(80, 220, 190, 0.1) 50%, rgba(80, 220, 190, 0) 100%),
        radial-gradient(ellipse 40% 22% at 72% 12%, rgba(110, 150, 255, 0.3) 0%, rgba(110, 150, 255, 0.1) 55%, rgba(110, 150, 255, 0) 100%),
        radial-gradient(ellipse 50% 22% at 86% 44%, rgba(170, 110, 255, 0.16) 0%, rgba(170, 110, 255, 0) 100%),
        radial-gradient(ellipse 60% 25% at 40% 105%, rgba(60, 200, 130, 0.3) 0%, rgba(60, 200, 130, 0.1) 45%, rgba(60, 200, 130, 0) 100%),
        radial-gradient(circle at 92% 6%, rgba(230, 240, 255, 0.55) 0%, rgba(200, 220, 255, 0.14) 10%, rgba(200, 220, 255, 0) 24%);
}

[data-theme='aero'][data-mode='dark'] #topbar,
[data-theme='aero'][data-mode='dark'] .panel .toolbar,
[data-theme='aero'][data-mode='dark'] .menu .dropdown {
    background: linear-gradient(180deg, rgba(70, 120, 180, 0.5) 0%, rgba(30, 60, 105, 0.5) 50%, rgba(14, 36, 70, 0.6) 51%, rgba(24, 56, 96, 0.55) 100%);
}

[data-theme='aero'][data-mode='dark'] #topbar {
    border-bottom: 1px solid rgba(160, 210, 255, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

[data-theme='aero'][data-mode='dark'] #topbar::after {
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(200, 230, 255, 0.22) 50%, rgba(255, 255, 255, 0) 100%);
}

[data-theme='aero'][data-mode='dark'] .dv-tabs-and-actions-container {
    background: linear-gradient(180deg, rgba(50, 95, 150, 0.5) 0%, rgba(14, 36, 70, 0.55) 100%) !important;
}

[data-theme='aero'][data-mode='dark'] .dv-groupview {
    box-shadow: inset 0 0 0 1px rgba(160, 210, 255, 0.25), 0 4px 18px rgba(0, 0, 0, 0.45);
}

[data-theme='aero'][data-mode='dark'] .dv-groupview::before {
    background: linear-gradient(180deg, rgba(180, 220, 255, 0.1), rgba(255, 255, 255, 0));
}

[data-theme='aero'][data-mode='dark'] select,
[data-theme='aero'][data-mode='dark'] input[type='text'],
[data-theme='aero'][data-mode='dark'] input[type='password'],
[data-theme='aero'][data-mode='dark'] input[type='number'],
[data-theme='aero'][data-mode='dark'] textarea {
    background: rgba(6, 18, 36, 0.7);
    border-color: rgba(110, 170, 230, 0.5);
}

[data-theme='aero'][data-mode='dark'] .snowflake {
    color: #bfe3ff;
    opacity: 0.55;
    text-shadow: 0 0 6px rgba(150, 210, 255, 0.7);
}

[data-theme='aero'][data-mode='dark'] .description em,
[data-theme='aero'][data-mode='dark'] .header {
    text-shadow: 0 0 8px rgba(110, 190, 255, 0.4);
}

[data-theme='aero'][data-mode='dark'] button.link,
[data-theme='aero'][data-mode='dark'] #topbar a,
[data-theme='aero'][data-mode='dark'] .day a,
[data-theme='aero'][data-mode='dark'] .year-selector {
    color: #d6ecff;
    background: linear-gradient(180deg, #4d7fb8 0%, #2a5a94 48%, #173f73 52%, #2b639c 100%);
    border: 1px solid rgba(150, 200, 250, 0.55);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(0, 20, 50, 0.7);
}

[data-theme='aero'][data-mode='dark'] button.link:hover,
[data-theme='aero'][data-mode='dark'] #topbar a:hover,
[data-theme='aero'][data-mode='dark'] .day a:hover,
[data-theme='aero'][data-mode='dark'] .year-selector:hover {
    color: #ffffff;
    background: linear-gradient(180deg, #62a0e0 0%, #3877bd 48%, #1f559a 52%, #3d83c9 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 3px rgba(110, 190, 255, 0.25);
}

[data-theme='aero'][data-mode='dark'] button.link:disabled,
[data-theme='aero'][data-mode='dark'] a.disabled {
    background: linear-gradient(180deg, #2a3b50, #1c2a3c);
    color: #5d7690;
    box-shadow: none;
}

[data-theme='aero'][data-mode='dark'] .year-selector.current,
[data-theme='aero'][data-mode='dark'] button.link.current,
[data-theme='aero'][data-mode='dark'] body.view-dashboard .view-link-dashboard,
[data-theme='aero'][data-mode='dark'] body.view-editor .view-link-editor {
    background: linear-gradient(180deg, #7fe3a8 0%, #2fb866 48%, #17964a 52%, #4fd086 100%);
    color: #04210f;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    border-color: #7fe3a8;
}

[data-theme='aero'][data-mode='dark'] .brand.header,
[data-theme='aero'][data-mode='dark'] .dashboard-title {
    background: linear-gradient(180deg, #b8f5cf 0%, #5fe08a 50%, #2fb866 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(95, 224, 138, 0.35));
}

[data-theme='aero'][data-mode='dark'] .dv-tab {
    background: linear-gradient(180deg, rgba(70, 120, 180, 0.55), rgba(20, 48, 88, 0.6)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme='aero'][data-mode='dark'] .dv-tab.dv-active-tab {
    background: linear-gradient(180deg, #5b95d6 0%, #2f66a8 60%, #1f4f8c 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 -2px 8px rgba(80, 160, 255, 0.3);
}

[data-theme='aero'][data-mode='dark'] .day,
[data-theme='aero'][data-mode='dark'] .dashboard .tools {
    background: linear-gradient(180deg, rgba(70, 120, 180, 0.35) 0%, rgba(24, 56, 100, 0.35) 50%, rgba(10, 30, 60, 0.45) 51%, rgba(20, 50, 90, 0.4) 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(160, 210, 255, 0.35);
}

[data-theme='aero'][data-mode='dark'] .day.active {
    box-shadow: 0 0 0 3px rgba(95, 224, 138, 0.45), 0 4px 14px rgba(0, 0, 0, 0.4);
}

[data-theme='aero'][data-mode='dark'] table.results th {
    color: #6cc0ff;
}

[data-theme='aero'][data-mode='dark'] .panel .toolbar {
    border-bottom: 1px solid rgba(160, 210, 255, 0.3);
}

[data-theme='aero'][data-mode='dark'] .claimed-stars {
    color: #ffc233;
    text-shadow: 0 0 8px rgba(255, 190, 0, 0.6);
}

/* ---- aquaq: the challenge hub is stock bootstrap, so this is too ---------------------------- */
[data-theme='aquaq'] {
    --background: #ffffff;
    --panel: #f8f9fa;
    --hover: #e9ecef;
    --lightgreen: #28a745;
    --linkgreen: #007bff;
    --highlightlinkgreen: #0056b3;
    --staryellow: #e0a800;
    --unclaimedstar: #ced4da;
    --disabled: #adb5bd;
    --offwhite: #212529;
    --dim: #6c757d;
    --red: #dc3545;
    --border: #dee2e6;
    --card-border: #ced4da;
    --snow: #9ec5fe;
    --app-bg: var(--background);
    --glow-accent: none;
    --glow-star: none;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --radius: 4px;
    --panel-blur: none;
}

[data-theme='aquaq'][data-mode='dark'] {
    --background: #212529;
    --panel: #2b3035;
    --hover: #343a40;
    --lightgreen: #75b798;
    --linkgreen: #6ea8fe;
    --highlightlinkgreen: #9ec5fe;
    --staryellow: #ffc107;
    --unclaimedstar: #495057;
    --disabled: #565e66;
    --offwhite: #dee2e6;
    --dim: #8a939b;
    --red: #ea868f;
    --border: #495057;
    --card-border: #6c757d;
    --snow: #6ea8fe;
}

/* the dark navbar of the site, in both modes: the bar gets its own palette */
[data-theme='aquaq'] #topbar {
    --panel: #495057;
    --hover: #5a6268;
    --offwhite: #f8f9fa;
    --dim: #adb5bd;
    --border: #6c757d;
    --linkgreen: #9ec5fe;
    --highlightlinkgreen: #ffffff;
    --lightgreen: #ffffff;
    --disabled: #6c757d;
    --staryellow: #ffc107;
    --unclaimedstar: #6c757d;
    background: #343a40;
    color: #f8f9fa;
    border-bottom-color: #23272b;
}

[data-theme='aquaq'] #topbar .menu .dropdown {
    background: #343a40;
}

/* headings are plain dark text on the site; green is kept for "it worked" */
[data-theme='aquaq'] .header {
    color: var(--offwhite);
    font-weight: 500;
}

[data-theme='aquaq'] .day .header,
[data-theme='aquaq'] .description h2 {
    color: var(--linkgreen);
}

[data-theme='aquaq'] .dashboard-title {
    font-weight: 300;
    letter-spacing: -0.01em;
}

[data-theme='aquaq'] button.link::before,
[data-theme='aquaq'] button.link::after,
[data-theme='aquaq'] a.bracket::before,
[data-theme='aquaq'] a.bracket::after {
    content: none;
}

[data-theme='aquaq'] .deco {
    display: none;
}

/* bootstrap's small outline buttons */
[data-theme='aquaq'] button.link,
[data-theme='aquaq'] a.bracket {
    border: 1px solid var(--linkgreen);
    border-radius: 0.25rem;
    padding: 1px 9px;
    color: var(--linkgreen);
    background: transparent;
    text-decoration: none;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

[data-theme='aquaq'] button.link:hover,
[data-theme='aquaq'] a.bracket:hover,
[data-theme='aquaq'] .year-selector.current,
[data-theme='aquaq'] button.link.current,
[data-theme='aquaq'] body.view-dashboard .view-link-dashboard,
[data-theme='aquaq'] body.view-editor .view-link-editor {
    background: var(--linkgreen);
    border-color: var(--linkgreen);
    color: #ffffff;
    text-shadow: none;
}

[data-theme='aquaq'][data-mode='dark'] button.link:hover,
[data-theme='aquaq'][data-mode='dark'] a.bracket:hover,
[data-theme='aquaq'][data-mode='dark'] .year-selector.current,
[data-theme='aquaq'][data-mode='dark'] button.link.current {
    color: #0b1c33;
}

[data-theme='aquaq'] button.link:disabled,
[data-theme='aquaq'] a.disabled {
    border-color: var(--disabled);
    background: transparent;
}

[data-theme='aquaq'] select,
[data-theme='aquaq'] input[type='text'],
[data-theme='aquaq'] input[type='password'],
[data-theme='aquaq'] input[type='number'],
[data-theme='aquaq'] textarea {
    border-radius: 0.25rem;
    background: var(--background);
}

[data-theme='aquaq'] #topbar select {
    background: var(--panel);
}

[data-theme='aquaq'] select:focus,
[data-theme='aquaq'] input:focus,
[data-theme='aquaq'] textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* cards like bootstrap's, with the grey jumbotron tone for the tools box */
[data-theme='aquaq'] .day {
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--background);
    transition: box-shadow 0.15s, border-color 0.15s;
}

[data-theme='aquaq'][data-mode='dark'] .day {
    background: var(--panel);
}

[data-theme='aquaq'] .day:hover {
    border-color: var(--linkgreen);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

[data-theme='aquaq'] .day.active {
    border-color: var(--linkgreen);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

[data-theme='aquaq'] .dashboard .tools {
    background: var(--hover);
    border: 0;
    border-radius: 0.3rem;
    padding: 16px 20px;
}

[data-theme='aquaq'] table.results tbody tr:nth-child(odd) {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme='aquaq'][data-mode='dark'] table.results tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme='aquaq'] pre,
[data-theme='aquaq'] code,
[data-theme='aquaq'] .result-answer,
[data-theme='aquaq'] .tests-input,
[data-theme='aquaq'] textarea {
    font-family: var(--font-mono);
}

/* a few bubbles drifting, for the name */
[data-theme='aquaq'] .snowflake {
    color: var(--snow);
    opacity: 0.45;
    text-shadow: none;
}

/* on the dark navbar the filled button is pale blue, so its label goes dark */
[data-theme='aquaq'] #topbar button.link:hover,
[data-theme='aquaq'] #topbar a.bracket:hover,
[data-theme='aquaq'] #topbar button.link.current,
[data-theme='aquaq'] body.view-dashboard #topbar .view-link-dashboard,
[data-theme='aquaq'] body.view-editor #topbar .view-link-editor {
    color: #0b1c33;
}
