:root {
    /* Soft base fills stay light; structural hues are deepened for contrast */
    --alabaster-grey: #C9BCC6;
    --linen: #FFF6EE;
    --soft-blush: #F5C5CB;
    --petal-frost: #E39BB0;
    --azure-mist: #B7CEC8;
    --light-blue: #7EB9C4;
    --ink: #4A3F45;
    --ink-muted: #6B5E66;
}

* {
    border-radius: 0px !important;
    font-family: 'VT323', monospace;
    font-weight: 400;
}

body {
    background-color: var(--linen);
    font-size: 1.5rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    background-image:
        linear-gradient(rgba(255, 246, 238, 0.42), rgba(253, 226, 228, 0.38)),
        url('zyanya-bmo-s0cQoh_3NsM-unsplash.jpg');
    background-size: cover, cover;
    background-position: center, center;
    background-attachment: fixed, fixed;
    background-repeat: no-repeat;
    color: var(--ink-muted);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(rgba(126, 185, 196, 0.55) 1px, transparent 1px),
        radial-gradient(rgba(245, 197, 203, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

.page-shell {
    display: grid;
    grid-template-columns: minmax(0, 56rem) auto;
    justify-content: center;
    align-items: start;
    gap: 1rem;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 0.75rem 2.5rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.photo-credit {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 0.75rem 1.25rem;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    color: var(--ink-muted);
    opacity: 0.75;
}

.photo-credit a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.photo-credit a:hover {
    color: var(--petal-frost);
}

.page-center {
    min-width: 0;
    width: 100%;
}

.active-stage {
    position: relative;
    min-height: 12rem;
    padding-top: 0.75rem;
}

.active-stage > .window-box {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.active-stage > .window-box.is-raised {
    transform: translateY(-1.25rem);
    box-shadow: 6px 14px 0 var(--light-blue);
}

/* Side vertical navbars */
.side-nav {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    z-index: 20;
    padding-top: 0.25rem;
    width: 9.5rem;
}

.nav-tab {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
    transform-origin: center center;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease,
        background-color 0.2s ease,
        color 0.2s ease;
    will-change: transform;
}

.nav-tab-emoji {
    writing-mode: horizontal-tb;
    font-size: 1.3rem;
    line-height: 1;
    transform: none;
    flex-shrink: 0;
}

.nav-tab-label {
    font-size: 1.15rem !important;
    line-height: 1.15 !important;
    letter-spacing: 0.04em;
    white-space: normal;
    text-align: left;
}

.side-nav-right .nav-tab:hover:not(.is-active) {
    transform: rotate(5deg) translateY(-0.35rem);
    box-shadow: 4px 5px 0 var(--petal-frost);
}

.nav-tab.is-active {
    transform: none;
    box-shadow: 3px 3px 0 var(--light-blue);
}

.nav-tab.is-active:hover {
    transform: none;
}

@media (max-width: 900px) {
    .page-shell {
        grid-template-columns: 1fr;
        padding: 1rem 0.75rem 2rem;
    }

    .side-nav {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: auto;
        order: 2;
    }

    .page-center { order: 1; }
    .side-nav-right { order: 3; }

    .nav-tab {
        width: auto;
        min-height: 0;
        padding: 0.55rem 0.8rem;
    }

    .nav-tab-emoji {
        font-size: 1.2rem;
    }

    .side-nav-right .nav-tab:hover:not(.is-active) {
        transform: rotate(3deg) translateY(-0.3rem);
    }

    .active-stage > .window-box.is-raised {
        transform: translateY(-0.65rem);
    }
}

/* Retro Window Styling */
.window-box {
    background: #ffffff;
    border: 2px solid var(--alabaster-grey);
    box-shadow: 4px 4px 0px var(--light-blue);
}

.window-header {
    background: linear-gradient(90deg, var(--soft-blush), var(--petal-frost), var(--light-blue));
    color: var(--ink);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--alabaster-grey);
}

.font-retro-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    line-height: 1.7;
}

.site-subheading {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    line-height: 1.2;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    opacity: 0.9;
}

.font-retro-body {
    font-family: 'VT323', monospace;
}

.section-header-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    line-height: 1.7;
}

/* VT323 reads smaller than typical fonts — scale up Tailwind text utilities */
.text-xs {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
}

.text-sm {
    font-size: 1.4rem !important;
    line-height: 1.35 !important;
}

.text-base {
    font-size: 1.5rem !important;
    line-height: 1.35 !important;
}

.text-lg {
    font-size: 1.65rem !important;
    line-height: 1.35 !important;
}

.text-\[10px\] {
    font-size: 1.1rem !important;
}

.text-\[13px\] {
    font-size: 1.2rem !important;
}

#bgmSourceSelect {
    min-height: 2.75rem;
    padding: 0.45rem 0.75rem;
    line-height: 1.2;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Chiptune piano keyboard */
.synth-piano {
    --synth-white-w: 3rem;
    --synth-black-w: 1.75rem;
    --synth-white-h: 8rem;
    --synth-black-h: 5rem;
    position: relative;
    display: inline-block;
}

.synth-piano-whites {
    display: flex;
}

.synth-key-white {
    width: var(--synth-white-w);
    height: var(--synth-white-h);
    background: #ffffff;
    border: 1px solid #1e293b;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0.25rem 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 1.1rem !important;
    line-height: 1.1 !important;
    text-align: center;
    box-sizing: border-box;
}

.synth-key-white span {
    display: block;
    width: 100%;
    text-align: center;
}

.synth-key-white .synth-key-bind {
    color: #94a3b8;
    font-size: 0.95rem !important;
    margin-top: 0.15rem;
}

.synth-piano-blacks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--synth-black-h);
    pointer-events: none;
}

