/* Pixel Wall Styles v2.3.0 */
/* Base Reset & Variables */
:root {
    /* Dark Theme (Default) */
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-section: rgba(30, 30, 30, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --accent-yellow: #ffe600;
    --accent-orange: #f09100;
    --accent-red: #e63228;
    --accent-purple: #823c8c;
    --accent-turquoise: #1de9b6;
    --header-bg: rgba(18, 18, 18, 0.5);
    --header-scrolled: rgba(18, 18, 18, 0.5);
    --card-hover-bg: #252525;
    --border-opacity: 0.1;
    --site-bg-opacity: 0.2;

    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-ui: 'Source Sans Pro', sans-serif;

    /* i18n variables for CSS content */
    --ribbon-active: "ATTIVO";
    --ribbon-wip: "WORK IN PROGRESS";
}

/* Light Theme Variables (kept for compatibility handling) */
body.light-theme {
    --bg-dark: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-section: rgba(255, 255, 255, 0.5);
    --text-primary: #121212;
    --text-secondary: #444444;
    --accent-yellow: #cda300;
    --accent-orange: #d35400;
    --accent-turquoise: #008f7a;
    --header-bg: rgba(255, 255, 255, 0.5);
    --header-scrolled: rgba(255, 255, 255, 0.5);
    --card-hover-bg: #ffffff;
    --border-opacity: 0.1;
    --site-bg-opacity: 0.4;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Theme Global Behavior */
body.light-theme .logo-dark {
    display: none !important;
}

body.light-theme .logo-light {
    display: block !important;
}

body.light-theme .btn-outline {
    color: var(--text-primary) !important;
}

body.light-theme .social-circle {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

body.light-theme .social-circle:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utilities */
.highlight {
    color: var(--accent-yellow);
}

.highlight-alt {
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange), var(--accent-red), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-anim {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(166, 77, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(166, 77, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(166, 77, 255, 0);
    }
}

.gradient-text {
    background: linear-gradient(45deg, var(--accent-yellow), var(--accent-orange), var(--accent-red), var(--accent-purple));
    background-size: 300% 300%;
    animation: gradient-shift 5s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    line-height: 1;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-orange), var(--accent-red), var(--accent-purple));
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(230, 50, 40, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 50, 40, 0.6);
}

.btn-outline {
    background: transparent;
    position: relative;
    border: 2px solid transparent;
    background-image: linear-gradient(var(--bg-dark), var(--bg-dark)),
        linear-gradient(90deg, var(--accent-yellow), var(--accent-orange), var(--accent-red), var(--accent-purple));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.btn-outline:hover {
    transform: translateY(-2px);
    filter: brightness(1.3);
}

/* Header (Minimal for Pixel Wall) */
/* Note: Pixel Wall overrides most header styles inline, but these variables are key */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-opacity);
    transition: all 0.3s ease;
}

/* Navigation Utilities */
.nav-item-dropdown {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: block;
    margin: 0;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-turquoise);
    padding-left: 25px;
}

/* =========================================
   Inline Styles Extracted from index.html
   ========================================= */

/* Mobile Header Fixes */
@media (max-width: 768px) {
    .pixel-header {
        padding: 10px 15px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .right-side-controls {
        top: 70px;
    }

    @media (max-width: 400px) {
        .logo-text span {
            display: none;
        }

        .logo-text::after {
            content: 'MR';
        }
    }
}

:root,
html,
body {
    overflow: hidden !important;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    touch-action: manipulation;
}

/* Specific Styles for Pixel Wall */
.community-hud {
    position: absolute;
    top: 15px;
    left: calc(50% - 120px);
    /* Center between left controls (80px) and right controls (240px) */
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    padding: 6px 15px;
    border-radius: 50px;
    border: 1px solid var(--border-opacity);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    white-space: nowrap;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.diary-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.diary-img {
    max-width: 100%;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.diary-link {
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.hud-value {
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.hud-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.gold-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px dashed #FFD700;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
}

.gold-box strong {
    color: #FFD700;
    display: block;
    margin-bottom: 2px;
}

.gold-box p {
    margin-bottom: 0 !important;
}

.pixel-page {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.pixel-header {
    padding: 10px 20px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-opacity);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.pixel-container {
    flex: 1;
    position: relative;
    background: #000000;
    overflow: hidden;
    cursor: crosshair;
}

#pixel-canvas {
    image-rendering: pixelated;
    display: block;
    background-color: transparent;
}

/* Tools Toolbar */
.pixel-tools {
    position: absolute;
    bottom: 30px;
    left: calc(50% - 120px);
    /* Centers more precisely between left edge and 240px right panel */
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-opacity);
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 200;
    white-space: nowrap;
    flex-wrap: nowrap;
    min-width: max-content;
}

.tool-group {
    display: flex;
    gap: 10px;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 15px;
}

.tool-group:last-child {
    border-right: none;
    padding-right: 0;
}

.color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-circle.active {
    border-color: #fff;
    transform: scale(1.2);
}

.right-side-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 200;
    width: 240px;
}

/* Welcome Modal Card Style - Static Rounded Gradient Border */
#welcome-modal .welcome-card {
    text-align: center;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        linear-gradient(135deg, var(--accent-yellow), var(--accent-orange), var(--accent-red), var(--accent-purple)) border-box !important;
    border: 3px solid transparent !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 102, 0, 0.2);
}

.welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.stats-panel {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(15px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-opacity);
    color: white;
}

.stat-item {
    margin-bottom: 10px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    color: var(--accent-turquoise);
}

.buy-btn {
    background: linear-gradient(45deg, var(--accent-orange), var(--accent-red));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 50, 40, 0.4);
}

.zoom-controls {
    position: absolute;
    left: 20px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--border-opacity);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

@media (hover: hover) {
    .zoom-btn:hover {
        background: var(--accent-turquoise);
        color: var(--bg-dark);
        box-shadow: 0 0 15px var(--accent-turquoise);
    }
}

.zoom-btn.active {
    background: var(--accent-turquoise);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-turquoise);
}

#nav-back {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* Pricing Info Box */
.pricing-info-box {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pricing-info-box:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-turquoise);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 12, 16, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
    will-change: opacity;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Pause background infinite animations when a modal is active */
body.modal-open * {
    animation-play-state: paused !important;
}

.modal-content {
    background: #111;
    border: 1px solid var(--accent-turquoise);
    padding: 30px;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: white;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.15);
}

/* Wider mission modal for desktop to avoid scroll */
@media (min-width: 769px) {
    #mission-modal .modal-content {
        max-width: 1000px;
    }

    #mission-modal .modal-body img {
        max-width: 500px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 25px 20px;
        width: 95%;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-title {
    font-family: var(--font-heading);
    color: var(--accent-turquoise);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal-body p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.modal-body strong {
    color: white;
}

/* Mission Box Styling */
.mission-box {
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-red), var(--accent-orange), var(--accent-yellow));
    background-size: 200% 200%;
    animation: vibrantGradient 5s ease infinite;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mission-box:hover {
    transform: scale(1.05);
}

