/* PixelVerse Game Styles */

:root {
    --bg-dark: #2e222f;
    --bg-medium: #1e1824;
    --text-color: #ffffff;
    --accent-color: #42f5e0;
    --error-color: #ff5959;
    --primary-visual-accent: #C700C7; /* Softer Magenta */
    --secondary-visual-accent: #D4C037; /* Softer Gold/Yellow */
    --tertiary-visual-accent: #00A0A0; /* Softer Cyan */
    --quaternary-visual-accent: #005F9C; /* Softer Electric Blue */
}

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

html {
    /* Prevent pull-to-refresh and overscroll behaviors */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-color);
    overflow: hidden;
    position: relative;
    width: 100vw;
    height: 100vh;
    /* Mobile viewport optimizations */
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    min-height: -webkit-fill-available; /* Safari mobile support */
    /* Prevent pull-to-refresh and overscroll behaviors */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-container > * {
    pointer-events: auto;
}

#color-palette {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-medium);
    border-radius: 6px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(16, 20px);
    grid-template-rows: repeat(4, 20px);
    grid-gap: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    width: auto;
    overflow: hidden;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 0;
    cursor: pointer;
}

.color-swatch:hover {
    z-index: 1;
}

.color-swatch.selected {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--accent-color);
}

.color-swatch.equipped {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #C700C7;
    position: relative;
}

.color-swatch.equipped::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #C700C7;
    border-radius: 50%;
    top: -3px;
    right: -3px;
    border: 1px solid white;
}

.color-swatch.selected.equipped {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #9c44ff;
}

#whisper-popup {
    position: absolute;
    padding: 8px 12px;
    background-color: var(--bg-medium);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transform: translate(-50%, -110%);
    font-size: 14px;
    z-index: 100;
}

#cooldown-timer {
    display:none !important; /* replaced by central toast */
}

/* Main Menu Styles */
#main-menu {
    /* Styles moved to cyberpunk-menu.css for consistency */
    animation: fadeIn 0.3s ease-in-out;
}

#main-menu.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.menu-container {
    /* Styles moved to cyberpunk-menu.css for consistency */
    background-color: #000000;
}

.menu-container h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 24px;
    color: var(--text-color);
    background-color: transparent;
    padding: 5px;
    border-radius: 0;
    border: none;
    text-shadow: none;
}

/* Animated PixelVerse Title */
h2.pixelverse-title { 
    text-align: center;
    font-size: 32px; /* Slightly smaller than standalone for menu integration */
    font-variant: small-caps;
    font-weight: bold; 
    padding: 10px 0px; 
    border: none; 
    background: transparent; 
    color: transparent; /* Letters initially invisible */
    text-shadow: none; 
    letter-spacing: 3px; /* Spacing for effect */
    cursor: default; 
    height: 1.8em; /* Ensure clickable area */
    line-height: 1.8em;
    margin-bottom: 15px;
    
    /* Animation timing variables */
    --letter-animation-duration: 0.7s; 
    --letter-persistence-duration: 2s;
    --secondary-visual-accent: #D4C037; /* Softer Gold/Yellow for title text */
    --secondary-visual-accent-glow: rgba(212, 192, 55, 0.6);
    --square-flash-color: #FFC300; /* Bright Gold for square flash */
    --square-flash-glow: rgba(255, 195, 0, 0.8);
}

/* Styling for individual letters in the title */
h2.pixelverse-title .title-letter {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    position: relative; 
    width: 1.2em;  
    height: 1.2em; 
    
    opacity: 0; /* Initially hidden */
    transform: scale(0.7) translateY(4px); 
    color: var(--secondary-visual-accent); /* Final letter color */
    background-color: transparent;
    border: 1px solid transparent; 
    box-shadow: none;
    text-shadow: none; 
    
    /* This transition handles the fade-out when 'is-visible' is removed */
    transition: opacity 0.3s 0.1s ease-out, 
                transform 0.3s ease-out,
                background-color 0.2s ease-out, border-color 0.2s ease-out,
                box-shadow 0.2s ease-out, color 0.2s ease-out;
}

h2.pixelverse-title .title-letter.play-reveal {
    /* This class triggers the animation */
    animation: revealSquareThenLetter var(--letter-animation-duration) forwards ease-in-out;
}

h2.pixelverse-title .title-letter.is-visible {
    /* This class, managed by JS, keeps the letter visible after animation/persistence */
    opacity: 1;
    transform: scale(1) translateY(0);
    background-color: transparent; 
    border-color: transparent;
    box-shadow: none;
    color: var(--secondary-visual-accent); 
    text-shadow: 0 0 12px var(--secondary-visual-accent-glow); /* Final letter glow */
}

