/* [TRACE: STYLE_GUIDE.md] Root Theme Variables - Default Obsidian theme color palette */
:root {
    --bg-color: #2c2c2c;
    --bg-pattern: #3a3a3a;
    --container-bg: #4d4d4d;
    --box-bg: #3e3e3e;
    --text-color: #e0e0e0;
    --accent-color: #ff9900;
    --border-light: #7a7a7a;
    --border-dark: #1a1a1a;
    --input-bg: #1a1a1a;
    --green: #00ff00;
    --yellow: #ffff00;
    --glow: none;
    --rpg-gold: #c9a227;
    --rpg-gold-bright: #ffe566;
    --rpg-title-font: Georgia, "Palatino Linotype", "Book Antiqua", serif;
    --rpg-stone-dark: #1a1612;
    --rpg-stone-mid: #3d3530;
    --rpg-stone-edge: #5c5348;
    --rpg-parchment: #e8d4a8;
    --rpg-parchment-edge: #a08050;
    --rpg-bar-title: #2a4a2a;
    --rpg-bar-title-text: #b8e0b0;
}

/* [TRACE: STYLE_GUIDE.md] Paladin (Light) Theme Override - Daytime-friendly light theme */
[data-theme="paladin"] {
    --bg-color: #b3b3b3;
    --bg-pattern: #c0c0c0;
    --container-bg: #d4d4d4;
    --box-bg: #e1e1e1;
    --text-color: #222;
    --accent-color: #0055aa;
    --border-light: #ffffff;
    --border-dark: #808080;
    --input-bg: #ffffff;
    --green: #008000;
    --yellow: #aa7700;
    --glow: none;
}