.mission-box .stat-label {
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mission-box p {
    font-size: 0.7rem;
    color: white;
    font-weight: 500;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes vibrantGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Canvas Title Styling */
.canvas-title {
    position: absolute;
    transform-origin: bottom center;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    z-index: 50;
    pointer-events: none;
    white-space: nowrap;
    animation: color-cycle 4s infinite alternate;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.canvas-title.visible {
    opacity: 1;
}

@keyframes color-cycle {
    0% {
        color: var(--accent-yellow);
        text-shadow: 0 0 10px rgba(255, 230, 0, 0.4);
    }

    33% {
        color: var(--accent-orange);
        text-shadow: 0 0 10px rgba(240, 145, 0, 0.4);
    }

    66% {
        color: var(--accent-red);
        text-shadow: 0 0 10px rgba(230, 50, 40, 0.4);
    }

    100% {
        color: var(--accent-purple);
        text-shadow: 0 0 10px rgba(130, 60, 140, 0.4);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Toggle Button for Side Panel */
.toggle-panel-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

/* Minimized State Styles */
.right-side-controls.minimized {
    background: transparent;
    padding: 0;
    width: auto;
    min-width: auto;
    /* Allow shrinking */
    border-radius: 12px;
}

.right-side-controls.minimized .stats-panel {
    padding: 8px 30px 8px 12px;
    /* Reduce padding, keep space for button on right */
    min-width: 90px;
}

.right-side-controls.minimized .mission-box,
.right-side-controls.minimized .pricing-info-box,
.right-side-controls.minimized .buy-btn,
.right-side-controls.minimized .stat-label,
.right-side-controls.minimized div[style*="margin-top: 15px"] {
    display: none !important;
}

.right-side-controls.minimized .stat-item {
    margin-bottom: 2px;
    text-align: right;
}

.right-side-controls.minimized .stat-value {
    font-size: 0.9rem;
    color: white;
}

.right-side-controls.minimized .stat-item::before {
    content: '📐 ';
    font-size: 0.8rem;
}

.right-side-controls.minimized .stat-item:nth-child(2)::before {
    content: '💰 ';
}

@media (max-width: 768px) {
    .canvas-title {
        font-size: 1rem;
        top: 70px;
        width: 70%;
    }

    .right-side-controls {
        width: auto;
        max-width: 220px;
        right: 10px;
        top: 65px;
        transform-origin: top right;
        display: flex !important;
        flex-direction: column;
        gap: 5px;
    }

    .zoom-controls {
        left: 10px;
        top: 65px;
        transform: scale(0.85);
        transform-origin: top left;
    }

    .pixel-header {
        justify-content: space-between;
        padding: 10px;
        gap: 5px;
    }

    .logo img {
        height: 30px !important;
    }

    #nav-back {
        font-size: 0.8rem;
    }

    .pixel-tools {
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        transform: none !important;
        min-width: 0 !important;
        max-width: none !important;
        border-radius: 20px 20px 0 0;
        background: rgba(13, 17, 23, 0.95);
        border: none;
        border-top: 1px solid var(--accent-turquoise);
        padding: 15px 15px max(15px, env(safe-area-inset-bottom)) 15px;
        box-sizing: border-box;
        gap: 15px;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        z-index: 100;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    }

    @media (orientation: landscape) {
        .pixel-tools {
            width: auto;
            max-width: 600px;
            bottom: 10px;
            padding: 5px 15px;
        }

        .right-side-controls {
            transform: scale(0.7);
            top: 8px;
        }

        .zoom-controls {
            top: 8px;
            transform: scale(0.7);
        }
    }

    .pixel-tools::-webkit-scrollbar {
        display: none;
    }

    .tool-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .modal-overlay {
        z-index: 5000 !important;
    }

    .welcome-icon {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }

    .modal-title {
        font-size: 0.9rem !important;
        margin-bottom: 4px !important;
    }

    .modal-body p {
        font-size: 0.68rem !important;
        line-height: 1.1 !important;
        margin-bottom: 2px !important;
    }

    .modal-content {
        padding: 8px 6px !important;
        max-width: 98% !important;
        max-height: 80vh;
        overflow-y: auto;
        border-width: 1px !important;
    }

    .buy-btn#ack-welcome {
        margin-top: 15px !important;
        padding: 8px 15px !important;
        font-size: 0.85rem !important;
    }

    /* Welcome Modal Mobile Optimization */
    #welcome-modal .welcome-card {
        max-height: 80vh !important;
        padding: 20px 15px !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto !important;
        gap: 10px;
    }

    #welcome-modal .welcome-card .modal-body p {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }

    .gold-box {
        margin-top: 10px !important;
        padding: 12px !important;
    }

    .gold-box strong {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }

    #welcome-modal .welcome-card .gold-box p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
    }

    .community-hud {
        top: 8px;
        left: 50%;
        padding: 5px 12px;
        gap: 4px 10px;
        transform: translateX(-50%);
        width: max-content;
        max-width: 96vw;
        justify-content: center;
        flex-wrap: wrap;
        border-radius: 15px;
        white-space: normal;
    }

    .hud-item {
        gap: 4px;
        white-space: nowrap;
    }

    .hud-value {
        font-size: 0.7rem;
        letter-spacing: -0.3px;
    }

    .hud-icon {
        font-size: 0.8rem;
    }

    .hud-divider {
        display: none;
    }
}


.floating-controls {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    border: 2px solid var(--accent-turquoise);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .floating-controls {
        bottom: 100px;
        width: 80%;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .floating-controls {
        bottom: 10px;
        padding: 8px 15px;
        width: auto;
        min-width: 300px;
    }

    .floating-controls p {
        display: none;
    }
}

/* Diary / DevLog Styles */
.diary-entry {
    margin-bottom: 45px;
    padding-left: 30px;
    border-left: 1px solid rgba(29, 233, 182, 0.3);
    /* Turquoise dim */
    position: relative;
    animation: fadeIn 0.5s ease;
}

.diary-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    /* Slightly adjusted for better alignment with the title text */
    width: 10px;
    height: 10px;
    transform: translateX(-50%);
    margin-left: -0.5px;
    /* Offset for the 1px border center */
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent-turquoise);
    box-shadow: 0 0 5px var(--accent-turquoise);
    z-index: 2;
}