@keyframes revealSquareThenLetter {
    0% { /* Start appearing as a small square */
        opacity: 0.5;
        transform: scale(0.7) translateY(4px);
        background-color: rgba(255, 195, 0, 0.15); 
        border: 1px solid rgba(255, 195, 0, 0.6);
        box-shadow: 0 0 5px 1px rgba(255, 195, 0, 0.4); 
        color: transparent;
    }
    40% { /* Fully formed, glowing square */
        opacity: 1;
        transform: scale(1.1) translateY(0);
        background-color: rgba(255, 195, 0, 0.25); 
        border: 1px solid var(--square-flash-color);
        box-shadow: 0 0 10px 3px var(--square-flash-glow); 
        color: transparent;
    }
    60% { /* Hold square briefly, start transition to letter */
        opacity: 1;
        transform: scale(1.05) translateY(0); 
        background-color: rgba(255, 195, 0, 0.15); 
        border: 1px solid var(--square-flash-color); 
        box-shadow: 0 0 7px 2px var(--square-flash-glow); 
        color: transparent;
    }
    100% { /* Fully letter */
        opacity: 1;
        transform: scale(1) translateY(0);
        background-color: transparent;
        border-color: transparent;
        box-shadow: none;
        color: var(--secondary-visual-accent); 
        text-shadow: 0 0 12px var(--secondary-visual-accent-glow); 
    }
}

/* Menu header with buttons */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.menu-left-buttons, .menu-right-buttons {
    display: flex;
    gap: 10px;
}

.menu-left-buttons button, .menu-right-buttons button {
    width: 40px;
    height: 40px;
    padding: 5px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    background-color: var(--bg-medium);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-left-buttons button:hover, .menu-right-buttons button:hover {
    background-color: var(--accent-color);
    color: #000000;
}

.menu-container h3 {
    margin: 10px 0 10px;
    color: var(--text-color);
    font-size: 18px;
    background-color: transparent;
    padding: 5px;
    border-radius: 0;
    border: none;
    text-shadow: none;
}

#login-section {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

#login-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    gap: 8px;
    padding-left: 15px; /* Add padding to prevent button from touching edge */
}

#xp-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 1;
}

/* Nickname Section Styling */
#nickname-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 4px;
    min-width: 120px;
}

#nickname-input {
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #42f5e0;
    border-radius: 3px;
    color: white;
    font-size: 12px;
    padding: 4px 6px;
    text-align: center;
    width: 100px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#nickname-input:focus {
    outline: none;
    border-color: #66f9f9;
    box-shadow: 0 0 5px rgba(66, 245, 224, 0.4);
}

#nickname-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

#current-nickname {
    font-size: 11px;
    color: #ffffff;
    font-style: italic;
    text-align: center;
    margin-top: 2px;
}

/* XP Bar Styling */
.xp-bar-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 200px;
}

.xp-level-text {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
    text-shadow: 0 0 4px rgba(66, 245, 224, 0.5);
    margin-bottom: 2px;
}

.xp-bar-background {
    position: relative;
    width: 200px;
    height: 3px;
    background: #000000;
    border: 1px solid #42f5e0;
    border-radius: 2px;
    overflow: hidden;
}

.xp-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(66, 245, 224, 0.8) 0%, 
        rgba(66, 245, 224, 1) 50%, 
        rgba(66, 245, 224, 0.8) 100%);
    transition: width 0.3s ease-out;
    box-shadow: 0 0 4px rgba(66, 245, 224, 0.6);
    
    /* Subtle animated shimmer effect */
    background-size: 200% 100%;
    animation: xp-shimmer 2s ease-in-out infinite;
}

@keyframes xp-shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.xp-bar-text {
    display: none; /* Hide internal XP text */
}

.xp-access-text {
    font-size: 12px;
    color: var(--accent-color); /* Use accent color for consistency */
    font-style: italic;
    margin-top: 2px;
}

/* XP Gain Feedback Animation */
.xp-gain-indicator {
    position: fixed;
    font-size: 14px;
    font-weight: bold;
    color: #55ff55;
    text-shadow: 0 0 4px rgba(85, 255, 85, 0.8);
    pointer-events: none;
    z-index: 1000;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
    opacity: 1;
}

/* XP Gain Feedback at Selector Position */
.xp-gain-selector {
    position: fixed;
    font-size: 12px;
    font-weight: bold;
    color: #55ff55;
    text-shadow: 0 0 3px rgba(85, 255, 85, 0.8);
    pointer-events: none;
    z-index: 1000;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
    opacity: 1;
}

/* Level Requirement Notification */
.level-requirement-notification {
    position: fixed;
    background: linear-gradient(135deg, 
        rgba(20, 20, 30, 0.95) 0%, 
        rgba(40, 20, 20, 0.95) 100%);
    border: 2px solid #ff5555;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-width: 200px;
}

.level-requirement-notification.visible {
    opacity: 1;
    transform: translateY(0);
}

