:root {
    --xp-blue: #195cc7;
    --xp-blue-dark: #0721a0;
    --xp-blue-light: #53a0ff;
    --xp-silver: #cad2db;
    --xp-silver-dark: #95a0ab;
    --xp-window: #e6ecf2;
    --rh-green: #cefa05;
    --rh-green-dark: #a8d000;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Tahoma, "Segoe UI", Verdana, Arial, sans-serif;
    color: #111827;
}

button {
    font-family: inherit;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

/* ---------- Desktop ---------- */

.desktop {
    min-height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    background-image: url('images/imgur/kdQzraQ.gif');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--rh-green);
    border-bottom: 2px solid var(--rh-green-dark);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-bar .logo {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #000;
    font-family: 'Impact', 'Arial Black', sans-serif;
    user-select: none;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.top-bar .logo .logo-sub {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #000;
    font-family: Tahoma, "Segoe UI", Verdana, Arial, sans-serif;
}

.top-bar .ca {
    flex: 1;
    text-align: center;
    font-family: monospace;
    font-size: 13px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
}

.top-bar .socials {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar .socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    border-radius: 6px;
    text-decoration: none;
    color: #000;
    transition: background-color .15s, color .15s;
}

.top-bar .socials a:hover {
    background: #000;
    color: var(--rh-green);
}

.top-bar .socials svg {
    width: 16px;
    height: 16px;
}

/* ---------- Desktop icons ---------- */

.desktop-icons {
    position: absolute;
    top: 80px;
    left: 16px;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(5, auto);
    gap: 8px;
    width: max-content;
}

.desktop-icon {
    width: 96px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 8px;
}

.desktop-icon:hover {
    background: color-mix(in oklab, var(--xp-blue) 30%, transparent);
    outline: 1px dotted #fff9;
}

.desktop-icon.selected {
    background: color-mix(in oklab, var(--xp-blue) 50%, transparent);
    outline: 1px dotted #fffc;
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

.desktop-icon.icon-token img {
    width: 64px;
    height: 64px;
}

.desktop-icon span {
    color: #fff;
    font-size: 12px;
    text-align: center;
    font-weight: 600;
    margin-top: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
}

/* ---------- Windows ---------- */

.xp-window {
    background: var(--xp-window);
    border: 1px solid #0831d9;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    position: absolute;
    overflow: hidden;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.4);
}

.xp-titlebar {
    color: #fff;
    cursor: move;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    user-select: none;
    background: linear-gradient(#0058ee, #3593ff 8%, #288eff 40%, #0061f2 88%, #003fc0);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 8px;
    font-weight: 700;
}

.xp-titlebar.inactive {
    background: linear-gradient(#7a96df, #92aef0 8%, #7390db 40%, #5478c5 88%, #3b5fa8);
}

.xp-titlebar img {
    width: 16px;
    height: 16px;
}

.xp-titlebar span {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-titlebar-btn {
    color: #fff;
    cursor: pointer;
    background: linear-gradient(#4a8ce6, #1e58c4);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: 700;
}

.xp-titlebar-btn.close {
    background: linear-gradient(#e87263, #c11b1b);
}

.xp-titlebar-btn:hover {
    filter: brightness(1.15);
}

.xp-window-body {
    background: var(--xp-window);
    flex: 1;
    padding: 10px;
    overflow: auto;
}

.xp-btn {
    cursor: pointer;
    background: linear-gradient(#f5f5f5, #d8d8d8);
    border: 1px solid #888;
    border-radius: 3px;
    padding: 4px 12px;
    font-size: 12px;
}

.xp-btn:hover {
    background: linear-gradient(#fff, #e0e0e0);
}

.xp-btn:active {
    background: linear-gradient(#d0d0d0, #e8e8e8);
}

.xp-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ---------- Taskbar ---------- */

.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 30;
    display: flex;
    align-items: center;
    padding: 0 4px;
    background: linear-gradient(#245edb, #3f8cf4 8%, #245edb 40%, #1941a5 88%, #14398d);
    border-top: 1px solid #0d3aae;
    box-shadow: inset 0 -1px rgba(255,255,255,0.25);
}

.start-button {
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    cursor: pointer;
    background: linear-gradient(#3da94c, #59c466 10%, #3aa64a, #2f8a3d 90%, #1d6b2a);
    border: 1px solid #1d6b2a;
    border-radius: 0 12px 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 18px 4px 10px;
    font-size: 14px;
    font-style: italic;
    font-weight: 700;
    box-shadow: inset 0 1px rgba(255,255,255,0.4);
}

.start-button:hover {
    filter: brightness(1.08);
}

.start-button:active {
    filter: brightness(0.9);
}

.taskbar-tasks {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    padding-left: 8px;
}

.taskbar-task {
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: linear-gradient(#3a7fdc, #1e58c4);
    border: 1px solid #0a3a9c;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
    height: 28px;
    padding: 4px 10px;
    font-size: 12px;
    overflow: hidden;
}

.taskbar-task img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.taskbar-task.active {
    background: linear-gradient(#1a3e8c, #0a2666);
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3);
}

.tray {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 0 12px;
    height: 100%;
    border-left: 1px solid #0d3aae;
    background: rgba(15,78,196,0.4);
    color: #fff;
    font-size: 12px;
}

.tray .clock {
    text-align: center;
    line-height: 1.2;
}

.tray .clock .time {
    font-weight: 500;
}

.tray .clock .date {
    font-size: 10px;
    opacity: 0.8;
}

/* ---------- Start menu ---------- */

.start-menu {
    display: none;
    z-index: 40;
    background: #fff;
    border: 1px solid #0831d9;
    border-radius: 8px 8px 0 0;
    width: 340px;
    position: fixed;
    bottom: 40px;
    left: 0;
    overflow: hidden;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.4);
}

.start-menu.open {
    display: block;
}

.start-menu-header {
    color: #fff;
    background: linear-gradient(#1e58c4, #0a3a9c);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-weight: 700;
}

.start-menu-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.start-menu-body {
    padding: 8px 0;
}

.start-menu-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
}

.start-menu-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.start-menu-item:hover {
    color: #fff;
    background: linear-gradient(90deg, #2a5fd6, #4a8ce6);
}

/* ---------- Story / References / generic content ---------- */

.content-story h1 {
    font-size: 22px;
    font-weight: 700;
    color: #0a3a9c;
    border-bottom: 2px solid #0a3a9c;
    padding-bottom: 8px;
    margin: 0 0 16px;
}

.content-story h2 {
    font-size: 16px;
    font-weight: 700;
    color: #0a3a9c;
    margin: 20px 0 6px;
}

.content-story p {
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 10px;
}

.content-story ul {
    padding-left: 22px;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
}

.content-story img.float {
    float: right;
    margin-left: 16px;
    width: 128px;
    height: 128px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--xp-silver-dark);
    padding: 4px;
}

.content-story .footer-note {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #ccc;
    font-size: 13px;
    font-style: italic;
    font-weight: 600;
}

.center-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background: #ECE9D8;
}

.center-panel svg {
    width: 64px;
    height: 64px;
    color: #0a3a9c;
    margin-bottom: 16px;
}

.center-panel img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 2px solid #d1d5db;
}

.center-panel h1 {
    font-size: 22px;
    font-weight: 700;
    color: #0a3a9c;
    margin: 0 0 8px;
}

.center-panel p {
    font-size: 13px;
    color: #374151;
    max-width: 320px;
    margin: 0 0 20px;
}

.center-panel .url-hint {
    margin-top: 16px;
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
}

.xp-btn.cta {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.xp-btn.cta svg {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* ---------- References ---------- */

.content-refs .refs-header {
    border-bottom: 2px solid #0a3a9c;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.content-refs h1 {
    font-size: 18px;
    font-weight: 700;
    color: #0a3a9c;
    margin: 0;
}

.content-refs .subtitle {
    font-size: 11px;
    color: #6b7280;
    margin: 2px 0 0;
}

.content-refs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-refs li {
    border: 1px solid var(--xp-silver-dark);
    background: #fff;
    padding: 8px;
}

.content-refs a {
    color: #0058ee;
    font-weight: 500;
    text-decoration: underline;
}

.content-refs .note {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.content-refs .footer-note {
    margin-top: 24px;
    font-size: 11px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    font-style: italic;
}

/* ---------- Token Info ---------- */

.content-token {
    padding: 4px;
    font-size: 13px;
}

.content-token .head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #aca899;
}

.content-token .head img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.content-token .head .title {
    font-weight: 700;
    font-size: 15px;
}

.content-token .head .subtitle {
    font-size: 11px;
    color: #6b7280;
}

.content-token .ca-box {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #7f9db9;
    padding: 12px;
}

.content-token .ca-box .label {
    font-weight: 700;
    margin-bottom: 8px;
}

.content-token .ca-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-token code {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #aca899;
    padding: 4px 8px;
    font-size: 11px;
    word-break: break-all;
    min-height: 28px;
}

.content-token .hint {
    margin-top: 16px;
    font-size: 11px;
    color: #374151;
}

/* ---------- Prophecy ---------- */

.content-prophecy {
    height: 100%;
    overflow: auto;
    padding: 24px;
    font-size: 13px;
    line-height: 1.6;
    background: radial-gradient(ellipse at top, #1a1238 0%, #0a0418 60%, #000 100%);
    color: #e8d9a8;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.content-prophecy .inner {
    max-width: 640px;
    margin: 0 auto;
}

.content-prophecy h1 {
    font-size: 26px;
    text-align: center;
    margin: 0 0 8px;
    letter-spacing: 0.05em;
    color: #f5d061;
    text-shadow: 0 0 10px rgba(245,208,97,0.7), 0 0 20px rgba(245,208,97,0.4);
    font-family: 'Cinzel', 'Georgia', serif;
}

.content-prophecy .divider {
    text-align: center;
    font-size: 11px;
    margin-bottom: 24px;
    opacity: 0.7;
    font-style: italic;
    color: #c9b681;
}

.content-prophecy p {
    margin: 0 0 14px;
}

.content-prophecy p.lead {
    font-style: italic;
    text-align: center;
    font-size: 15px;
    color: #f5d061;
    margin-bottom: 20px;
}

.content-prophecy p.gold {
    color: #f5d061;
    font-style: italic;
}

.content-prophecy p.gold-center {
    color: #f5d061;
    text-align: center;
    font-size: 17px;
}

.content-prophecy blockquote {
    border-left: 2px solid #f5d061;
    padding-left: 16px;
    margin: 20px 0;
    font-style: italic;
    color: #f5d061;
}

.content-prophecy .closing {
    text-align: center;
    font-size: 17px;
    margin-top: 30px;
    margin-bottom: 14px;
    color: #f5d061;
    text-shadow: 0 0 10px rgba(245,208,97,0.6);
}

/* ---------- Painter ---------- */

.content-painter {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    overflow-y: auto;
    padding-bottom: 12px;
}

.painter-canvas-wrap {
    display: flex;
    justify-content: center;
    background: #e5e7eb;
    padding: 8px;
    border-radius: 4px;
}

.painter-canvas-inner {
    position: relative;
    width: 100%;
    max-width: 560px;
}

.painter-canvas-inner canvas {
    border: 1px solid var(--xp-silver-dark);
    background: #fff;
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
}

.painter-objects-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.painter-obj {
    position: absolute;
    transform-origin: center;
}

.painter-obj img {
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.painter-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.painter-toolbar .label {
    font-weight: 600;
}

.painter-colors {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.painter-colors button {
    width: 20px;
    height: 20px;
    border: 1px solid #000;
    padding: 0;
    cursor: pointer;
}

.painter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.painter-hint {
    font-size: 11px;
    color: #4b5563;
    font-style: italic;
}

.painter-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

.painter-modal-overlay.open {
    display: flex;
}

.painter-modal {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 720px;
    width: 90vw;
    max-height: 80vh;
    overflow: auto;
}

.painter-modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.painter-modal-header h3 {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.painter-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 640px) {
    .painter-modal-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.painter-modal-grid button {
    border: 1px solid #d1d5db;
    padding: 4px;
    background: #fff;
    cursor: pointer;
}

.painter-modal-grid button:hover {
    border-color: #3b82f6;
}

.painter-modal-grid img {
    width: 100%;
    height: 64px;
    object-fit: contain;
}
