/* GLOBAL STYLES & RESETS */
html, body {
    cursor: url('data:image/x-icon;base64,AAACAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEQD/AODc1wAcGhcA//36AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMzMAAAAAAAAAAAAAAAAAMyIiMwAAAAAAAAAAAAAAAyREIiIwAAAAAAAAAAAAAANEQzIiMAAAAAAAAAAAAAA0MzIjMyMAAAAAAAAAAAAAMxE0IxEzAAAAAAAAAAAAADEREzEREwAAAAAAAAAAAAAxEUERERMAAAAAAAAAAAAAAxREEREwAAAAAAAAAAAAAAMRQRERMAAAAAAAAAAAAAAAMxERMwAAAAAAAAAAAAAAAAAzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADMAAAAAAAAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////h////gH///wA///8AP//+AB///gAf//4AH//+AB///wA///8AP///gH///+H////////9/////P////w=='), auto;
}

@font-face {
    font-family: "VCR OSD Mono";
    src: url("https://static.tumblr.com/nlxfn1e/7Pwqv8mt8/vcr_osd_mono_1.001.ttf") format("truetype");
}

body {
    font-family: "VCR OSD Mono", Courier, monospace;
    color: white;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    background-image: url('https://deadjackdaw.com/assets/images/background_tiles/grass_texture_repeating_patter_by_mas_d188zr-375w-2x.jpg');
    background-repeat: repeat;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

.sprite-loading {
    filter: brightness(0) invert(0);
}

/* MAIN CONTAINERS */
.game-container {
    display: flex;
    flex-direction: row; 
    align-items: stretch;
    justify-content: center;
    width: 90vw;
    max-width: 1200px;
    min-height: 60vh;
    height: auto;
    gap: 20px;
}

.content-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 20px;
}

.dialogue-box {
    background-color: #fff;
    border: 4px solid #000;
    border-radius: 8px;
    padding: 0 20px;
    width: 100%;
    height: 100%;
    box-shadow: inset -4px -4px 0px #888;
    color: #000;
    box-sizing: border-box;
    overflow-y: auto;
}

/* TYPOGRAPHY */
.main-title {
    margin: 0 0 15px 0;
    font-size: 3.2em; 
    text-transform: uppercase;
    min-height: 2.2em;
    text-shadow: 0 0 4px #fff;
    line-height: 1.1;
}

.title-highlight {
    color: red;
    text-shadow: 0 0 4px red;
}

/* MAIN MENU SYSTEM */
.main-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: flex-start;
}

.main-menu li {
    margin: 5px 0; 
}

.main-menu li::before {
    display: none;
}

.main-menu a {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 2.2em; 
    text-transform: uppercase;
    transition: color 0.1s, transform 0.2s ease-out;
    text-shadow: 0 0 5px currentColor;
}

.main-menu a::before {
    content: '▶';
    margin-right: 15px;
    font-size: 0.8em;
    vertical-align: middle;
}

.main-menu a:hover {
    transform: translateX(10px);
}

.inactive-link {
    opacity: 0.5;
    pointer-events: none;
}

/* SIDE NAVIGATION SYSTEM */
.side-nav {
    position: relative; 
    top: auto;
    left: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; 
    gap: 15px;
    z-index: 1000;
    background-color: #000; 
    border: 4px solid #fff; 
    border-radius: 8px; 
    padding: 20px;
    box-shadow: inset -4px -4px 0px #888;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.1s; 
}

.nav-icon {
    width: 50px;
    height: 50px;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    image-rendering: pixelated;
    transition: filter 0.1s; 
    filter: drop-shadow(0 0 5px currentColor);
}

.icon-home {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
}

.icon-pokecenter {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
}

.icon-box {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 6h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM10 4h4v2h-4V4zm10 16H4V8h16v12z"/><path d="M9 10h6v2H9z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 6h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM10 4h4v2h-4V4zm10 16H4V8h16v12z"/><path d="M9 10h6v2H9z"/></svg>');
}

.icon-trainers {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
}

.icon-lightbulb {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-1.3l-.85-.6C7.8 13.12 7 11.16 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.16-.8 4.12-2.15 5.1z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-1.3l-.85-.6C7.8 13.12 7 11.16 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.16-.8 4.12-2.15 5.1z"/></svg>');
}

.icon-help {
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"/></svg>');
}

.nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 85px; 
    background-color: #fff;
    color: #000;
    padding: 5px 10px;
    border: 2px solid #000;
    font-family: "VCR OSD Mono", Courier, monospace;
    font-size: 0.8em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1001; 
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item:hover .nav-icon {
    animation: shake 0.4s ease-in-out 1;
}

/* ANIMATIONS */
@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes ringExpand {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}

@keyframes particleExplode {
    0% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
    100% { 
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); 
        opacity: 0; 
    }
}

/* CLICK EXPLOSION EFFECTS */
.click-effect-container {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.click-ring {
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff, inset 0 0 5px #fff;
    animation: ringExpand 0.4s ease-out forwards;
}

.click-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: #fff;
    box-shadow: 0 0 6px #fff;
    border-radius: 50%;
    pointer-events: none;
    animation: particleExplode 0.5s cubic-bezier(0, .9, .57, 1) forwards;
}

/* MODAL OVERLAY */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 50;
}

.help-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border: 4px solid #000;
    padding: 30px;
    z-index: 100;
    color: #000;
    text-align: center;
    max-width: 400px;
}

.help-modal button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #000;
    color: #fff;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* DARK THEME */
html.dark-theme {
    filter: invert(1) hue-rotate(180deg);
    background-color: #fff;
}

html.dark-theme body::before {
    background-image: url('https://deadjackdaw.com/assets/images/background_tiles/EVRGREN2.JPG');
    filter: invert(1) hue-rotate(180deg); 
}

html.dark-theme img {
    filter: invert(1) hue-rotate(180deg);
}

html.dark-theme img.sprite-loading {
    filter: brightness(0) invert(1);
}

html.dark-theme img[src="https://deadjackdaw.com/assets/images/large_graphics/Pok%C3%A9mon_Center_RB.png"] {
    filter: none;
}

html.dark-theme .side-nav {
    background-color: #fff;
    border: 4px solid #000;
    filter: none; 
}

html.dark-theme .side-nav .nav-item {
    color: #000; 
}

html.dark-theme .nav-item::after {
    background-color: #000;
    color: #fff;
    border-color: #fff;
}

html.dark-theme .modal-overlay {
    background-color: rgba(255, 255, 255, 0.8);
}