.level-requirement-notification.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.requirement-icon {
    font-size: 20px;
    color: #ff5555;
    text-shadow: 0 0 4px rgba(255, 85, 85, 0.6);
}

.requirement-text {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.3;
}

.requirement-text strong {
    color: #ff5555;
    font-weight: bold;
}

.current-level {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* Access Indicators for Quadrants */
.access-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* Responsive Design for XP Bar */
@media screen and (max-width: 768px) {
    /* Reduce PixelVerse title size by 50% on mobile */
    h2.pixelverse-title {
        font-size: 16px !important;
        letter-spacing: 2px !important;
        padding: 5px 0px !important;
        height: 1.2em !important;
    }
    
    /* Fix login section layout for mobile */
    #login-section {
        flex-direction: column !important;
    gap: 15px;
    align-items: center;
        margin-bottom: 15px;
    }
    
    #login-container, #nickname-container {
        align-items: center;
        width: 100%;
        padding-left: 0;
        flex: none !important;
        text-align: center;
    }
    
    #login-container {
        order: 1;
    }
    
    #nickname-container {
        order: 2;
    }
    
    /* Move XP container to separate row */
    #xp-container {
        order: 3;
        width: 100%;
        align-items: center;
        flex: none !important;
        margin-top: 10px;
        text-align: center;
    }
    
    .xp-bar-container {
        align-items: center;
        min-width: 180px;
    }
    
    .xp-bar-background {
        width: 180px;
        height: 14px;
    }
    
    .xp-bar-text {
        font-size: 10px;
    }
    
    /* Improve Google Sign-in button on mobile */
    #google-signin-container {
        max-width: 220px;
        width: 100%;
    }
    
    .level-requirement-notification {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(10px);
        min-width: 250px;
    }
    
    .level-requirement-notification.visible {
        transform: translateX(-50%) translateY(0);
    }
    
    .level-requirement-notification.fade-out {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Enhanced Login Status Styling */
#login-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: left;
    margin: 0;
}

#login-status strong {
    color: var(--accent-color);
    text-shadow: 0 0 2px rgba(66, 245, 224, 0.3);
}

/* Improved Google Sign-in Container */
#google-signin-container {
    width: 100%;
    max-width: 200px; /* Increased from 180px for better button spacing */
    margin: 0;
}

/* Google Sign-In Button customization */
.g_id_signin {
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-dark);
}

.g_id_signin div {
    background-color: var(--bg-medium) !important;
}

.google-login-button {
    background-color: #4285F4;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.google-login-button:hover {
    background-color: #357ae8;
}

.google-login-button:active {
    background-color: #2a67c6;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 10px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#avatar-editor-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

#avatar-editor-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto;
    width: 100%;
    height: 192px;
    box-sizing: border-box;
}

#avatar-editor-canvas {
    width: 192px !important;
    height: 192px !important;
    background-color: rgba(0, 0, 0, 0.2);
    image-rendering: pixelated;
    border: 2px solid #C700C7; /* Magenta border for avatar section */
    border-radius: 4px;
    position: relative;
    box-sizing: border-box;
}

#avatar-color-palette {
    display: none;
}

#help-section {
    margin-bottom: 5px;
}

#help-section ul {
    list-style-type: none;
    padding-left: 5px;
    columns: 3;
    column-gap: 20px;
}

#help-section li {
    margin-bottom: 4px;
    font-size: 11px;
    break-inside: avoid;
}

/* Secret hint text for Easter eggs */
.secret-hint {
    font-size: 11px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 15px;
    font-family: serif;
    letter-spacing: 0.5px;
}

button {
    background-color: var(--accent-color);
    color: #00A0A0; /* Cyan text color for buttons */
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #5affe6;
}

button:active {
}

button:disabled {
    background-color: #4a5a5a;
    color: #888;
    cursor: not-allowed;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: var(--bg-medium);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    font-family: sans-serif;
    font-size: 14px;
}

.notification.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.info {
    border-left: 4px solid var(--accent-color);
}

.notification.success {
    border-left: 4px solid #55ff55;
}

.notification.warning {
    border-left: 4px solid #ffff55;
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.hidden {
    display: none !important;
}

/* Color Inventory Section */
#color-inventory-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33.3%;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

#color-inventory-container {
    display: grid;
    grid-template-columns: repeat(8, 24px);
    grid-template-rows: repeat(8, 24px);
    width: 192px;
    height: 192px;
    grid-gap: 0;
    padding: 0;
    background-color: var(--bg-dark);
    border-radius: 4px;
    margin: 10px auto;
    overflow: hidden;
    border: 2px solid #42f5e0; /* Original accent color for inventory section */
}

.inventory-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.inventory-controls button {
    min-width: 80px;
    font-size: 14px;
    padding: 6px 16px;
}

#color-inventory-container .color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