/* [TRACE: STYLE_GUIDE.md] Arcade Cabinet Theme Override - Neon cyberpunk aesthetic with glow effects */
[data-theme="arcade"] {
    --bg-color: #050505;
    --bg-pattern: #1a0033;
    --container-bg: #2b0057;
    --box-bg: #111;
    --text-color: #00ffff;
    --accent-color: #ff00ff;
    --border-light: #ff00ff;
    --border-dark: #330066;
    --input-bg: #000;
    --green: #39ff14;
    --yellow: #fff300;
    --glow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* [TRACE: STYLE_GUIDE.md] Scroll (Parchment) Theme - Warm medieval scribe aesthetic with aged paper tones */
[data-theme="scroll"] {
    --bg-color: #c4a878;
    --bg-pattern: #b09060;
    --container-bg: #d8c190;
    --box-bg: #e8d4a8;
    --text-color: #2c1a0a;
    --accent-color: #8b1a1a;
    --border-light: #f5ecd4;
    --border-dark: #7a5c30;
    --input-bg: #f0e4c0;
    --green: #2d6a2d;
    --yellow: #8b6914;
    --glow: none;
    --rpg-gold: #c8860a;
    --rpg-gold-bright: #f0c050;
    --rpg-bar-title: #3a1e08;
    --rpg-bar-title-text: #f0d890;
}

/* Tidepool — underwater otter tavern */
[data-theme="tidepool"] {
    --bg-color: #0a1a1f;
    --bg-pattern: #0f2830;
    --container-bg: #143238;
    --box-bg: #1a4048;
    --text-color: #c8e8f0;
    --accent-color: #40c8e0;
    --border-light: #5a9098;
    --border-dark: #061014;
    --input-bg: #0a2028;
    --green: #5ce0a8;
    --yellow: #f0d060;
    --glow: 0 0 8px rgba(64, 200, 224, 0.25);
    --rpg-gold: #5ce0c8;
    --rpg-gold-bright: #a8fff0;
    --chrome-body: #081820;
    --chrome-radial: rgba(40, 120, 140, 0.35);
    --chrome-pattern-a: #0f2830;
    --chrome-pattern-b: #081820;
    --chrome-container-border: #2a6870;
    --chrome-container-highlight: #4a98a0;
    --chrome-header-top: #1a4850;
    --chrome-header-bottom: #0a2830;
    --chrome-header-border: #2a5860;
    --chrome-nav-top: #2a5868;
    --chrome-nav-bottom: #143038;
    --chrome-nav-border: #061014;
    --chrome-nav-highlight: #6ab0b8;
    --chrome-nav-text: #c8e8f0;
    --chrome-nav-active-top: #3a7888;
    --chrome-nav-active-bottom: #1a4850;
    --chrome-marquee-top: #0a2028;
    --chrome-marquee-bottom: #061014;
    --chrome-marquee-border: #2a5860;
    --chrome-marquee-text: #5ce0a8;
    --chrome-box-top: #1a4850;
    --chrome-box-bottom: #0a2830;
    --chrome-box-border: #061014;
    --chrome-box-text: #a8fff0;
    --chrome-content-border: #061014;
    --chrome-content-highlight: #3a7880;
    --chrome-tagline: #5ce0a8;
    --footer-bg-top: #143038;
    --footer-bg-mid: #0a2028;
    --footer-bg-bot: #061014;
    --footer-border: #061014;
    --footer-border-hi: #3a7880;
    --footer-xp-color: #a8fff0;
    --footer-xp-counter: #40c8e0;
    --footer-copy: #6a98a0;
    --footer-timer-text: #5ce0a8;
    --footer-timer-border: #2a5860;
    --footer-timer-bg: rgba(0, 0, 0, 0.45);
    --footer-rule-color: rgba(90, 160, 170, 0.3);
}

/* Runescape — classic brown panels + green bars */
[data-theme="runescape"] {
    --bg-color: #1e1810;
    --bg-pattern: #2a2218;
    --container-bg: #4a3828;
    --box-bg: #5c4630;
    --text-color: #ffff00;
    --accent-color: #90c040;
    --border-light: #8a7058;
    --border-dark: #1a1008;
    --input-bg: #3a2c1e;
    --green: #00ff00;
    --yellow: #ffff00;
    --glow: none;
    --rpg-gold: #ffff00;
    --rpg-gold-bright: #ffff66;
    --rpg-bar-title: #1a5010;
    --rpg-bar-title-text: #ffffff;
    --chrome-body: #1e1810;
    --chrome-radial: rgba(80, 60, 30, 0.3);
    --chrome-pattern-a: #2a2218;
    --chrome-pattern-b: #1e1810;
    --chrome-container-border: #6a5840;
    --chrome-container-highlight: #9a8060;
    --chrome-header-top: #3a2c18;
    --chrome-header-bottom: #1e1408;
    --chrome-header-border: #4a3820;
    --chrome-nav-top: #6a5840;
    --chrome-nav-bottom: #4a3828;
    --chrome-nav-border: #1a1008;
    --chrome-nav-highlight: #9a8060;
    --chrome-nav-text: #ffff00;
    --chrome-nav-active-top: #8a7048;
    --chrome-nav-active-bottom: #5a4830;
    --chrome-marquee-top: #2a2010;
    --chrome-marquee-bottom: #1a1008;
    --chrome-marquee-border: #4a3820;
    --chrome-marquee-text: #00ff00;
    --chrome-box-top: #1a5010;
    --chrome-box-bottom: #0a3008;
    --chrome-box-border: #0a2008;
    --chrome-box-text: #ffffff;
    --chrome-content-border: #1a1008;
    --chrome-content-highlight: #7a6048;
    --chrome-tagline: #00ff00;
    --footer-bg-top: #4a3828;
    --footer-bg-mid: #3a2c1e;
    --footer-bg-bot: #1e1408;
    --footer-border: #1a1008;
    --footer-border-hi: #8a7058;
    --footer-xp-color: #ffff00;
    --footer-xp-counter: #90c040;
    --footer-copy: #c8b060;
    --footer-timer-text: #00ff00;
    --footer-timer-border: #4a3820;
    --footer-timer-bg: rgba(0, 0, 0, 0.4);
    --footer-rule-color: rgba(120, 90, 50, 0.35);
}

/* Ember — forge / campfire warmth */
[data-theme="ember"] {
    --bg-color: #1a1008;
    --bg-pattern: #2a1810;
    --container-bg: #3a2418;
    --box-bg: #4a3020;
    --text-color: #f0d8c0;
    --accent-color: #ff6622;
    --border-light: #8a5840;
    --border-dark: #100804;
    --input-bg: #2a1810;
    --green: #88cc44;
    --yellow: #ffaa33;
    --glow: 0 0 10px rgba(255, 102, 34, 0.2);
    --rpg-gold: #ffaa33;
    --rpg-gold-bright: #ffcc66;
    --chrome-body: #140c06;
    --chrome-radial: rgba(200, 80, 20, 0.25);
    --chrome-pattern-a: #2a1810;
    --chrome-pattern-b: #140c06;
    --chrome-container-border: #6a4030;
    --chrome-container-highlight: #9a6048;
    --chrome-header-top: #4a2818;
    --chrome-header-bottom: #2a1408;
    --chrome-header-border: #5a3020;
    --chrome-nav-top: #6a4830;
    --chrome-nav-bottom: #3a2418;
    --chrome-nav-border: #100804;
    --chrome-nav-highlight: #aa6848;
    --chrome-nav-text: #f0d8c0;
    --chrome-nav-active-top: #8a5028;
    --chrome-nav-active-bottom: #5a3018;
    --chrome-marquee-top: #2a1408;
    --chrome-marquee-bottom: #100804;
    --chrome-marquee-border: #5a3020;
    --chrome-marquee-text: #88cc44;
    --chrome-box-top: #5a2810;
    --chrome-box-bottom: #3a1808;
    --chrome-box-border: #200804;
    --chrome-box-text: #ffcc88;
    --chrome-content-border: #100804;
    --chrome-content-highlight: #8a5840;
    --chrome-tagline: #ffaa33;
    --footer-bg-top: #3a2418;
    --footer-bg-mid: #2a1408;
    --footer-bg-bot: #100804;
    --footer-border: #100804;
    --footer-border-hi: #8a5840;
    --footer-xp-color: #ffcc66;
    --footer-xp-counter: #ff6622;
    --footer-copy: #a08060;
    --footer-timer-text: #88cc44;
    --footer-timer-border: #5a3020;
    --footer-timer-bg: rgba(0, 0, 0, 0.45);
    --footer-rule-color: rgba(180, 90, 40, 0.3);
}

/* Void — necromancer shadow realm */
[data-theme="void"] {
    --bg-color: #0a0612;
    --bg-pattern: #150a22;
    --container-bg: #1a1030;
    --box-bg: #221838;
    --text-color: #d8c8f0;
    --accent-color: #a855f7;
    --border-light: #6a48a0;
    --border-dark: #050208;
    --input-bg: #120820;
    --green: #c084fc;
    --yellow: #e9d5ff;
    --glow: 0 0 12px rgba(168, 85, 247, 0.35);
    --rpg-gold: #c084fc;
    --rpg-gold-bright: #e9d5ff;
    --chrome-body: #06040c;
    --chrome-radial: rgba(100, 40, 180, 0.3);
    --chrome-pattern-a: #150a22;
    --chrome-pattern-b: #06040c;
    --chrome-container-border: #4a3080;
    --chrome-container-highlight: #7a58b0;
    --chrome-header-top: #2a1848;
    --chrome-header-bottom: #120820;
    --chrome-header-border: #3a2060;
    --chrome-nav-top: #3a2860;
    --chrome-nav-bottom: #1a1030;
    --chrome-nav-border: #050208;
    --chrome-nav-highlight: #7a58b0;
    --chrome-nav-text: #d8c8f0;
    --chrome-nav-active-top: #5a3888;
    --chrome-nav-active-bottom: #2a1848;
    --chrome-marquee-top: #120820;
    --chrome-marquee-bottom: #050208;
    --chrome-marquee-border: #3a2060;
    --chrome-marquee-text: #c084fc;
    --chrome-box-top: #3a1860;
    --chrome-box-bottom: #1a0830;
    --chrome-box-border: #0a0418;
    --chrome-box-text: #e9d5ff;
    --chrome-content-border: #050208;
    --chrome-content-highlight: #5a4080;
    --chrome-tagline: #c084fc;
    --footer-bg-top: #1a1030;
    --footer-bg-mid: #120820;
    --footer-bg-bot: #050208;
    --footer-border: #050208;
    --footer-border-hi: #5a4080;
    --footer-xp-color: #e9d5ff;
    --footer-xp-counter: #a855f7;
    --footer-copy: #8a78a8;
    --footer-timer-text: #c084fc;
    --footer-timer-border: #3a2060;
    --footer-timer-bg: rgba(0, 0, 0, 0.5);
    --footer-rule-color: rgba(120, 80, 180, 0.3);
}

/* Frost — ice cavern (light) */
[data-theme="frost"] {
    --bg-color: #a8c8e0;
    --bg-pattern: #98b8d0;
    --container-bg: #c8dce8;
    --box-bg: #dce8f0;
    --text-color: #1a2838;
    --accent-color: #2878b8;
    --border-light: #f0f8ff;
    --border-dark: #6888a8;
    --input-bg: #e8f4fc;
    --green: #308850;
    --yellow: #5080a0;
    --glow: 0 0 8px rgba(40, 120, 184, 0.2);
    --rpg-gold: #2878b8;
    --rpg-gold-bright: #4090d0;
    --chrome-body: #88b0c8;
    --chrome-radial: rgba(200, 230, 255, 0.5);
    --chrome-pattern-a: #98b8d0;
    --chrome-pattern-b: #88b0c8;
    --chrome-container-border: #6888a8;
    --chrome-container-highlight: #d0e8f8;
    --chrome-header-top: #4878a0;
    --chrome-header-bottom: #285878;
    --chrome-header-border: #5878a0;
    --chrome-nav-top: #b8d4e8;
    --chrome-nav-bottom: #98b8d0;
    --chrome-nav-border: #5878a0;
    --chrome-nav-highlight: #f0f8ff;
    --chrome-nav-text: #1a2838;
    --chrome-nav-active-top: #6898c0;
    --chrome-nav-active-bottom: #4878a0;
    --chrome-marquee-top: #285878;
    --chrome-marquee-bottom: #183848;
    --chrome-marquee-border: #5878a0;
    --chrome-marquee-text: #a8e0ff;
    --chrome-box-top: #285878;
    --chrome-box-bottom: #183848;
    --chrome-box-border: #102838;
    --chrome-box-text: #d0f0ff;
    --chrome-content-border: #5878a0;
    --chrome-content-highlight: #c0d8e8;
    --chrome-tagline: #2878b8;
    --footer-bg-top: #e8f4fc;
    --footer-bg-mid: #c8dce8;
    --footer-bg-bot: #a0c0d8;
    --footer-border: #6888a8;
    --footer-border-hi: #f0f8ff;
    --footer-xp-color: #183848;
    --footer-xp-counter: #2878b8;
    --footer-copy: #385868;
    --footer-timer-text: #2878b8;
    --footer-timer-border: #6888a8;
    --footer-timer-bg: rgba(255, 255, 255, 0.55);
    --footer-rule-color: rgba(80, 120, 160, 0.3);
}

/* Treasure — black & gold loot screen */
[data-theme="treasure"] {
    --bg-color: #0a0804;
    --bg-pattern: #1a1408;
    --container-bg: #2a2010;
    --box-bg: #3a3018;
    --text-color: #f0e8c8;
    --accent-color: #ffd700;
    --border-light: #c9a227;
    --border-dark: #080604;
    --input-bg: #1a1408;
    --green: #c9a227;
    --yellow: #ffe566;
    --glow: 0 0 10px rgba(255, 215, 0, 0.25);
    --rpg-gold: #c9a227;
    --rpg-gold-bright: #ffe566;
    --chrome-body: #060504;
    --chrome-radial: rgba(200, 160, 40, 0.2);
    --chrome-pattern-a: #1a1408;
    --chrome-pattern-b: #060504;
    --chrome-container-border: #8a7020;
    --chrome-container-highlight: #c9a040;
    --chrome-header-top: #3a3010;
    --chrome-header-bottom: #1a1408;
    --chrome-header-border: #6a5018;
    --chrome-nav-top: #5a4818;
    --chrome-nav-bottom: #3a2c10;
    --chrome-nav-border: #080604;
    --chrome-nav-highlight: #d4b040;
    --chrome-nav-text: #f0e8c8;
    --chrome-nav-active-top: #8a7020;
    --chrome-nav-active-bottom: #5a4818;
    --chrome-marquee-top: #1a1408;
    --chrome-marquee-bottom: #080604;
    --chrome-marquee-border: #6a5018;
    --chrome-marquee-text: #ffe566;
    --chrome-box-top: #4a3810;
    --chrome-box-bottom: #2a2008;
    --chrome-box-border: #100804;
    --chrome-box-text: #ffe566;
    --chrome-content-border: #080604;
    --chrome-content-highlight: #9a7828;
    --chrome-tagline: #ffd700;
    --footer-bg-top: #2a2010;
    --footer-bg-mid: #1a1408;
    --footer-bg-bot: #080604;
    --footer-border: #080604;
    --footer-border-hi: #c9a227;
    --footer-xp-color: #ffe566;
    --footer-xp-counter: #ffd700;
    --footer-copy: #a09060;
    --footer-timer-text: #c9a227;
    --footer-timer-border: #6a5018;
    --footer-timer-bg: rgba(0, 0, 0, 0.5);
    --footer-rule-color: rgba(180, 140, 40, 0.35);
}

/* [TRACE: STYLE_GUIDE.md] Office (Professional) Theme Override - Clean corporate aesthetic for professional contexts */
[data-theme="office"] {
    --bg-color: #e2e8f0;
    --bg-pattern: #cbd5e1;
    --container-bg: #ffffff;
    --box-bg: #f8fafc;
    --text-color: #1e293b;
    --accent-color: #2563eb;
    --border-light: #f1f5f9;
    --border-dark: #94a3b8;
    --input-bg: #ffffff;
    --green: #16a34a;
    --yellow: #ca8a04;
    --glow: 0 0 5px rgba(37, 99, 235, 0.1);
}

/* [TRACE: STYLE_GUIDE.md] Retro Gaming Aesthetic - Global styles for pixelated rendering and smooth transitions */
* {
    box-sizing: border-box;
    image-rendering: pixelated; /* Pixelated rendering for retro feel, except badges which use auto */
    -webkit-tap-highlight-color: transparent; /* Remove mobile tap highlight for cleaner UX */
    transition: background-color 0.2s, color 0.2s; /* Smooth theme transitions */
}

body {
    background-color: var(--bg-color);
    background-image: repeating-conic-gradient(var(--bg-pattern) 0% 25%, var(--bg-color) 0% 50%);
    background-size: 4px 4px;
    font-family: "Courier New", Courier, monospace;
    margin: 0;
    padding: 10px;
    color: var(--text-color);
    line-height: 1.4;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--container-bg);
    border: 4px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    padding: 8px;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* [TRACE: STYLE_GUIDE.md] Subtle Scanline Overlay - Mimics CRT monitor scanlines for authentic retro feel */
.container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    z-index: 10;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
}

header {
    text-align: center;
    border: 3px inset #333;
    padding: 15px 5px;
    margin-bottom: 15px;
    background: #1e1e1e;
    color: var(--accent-color);
    position: relative;
    text-shadow: var(--glow);
}

h1 {
    font-size: 1.5em;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 2px 2px #000;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    font-size: 9px;
    padding: 2px 5px;
    cursor: pointer;
    text-transform: uppercase;
    z-index: 20;
}

.theme-toggle:hover {
    color: #fff;
    border-color: #888;
}

/* Navigation */
nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 4px;
    margin-bottom: 15px;
}

nav button {
    color: var(--text-color);
    font-weight: bold;
    font-size: 0.75em;
    padding: 12px 5px;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    cursor: pointer;
    font-family: inherit;
    text-shadow: var(--glow);
}

nav button:active,
nav button.active {
    background: #222;
    color: var(--yellow);
    border-top-color: var(--border-dark);
    border-left-color: var(--border-dark);
    outline: none;
}

.main-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Page Visibility Logic */
.page {
    display: none !important;
}

.page.active {
    display: block !important;
}

.content-box {
    border: 3px solid var(--border-dark);
    padding: 12px;
    background: var(--box-bg);
    margin-bottom: 5px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
}

.box-title {
    background: #2a2a2a;
    border-bottom: 2px solid #555;
    color: var(--accent-color);
    padding: 6px 10px;
    margin: -12px -12px 10px -12px;
    font-size: 0.8em;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    text-shadow: var(--glow);
}