.synth-key-black {
    position: absolute;
    top: 0;
    width: var(--synth-black-w);
    height: var(--synth-black-h);
    margin-left: calc(var(--synth-black-w) / -2);
    background: #0f172a;
    border: 1px solid #1e293b;
    color: #ffffff;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.35rem;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    z-index: 2;
    font-size: 0.95rem !important;
    line-height: 1.1 !important;
    text-align: center;
    box-sizing: border-box;
}

.synth-key-white:active {
    background: #e2e8f0;
}

.synth-key-black:active {
    background: #334155;
}

.synth-key-lit {
    background: var(--petal-frost) !important;
    color: #1e293b !important;
}

/* Retro Button Styling */
.btn-retro {
    background: #ffffff;
    border: 2px solid var(--alabaster-grey);
    box-shadow: 2px 2px 0px var(--light-blue);
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    box-sizing: border-box;
}

.btn-retro:hover {
    background: var(--azure-mist);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--light-blue);
}

.btn-retro:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px var(--light-blue);
}

.btn-retro-accent {
    background: var(--petal-frost);
    color: #ffffff;
    border-color: #C47A92;
    box-shadow: 2px 2px 0px var(--light-blue);
}

.btn-retro-accent:hover {
    color: var(--ink);
    background: var(--soft-blush);
}

.header-user-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-width: 2px;
    border-style: solid;
    font-size: 1.5rem !important;
    line-height: 1;
    box-sizing: border-box;
}

.text-accent {
    color: #9B5A6E;
}

/* Static welcome banner */
.banner-container {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, #FDE8EA, #FFF6EE, #D7EBEC);
    border-bottom: 2px solid var(--petal-frost);
}

.banner-text {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
    text-align: center;
    color: var(--ink);
    font-size: 1.35rem !important;
    line-height: 1.4;
    letter-spacing: 0.03em;
}

.banner-sep {
    color: var(--petal-frost);
    opacity: 0.7;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--azure-mist);
    border: 1px solid var(--light-blue);
}
::-webkit-scrollbar-thumb {
    background: var(--petal-frost);
    border: 1px solid #C47A92;
}