#color-inventory-container .color-swatch:hover {
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 8px rgba(66, 245, 224, 0.4);
    border-color: rgba(66, 245, 224, 0.6);
    transform: scale(1.05);
}

#color-inventory-container .color-swatch.selected {
    box-shadow: 
        inset 0 0 0 2px #42f5e0,
        0 0 12px rgba(66, 245, 224, 0.8),
        0 0 0 1px rgba(66, 245, 224, 0.3);
    border-color: #42f5e0;
    transform: scale(1.1);
}

#color-inventory-container .color-swatch.selected:hover {
    box-shadow: 
        inset 0 0 0 2px #42f5e0,
        0 0 16px rgba(66, 245, 224, 1),
        0 0 0 1px rgba(66, 245, 224, 0.5);
}

#color-inventory-container .color-swatch.dragging {
    opacity: 0.7;
    cursor: grabbing;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(66, 245, 224, 0.6);
}

/* Empty inventory slots */
#color-inventory-container .color-swatch.empty-slot {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    cursor: default;
}

#color-inventory-container .color-swatch.empty-slot:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.5);
    transform: none;
    box-shadow: none;
}

/* Drop zone for destroying colors */
#color-drop-zone {
    display: none;
}

/* Confirmation dialog styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-overlay.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.confirmation-dialog {
    background-color: var(--bg-medium);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    width: 420px;
    max-width: 80%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.confirmation-dialog h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.confirmation-dialog p {
    margin: 0 0 14px 0;
    line-height: 1.5;
    font-size: 16px;
}

.confirmation-dialog .color-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin: 10px auto;
    border: 1px solid white;
}

.dialog-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.dialog-buttons button.cancel {
    background-color: #555;
}

.dialog-buttons button.confirm {
    background-color: var(--error-color);
}

/* New menu layout for side-by-side sections */
.menu-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 15px;
}

#avatar-editor-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33.3%;
    min-width: 160px;
}

.avatar-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.avatar-controls, .inventory-controls, .whisper-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

/* Whisper section styling */
#whisper-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33.3%;
    min-width: 160px;
}

#whisper-container {
    display: flex;
    flex-direction: column;
    width: 192px;
    gap: 10px;
    padding: 10px;
    background-color: var(--bg-dark);
    border-radius: 4px;
    margin: 10px auto;
    border: 2px solid #D4C037; /* Gold border for whisper section */
    height: 192px;
    box-sizing: border-box;
}

#whisper-input {
    width: 100%;
    height: 142px;
    padding: 8px;
    background-color: var(--bg-medium);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    resize: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    overflow-y: auto;
    font-family: Arial, sans-serif;
}

#whisper-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.whisper-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    width: 100%;
}

#send-whisper-button {
    min-width: 80px;
    font-size: 14px;
    padding: 6px 16px;
}

#whisper-cooldown {
    text-align: center;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
}

/* Style for active whispers in the macro world */
.whisper-stamp {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 50;
    animation: fadeIn 0.3s ease-in-out;
}

/* No longer needed - styling is done directly in canvas */
.whisper-stamp .whisper-text {
    padding: 0;
    border: none;
    background: none;
    white-space: nowrap;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Ensure all section titles are aligned */
.menu-layout h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    width: 100%;
    color: var(--text-color);
    background-color: transparent;
    border: none;
    text-shadow: none;
}

/* Cyberpunk Section Titles */
.menu-layout h3 {
    /* Override the basic styling with cyberpunk effects */
    font-variant: small-caps;
    font-size: 18px;
    font-weight: bold;
    color: #00E5E5; /* Vibrant Teal matching buttons */
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    width: 100%;
    background-color: transparent;
    border: none;
    user-select: none;
    
    /* Enhanced glow effect for titles - more impactful than buttons */
    text-shadow: 
        0 0 6px rgba(0, 229, 229, 0.8),   /* Strong inner glow */
        0 0 12px rgba(0, 229, 229, 0.6),  /* Medium outer glow */
        0 0 18px rgba(0, 229, 229, 0.4),  /* Soft far glow */
        0 0 2px rgba(200, 255, 255, 0.5), /* Sharp highlight */
        -1px -1px 0 #000,                 /* Text outline */
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    
    /* Subtle hover effect for interactivity */
    transition: color 0.3s ease-out, text-shadow 0.3s ease-out;
    cursor: default;
}

/* Subtle hover effect for section titles */
.menu-layout h3:hover {
    color: #60FFFF; /* Brighter teal on hover */
    text-shadow: 
        0 0 8px rgba(96, 255, 255, 0.9),   /* Stronger inner glow */
        0 0 15px rgba(96, 255, 255, 0.7),  /* Enhanced outer glow */
        0 0 22px rgba(96, 255, 255, 0.5),  /* Extended far glow */
        0 0 3px rgba(224, 255, 255, 0.6),  /* Brighter highlight */
        -1px -1px 0 #000,                  /* Text outline */
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

/* Make sure all the controls are aligned properly */
.avatar-controls, .inventory-controls, .whisper-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
    width: 100%;
}