/* Form Styles */
input,
textarea,
select {
    width: 100%;
    padding: 8px;
    background: var(--input-bg);
    border: 2px solid #555;
    color: var(--text-color);
    font-family: inherit;
    margin-bottom: 10px;
    position: relative;
    z-index: 20; /* Ensure inputs are clickable above scanline overlay */
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
}

input[type="file"] {
    color: #888;
    font-size: 0.7em;
    border: 2px dashed #555;
    background: #222;
    cursor: pointer;
}

.admin-btn {
    background: var(--accent-color);
    color: #fff;
    border: 3px solid var(--border-dark);
    border-top-color: #ffcc66;
    border-left-color: #ffcc66;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-bottom: 5px;
    text-shadow: 1px 1px #000;
    position: relative;
    z-index: 20; /* Ensure clickable */
}

/* Ensure list delete buttons are clickable */
.admin-panel button {
    position: relative;
    z-index: 20;
}

/* Posts Styles */
.post-item {
    border-bottom: 2px solid var(--border-dark);
    padding: 15px 0;
}

.post-item:last-child {
    border-bottom: none;
}

.post-title-text {
    color: var(--yellow);
    font-weight: bold;
    text-shadow: var(--glow);
}

.post-date-text {
    color: var(--green);
    font-size: 0.7em;
}

.post-image {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--border-dark);
    margin-top: 10px;
    display: block;
}

/* Pagination Styles */
#pagination {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    border-top: 2px solid var(--border-dark);
}

#pagination button {
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    color: var(--text-color);
    padding: 8px 15px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.7em;
    transition: all 0.2s;
}

#pagination button:hover:not(:disabled) {
    background: var(--container-bg);
    color: var(--yellow);
    border-top-color: var(--border-dark);
    border-left-color: var(--border-dark);
}

#pagination button:active:not(:disabled) {
    background: #222;
    transform: translate(1px, 1px);
}

#pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    color: var(--green);
    font-weight: bold;
    font-size: 0.8em;
    text-shadow: var(--glow);
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 30px;
    margin: 20px 0;
    border-left: 4px solid var(--border-dark);
}

.timeline-event {
    position: relative;
    margin-bottom: 30px;
    padding-left: 20px;
}

.timeline-event::before {
    content: '◆';
    position: absolute;
    left: -32px;
    top: 0;
    color: var(--accent-color);
    background: var(--box-bg);
    padding: 2px;
    font-weight: bold;
    box-shadow: var(--glow);
}

marquee {
    background: #111;
    padding: 6px;
    color: var(--green);
    font-size: 0.75em;
}

/* Tool Cards */
.tools-section {
    margin-bottom: 18px;
}

.tools-section:last-child {
    margin-bottom: 0;
}

.tools-section--group {
    padding-top: 4px;
    border-top: 2px solid var(--border-dark);
}

.tools-section--group > .tools-section-header {
    margin-top: 8px;
}

/* Section panels — boxed header bar + body (Tools + Creations subsections) */
.tools-section-block,
.creations-subsection {
    margin-bottom: 18px;
    scroll-margin-top: 12px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: var(--box-bg);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.tools-section-block:last-child,
.creations-subsection:last-child {
    margin-bottom: 0;
}

.creations-page .creations-subsection + .creations-subsection {
    margin-top: 24px;
}

.tools-section-block > .tools-section-header,
.creations-subsection > .tools-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: none;
    border-bottom: 2px solid #555;
    border-left: 4px solid var(--accent-color);
    background: #2a2a2a;
    color: var(--accent-color);
    font-size: 0.72em;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: var(--glow);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tools-section-block > .tools-section-body,
.creations-subsection > .creations-subsection-body {
    padding: 12px 10px 14px;
    background: rgba(0, 0, 0, 0.18);
}

#tools-container > .tools-section-block:first-child,
.tools-section--games > .tools-section-block:first-child,
.tools-section--llm > .tools-section-block:first-child {
    margin-top: 0;
}

/* Group / legacy flat titles (no panel wrapper) */
.tools-section-title,
.tools-subsection-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 16px 0 10px;
    padding: 8px 12px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left: 4px solid var(--accent-color);
    background: #2a2a2a;
    color: var(--accent-color);
    font-size: 0.72em;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: var(--glow);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35);
}

.tools-section-index {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 10px 10px;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.22);
}

.tools-section-index[hidden] {
    display: none !important;
}

.tools-index-btn {
    padding: 5px 10px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.62em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 var(--border-light);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.tools-index-btn:hover,
.tools-index-btn:focus {
    border-color: var(--accent-color);
    color: var(--yellow);
    outline: none;
}

.tools-section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 2px 4px;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

.tools-section-toggle:hover,
.tools-section-toggle:focus {
    color: var(--yellow);
    outline: none;
}

.tools-section-toggle .tools-section-chevron {
    color: var(--green);
    font-size: 0.85em;
}

.tools-section-body--collapsed {
    display: none;
}

.tools-section-tag {
    color: var(--green);
    font-size: 0.9em;
}

.tools-tabbed-shell {
    margin-bottom: 12px;
    padding: 10px 8px 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: inset 1px 1px 0 var(--border-light);
}

.tools-tabbed-shell .tools-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0 4px;
}

.tools-tabbed-shell .tools-tab-panels {
    min-width: 0;
}

.tools-tabbed-shell .tools-carousel-embedded {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.tools-tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 2px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 var(--border-light);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.tools-tab-btn:hover,
.tools-tab-btn:focus {
    border-color: var(--accent-color);
    color: var(--yellow);
    outline: none;
}

.tools-tab-btn--active {
    border-color: var(--accent-color);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.08));
    color: var(--yellow);
    box-shadow: inset 1px 1px 0 var(--border-light), var(--glow);
}

.tools-tab-panel:not(.tools-tab-panel--active) {
    display: none;
}

#tools-container .tools-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
}

/* Project vault tab */
.projects-intro {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: rgba(0, 0, 0, 0.25);
}

.projects-lede {
    margin: 0 0 12px;
    font-size: 0.78em;
    line-height: 1.5;
    color: var(--text-color);
}

.projects-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.projects-link-btn {
    display: inline-block;
    padding: 6px 10px;
    font-size: 0.65em;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-color);
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: var(--box-bg);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.projects-link-btn:hover,
.projects-link-btn:focus {
    border-color: var(--accent-color);
    color: var(--yellow);
    outline: none;
}

.projects-link-btn--hub {
    border-color: var(--green);
    color: var(--green);
}

#projects-container .projects-wall {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Creations tab */
.creations-lede {
    margin: 0 0 16px;
    font-size: 0.78em;
    line-height: 1.5;
    color: #888;
    text-align: center;
}

.creations-lede-note {
    display: block;
    margin-top: 8px;
    font-size: 0.92em;
    color: #666;
}

.creations-lede-note a {
    color: var(--accent-color);
    text-decoration: none;
}

.creations-lede-note a:hover,
.creations-lede-note a:focus {
    text-decoration: underline;
}


.creations-desktop-wrap {
    margin-bottom: 8px;
}

.creations-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.creations-wall .creation-card--featured {
    border-color: var(--yellow);
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.25);
}

.creations-wall .creation-card--featured .tool-card-title::after {
    content: ' #1';
    color: var(--yellow);
    font-size: 0.75em;
}

.creations-wall .creation-card--hub {
    grid-column: 1 / -1;
}

.tool-alt-link {
    font-size: 0.65em;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 2px 6px;
}

.tool-alt-link:hover,
.tool-alt-link:focus {
    color: var(--yellow);
    border-color: var(--yellow);
    outline: none;
}

@media (min-width: 768px) {
    .creations-wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .creations-wall .creation-card--hub {
        grid-column: span 2;
    }
}

#projects-container .project-card--hub {
    grid-column: 1 / -1;
    max-width: 100%;
}

@media (min-width: 768px) {
    #projects-container .projects-wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #projects-container .project-card--hub {
        grid-column: span 2;
    }
}

.tools-carousel-shell,
.tools-carousel-embedded {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.tools-carousel-shell {
    margin-bottom: 12px;
    padding: 10px 8px 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: inset 1px 1px 0 var(--border-light);
}

.tools-carousel {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    grid-template-rows: auto;
    align-items: center;
    gap: 8px 6px;
    width: 100%;
}

.tools-carousel--no-nav {
    grid-template-columns: minmax(0, 1fr);
}

.tools-carousel--no-nav .tools-carousel-viewport {
    grid-column: 1;
}

.tools-carousel-viewport {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
}

.tools-carousel-pages {
    width: 100%;
}

.tools-carousel-page:not(.tools-carousel-page--active) {
    display: none;
}

.tools-wall--carousel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tools-carousel-btn {
    grid-row: 1;
    width: 36px;
    height: 72px;
    padding: 0;
    border: 2px solid var(--border-dark);
    border-bottom-color: var(--border-light);
    border-right-color: var(--border-light);
    background: rgba(0, 0, 0, 0.45);
    color: var(--yellow);
    font-family: inherit;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 var(--border-light);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.tools-carousel-btn--prev {
    grid-column: 1;
}

.tools-carousel-btn--next {
    grid-column: 3;
}

.tools-carousel-btn:hover:not(:disabled),
.tools-carousel-btn:focus:not(:disabled) {
    border-color: var(--accent-color);
    color: var(--accent-color);
    outline: none;
}

.tools-carousel-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tools-carousel-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0 0;
    padding: 8px 10px 10px;
    border-top: 2px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.22);
}

.tools-carousel-status {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--green);
    font-size: 0.65em;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.tool-card {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-dark);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.04));
    color: var(--text-color);
    min-height: 220px;
    padding: 7px;
    margin-bottom: 0;
    box-shadow: inset 1px 1px 0 var(--border-light);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
    border-color: var(--accent-color);
    box-shadow: inset 1px 1px 0 var(--border-light), var(--glow);
    transform: translateY(-2px);
}

.tool-card-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    color: inherit;
    min-height: 0;
    text-decoration: none;
}

.tool-card-link:hover,
.tool-card-link:focus {
    outline: none;
}

.tool-info-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid var(--border-light);
    border-bottom-color: var(--border-dark);
    border-right-color: var(--border-dark);
    background: rgba(0, 0, 0, 0.82);
    color: var(--yellow);
    font-family: inherit;
    font-size: 0.72em;
    font-style: italic;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.tool-info-btn:hover,
.tool-info-btn:focus {
    background: var(--accent-color);
    color: #111;
    outline: none;
}

