/* Studio Zoar - Digital Theme Park Styles */

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

:root {
    --bg-dark: #0a0e27;
    --bg-card: #111633;
    --accent-green: #00ff88;
    --accent-cyan: #00ffff;
    --accent-magenta: #ff00ff;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
}


body {
    font-family: 'Courier New', monospace;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Smooth page load animation - DISABLED FOR DEBUGGING */
/*
#main-site {
    animation: fadeIn 0.5s ease-in;
}

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

/* Animated grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 255, 136, 0) 50%,
        rgba(0, 255, 136, 0.02) 51%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 0;
}

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

/* Modal Base */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    transition: color 0.2s;
}

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

/* Onboarding */
.onboarding h1 {
    color: var(--accent-green);
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.onboarding .subtitle {
    color: var(--accent-cyan);
    text-align: center;
    font-size: 14px;
    margin-bottom: 40px;
}

.onboarding-step h2 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

#username-input,
#settings-username {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

#username-input:focus,
#settings-username:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    border: 3px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px;
    background: var(--accent-green);
    border: none;
    border-radius: 4px;
    color: var(--bg-dark);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-cyan);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--accent-cyan);
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #00aaaa;
}

/* Auth Modal */
.auth h2 {
    color: var(--accent-green);
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

#auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--accent-green);
    color: var(--bg-dark);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 15px;
}

.auth-form input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.auth-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 15px;
}

.error-message {
    color: #ff4444;
    text-align: center;
    padding: 10px;
    margin-top: 15px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 4px;
}

.settings-info {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: #ff4444;
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #cc0000;
}

.btn-delete {
    width: 100%;
    padding: 12px;
    background: #ff0000;
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #990000;
}

.btn-text {
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.btn-text:hover {
    color: var(--accent-green);
}

.delete-confirm h2 {
    color: #ff4444;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.delete-warning {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}

.delete-confirm input {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid #ff4444;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    padding: 15px 20px;
    min-width: 250px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
    animation: slideIn 0.3s ease-out;
}

.toast.error {
    border-color: #ff4444;
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.3);
}

.toast.success {
    border-color: var(--accent-green);
}

.toast-message {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Settings Modal */
.settings h2 {
    color: var(--accent-green);
    font-size: 24px;
    margin-bottom: 30px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 10px;
}

/* Header */
header {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 2px solid var(--accent-green);
    background: rgba(17, 22, 51, 0.8);
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.tagline {
    font-size: 12px;
    color: var(--accent-cyan);
    margin-top: 5px;
}

.header-right {
    display: flex;
    align-items: center;
}

.profile-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 2px solid var(--text-primary);
}

.username {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: bold;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    margin-left: 5px;
    position: relative;
    z-index: 200;
}

.settings-btn:hover {
    transform: rotate(90deg);
}

/* Hero Section */
.hero {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.1) 0%, transparent 100%);
}

.hero-title {
    font-size: 48px;
    color: var(--accent-green);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--accent-cyan);
    margin-bottom: 15px;
}

.hero-description {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Games Section */
.games {
    position: relative;
    z-index: 10;
    padding: 60px 40px;
}

.section-title {
    font-size: 32px;
    color: var(--accent-green);
    text-align: center;
    margin-bottom: 40px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: var(--bg-card);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    padding: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    text-align: center;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.game-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.status-playable {
    background: var(--accent-green);
    color: var(--bg-dark);
}

.status-wip {
    background: var(--accent-cyan);
    color: var(--bg-dark);
}

.status-planned {
    background: var(--accent-magenta);
    color: var(--text-primary);
}

.status-live {
    background: var(--accent-green);
    color: var(--bg-dark);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.game-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.game-card h3 {
    color: var(--accent-green);
    font-size: 20px;
    margin-bottom: 10px;
}

.game-genre {
    color: var(--accent-cyan);
    font-size: 12px;
    margin-bottom: 10px;
}

.game-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Footer */
footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
    border-top: 2px solid var(--accent-green);
    background: rgba(17, 22, 51, 0.8);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-green);
}

/* Buddy Modal */
.buddy-select h2 {
    color: var(--accent-green);
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.buddy-select .subtitle {
    color: var(--accent-cyan);
    text-align: center;
    font-size: 14px;
    margin-bottom: 30px;
}

.buddy-select h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.buddy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px auto;
    max-width: 600px;
    justify-items: center;
}

.buddy-option {
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.buddy-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.buddy-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.buddy-option img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    margin-bottom: 10px;
}

.buddy-option p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

#buddy-naming {
    text-align: center;
}

#selected-buddy-preview {
    width: 128px;
    height: 128px;
    margin: 20px auto;
    display: block;
}

#selected-buddy-type {
    color: var(--accent-cyan);
    font-size: 18px;
    margin-bottom: 20px;
}

#buddy-name-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

#buddy-name-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.buddy-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    order: -1;
    cursor: pointer;
    transition: transform 0.2s ease;
}


.try-today-section .game-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 420px));
    justify-content: center;
}

.game-card[data-game="buddy"] {
    cursor: pointer;
    aspect-ratio: 1 / 1;
    max-width: 420px;
    margin: 0 auto;
}

/* Buddy Profile View */
.buddy-profile-content {
    text-align: center;
}

#buddy-profile-img {
    width: 256px;
    height: 256px;
    margin: 20px auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

#buddy-profile-img:hover {
    transform: scale(1.05);
}

#buddy-profile-name {
    color: var(--accent-cyan);
    font-size: 32px;
    margin-bottom: 15px;
}


.buddy-status-msg {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 30px;
}

.buddy-actions {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.btn-release {
    width: 100%;
    padding: 12px;
    background: #ff8800;
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-release:hover {
    background: #cc6600;
}

#rename-buddy-preview,
#release-buddy-preview {
    width: 128px;
    height: 128px;
    margin: 20px auto;
    display: block;
}

#rename-buddy-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-green);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

#rename-buddy-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.release-warning {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}

.release-warning span {
    color: var(--accent-cyan);
    font-weight: bold;
}

.species-label {
    color: var(--accent-cyan) !important;
    font-size: 12px !important;
}


/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .game-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .buddy-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .buddy-option img {
        width: 96px;
        height: 96px;
    }
}