.diary-date {
    font-family: 'Source Code Pro', monospace;
    /* Monospace aesthetic */
    color: var(--accent-turquoise);
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 8px;
    opacity: 0.9;
    letter-spacing: 1px;
    background: rgba(29, 233, 182, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.diary-title {
    color: white;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.diary-text {
    color: #ddd;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-line;
    /* Preserves newlines but wraps text */
}

.diary-reactions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reaction-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.reaction-btn.active {
    background: rgba(29, 233, 182, 0.2);
    border-color: var(--accent-turquoise);
    color: var(--accent-turquoise);
}

.reaction-btn.active.heart-btn {
    background: rgba(255, 77, 77, 0.2);
    border-color: #ff4d4d;
    color: #ff4d4d;
}

.reaction-count {
    font-weight: bold;
    font-family: 'Source Code Pro', monospace;
}


.diary-img {
    max-width: 400px;
    width: 100%;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.diary-img:hover {
    transform: scale(1.02);
}

/* Responsive Iframe (YouTube) */
.iframe-container {
    position: relative;
    width: 100%;
    /* Default maximum width, can be overridden by JS from the iFrame attribute */
    max-width: 560px;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    margin: 15px 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.diary-image-link {
    display: block;
    width: fit-content;
}

.diary-error {
    color: var(--accent-red);
    text-align: center;
    padding: 20px;
}

.diary-empty {
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    padding: 20px;
}

/* Diary Link Styles */
.diary-text a {
    color: var(--accent-turquoise);
    text-decoration: underline;
    transition: color 0.2s;
}

.diary-text a:hover {
    color: white;
    text-shadow: 0 0 5px var(--accent-turquoise);
}

/* Pricing & Mission Modals Mobile Portrait Fix */
@media (max-width: 768px) and (orientation: portrait) {

    #pricing-modal .modal-content,
    #mission-modal .modal-content {
        max-height: 85vh !important;
        padding: 20px 15px !important;
    }

    #pricing-modal .modal-body p,
    #mission-modal .modal-body p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 10px !important;
    }

    #pricing-modal .modal-title,
    #mission-modal .modal-title {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }

    .diary-modal-content {
        width: 85% !important;
        padding: 20px 10px !important;
    }
}

/* Mission Modal Buttons Layout */
.mission-modal-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

@media (max-width: 768px) {
    .mission-modal-btns {
        flex-direction: column;
        align-items: center;
    }
}

/* Checkout Modal Styles */
.checkout-summary-container {
    text-align: center;
    margin-bottom: 20px;
}

.checkout-breakdown {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
    line-height: 1.5;
}

.checkout-total-price {
    font-size: 1.5rem;
    color: var(--accent-turquoise);
    font-weight: 700;
    margin: 0;
}

/* --- UTILITY CLASSES FOR CSP COMPATIBILITY --- */
/* Replaces inline styles for index.php and pixel-wall.js */

/* Header & Navigation */
.logo-img {
    height: 40px;
}

.header-links-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.diary-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0.9;
}

.diary-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent-turquoise);
    box-shadow: 0 0 5px var(--accent-turquoise);
}

.diary-label {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--accent-turquoise);
    font-weight: 600;
}

.lang-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* HUD Items */
.hud-item-clickable {
    cursor: pointer;
}

.hud-icon-silver {
    filter: grayscale(100%) contrast(1.2) brightness(0.7);
}