.tool-preview-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 110px;
    border: 2px solid var(--border-dark);
    background: #111;
    overflow: hidden;
}

.tool-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    opacity: 0.75;
    image-rendering: auto;
}

.tool-preview-empty,
.tool-preview-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 110px;
}

.tool-preview-empty {
    color: #666;
    font-size: 0.65em;
    text-transform: uppercase;
}

.tool-preview-fallback {
    background: linear-gradient(145deg, #1c2430 0%, #0f1218 50%, #1a2228 100%);
}

.tool-preview-fallback-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.tool-preview-fallback--initial {
    color: var(--yellow);
    font-size: 2em;
    font-weight: bold;
    text-transform: uppercase;
}

.tool-preview--icon {
    object-fit: contain;
    padding: 18%;
    opacity: 0.92;
    background: linear-gradient(145deg, #1c2430 0%, #0f1218 50%, #1a2228 100%);
}

.tool-icon-plate {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid var(--border-light);
}

.tool-favicon {
    width: 24px;
    height: 24px;
    image-rendering: auto;
}

.tool-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding-top: 8px;
}

.tool-card-title {
    color: var(--yellow);
    font-size: 0.8em;
    font-weight: bold;
    line-height: 1.25;
    min-height: 2.5em;
    text-transform: uppercase;
}

.tool-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 0.72em;
    line-height: 1.35;
    margin: 6px 0;
    overflow: hidden;
}

.tool-category {
    position: absolute;
    left: 6px;
    top: 6px;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid var(--border-light);
    color: #aaa;
    font-size: 0.58em;
    max-width: calc(100% - 12px);
    overflow: hidden;
    padding: 2px 5px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    color: #888;
    font-size: 0.65em;
    text-transform: uppercase;
}

.tool-permanent {
    color: var(--green);
}

.tool-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
}

.tool-info-modal.is-open {
    display: flex;
}

.tool-info-panel {
    width: 360px;
    max-width: 92%;
    background: var(--box-bg);
    border: 4px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
}

.tool-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #2a4a2a;
    color: #fff;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tool-info-close {
    padding: 0 6px;
    border: none;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
}

.tool-info-body {
    padding: 14px 16px;
    font-size: 0.82em;
    line-height: 1.45;
    max-height: 55vh;
    overflow-y: auto;
}

.tool-info-row {
    margin-bottom: 12px;
}

.tool-info-row:last-child {
    margin-bottom: 0;
}

.tool-info-label {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-color);
    font-size: 0.68em;
    font-weight: bold;
    text-transform: uppercase;
}

.tool-info-value {
    color: var(--text-color);
}

.tool-info-value.contrib {
    color: var(--green);
}

.tool-info-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.tool-info-links a {
    color: var(--green);
    font-size: 0.9em;
    text-decoration: none;
    border-bottom: 1px dotted var(--green);
}

.tool-info-links a:hover,
.tool-info-links a:focus {
    color: var(--yellow);
    border-bottom-color: var(--yellow);
    outline: none;
}

.tool-info-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 16px;
}

.tool-info-dismiss,
.tool-info-portal {
    padding: 8px 14px;
    border: 2px solid var(--border-dark);
    font-family: inherit;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
}

.tool-info-dismiss {
    background: #333;
    color: #fff;
}

.tool-info-portal {
    background: var(--accent-color);
    color: #111;
    border-top-color: #ffcc66;
    border-left-color: #ffcc66;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.2em;
    }

    .main-layout {
        flex-direction: row;
    }

    .left-column {
        flex: 2.5;
    }

    .right-column {
        flex: 1;
    }
}

@media (max-width: 640px) {
    #tools-container .tools-wall:not(.tools-wall--carousel) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tools-wall--carousel {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .tools-carousel {
        grid-template-columns: 28px minmax(0, 1fr) 28px;
    }

    .tools-carousel-btn {
        width: 28px;
        height: 60px;
        font-size: 0.95em;
    }

    .tool-card {
        min-height: 205px;
    }
}

/* Footer Styles */
footer {
    border-top: 3px solid var(--border-dark);
    padding: 15px 5px;
    margin-top: 15px;
    background: #1e1e1e;
    text-align: center;
    position: relative;
    z-index: 20;
}

.xp-counter {
    color: var(--yellow);
    font-family: monospace;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: var(--glow);
}

.timer-display {
    margin-left: 10px;
    color: var(--yellow);
    font-family: monospace;
    border: 1px solid #444;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.5);
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 2px;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    display: inline-block;
    vertical-align: middle;
}

/* Cookie Banner Styles */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--box-bg);
    border-top: 4px solid var(--border-dark);
    padding: 15px;
    z-index: 1000;
    display: none; /* Hidden by default */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
}

.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.cookie-text {
    font-size: 0.8em;
    color: var(--text-color);
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-btn {
    background: var(--container-bg);
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    color: var(--text-color);
    padding: 5px 15px;
    font-family: inherit;
    font-size: 0.7em;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

.cookie-btn:active {
    border-top-color: var(--border-dark);
    border-left-color: var(--border-dark);
    transform: translate(1px, 1px);
}

.cookie-btn.accept {
    background: var(--green);
    color: #000;
    border-color: #004d00;
}

@media (min-width: 600px) {
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* [TRACE: STYLE_GUIDE.md] Admin page scales as a full-width workspace without affecting other pages. */
#page-admin.active {
    min-width: 0;
}

body:has(#page-admin.active) .main-layout {
    flex-direction: column;
}

body:has(#page-admin.active) .left-column,
body:has(#page-admin.active) .right-column {
    width: 100%;
    min-width: 0;
}

body:has(#page-admin.active) .right-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

body:has(#page-admin.active) .right-column > .content-box {
    margin-top: 0 !important;
}

#page-admin .content-box,
#page-admin .admin-panel {
    min-width: 0;
}

#page-admin input,
#page-admin textarea,
#page-admin select,
#page-admin .admin-btn {
    min-width: 0;
}

/* Admin Grid Layout */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: clamp(12px, 2vw, 20px);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .admin-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    }
}

.admin-panel {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid #555;
    padding: clamp(10px, 1.8vw, 15px);
    height: 100%;
    overflow: hidden;
}

.admin-panel-title {
    font-size: 0.7em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

#page-admin [id^="admin-"][id$="-list"] {
    max-height: clamp(160px, 30vh, 260px) !important;
    overflow: auto !important;
}

#page-admin [id^="admin-"][id$="-list"] > div {
    min-width: 0;
}

@media (max-width: 640px) {
    #page-admin .content-box {
        padding: 10px;
    }

    #page-admin .box-title {
        align-items: flex-start;
        gap: 6px;
        flex-direction: column;
    }

    #page-admin textarea {
        min-height: 96px;
    }

    body:has(#page-admin.active) .right-column {
        grid-template-columns: 1fr;
    }
}

/* Social links — sidebar profile row */
.social-links-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px;
    padding: 10px;
}

.social-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.social-link-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.25);
    transform: translateY(-2px);
}

.social-link-item:active {
    transform: translateY(0);
    border-top-color: var(--border-dark);
    border-left-color: var(--border-dark);
}

.social-link-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 6px;
    image-rendering: auto;
}

.social-link-label {
    font-size: 0.58em;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.2;
    word-break: break-word;
}

body[data-theme="paladin"] .social-link-item,
body[data-theme="office"] .social-link-item,
body[data-theme="scroll"] .social-link-item {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme="paladin"] .social-links-container .social-link-item img[src*="github"],
body[data-theme="office"] .social-links-container .social-link-item img[src*="github"],
body[data-theme="scroll"] .social-links-container .social-link-item img[src*="github"] {
    filter: invert(1);
}

body[data-theme="paladin"] .social-links-container .social-link-item img[src*="tiktok"],
body[data-theme="office"] .social-links-container .social-link-item img[src*="tiktok"],
body[data-theme="scroll"] .social-links-container .social-link-item img[src*="tiktok"] {
    filter: invert(1);
}

/* Badge System Styles - Responsive grid layout for software icons in sidebar */
.badge-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    padding: 10px;
    margin-top: 10px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    border: 2px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

.badge-item:hover {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 8px rgba(255, 153, 0, 0.3);
    transform: translateY(-2px);
}

.badge-item:active {
    transform: translateY(0);
    border-top-color: var(--border-dark);
    border-left-color: var(--border-dark);
}

.badge-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 2px solid var(--border-dark);
    background: var(--input-bg);
    padding: 4px;
    margin-bottom: 8px;
    image-rendering: auto; /* Allow smooth rendering for icons */
}

.badge-name {
    font-size: 0.65em;
    font-weight: bold;
    color: var(--text-color);
    text-transform: uppercase;
    word-break: break-word;
    line-height: 1.2;
}

/* Admin badge catalog — click to equip on public sidebar */
.admin-badge-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #444;
    background: rgba(0, 0, 0, 0.3);
}

.admin-badge-catalog__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border: 2px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-color);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.admin-badge-catalog__item:hover {
    border-color: var(--accent-color);
}

.admin-badge-catalog__item--equipped {
    border-color: var(--green);
    background: rgba(0, 80, 0, 0.25);
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.25);
}

.admin-badge-catalog__icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: var(--input-bg);
    border: 1px solid var(--border-dark);
    padding: 2px;
}

.admin-badge-catalog__name {
    font-size: 0.55em;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    word-break: break-word;
}

/* Realm check-in board — guest wall + LLM agent log [TRACE: ARCHITECTURE.md] */
.checkin-duo-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 960px) {
    .checkin-duo-row {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.checkin-board-box--guest .checkin-form {
    border-left-color: #ff00ff;
}

.checkin-board-box--llm::before {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.06) 2px,
        rgba(0, 255, 255, 0.06) 4px
    );
}

.checkin-board-lede--llm code {
    font-size: 0.95em;
    color: #9cf;
}

.checkin-feed--llm {
    max-height: 520px;
}

.checkin-entry--agent {
    border-left-color: #00ffff;
}

.checkin-entry--agent .checkin-entry-name {
    color: #9ff;
}

.checkin-entry-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    font-size: 0.85em;
    letter-spacing: 0.4px;
    color: #0ff;
    border: 1px solid #066;
    background: rgba(0, 80, 80, 0.35);
    vertical-align: middle;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checkin-board-box {
    position: relative;
    overflow: hidden;
}