/* Help dialog styles */
#help-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

#help-dialog.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.help-dialog-content {
    background-color: #000000;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    border: 1px solid var(--accent-color);
}

.help-dialog-content h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

.help-dialog-content h3 {
    color: var(--accent-color);
    margin-bottom: 12px;
    font-size: 18px;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 5px;
}

.help-dialog-content h4 {
    color: #ffffff;
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Help dialog columns - responsive layout */
.help-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.help-column {
    flex: 1;
    min-width: 250px;
}

.help-column h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
    font-size: 14px;
}

.help-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-column li {
    margin-bottom: 8px;
    padding: 4px 0;
    font-size: 12px;
    line-height: 1.4;
}

.help-column strong {
    color: #4fc3f7;
}

/* Responsive adjustments for help dialog */
@media screen and (max-width: 768px) {
    .help-columns {
        flex-direction: column;
        gap: 15px;
    }
    
    .help-column {
        min-width: auto;
    }
    
    .help-column h3 {
        font-size: 16px;
    }
    
    .help-column li {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .help-dialog-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* Dialog buttons */
.dialog-buttons {
    text-align: center;
    margin-top: 20px;
}

#close-help-dialog {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#close-help-dialog:hover {
    background-color: var(--accent-color);
    color: black;
}

/* Quadrant Info Display */
#quadrant-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid var(--accent-color);
    pointer-events: none; /* Allow clicks through */
    transition: opacity 0.3s ease-in-out;
    z-index: 50;
}

.entry-message {
    font-size: 14px;
    font-style: italic;
    color: #ffffff;
    margin-top: 4px;
}

.game-ui-element {
    pointer-events: none;
}

/* Color found dialog specific styles */
.color-found-dialog {
    border-width: 3px;
    animation: pulse 1.5s infinite alternate;
}

.color-found-dialog .color-preview {
    width: 60px;
    height: 60px;
    margin: 15px auto;
    border-radius: 50%;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    }
}

.confirmation-dialog.donation-dialog {
    border-color: var(--text-color-main); /* Use the teal accent color from pixel-buttons.css */
}

.confirmation-dialog.donation-dialog h4 {
    color: var(--text-color-main);
    margin-bottom: 15px;
}

.confirmation-dialog.donation-dialog p {
    margin-bottom: 10px;
    line-height: 1.4;
}

.donation-dialog .dialog-buttons .confirm {
    background-color: transparent; /* Override the red color */
}

/* Chat Window */
#chat-window {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    height: 200px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    z-index: 50;
    pointer-events: none; /* Allow clicks through */
}

#chat-messages {
    height: 100%;
    padding: 8px;
    overflow-y: auto;
    font-size: 12px;
    font-family: Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.3;
}

.chat-message {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.chat-username {
    color: var(--accent-color);
    font-weight: bold;
}

.chat-text {
    color: var(--text-color);
}

/* Custom scrollbar for chat */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #5affe6;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* Pure black */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 2s ease-out;
    padding: 40px;
    box-sizing: border-box;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Onboarding Text Container */
.lore-container {
    max-width: 800px;
    text-align: center;
    margin-top: 20px;
}

.lore-text {
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: #ffffff;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    margin-bottom: 25px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.3px;
    font-weight: 400;
}

.lore-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.lore-text.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Welcome title styling */
.lore-title {
    font-family: 'Arial', sans-serif;
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    text-shadow: 0 0 15px var(--accent-color);
    letter-spacing: 1px;
}

.lore-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Help hint styling */
.help-hint {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 40px;
    opacity: 0;
    transition: opacity 1s ease-out;
    font-style: italic;
}

.help-hint.visible {
    opacity: 1;
}

/* Loading container and progress bar */
.loading-container {
    margin-top: 40px;
    width: 100%;
    max-width: 400px;
    opacity: 0;
    transition: opacity 1s ease-out;
}

.loading-container.visible {
    opacity: 1;
}

.loading-text {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 8px var(--accent-color);
}

.loading-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--accent-color) 0%, 
        rgba(13, 211, 211, 0.8) 50%, 
        var(--accent-color) 100%);
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px var(--accent-color);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { 
        box-shadow: 0 0 5px var(--accent-color); 
    }
    50% { 
        box-shadow: 0 0 15px var(--accent-color), 0 0 25px rgba(13, 211, 211, 0.5); 
    }
    100% { 
        box-shadow: 0 0 5px var(--accent-color); 
    }
}

/* Skip hint styling */
.skip-hint {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    opacity: 0;
    transition: opacity 1s ease-out;
    font-style: italic;
}

.skip-hint.visible {
    opacity: 1;
}