/* Solitaire Styles */
.sol-board {
    min-width: 700px;
    min-height: 550px;
    overflow-x: auto;
}
.sol-pile {
    width: 80px;
    height: 112px;
    border: 2px dashed var(--light-blue);
    position: relative;
}
.sol-card {
    width: 80px;
    height: 112px;
    border: 2px solid var(--alabaster-grey);
    background-color: #ffffff;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 5px;
    cursor: grab;
    user-select: none;
    box-shadow: 2px 2px 0px var(--light-blue);
    font-size: 22px;
    line-height: 1;
    transition: transform 0.1s, opacity 0.1s;
    touch-action: none;
}
.sol-card-index {
    font-size: 0.95rem !important;
    line-height: 1 !important;
    font-weight: 500;
}
.sol-card-face {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
    padding: 1px 0;
}
.sol-card-pips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    width: 100%;
    height: 100%;
    gap: 0;
}
.sol-card-pip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30%;
    line-height: 1 !important;
    font-size: var(--pip-size, 0.95rem) !important;
    height: var(--pip-height, 14px);
}
.sol-card:active {
    cursor: grabbing;
}
.sol-card.selected {
    border-color: var(--petal-frost);
    box-shadow: 0 0 6px var(--soft-blush), 2px 2px 0px var(--light-blue);
    transform: translateY(-4px);
    z-index: 50 !important;
}
.sol-card.dragging-source {
    opacity: 0.35;
    pointer-events: none;
}
.sol-card.sol-card-single {
    position: relative;
    left: auto;
    top: auto;
    z-index: 2;
}
.sol-pile-label {
    pointer-events: none;
    user-select: none;
}
.sol-pile.drag-over-valid {
    border-color: var(--light-blue);
    background-color: var(--azure-mist);
    box-shadow: inset 0 0 0 2px var(--light-blue);
}
.sol-pile.drag-over-invalid {
    border-color: var(--petal-frost);
    background-color: var(--soft-blush);
}
.sol-drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(4px 6px 8px rgba(0, 0, 0, 0.25));
}
.sol-card-back {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 140'%3E%3Crect width='100' height='140' fill='%23ffffff' rx='6'/%3E%3Crect x='4' y='4' width='92' height='132' fill='none' stroke='%231e40af' stroke-width='3' rx='4'/%3E%3Crect x='9' y='9' width='82' height='122' fill='none' stroke='%231e40af' stroke-width='1' rx='2'/%3E%3Cpattern id='pattern' width='16' height='16' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Crect width='16' height='16' fill='%23ffffff'/%3E%3Ccircle cx='4' cy='4' r='2.5' fill='%231e40af'/%3E%3Ccircle cx='12' cy='12' r='2.5' fill='%231e40af'/%3E%3Cpath d='M-2 8h20M8-2v20' stroke='%231e40af' stroke-width='1'/%3E%3Cpath d='M4 4l8 8M4 12l8-8' stroke='%231e40af' stroke-width='0.5'/%3E%3C/pattern%3E%3Crect x='12' y='12' width='76' height='116' fill='url(%23pattern)' rx='1'/%3E%3Ccircle cx='50' cy='70' r='24' fill='%23ffffff'/%3E%3Ccircle cx='50' cy='70' r='21' fill='none' stroke='%231e40af' stroke-width='1.5'/%3E%3Cpath d='M50 54l4.5 11.5L66 70l-11.5 4.5L50 86l-4.5-11.5L34 70l11.5-4.5Z' fill='%231e40af'/%3E%3Ccircle cx='50' cy='70' r='5' fill='%23ffffff'/%3E%3Ccircle cx='50' cy='70' r='2.5' fill='%231e40af'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: white;
    cursor: pointer;
}
.text-red { color: #e11d48; }
.text-black { color: #334155; }