.checkin-board-box::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    opacity: 0.35;
    z-index: 0;
}

.checkin-board-body {
    position: relative;
    z-index: 1;
    padding: 10px;
}

.checkin-board-lede {
    font-size: 0.72em;
    color: #999;
    margin: 0 0 14px;
    text-align: center;
    letter-spacing: 0.5px;
}

.checkin-board-note {
    font-size: 0.68em;
    color: #777;
    text-align: center;
    margin: 0 0 12px;
    font-style: italic;
}

.checkin-form {
    border: 2px solid var(--border-dark);
    border-left: 4px solid #ff00ff;
    background: rgba(0, 0, 0, 0.35);
    padding: 12px;
    margin-bottom: 18px;
}

.checkin-label {
    display: block;
    font-size: 0.65em;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--yellow);
    margin-bottom: 4px;
}

.checkin-input {
    margin-bottom: 12px;
}

.checkin-editor {
    border: 2px solid #444;
    background: var(--input-bg);
    margin-bottom: 6px;
}

.checkin-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 1px solid #444;
    background: rgba(0, 0, 0, 0.4);
}

.checkin-editor-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: var(--box-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.75em;
    cursor: pointer;
}

.checkin-editor-btn:hover {
    border-color: var(--accent-color);
    color: var(--yellow);
}

.checkin-editor-hint {
    font-size: 0.58em;
    color: #777;
    margin-left: auto;
}

.checkin-editor-surface {
    min-height: 110px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    font-size: 0.9em;
    line-height: 1.45;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.checkin-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #666;
    font-style: italic;
    pointer-events: none;
}

.checkin-editor-surface:focus {
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

.checkin-editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.checkin-char-count {
    font-size: 0.62em;
    color: #888;
    font-family: monospace;
}

.checkin-char-count--warn {
    color: var(--yellow);
}

.checkin-char-count--max {
    color: #ff6666;
}

.checkin-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.checkin-submit-btn {
    background: linear-gradient(180deg, #660066, #330033) !important;
    border-color: #ff00ff !important;
}

.checkin-form-status {
    font-size: 0.7em;
    margin: 8px 0 0;
    min-height: 1.2em;
    text-align: center;
}

.checkin-form-status--ok {
    color: var(--green);
}

.checkin-form-status--err {
    color: #ff6666;
}

.checkin-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.checkin-feed-empty {
    text-align: center;
    color: #666;
    font-size: 0.8em;
    padding: 20px;
    font-style: italic;
}

.checkin-entry {
    border: 1px solid #444;
    border-left: 3px solid var(--accent-color);
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 12px 10px;
    position: relative;
}

.checkin-entry::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.04));
}

.checkin-entry-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.65em;
}

.checkin-entry-name {
    color: var(--yellow);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkin-entry-date {
    color: #666;
    font-family: monospace;
}

.checkin-entry-message {
    font-size: 0.85em;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive badge layout */
@media (min-width: 768px) {
    .badge-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .badge-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .badge-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .badge-icon {
        width: 56px;
        height: 56px;
    }
    
    .badge-name {
        font-size: 0.6em;
    }
}

/* Retro Modal Styles */
#retro-modal {
    background: rgba(0,0,0,0.85); /* Dimmed overlay */
    z-index: 9999;
}

#retro-modal > div {
    background: var(--box-bg);
    border: 4px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: 10px 10px 0px rgba(0,0,0,0.5); /* Retro shadow */
}

/* Session Revisit Toast */
.session-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    max-width: min(360px, calc(100vw - 32px));
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.session-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.session-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    background: var(--box-bg);
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
}

.session-toast-label {
    display: block;
    margin-bottom: 4px;
    color: var(--green);
    font-size: 0.62em;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.session-toast-msg {
    margin: 0;
    color: var(--text-color);
    font-size: 0.78em;
    line-height: 1.4;
}

.session-toast-close {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.session-toast-timer {
    width: 36px;
    height: 36px;
    display: block;
}

.session-toast-track,
.session-toast-progress {
    fill: none;
    stroke-width: 2.5;
}

.session-toast-track {
    stroke: rgba(255, 255, 255, 0.15);
}

.session-toast-progress {
    stroke: var(--accent-color);
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    animation: session-toast-countdown 5s linear forwards;
}

.session-toast-x {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    color: var(--yellow);
    font-size: 1.15em;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
}

.session-toast-close:hover .session-toast-x,
.session-toast-close:focus .session-toast-x {
    color: #fff;
}

@keyframes session-toast-countdown {
    to {
        stroke-dashoffset: 100;
    }
}

/* [TRACE: STYLE_GUIDE.md] RPG / OSRS-inspired chrome — stone frame, parchment footer, otter adventurer panel */
body:not([data-theme="office"]) {
    background-color: #0d0b09;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(60, 50, 35, 0.35), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.15) 3px,
            rgba(0, 0, 0, 0.15) 4px
        ),
        repeating-conic-gradient(var(--rpg-stone-mid) 0% 25%, var(--rpg-stone-dark) 0% 50%);
    background-size: 100% 100%, 100% 8px, 6px 6px;
}

body:not([data-theme="office"]) .container {
    border-color: var(--rpg-stone-edge);
    border-top-color: #7a6f62;
    border-left-color: #7a6f62;
    box-shadow:
        0 0 0 2px #0a0806,
        6px 6px 0 rgba(0, 0, 0, 0.65),
        inset 0 0 40px rgba(0, 0, 0, 0.25);
}

body:not([data-theme="office"]) .container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 6px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent);
    pointer-events: none;
    z-index: 11;
}

body:not([data-theme="office"]) .container::before {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.06) 50%),
        linear-gradient(90deg, rgba(80, 60, 30, 0.03), rgba(0, 0, 0, 0.02), rgba(80, 60, 30, 0.03));
}

body:not([data-theme="office"]) .realm-header {
    background: linear-gradient(180deg, #2a2218 0%, #1a1610 100%);
    border: 3px inset var(--rpg-stone-mid);
    border-bottom-color: #0a0806;
}

body:not([data-theme="office"]) .realm-crest {
    margin: 0 0 4px;
    font-size: 1.4em;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255, 200, 100, 0.35));
}

body:not([data-theme="office"]) h1 {
    font-family: var(--rpg-title-font);
    color: var(--rpg-gold-bright);
    text-shadow:
        2px 2px 0 #3a2800,
        0 0 12px rgba(255, 200, 80, 0.35),
        var(--glow);
    letter-spacing: 3px;
}

body:not([data-theme="office"]) .realm-tagline {
    margin: 6px 0 0;
    font-size: 0.65em;
    color: var(--green);
    letter-spacing: 1px;
}