/* Responsive adjustments for loading screen */
@media screen and (max-width: 768px) {
    #loading-screen {
        padding: 20px;
    }
    
    .lore-text {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .lore-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
}

@media screen and (max-width: 480px) {
    .lore-text {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .lore-title {
        font-size: 20px;
    }
}

/* Mobile and Touch Styles */

/* Mobile portrait mode optimizations */
@media screen and (orientation: portrait) and (max-width: 768px) {
    .menu-container {
        width: 95vw;
        max-height: 90vh;
        padding: 10px;
    }
    
    .menu-layout {
        flex-direction: column;
        gap: 15px;
    }
    
    #avatar-editor-section,
    #color-inventory-section,
    #whisper-section {
        width: 100%;
        min-width: auto;
    }
    
    #color-palette {
        bottom: 10px;
        grid-template-columns: repeat(8, 28px);
        grid-template-rows: repeat(8, 28px);
        padding: 8px;
    }
    
    #color-palette .color-swatch {
        width: 28px !important;
        height: 28px !important;
    }
}

/* Mobile touch optimizations */
@media screen and (max-width: 768px) {
    /* Prevent text selection and touch callouts */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Make buttons larger for touch */
    .pixel-action-button {
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 8px 12px !important;
    }
    
    /* Improve menu button spacing */
    .menu-right-buttons button,
    .menu-left-buttons button {
        margin: 0 4px !important;
    }
    
    /* Make color palette touch-friendly */
    #color-palette .color-swatch {
        width: 32px !important;
        height: 32px !important;
        margin: 2px !important;
    }
    
    /* Improve color inventory for touch */
    .color-inventory-grid .color-item {
        width: 36px !important;
        height: 36px !important;
        margin: 2px !important;
    }
    
    /* Make text input larger */
    #whisper-input {
        font-size: 16px !important;
        padding: 8px !important;
        min-height: 44px !important;
    }
    
    /* Improve chat visibility */
    #chat-window {
        max-height: 150px !important;
        font-size: 14px !important;
    }
    
    /* Make game info more readable */
    #game-info-display {
        font-size: 12px !important;
        padding: 8px !important;
        min-width: 200px !important;
        max-width: 250px !important;
    }
    
    /* Canvas touch behavior */
    #game-canvas {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
    
    /* Prevent intersection on very small screens */
    @media screen and (max-width: 600px) {
        #game-info-display {
            min-width: 180px !important;
            max-width: 200px !important;
            font-size: 11px !important;
            padding: 6px !important;
        }
        
        #chat-window {
            width: 250px !important;
            height: 150px !important;
            top: 10px !important;
            right: 10px !important;
        }
    }
    
    /* Portrait mode specific adjustments */
    @media screen and (orientation: portrait) {
        .menu-container {
            width: 95vw;
            max-width: 95vw;
        }
        
        .menu-header {
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .menu-left-buttons,
        .menu-right-buttons {
            order: 2;
        }
        
        h2.pixelverse-title {
            order: 1;
            width: 100%;
            margin-bottom: 10px;
            text-align: center;
        }
        
        #cooldown-timer {
            top: 10px;
            right: 10px;
            font-size: 14px;
            padding: 6px 12px;
        }
        
        #quadrant-info {
            top: 10px;
            left: 10px;
            font-size: 12px;
            max-width: 60%;
        }
    }
}

/* Touch feedback styles */
.touch-feedback {
    position: fixed;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    animation: touch-ripple 0.3s ease-out;
}

@keyframes touch-ripple {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
    }
    100% {
        width: 40px;
        height: 40px;
        opacity: 0;
    }
}

/* Unified touch feedback styles */
.paint-hold-progress {
    position: fixed;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(66, 245, 224, 0.3);
    border-top: 3px solid #42f5e0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    animation: paint-progress linear;
}

@keyframes paint-progress {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg) scale(0.5); 
        opacity: 0; 
    }
    10% { opacity: 1; }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg) scale(1); 
    }
}

.paint-success {
    position: fixed;
    font-size: 28px;
    pointer-events: none;
    z-index: 1001;
    transform: translate(-50%, -50%);
    animation: paint-success 1s ease-out forwards;
}

@keyframes paint-success {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1) translateY(-30px); opacity: 0; }
}

.touch-ripple {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    animation: touch-ripple-new 0.3s ease-out;
}

@keyframes touch-ripple-new {
    0% { width: 20px; height: 20px; opacity: 1; }
    100% { width: 60px; height: 60px; opacity: 0; }
}