/* Floating Controls */
.controls-text {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.controls-buttons {
    display: flex;
    gap: 15px;
}

.btn-cancel {
    background: #444;
}

.btn-confirm {
    background: var(--accent-turquoise);
    color: #000;
}

/* Stats Panel & Modals */
.pricing-info-title {
    font-size: 0.65rem;
    color: var(--accent-turquoise);
}

.pricing-info-text {
    font-size: 0.75rem;
    margin-top: 5px;
}

.pricing-info-subtext {
    font-size: 0.75rem;
}

.checkout-btn {
    margin-top: 15px;
    width: 100%;
}

/* Mission Box */
.mission-wall-box {
    background: linear-gradient(135deg, #1de9b6, #008f7a);
    animation: none;
}

.mission-wall-label {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.mission-wall-text {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* Wall of Fame Modal */
.wall-modal-content {
    max-width: 90vw;
    height: 80vh;
    padding: 10px;
    background: #000;
    border: 2px solid var(--accent-turquoise);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wall-modal-close {
    z-index: 1000;
    color: white;
}

.wall-modal-intro {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 5px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.wall-modal-iframe {
    width: 100%;
    flex: 1;
    border: none;
    overflow: auto;
}

/* Canvas & Tools */
.color-circle-red {
    background: #ff4d4d;
}

.color-circle-green {
    background: #4dff88;
}

.color-circle-blue {
    background: #4da6ff;
}

.color-circle-yellow {
    background: #ffcc4d;
}

.color-circle-black {
    background: #000000;
}

.color-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-color-btn {
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.color-input-hidden {
    position: absolute;
    opacity: 0;
    width: 28px;
    height: 28px;
    cursor: pointer;
    left: 0;
}

.tool-btn-pan {
    background: var(--accent-turquoise);
}

.tool-btn-draw {
    background: #333;
}

.tool-btn-erase {
    background: #333;
}

.tool-btn-undo {
    background: #444;
}

.tool-btn-clear {
    background: #a33;
}

.tool-btn-upload {
    background: #2a9d8f;
}

.file-input-hidden {
    display: none;
}

/* Mission Modal Inside */
.mission-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--accent-turquoise);
}

.mission-links-container {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.mission-tourism-text {
    font-style: italic;
    color: #fff;
}

.mission-map-link {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-family: var(--font-heading);
}

.mission-tourism-link {
    color: var(--accent-turquoise);
    border-color: var(--accent-turquoise);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-family: var(--font-heading);
}

/* Size Modal */
.size-modal-content {
    max-width: 300px;
    text-align: center;
}

.size-input {
    width: 80px;
    padding: 10px;
    font-size: 1.2rem;
    text-align: center;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    margin-bottom: 20px;
}

.size-buttons-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-auto-width {
    width: auto;
}

.btn-bg-444 {
    background: #444;
}

.btn-bg-red {
    background: var(--accent-red);
}

/* Clear Modal */
.clear-modal-content {
    max-width: 350px;
    text-align: center;
}

.clear-confirm-text {
    margin-bottom: 20px;
}

/* Pricing Modal */
.support-link-wrapper {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    font-size: 0.85rem;
    color: #888;
}

/* Welcome Modal */
.welcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.welcome-title-style {
    color: var(--accent-yellow);
    margin-bottom: 0px;
}

.welcome-icon-style {
    margin-bottom: 0;
}

.gold-box-style {
    background: rgba(255, 215, 0, 0.1);
    border: 1px dashed #FFD700;
    padding: 10px;
    margin: 15px 0;
    border-radius: 8px;
}

.gold-box-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.gold-title-style {
    color: #FFD700;
    text-transform: uppercase;
}

.gold-text-style {
    font-size: 0.9rem;
    margin: 0;
    color: #eee;
}

.welcome-conversion-text {
    color: var(--accent-turquoise);
    font-weight: bold;
    margin-top: 15px;
}

.welcome-close-btn {
    margin-top: 20px;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

/* Diary Modal */
.diary-modal-content {
    width: 70%;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: column;
}

.diary-title-header {
    color: var(--accent-turquoise);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.diary-body-content {
    flex: 1;
    overflow-y: auto;
    text-align: left;
    padding: 20px 30px;
}

/* Checkout Modal */
.checkout-modal-content {
    max-width: 500px;
}

.checkout-modal-title {
    text-align: center;
}

.sign-label-margin {
    margin-top: 10px;
}

.email-input-group {
    margin-bottom: 5px;
}

.email-input-wrapper {
    margin-bottom: 15px;
}

.email-input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #222;
    color: white;
}

.privacy-text {
    font-size: 0.7rem;
    color: #888;
    margin-top: 5px;
    text-align: left;
}

.privacy-link {
    color: #00f0ff;
}

.stripe-logo-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

.stripe-logo {
    height: 25px;
    opacity: 0.9;
}

.payment-error-msg {
    color: #ff4d4d;
    margin-top: 10px;
    text-align: center;
}

.pay-btn-wrapper {
    width: 100%;
    margin-top: 20px;
}

/* Display Utilities */
.hidden {
    display: none !important;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

/* JS Dynamic Classes (Winner Modals) */
.text-center {
    text-align: center;
}

.gold-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 1s infinite alternate;
}

.silver-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 1s infinite alternate;
    filter: grayscale(100%) contrast(1.2);
}

.gold-title {
    color: #FFD700;
    margin-bottom: 15px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    text-shadow: 0 0 20px #FFD700;
    font-size: 1.5rem;
}

.silver-title {
    color: #C0C0C0;
    margin-bottom: 15px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    text-shadow: 0 0 20px #C0C0C0;
    font-size: 1.5rem;
}

.winner-msg {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.winner-info {
    margin-bottom: 20px;
    color: #ccc;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 10px 0;
}

.gold-text {
    color: #FFD700;
}

.silver-text {
    color: #C0C0C0;
}

.gold-box-container {
    background: rgba(255, 215, 0, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px dashed #FFD700;
    margin-bottom: 15px;
}

.silver-box-container {
    background: rgba(192, 192, 192, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px dashed #C0C0C0;
    margin-bottom: 15px;
}

.gold-label {
    display: block;
    margin-bottom: 10px;
    color: #FFD700;
    font-size: 1rem;
    font-weight: bold;
}

.silver-label {
    display: block;
    margin-bottom: 10px;
    color: #C0C0C0;
    font-size: 1rem;
    font-weight: bold;
}

.sign-instr {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 15px;
}

.winner-input {
    width: 80%;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #555;
    font-family: inherit;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1rem;
    color: white;
    background: #000;
    font-weight: bold;
}

.winner-input:focus {
    outline: none;
}

.winner-input-gold:focus {
    border-color: #FFD700;
}

.winner-input-silver:focus {
    border-color: #C0C0C0;
}

.btn-gold {
    background: linear-gradient(135deg, #FFD700, #ff8c00);
    color: black;
    width: 100%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    font-weight: bold;
    border: none;
}

.btn-silver {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: black;
    width: 100%;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3);
    font-weight: bold;
    border: none;
}

.skip-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

/* --- CHECKOUT SUCCESS MODAL (Generic) --- */
.checkout-success-icon {
    font-size: 3rem;
    color: #4dff88;
    margin-bottom: 10px;
}

.checkout-success-msg {
    margin-bottom: 20px;
}

.checkout-sign-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px dashed var(--accent-purple);
    margin-bottom: 15px;
}

.checkout-sign-label {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-turquoise);
    font-size: 1rem;
    font-weight: bold;
}

.checkout-sign-instr {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 15px;
}

.checkout-sign-btn {
    background: var(--accent-purple);
    width: 100%;
    box-shadow: 0 4px 15px rgba(120, 0, 200, 0.4);
}

/* Winner Popup Labels */
.winner-popup {
    position: fixed;
    transform: translate(-50%, -100%);
    background: rgba(20, 25, 35, 0.95);
    backdrop-filter: blur(5px);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--accent-turquoise);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent-turquoise);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 9999;
    animation: popupIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    white-space: nowrap;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@keyframes popupIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -100%) scale(1);
    }
}

/* Diary Link Styling */
.diary-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent-orange);
    font-weight: 700;
    text-decoration: underline;
    font-size: 0.9rem;
}

.diary-link:hover {
    color: var(--accent-yellow);
    filter: brightness(1.2);
}

/* Beta Warning Banner */


/* --- Lightbox Styles --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95) !important;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    backdrop-filter: blur(20px) !important;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 3001;
}

/* --- Wall Stats HUD (Below Canvas Board) --- */
.wall-stats-hud {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 5;
    /* Below main app mods but above canvas */
    white-space: nowrap;
    text-transform: uppercase;
}

.stat-cell {
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-left {
    text-align: left;
}

.stat-center {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 10px;
}

.stat-right {
    text-align: right;
}

@media (max-width: 768px) {
    .wall-stats-hud {
        font-size: 9px;
    }

    .stat-center {
        padding: 0 5px;
    }
}

/* Footer Legal Information (Google Ads Compliance) */
.footer-legal {
    position: fixed;
    bottom: 5px;
    right: 15px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 400;
    text-align: right;
    pointer-events: none;
    line-height: 1.4;
    font-family: var(--font-body);
}

.footer-legal a {
    pointer-events: auto;
    text-decoration: underline;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .footer-legal {
        bottom: 75px;
        /* Stay above tools */
        right: 10px;
        font-size: 0.6rem;
        text-align: center;
        width: 100%;
        left: 0;
        right: 0;
    }
}