body:not([data-theme="office"]) nav button {
    background: linear-gradient(180deg, #4a4038 0%, #2e2820 100%);
    border-color: #1a1410;
    border-top-color: #8a7a68;
    border-left-color: #8a7a68;
    color: #d4c4a8;
    text-shadow: 1px 1px 0 #000;
}

body:not([data-theme="office"]) nav button.active {
    background: linear-gradient(180deg, #5a4a20 0%, #3a3018 100%);
    color: var(--rpg-gold-bright);
    border-top-color: #1a1410;
    border-left-color: #1a1410;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}

body:not([data-theme="office"]) marquee {
    background: linear-gradient(180deg, #141210 0%, #0a0908 100%);
    border: 2px inset var(--rpg-stone-mid);
    color: var(--green);
    letter-spacing: 0.5px;
}

body:not([data-theme="office"]) .box-title {
    background: linear-gradient(180deg, var(--rpg-bar-title) 0%, #1a3018 100%);
    border-bottom: 2px solid #0f1a0f;
    color: var(--rpg-bar-title-text);
    text-shadow: 1px 1px 0 #000;
}

body:not([data-theme="office"]) .box-title span:last-child {
    color: var(--rpg-gold-bright);
}

body:not([data-theme="office"]) .content-box {
    border-color: #1a1410;
    border-top-color: var(--rpg-stone-edge);
    border-left-color: var(--rpg-stone-edge);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

body:not([data-theme="office"]) .tools-section-block,
body:not([data-theme="office"]) .creations-subsection {
    border-color: #1a1410;
    border-top-color: var(--rpg-stone-edge);
    border-left-color: var(--rpg-stone-edge);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

body:not([data-theme="office"]) .tools-section-block > .tools-section-header,
body:not([data-theme="office"]) .creations-subsection > .tools-section-header {
    background: linear-gradient(180deg, var(--rpg-bar-title) 0%, #1a3018 100%);
    border-bottom-color: #0f1a0f;
    border-left-color: var(--rpg-gold-bright);
    color: var(--rpg-bar-title-text);
    text-shadow: 1px 1px 0 #000;
}

body:not([data-theme="office"]) .tools-section-block > .tools-section-header .tools-section-tag,
body:not([data-theme="office"]) .creations-subsection > .tools-section-header .tools-section-tag {
    color: var(--rpg-gold-bright);
}

body:not([data-theme="office"]) .post-title-text {
    color: var(--rpg-gold-bright);
}

.player-alias {
    color: var(--yellow);
    font-size: 0.95em;
}

.player-portrait--triple {
    gap: 8px;
}

.player-portrait--triple .player-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.player-avatar--irl {
    object-fit: cover;
    border: 2px solid var(--border-dark);
    image-rendering: auto;
}

.player-avatar--pixel {
    border: 2px solid var(--border-dark);
}

.player-avatar-zoom {
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    line-height: 0;
}

.player-avatar-zoom:hover .player-avatar,
.player-avatar-zoom:focus-visible .player-avatar {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.portrait-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    padding: 16px;
}

.portrait-lightbox.is-open {
    display: flex;
}

.portrait-lightbox-panel {
    position: relative;
    max-width: min(92vw, 520px);
    max-height: 92vh;
    padding: 12px;
    background: var(--box-bg);
    border: 4px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
    text-align: center;
}

.portrait-lightbox-close {
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 2px 8px;
    border: 2px solid var(--border-dark);
    background: #2a4a2a;
    color: #fff;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
}

.portrait-lightbox-close:hover,
.portrait-lightbox-close:focus-visible {
    background: #3a6a3a;
}

.portrait-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: min(72vh, 480px);
    width: auto;
    height: auto;
    margin: 0 auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.portrait-lightbox-img--irl {
    image-rendering: auto;
    border: 2px solid var(--border-dark);
}

.portrait-lightbox-caption {
    margin: 10px 0 0;
    font-size: 0.75em;
    color: var(--rpg-gold-bright, #c9a227);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Welcome landing prompt — mobile-first, once per session */
.welcome-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10002;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}

.welcome-modal.is-open {
    display: flex;
}

.welcome-modal-panel {
    display: flex;
    flex-direction: column;
    width: min(92vw, 420px);
    max-height: min(90vh, 640px);
    background: var(--box-bg);
    border: 4px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.welcome-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #2a4a2a;
    color: var(--rpg-bar-title-text, #b8e0b0);
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-modal-close {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 10px;
    border: 2px solid var(--border-dark);
    background: #900;
    color: #fff;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
}

.welcome-modal-close:hover,
.welcome-modal-close:focus-visible {
    background: #b00;
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.welcome-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    -webkit-overflow-scrolling: touch;
}

.welcome-modal-crest {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1;
    text-align: center;
}

.welcome-modal-lede {
    margin: 0 0 14px;
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--text-color);
    text-align: center;
}

.welcome-featured-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.welcome-featured-links .welcome-featured-item {
    min-height: 44px;
    padding: 10px 8px;
}

.welcome-toggle-all {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: var(--container-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.72em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

.welcome-toggle-all:hover,
.welcome-toggle-all:focus-visible {
    color: var(--yellow);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.welcome-all-links-wrap {
    margin-bottom: 4px;
}

.welcome-all-links {
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.welcome-modal-actions {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 2px solid var(--border-dark);
}

.welcome-enter-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 2px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    background: var(--green);
    color: #000;
    font-family: inherit;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.welcome-enter-btn:hover,
.welcome-enter-btn:focus-visible {
    background: var(--yellow);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media (min-width: 480px) {
    .welcome-featured-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.player-portrait {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    margin: 0 auto 12px;
    padding: 10px;
    background:
        radial-gradient(ellipse at center, rgba(80, 60, 40, 0.25) 0%, transparent 70%),
        #0e0c0a;
    border: 3px solid var(--border-dark);
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}

.player-avatar {
    width: 120px;
    height: 120px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.player-stats {
    font-size: 0.75em;
}

.player-meta-line {
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px dashed var(--border-dark);
    font-size: 0.65em;
    line-height: 1.4;
    text-align: center;
    color: #777;
}

.player-meta-line a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.player-meta-line a:hover,
.player-meta-line a:focus {
    text-decoration: underline;
}

.stat-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: var(--rpg-gold-bright);
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
}

body:not([data-theme="office"]) .stat-label {
    font-family: var(--rpg-title-font);
}

.stat-bar {
    height: 14px;
    background: #0a0806;
    border: 2px solid;
    border-color: #1a1410 #4a4038 #4a4038 #1a1410;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.stat-fill {
    height: 100%;
    min-width: 2px;
    transition: width 0.3s ease;
}

.stat-bar--hp .stat-fill {
    background: linear-gradient(180deg, #ff4444 0%, #aa0000 100%);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.stat-bar--xp .stat-fill {
    background: linear-gradient(180deg, #66ff66 0%, #228822 100%);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.stat-value {
    color: var(--green);
    font-size: 0.85em;
    font-weight: bold;
    min-width: 42px;
    text-align: right;
}

body:not([data-theme="office"]) .realm-footer {
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: none;
}

/* Obsidian (no data-theme) — cold dark stone footer */
body:not([data-theme]) .realm-footer-scroll {
    padding: 18px 20px 14px;
    background: linear-gradient(180deg, #1e1c1a 0%, #141210 35%, #0e0c0a 100%);
    border: 3px solid #1a1410;
    border-top-color: #4a4038;
    border-left-color: #4a4038;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        inset 0 -4px 12px rgba(0, 0, 0, 0.4),
        4px 4px 0 rgba(0, 0, 0, 0.5);
    position: relative;
}

body:not([data-theme]) .realm-footer-scroll::before,
body:not([data-theme]) .realm-footer-scroll::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(100, 80, 50, 0.25) 4px,
        rgba(100, 80, 50, 0.25) 8px
    );
}

body:not([data-theme]) .realm-footer-scroll::before {
    top: 6px;
}

body:not([data-theme]) .realm-footer-scroll::after {
    bottom: 6px;
}

body:not([data-theme]) .realm-footer-xp {
    margin: 0 0 8px;
    color: var(--rpg-gold-bright);
    font-family: var(--rpg-title-font);
    font-size: 1.05em;
    font-weight: bold;
}

body:not([data-theme]) .realm-footer-xp .xp-counter {
    color: #ffcc44;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

body:not([data-theme]) .realm-footer-copy,
body:not([data-theme]) .realm-footer-credit {
    margin: 6px 0 0;
    color: #888878;
    font-size: 0.78em;
}

body:not([data-theme]) .realm-footer-credit .timer-display {
    color: var(--green);
    border-color: #3a3830;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

/* Scroll (parchment) theme — warm aged-paper footer */
body[data-theme="scroll"] .realm-footer-scroll {
    padding: 18px 20px 14px;
    background:
        linear-gradient(180deg, #f0e0bc 0%, var(--rpg-parchment) 35%, #d4bc88 100%);
    border: 3px solid var(--rpg-parchment-edge);
    border-top-color: #f5ecd4;
    border-left-color: #f5ecd4;
    box-shadow:
        inset 0 2px 8px rgba(255, 255, 255, 0.4),
        inset 0 -4px 12px rgba(120, 90, 40, 0.25),
        4px 4px 0 rgba(0, 0, 0, 0.35);
    position: relative;
}

body[data-theme="scroll"] .realm-footer-scroll::before,
body[data-theme="scroll"] .realm-footer-scroll::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(120, 90, 50, 0.35) 4px,
        rgba(120, 90, 50, 0.35) 8px
    );
}

body[data-theme="scroll"] .realm-footer-scroll::before {
    top: 6px;
}

body[data-theme="scroll"] .realm-footer-scroll::after {
    bottom: 6px;
}

body[data-theme="scroll"] .realm-footer-xp {
    margin: 0 0 8px;
    color: #4a3010;
    font-family: var(--rpg-title-font);
    font-size: 1.05em;
    font-weight: bold;
}

body[data-theme="scroll"] .realm-footer-xp .xp-counter {
    color: #8b4513;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

body[data-theme="scroll"] .realm-footer-copy,
body[data-theme="scroll"] .realm-footer-credit {
    margin: 6px 0 0;
    color: #5c4020;
    font-size: 0.78em;
}

body[data-theme="scroll"] .realm-footer-credit .timer-display {
    color: #4a3010;
    border-color: #a08050;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

body:not([data-theme="office"]) .badge-item {
    background: rgba(0, 0, 0, 0.35);
    border-color: var(--rpg-stone-edge);
}

body:not([data-theme="office"]) .badge-item:hover {
    border-color: var(--rpg-gold);
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.35);
}

body[data-theme="arcade"] h1 {
    font-family: inherit;
    color: var(--accent-color);
}

body[data-theme="arcade"] .box-title {
    background: linear-gradient(180deg, #330066 0%, #1a0033 100%);
    color: var(--text-color);
}

body[data-theme="paladin"] .realm-footer-scroll {
    background: linear-gradient(180deg, #f8f8f0 0%, #e8e4d8 100%);
}

body[data-theme="paladin"] .realm-footer-xp,
body[data-theme="paladin"] .realm-footer-copy,
body[data-theme="paladin"] .realm-footer-credit {
    color: #333;
}

/* ============================================================
   [TRACE: STYLE_GUIDE.md] SCROLL THEME — Parchment RPG Chrome
   Overrides the base body:not([data-theme="office"]) stone rules
   with warm aged-paper equivalents.
   ============================================================ */

body[data-theme="scroll"] {
    background-color: #b89860;
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(200, 160, 80, 0.3), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.06) 3px,
            rgba(0, 0, 0, 0.06) 4px
        ),
        repeating-conic-gradient(#c4a878 0% 25%, #b09060 0% 50%);
    background-size: 100% 100%, 100% 8px, 6px 6px;
}

body[data-theme="scroll"] .container {
    border-color: var(--rpg-parchment-edge);
    border-top-color: #f0dca8;
    border-left-color: #f0dca8;
    box-shadow:
        0 0 0 2px #7a5c20,
        6px 6px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 40px rgba(160, 120, 60, 0.15);
}

body[data-theme="scroll"] .container::after {
    background: linear-gradient(90deg, rgba(120, 90, 40, 0.15), transparent);
}

body[data-theme="scroll"] .container::before {
    background: linear-gradient(rgba(180, 140, 80, 0) 50%, rgba(120, 90, 40, 0.04) 50%),
        linear-gradient(90deg, rgba(180, 140, 80, 0.03), rgba(120, 90, 40, 0.02), rgba(180, 140, 80, 0.03));
}

body[data-theme="scroll"] .realm-header {
    background: linear-gradient(180deg, #3c2208 0%, #28160a 100%);
    border: 3px inset #5c3810;
    border-bottom-color: #1e1008;
}

body[data-theme="scroll"] h1 {
    font-family: var(--rpg-title-font);
    color: var(--rpg-gold-bright);
    text-shadow:
        2px 2px 0 #3a1e00,
        0 0 12px rgba(240, 190, 60, 0.4);
    letter-spacing: 3px;
}

body[data-theme="scroll"] .realm-tagline {
    color: #a8d490;
    letter-spacing: 1px;
}

body[data-theme="scroll"] nav button {
    background: linear-gradient(180deg, #e8d4a8 0%, #cdb880 100%);
    border-color: #7a5c30;
    border-top-color: #f5ecd4;
    border-left-color: #f5ecd4;
    color: #2c1a0a;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}

body[data-theme="scroll"] nav button.active {
    background: linear-gradient(180deg, #c8a060 0%, #9a7838 100%);
    color: var(--rpg-gold-bright);
    border-top-color: #7a5c30;
    border-left-color: #7a5c30;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

body[data-theme="scroll"] marquee {
    background: linear-gradient(180deg, #28160a 0%, #1e1008 100%);
    border: 2px inset #5c3810;
    color: #a8d490;
    letter-spacing: 0.5px;
}

body[data-theme="scroll"] .box-title {
    background: linear-gradient(180deg, var(--rpg-bar-title) 0%, #28160a 100%);
    border-bottom: 2px solid #1e1008;
    color: var(--rpg-bar-title-text);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

body[data-theme="scroll"] .box-title span:last-child {
    color: var(--rpg-gold-bright);
}

body[data-theme="scroll"] .content-box {
    border-color: #7a5c30;
    border-top-color: #c4a878;
    border-left-color: #c4a878;
    box-shadow: inset 0 0 12px rgba(120, 90, 40, 0.2);
}

body[data-theme="scroll"] .post-title-text {
    color: var(--accent-color);
}

body[data-theme="scroll"] .badge-item {
    background: rgba(200, 160, 80, 0.15);
    border-color: var(--rpg-parchment-edge);
}

body[data-theme="scroll"] .badge-item:hover {
    border-color: var(--rpg-gold);
    box-shadow: 0 0 10px rgba(200, 134, 10, 0.35);
}

body[data-theme="scroll"] .realm-footer {
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: none;
}

/* ============================================================
   [TRACE: STYLE_GUIDE.md] THEME PICKER — RPG skin selector dropdown
   ============================================================ */

.theme-picker {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 20;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    font-size: 9px;
    padding: 3px 6px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: inherit;
    white-space: nowrap;
}

.theme-toggle:hover {
    color: #fff;
    border-color: #888;
}

.theme-swatch-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.theme-btn-arrow {
    font-size: 7px;
    opacity: 0.7;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 3px);
    right: 0;
    min-width: 168px;
    max-height: min(70vh, 380px);
    overflow-y: auto;
    background: #1e1c18;
    border: 2px solid #4a4038;
    border-top-color: #6a5a48;
    border-left-color: #6a5a48;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.theme-menu[hidden] {
    display: none;
}

.theme-menu-header {
    padding: 5px 10px 4px;
    background: linear-gradient(180deg, #2a2218 0%, #1e1c18 100%);
    border-bottom: 1px solid #3a3028;
    color: #c9a227;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #2a2820;
    color: #c0b898;
    font-size: 9px;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    text-align: left;
    letter-spacing: 0.5px;
    transition: background 0.1s, color 0.1s;
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.theme-option.is-active {
    background: rgba(201, 162, 39, 0.12);
    color: #c9a227;
}

.theme-option .swatch {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.theme-option .opt-name {
    font-weight: bold;
    flex: 1;
}

.theme-option .opt-desc {
    color: #706858;
    font-size: 8px;
    font-style: italic;
}

.theme-option.is-active .opt-desc {
    color: #a08038;
}

/* Adapt menu chrome per active theme */
body[data-theme="paladin"] .theme-toggle,
body[data-theme="office"] .theme-toggle {
    background: #ddd;
    border-color: #bbb;
    color: #333;
}

body[data-theme="paladin"] .theme-toggle:hover,
body[data-theme="office"] .theme-toggle:hover {
    background: #f0f0f0;
    color: #111;
}

body[data-theme="arcade"] .theme-toggle {
    background: #1a0033;
    border-color: #ff00ff;
    color: #00ffff;
    text-shadow: 0 0 6px #00ffff;
}

body[data-theme="scroll"] .theme-toggle {
    background: #3c2208;
    border-color: #c4a060;
    color: #f0d890;
}

body[data-theme="scroll"] .theme-menu {
    background: #28160a;
    border-color: #7a5c30;
    border-top-color: #c4a060;
    border-left-color: #c4a060;
}

body[data-theme="scroll"] .theme-menu-header {
    background: linear-gradient(180deg, #3c2208 0%, #28160a 100%);
    border-bottom-color: #5c3818;
    color: #f0c050;
}

body[data-theme="scroll"] .theme-option {
    border-bottom-color: #3c2808;
    color: #c4a060;
}

body[data-theme="scroll"] .theme-option:hover {
    background: rgba(200, 160, 80, 0.1);
    color: #f0d890;
}

body[data-theme="scroll"] .theme-option.is-active {
    background: rgba(200, 160, 80, 0.2);
    color: #f0c050;
}

body[data-theme="arcade"] .theme-menu {
    background: #0a0015;
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3), 6px 6px 0 rgba(0, 0, 0, 0.8);
}

body[data-theme="arcade"] .theme-menu-header {
    background: #1a0033;
    border-bottom-color: #330066;
    color: #ff00ff;
}

body[data-theme="arcade"] .theme-option {
    border-bottom-color: #1a0033;
    color: #00ffff;
}

body[data-theme="arcade"] .theme-option:hover {
    background: rgba(0, 255, 255, 0.08);
    color: #fff;
}

body[data-theme="arcade"] .theme-option.is-active {
    background: rgba(255, 0, 255, 0.12);
    color: #ff00ff;
}

/* ============================================================
   CHROME + FOOTER — tidepool, runescape, ember, void, frost, treasure
   Uses --chrome-* and --footer-* vars defined on each [data-theme].
   ============================================================ */

body[data-theme="tidepool"],
body[data-theme="runescape"],
body[data-theme="ember"],
body[data-theme="void"],
body[data-theme="frost"],
body[data-theme="treasure"] {
    background-color: var(--chrome-body);
    background-image:
        radial-gradient(ellipse at 50% 0%, var(--chrome-radial), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.08) 3px,
            rgba(0, 0, 0, 0.08) 4px
        ),
        repeating-conic-gradient(var(--chrome-pattern-a) 0% 25%, var(--chrome-pattern-b) 0% 50%);
    background-size: 100% 100%, 100% 8px, 6px 6px;
}

body[data-theme="tidepool"] .container,
body[data-theme="runescape"] .container,
body[data-theme="ember"] .container,
body[data-theme="void"] .container,
body[data-theme="frost"] .container,
body[data-theme="treasure"] .container {
    border-color: var(--chrome-container-border);
    border-top-color: var(--chrome-container-highlight);
    border-left-color: var(--chrome-container-highlight);
    box-shadow:
        0 0 0 2px var(--chrome-nav-border),
        6px 6px 0 rgba(0, 0, 0, 0.4),
        inset 0 0 40px rgba(0, 0, 0, 0.15);
}

body[data-theme="tidepool"] .container::after,
body[data-theme="runescape"] .container::after,
body[data-theme="ember"] .container::after,
body[data-theme="void"] .container::after,
body[data-theme="frost"] .container::after,
body[data-theme="treasure"] .container::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent);
}

body[data-theme="frost"] .container::after {
    background: linear-gradient(90deg, rgba(80, 120, 160, 0.12), transparent);
}

body[data-theme="tidepool"] .realm-header,
body[data-theme="runescape"] .realm-header,
body[data-theme="ember"] .realm-header,
body[data-theme="void"] .realm-header,
body[data-theme="frost"] .realm-header,
body[data-theme="treasure"] .realm-header {
    background: linear-gradient(180deg, var(--chrome-header-top) 0%, var(--chrome-header-bottom) 100%);
    border: 3px inset var(--chrome-header-border);
    border-bottom-color: var(--chrome-nav-border);
}

body[data-theme="tidepool"] h1,
body[data-theme="runescape"] h1,
body[data-theme="ember"] h1,
body[data-theme="void"] h1,
body[data-theme="frost"] h1,
body[data-theme="treasure"] h1 {
    font-family: var(--rpg-title-font);
    color: var(--rpg-gold-bright);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5), var(--glow);
    letter-spacing: 3px;
}

body[data-theme="runescape"] h1 {
    color: #ffff00;
    text-shadow: 2px 2px 0 #3a2800;
}

body[data-theme="frost"] h1 {
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.5), var(--glow);
}

body[data-theme="tidepool"] .realm-tagline,
body[data-theme="runescape"] .realm-tagline,
body[data-theme="ember"] .realm-tagline,
body[data-theme="void"] .realm-tagline,
body[data-theme="frost"] .realm-tagline,
body[data-theme="treasure"] .realm-tagline {
    color: var(--chrome-tagline);
    letter-spacing: 1px;
}

body[data-theme="tidepool"] nav button,
body[data-theme="runescape"] nav button,
body[data-theme="ember"] nav button,
body[data-theme="void"] nav button,
body[data-theme="frost"] nav button,
body[data-theme="treasure"] nav button {
    background: linear-gradient(180deg, var(--chrome-nav-top) 0%, var(--chrome-nav-bottom) 100%);
    border-color: var(--chrome-nav-border);
    border-top-color: var(--chrome-nav-highlight);
    border-left-color: var(--chrome-nav-highlight);
    color: var(--chrome-nav-text);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

body[data-theme="frost"] nav button {
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

body[data-theme="tidepool"] nav button.active,
body[data-theme="runescape"] nav button.active,
body[data-theme="ember"] nav button.active,
body[data-theme="void"] nav button.active,
body[data-theme="frost"] nav button.active,
body[data-theme="treasure"] nav button.active {
    background: linear-gradient(180deg, var(--chrome-nav-active-top) 0%, var(--chrome-nav-active-bottom) 100%);
    color: var(--rpg-gold-bright);
    border-top-color: var(--chrome-nav-border);
    border-left-color: var(--chrome-nav-border);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

body[data-theme="runescape"] nav button.active {
    color: #ffff00;
}

body[data-theme="tidepool"] marquee,
body[data-theme="runescape"] marquee,
body[data-theme="ember"] marquee,
body[data-theme="void"] marquee,
body[data-theme="frost"] marquee,
body[data-theme="treasure"] marquee {
    background: linear-gradient(180deg, var(--chrome-marquee-top) 0%, var(--chrome-marquee-bottom) 100%);
    border: 2px inset var(--chrome-marquee-border);
    color: var(--chrome-marquee-text);
    letter-spacing: 0.5px;
}

body[data-theme="tidepool"] .box-title,
body[data-theme="runescape"] .box-title,
body[data-theme="ember"] .box-title,
body[data-theme="void"] .box-title,
body[data-theme="frost"] .box-title,
body[data-theme="treasure"] .box-title {
    background: linear-gradient(180deg, var(--chrome-box-top) 0%, var(--chrome-box-bottom) 100%);
    border-bottom: 2px solid var(--chrome-box-border);
    color: var(--chrome-box-text);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

body[data-theme="tidepool"] .box-title span:last-child,
body[data-theme="runescape"] .box-title span:last-child,
body[data-theme="ember"] .box-title span:last-child,
body[data-theme="void"] .box-title span:last-child,
body[data-theme="frost"] .box-title span:last-child,
body[data-theme="treasure"] .box-title span:last-child {
    color: var(--rpg-gold-bright);
}

body[data-theme="runescape"] .box-title span:last-child {
    color: #ffff00;
}

body[data-theme="tidepool"] .content-box,
body[data-theme="runescape"] .content-box,
body[data-theme="ember"] .content-box,
body[data-theme="void"] .content-box,
body[data-theme="frost"] .content-box,
body[data-theme="treasure"] .content-box {
    border-color: var(--chrome-content-border);
    border-top-color: var(--chrome-content-highlight);
    border-left-color: var(--chrome-content-highlight);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.25);
}

body[data-theme="frost"] .content-box {
    box-shadow: inset 0 0 12px rgba(80, 120, 160, 0.15);
}

body[data-theme="tidepool"] .post-title-text,
body[data-theme="runescape"] .post-title-text,
body[data-theme="ember"] .post-title-text,
body[data-theme="void"] .post-title-text,
body[data-theme="frost"] .post-title-text,
body[data-theme="treasure"] .post-title-text {
    color: var(--rpg-gold-bright);
}

body[data-theme="runescape"] .post-title-text {
    color: #ffff00;
}

body[data-theme="tidepool"] .badge-item,
body[data-theme="runescape"] .badge-item,
body[data-theme="ember"] .badge-item,
body[data-theme="void"] .badge-item,
body[data-theme="frost"] .badge-item,
body[data-theme="treasure"] .badge-item {
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--chrome-container-border);
}

body[data-theme="frost"] .badge-item {
    background: rgba(255, 255, 255, 0.35);
}

body[data-theme="tidepool"] .badge-item:hover,
body[data-theme="runescape"] .badge-item:hover,
body[data-theme="ember"] .badge-item:hover,
body[data-theme="void"] .badge-item:hover,
body[data-theme="frost"] .badge-item:hover,
body[data-theme="treasure"] .badge-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--glow);
}

/* Shared themed footers */
body[data-theme="tidepool"] .realm-footer-scroll,
body[data-theme="runescape"] .realm-footer-scroll,
body[data-theme="ember"] .realm-footer-scroll,
body[data-theme="void"] .realm-footer-scroll,
body[data-theme="frost"] .realm-footer-scroll,
body[data-theme="treasure"] .realm-footer-scroll {
    padding: 18px 20px 14px;
    background: linear-gradient(
        180deg,
        var(--footer-bg-top) 0%,
        var(--footer-bg-mid) 35%,
        var(--footer-bg-bot) 100%
    );
    border: 3px solid var(--footer-border);
    border-top-color: var(--footer-border-hi);
    border-left-color: var(--footer-border-hi);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.25),
        inset 0 -4px 12px rgba(0, 0, 0, 0.2),
        4px 4px 0 rgba(0, 0, 0, 0.35);
    position: relative;
}

body[data-theme="frost"] .realm-footer-scroll {
    box-shadow:
        inset 0 2px 8px rgba(255, 255, 255, 0.5),
        inset 0 -4px 12px rgba(80, 120, 160, 0.2),
        4px 4px 0 rgba(0, 0, 0, 0.2);
}

body[data-theme="tidepool"] .realm-footer-scroll::before,
body[data-theme="tidepool"] .realm-footer-scroll::after,
body[data-theme="runescape"] .realm-footer-scroll::before,
body[data-theme="runescape"] .realm-footer-scroll::after,
body[data-theme="ember"] .realm-footer-scroll::before,
body[data-theme="ember"] .realm-footer-scroll::after,
body[data-theme="void"] .realm-footer-scroll::before,
body[data-theme="void"] .realm-footer-scroll::after,
body[data-theme="frost"] .realm-footer-scroll::before,
body[data-theme="frost"] .realm-footer-scroll::after,
body[data-theme="treasure"] .realm-footer-scroll::before,
body[data-theme="treasure"] .realm-footer-scroll::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        var(--footer-rule-color) 4px,
        var(--footer-rule-color) 8px
    );
}

body[data-theme="tidepool"] .realm-footer-scroll::before,
body[data-theme="runescape"] .realm-footer-scroll::before,
body[data-theme="ember"] .realm-footer-scroll::before,
body[data-theme="void"] .realm-footer-scroll::before,
body[data-theme="frost"] .realm-footer-scroll::before,
body[data-theme="treasure"] .realm-footer-scroll::before {
    top: 6px;
}

body[data-theme="tidepool"] .realm-footer-scroll::after,
body[data-theme="runescape"] .realm-footer-scroll::after,
body[data-theme="ember"] .realm-footer-scroll::after,
body[data-theme="void"] .realm-footer-scroll::after,
body[data-theme="frost"] .realm-footer-scroll::after,
body[data-theme="treasure"] .realm-footer-scroll::after {
    bottom: 6px;
}

body[data-theme="tidepool"] .realm-footer-xp,
body[data-theme="runescape"] .realm-footer-xp,
body[data-theme="ember"] .realm-footer-xp,
body[data-theme="void"] .realm-footer-xp,
body[data-theme="frost"] .realm-footer-xp,
body[data-theme="treasure"] .realm-footer-xp {
    margin: 0 0 8px;
    color: var(--footer-xp-color);
    font-family: var(--rpg-title-font);
    font-size: 1.05em;
    font-weight: bold;
}

body[data-theme="tidepool"] .realm-footer-xp .xp-counter,
body[data-theme="runescape"] .realm-footer-xp .xp-counter,
body[data-theme="ember"] .realm-footer-xp .xp-counter,
body[data-theme="void"] .realm-footer-xp .xp-counter,
body[data-theme="frost"] .realm-footer-xp .xp-counter,
body[data-theme="treasure"] .realm-footer-xp .xp-counter {
    color: var(--footer-xp-counter);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

body[data-theme="frost"] .realm-footer-xp .xp-counter {
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

body[data-theme="tidepool"] .realm-footer-copy,
body[data-theme="tidepool"] .realm-footer-credit,
body[data-theme="runescape"] .realm-footer-copy,
body[data-theme="runescape"] .realm-footer-credit,
body[data-theme="ember"] .realm-footer-copy,
body[data-theme="ember"] .realm-footer-credit,
body[data-theme="void"] .realm-footer-copy,
body[data-theme="void"] .realm-footer-credit,
body[data-theme="frost"] .realm-footer-copy,
body[data-theme="frost"] .realm-footer-credit,
body[data-theme="treasure"] .realm-footer-copy,
body[data-theme="treasure"] .realm-footer-credit {
    margin: 6px 0 0;
    color: var(--footer-copy);
    font-size: 0.78em;
}

body[data-theme="tidepool"] .realm-footer-credit .timer-display,
body[data-theme="runescape"] .realm-footer-credit .timer-display,
body[data-theme="ember"] .realm-footer-credit .timer-display,
body[data-theme="void"] .realm-footer-credit .timer-display,
body[data-theme="frost"] .realm-footer-credit .timer-display,
body[data-theme="treasure"] .realm-footer-credit .timer-display {
    color: var(--footer-timer-text);
    border-color: var(--footer-timer-border);
    background: var(--footer-timer-bg);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

/* Theme picker chrome — new skins */
body[data-theme="tidepool"] .theme-toggle,
body[data-theme="void"] .theme-toggle,
body[data-theme="ember"] .theme-toggle,
body[data-theme="treasure"] .theme-toggle {
    background: var(--chrome-header-bottom);
    border-color: var(--chrome-container-border);
    color: var(--chrome-nav-text);
}

body[data-theme="runescape"] .theme-toggle {
    background: #3a2c18;
    border-color: #6a5840;
    color: #ffff00;
}

body[data-theme="frost"] .theme-toggle {
    background: #4878a0;
    border-color: #a0c0d8;
    color: #f0f8ff;
}

body[data-theme="tidepool"] .theme-menu,
body[data-theme="void"] .theme-menu,
body[data-theme="ember"] .theme-menu,
body[data-theme="treasure"] .theme-menu,
body[data-theme="runescape"] .theme-menu,
body[data-theme="frost"] .theme-menu {
    background: var(--chrome-header-bottom);
    border-color: var(--chrome-container-border);
    border-top-color: var(--chrome-container-highlight);
    border-left-color: var(--chrome-container-highlight);
}

body[data-theme="tidepool"] .theme-menu-header,
body[data-theme="void"] .theme-menu-header,
body[data-theme="ember"] .theme-menu-header,
body[data-theme="treasure"] .theme-menu-header,
body[data-theme="runescape"] .theme-menu-header,
body[data-theme="frost"] .theme-menu-header {
    background: linear-gradient(180deg, var(--chrome-header-top) 0%, var(--chrome-header-bottom) 100%);
    border-bottom-color: var(--chrome-header-border);
    color: var(--rpg-gold-bright);
}

body[data-theme="tidepool"] .theme-option,
body[data-theme="void"] .theme-option,
body[data-theme="ember"] .theme-option,
body[data-theme="treasure"] .theme-option,
body[data-theme="runescape"] .theme-option,
body[data-theme="frost"] .theme-option {
    border-bottom-color: var(--chrome-nav-border);
    color: var(--chrome-nav-text);
}

body[data-theme="tidepool"] .theme-option:hover,
body[data-theme="void"] .theme-option:hover,
body[data-theme="ember"] .theme-option:hover,
body[data-theme="treasure"] .theme-option:hover,
body[data-theme="runescape"] .theme-option:hover,
body[data-theme="frost"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--rpg-gold-bright);
}

body[data-theme="frost"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

body[data-theme="tidepool"] .theme-option.is-active,
body[data-theme="void"] .theme-option.is-active,
body[data-theme="ember"] .theme-option.is-active,
body[data-theme="treasure"] .theme-option.is-active,
body[data-theme="runescape"] .theme-option.is-active,
body[data-theme="frost"] .theme-option.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rpg-gold-bright);
}

/* Plumber's Vibe Pipeline animations */
.vibe-flow-fill-anim {
    background: repeating-linear-gradient(
        45deg,
        #ff9900,
        #ff9900 10px,
        #cc7a00 10px,
        #cc7a00 20px
    );
    background-size: 28px 28px;
    animation: pipeFlow 1.5s linear infinite;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

@keyframes pipeFlow {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 28px 0;
    }
}

.plumbing-panel .admin-btn {
    border-width: 2px;
}