/* Movement Indicator Styles */
.movement-indicator-circle {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(66, 245, 224, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    background-color: rgba(66, 245, 224, 0.1);
}

.movement-indicator-arrow {
    position: fixed;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid rgba(66, 245, 224, 0.95);
    pointer-events: none;
    z-index: 1001;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
    /* Neon glow */
    filter: drop-shadow(0 0 8px #42f5e0) drop-shadow(0 0 16px #42f5e0cc);
}

/* Admin Shield Color Styles */
.admin-shield-color {
    /* Remove all special styling - make it look like a normal color swatch */
}

.admin-shield-color::after {
    /* Remove the shield emoji indicator */
    display: none;
}

.admin-shield-color.selected {
    /* Use normal selection styling */
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--accent-color);
}

.admin-shield-color.equipped {
    /* Use normal equipped styling */
    box-shadow: 0 0 0 2px white, 0 0 0 4px #C700C7;
}

.admin-shield-color.equipped::after {
    /* Use normal equipped indicator */
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #C700C7;
    border-radius: 50%;
    top: -3px;
    right: -3px;
    border: 1px solid white;
}

.admin-shield-color.selected.equipped {
    /* Use normal selected+equipped styling */
    box-shadow: 0 0 0 2px white, 0 0 0 4px #9c44ff;
}

@keyframes admin-glow {
    /* Remove the glow animation */
}

/* UI Toggle Classes */
.ui-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease;
}

.ui-visible {
    opacity: 1.0 !important;
    pointer-events: none !important; /* Keep clickthrough */
    transition: opacity 0.3s ease;
}

/* Info toggle button active state */
#info-toggle-button.ui-active .button-text {
    color: var(--text-color-main-hover);
    text-shadow: 0 0 6px var(--text-color-main-hover-glow), 
                0 0 10px var(--text-color-main-hover-glow), 
                0 0 2px rgba(224, 255, 255, 0.5),
                -1px -1px 0 #000,  
                1px -1px 0 #000,
                -1px 1px 0 #000,
                1px 1px 0 #000;
}

/* Level Up Dialog Styling */
.level-up-dialog {
    border: 3px solid #42f5e0 !important;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(20, 20, 20, 0.95));
    box-shadow: 0 0 30px rgba(66, 245, 224, 0.5);
    animation: levelUpPulse 0.6s ease-out;
}

.level-up-dialog h4 {
    color: #42f5e0;
    text-shadow: 0 0 10px rgba(66, 245, 224, 0.8);
    font-size: 24px;
    margin-bottom: 15px;
}

.level-up-dialog .level-preview {
    animation: levelUpSpin 1s ease-out;
    box-shadow: 0 0 20px rgba(66, 245, 224, 0.6);
}

.level-up-dialog .dialog-buttons .confirm {
    background: linear-gradient(45deg, #42f5e0, #2aa89a);
    color: #000;
    font-weight: bold;
    border: 2px solid #42f5e0;
    text-shadow: none;
}

.level-up-dialog .dialog-buttons .confirm:hover {
    background: linear-gradient(45deg, #0d4e46, #42f5e0);
    box-shadow: 0 0 15px rgba(66, 245, 224, 0.8);
}

@keyframes levelUpPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes levelUpSpin {
    0% {
        transform: rotate(0deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

/* Quest Completion Dialog Styles */
.quest-completion-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.quest-completion-content {
    background: #000000 !important; /* unified black background matching erase-color dialog */
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: levelUpPulse 0.6s ease-out;
}

.quest-completion-header h2 {
    color: var(--accent-color);
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(66, 245, 224, 0.5);
}

.quest-completion-body h3 {
    color: #ffffff;
    font-size: 22px;
    margin-bottom: 15px;
}

.quest-completion-body p {
    color: #cccccc;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.quest-rewards {
    background-color: rgba(66, 245, 224, 0.1);
    border: 1px solid rgba(66, 245, 224, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.quest-rewards h4 {
    color: var(--accent-color);
    font-size: 18px;
    margin-bottom: 10px;
}

.quest-rewards p {
    color: #ffffff;
    font-size: 16px;
    margin: 5px 0;
}

.quest-completion-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2aa89a 100%);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 245, 224, 0.3);
}

.quest-completion-btn:hover {
    background: linear-gradient(135deg, #2aa89a 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 245, 224, 0.4);
}

.quest-completion-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(66, 245, 224, 0.3);
}

/* Settings Modal Overlay */
#settings-modal.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#settings-modal.hidden { display: none; }
#settings-modal .confirmation-dialog {
    background: var(--bg-medium);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 28px 32px 24px 32px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 4px 32px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
#settings-modal h3 {
    color: var(--accent-color);
    font-size: 22px;
    margin-bottom: 18px;
    text-align: center;
}
#settings-modal label {
    font-size: 16px;
    margin-bottom: 8px;
}
#settings-modal .pixel-action-button {
    margin-top: 10px;
    font-size: 16px;
    width: 100%;
}

/* NPC Dialogue vertical buttons */
.npc-dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.npc-dialogue-option {
    position: relative;
    padding-left: 32px;         /* leave room for arrow icon */
}

.npc-dialogue-option::before {
    content: '►';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-color);
    font-size: 14px;
    transition: transform 0.2s ease;
}

.npc-dialogue-option:hover::before {
    transform: translateY(-50%) translateX(4px);
}

.npc-dialogue-option:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* Quest selection styling */
.quest-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.quest-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quest-item::before {
    content: '🖌️';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}

.quest-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.quest-item.available {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(66,245,224,0.17) 0%, rgba(66,245,224,0.05) 100%);
}

.quest-item.active {
    border-color: #ffc107;
    background: linear-gradient(135deg, rgba(255,193,7,0.22) 0%, rgba(255,193,7,0.05) 100%);
}

.quest-item.completed {
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76,175,80,0.22) 0%, rgba(76,175,80,0.05) 100%);
}

.quest-item.claimed {
    border-color: #888;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, rgba(0,0,0,0.08) 12px 24px);
}

.quest-item.locked {
    border-color: #666;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 10px, rgba(0,0,0,0.06) 10px 20px);
}

.quest-item.repeat {
    border-color: #9E9E9E;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.1) 100%);
}

.quest-item.repeat strong {
    color: #9E9E9E;
}

.quest-item strong {
    display: block;
    font-size: 18px;
    margin-bottom: 6px;
    color: #ffffff;
}

.quest-item.available strong { color: var(--accent-color); }
.quest-item.active strong   { color: #ffc107; }
.quest-item.completed strong{ color: #4CAF50; }

/* Quest card refinement for Watts dialogue */
.quest-card {
  background: linear-gradient(145deg, #3f3b5d, #35324d);
  border: 1px solid rgba(74, 78, 105, 0.5);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  display: block;
  width: 100%;
  text-align: left;
  color: #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  background-size: 100% 100%;
  transition: filter 0.15s ease-in-out;
}

.quest-card:hover {
  filter: brightness(1.05);
  cursor: pointer;
}

.quest-card strong {
  color: #42f5e0;
  font-weight: 600;
}

.quest-card.locked { opacity: 0.5; pointer-events:none; }
.quest-card.completed strong { color: #4CAF50; }
.quest-card.active strong { color: #ffc107; }
.quest-card.repeat strong { color: var(--accent-color); }

.quest-icon {
  margin-right: 8px;
  vertical-align: middle;
}

/* ---------- NPC dialogue quest list harmonization --------- */
.menu-container .quest-item,
.menu-container .quest-card{
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
}
.menu-container .quest-item:hover,
.menu-container .quest-card:hover{
    filter: brightness(1.05);
}

/* ---------- Neon border for utility panes (HUD, chat) ---------- */
#game-info-display,
#chat-window{
    border: 1px solid var(--primary-visual-accent-medium) !important;
    box-shadow: 0 0 10px var(--primary-visual-accent-glow), 0 0 4px var(--secondary-visual-accent-glow) inset !important;
}

/* Loader CSS Particle System */
.pv-particles {
  position: absolute;
  width: 100vw;
  height: 100vh;
  top: 0; left: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.pv-particle {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  opacity: 0.7;
  will-change: transform, opacity;
}
.pv-particle-float {
  animation: pv-float 5s linear infinite;
}
@keyframes pv-float {
  0% {
    transform: translateY(-10vh) scale(1);
    opacity: 0.7;
  }
  80% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(110vh) scale(1.2);
    opacity: 0;
  }
}
.pv-particle-spin {
  animation: pv-spin 4s linear infinite;
}
@keyframes pv-spin {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 0.7;
  }
}
.pv-particle-bounce {
  animation: pv-bounce 3.5s cubic-bezier(.68,-0.55,.27,1.55) infinite;
}
@keyframes pv-bounce {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  40% {
    transform: translateY(-40px) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
}

/* Center loader content */
.pv-loader-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0; left: 0;
  background: none;
}
.pv-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 2;
  text-align: center;
  font-size: 1.3em;
}
.pv-logo {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 0.2em;
}
.pv-tagline {
  font-size: 1.2em;
  margin-bottom: 0.5em;
}
.pv-controls, .pv-humor, .pv-minigame-panel, .pv-stats-panel, .pv-particle-options {
  text-align: center;
}
.pv-minigame-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pv-stats-panel {
  margin-bottom: 0.5em;
}
.pv-particle-options {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0.5em;
}
.pv-news-btn, .pv-continue-btn {
  margin: 0.5em 0.25em 0 0.25em;
  display: inline-block;
  font-size: 1.4em;
}

#pv-updates-link {
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  font: inherit;
  cursor: pointer;
  display: inline-block;
  margin: 0.5em 0.25em 0 0.25em;
}
#pv-updates-link:visited,
#pv-updates-link:hover,
#pv-updates-link:focus {
  color: inherit;
  text-decoration: none;
}