@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg-color: #0d1117;
    --panel-bg: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-hover: #1f6feb;
    --gold: #f2cc60;
    --danger: #f85149;
    --success: #3fb950;
    --font-main: 'VT323', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1.3rem;
    /* Boost size for pixel font */
    overflow: hidden;
    /* Prevent scrolling on main body */
    height: 100vh;
}

button,
input,
textarea,
select {
    font-family: var(--font-main);
}

#app {
    display: flex;
    flex-direction: column;
    /* Changed to column for top bar */
    height: 100%;
    width: 100%;
    background-color: #000;
    /* Fallback */
}

/* --- Top Navigation Bar --- */
#top-bar {
    height: 60px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

.logo-area {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.logo-area sup {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
}

.top-tools {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.coin-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin-right: 1rem;
    cursor: help;
    font-size: 0.95rem;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background: #21262d;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #30363d;
    border-color: var(--accent-color);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 250px;
    background: #161b22;
    border: 1px solid #30363d;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
    z-index: 1000;
}

.hamburger-dropdown.hidden {
    display: none;
}

.hamburger-dropdown .tool-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.8rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 1rem;
}

.hamburger-dropdown .tool-btn:hover {
    background: #21262d;
    border: 1px solid #30363d;
    color: var(--accent-color);
}

/* Fix width for wide buttons in dropdown */
.hamburger-dropdown .tool-btn.wide {
    width: 100%;
}

.tool-btn.wide {
    width: auto;
    padding: 0 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 0.4rem;
}

.game-layout {
    display: grid;
    grid-template-columns: 350px 1fr 400px;
    /* Left (Fixed), Middle (Flex), Right (Fixed) */
    width: 100%;
    flex: 1;
    /* Take remaining height */
    overflow: hidden;
    position: relative;
}

/* --- Columns Common --- */
.column {
    height: 100%;
    position: relative;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Left Column: Interactions --- */
#left-column {
    background: #0d1117;
    /* Darkest */
    border-right: 3px solid #30363d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center everything now that tools are gone */
    padding: 2rem 1rem;
    z-index: 10;
    box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    /* Prevent scrollbars */
}

.header-info {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

/* .column-footer removed */

/* --- Middle Column: Visuals --- */
#middle-column {
    background-color: #161b22;
    /* Medium Dark */
    background-image:
        linear-gradient(#21262d 1px, transparent 1px),
        linear-gradient(90deg, #21262d 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    position: relative;
    overflow-y: auto;
    /* Custom Scrollbar for middle */
    scrollbar-width: thin;
    scrollbar-color: #30363d #161b22;
}

.visuals-header {
    background: #21262d;
    border-bottom: 2px solid #30363d;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.visuals-header h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

#buildings-visual-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Visual Rows */
.visual-row {
    display: flex;
    align-items: center;
    min-height: 80px;
    padding: 0.8rem;
    border: 1px solid #30363d;
    position: relative;
    background: #0d1117;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}



.visual-row-icon {
    width: 72px;
    /* Decreased from 80px */
    height: 72px;
    /* Decreased from 80px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    /* Decreased from 4rem */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-right: 1rem;
    flex-shrink: 0;
}

.visual-icons-area {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.visual-building-icon {
    font-size: 1.2rem;
    opacity: 0;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Right Column: Store --- */
#right-column {
    background-color: #21262d;
    /* Lightest of the darks */
    border-left: 3px solid #30363d;
    overflow-y: auto;
    width: 100%;
    /* Fills the grid cell */
    max-width: none;
    /* Override previous max-width */
    box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.2);
}

/* --- Overrides/Fixes for new layout --- */
/* --- Overrides/Fixes for new layout --- */
#emoji-count {
    font-size: 3.5rem;
    /* Smaller to fit column */
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.cps-display {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
}

.big-emoji-container {
    padding: 2rem;
    z-index: 10;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Full width of column */
    flex: 1;
    /* Take available space */
}

#big-emoji {
    font-size: 15rem;
    background: none;
    border: none;
    cursor: pointer;
    /* Use individual transform properties to separate animation from interaction */
    scale: 1;
    rotate: 0deg;
    translate: 0 0;
    transition: scale 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s;
    filter: drop-shadow(0 0 30px rgba(255, 200, 0, 0.2));
    line-height: 1;
    display: block;
    animation: hovercraft 4s ease-in-out infinite;
}

#big-emoji:active {
    scale: 0.9;
}

#big-emoji:hover {
    scale: 1.05;
    filter: drop-shadow(0 0 50px rgba(255, 200, 0, 0.4));
}

@keyframes hovercraft {
    0% {
        translate: 0 0;
        rotate: 0deg;
    }

    25% {
        translate: 0 -10px;
        rotate: 1.5deg;
    }

    50% {
        translate: 0 -15px;
        rotate: 0deg;
    }

    75% {
        translate: 0 -8px;
        rotate: -1.5deg;
    }

    100% {
        translate: 0 0;
        rotate: 0deg;
    }
}

/* --- Store Panel (Right) --- */


.store-panel h2 {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 2px solid #30363d;
    color: var(--accent-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.store-section {
    padding: 1rem;
}

.store-section h3 {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* --- Upgrades Grid --- */
.upgrade-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.upgrade-item {
    width: 50px;
    height: 50px;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    /* Ensure progress stays inside */
}

.upgrade-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: conic-gradient(rgba(88, 166, 255, 0.3) var(--progress, 0%), transparent 0);
    pointer-events: none;
    z-index: 1;
    transition: --progress 0.1s linear;
    /* optional if browser supports transition on vars */
}

.upgrade-icon {
    position: relative;
    z-index: 2;
}

.upgrade-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.upgrade-item.disabled {
    opacity: 0.3;
    pointer-events: none;
    /* Make unclickable effectively */
    filter: grayscale(1);
}

/* --- Settings --- */
.settings-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.setting-btn {
    flex: 1;
    background: #21262d;
    border: 1px solid #30363d;
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.setting-btn:hover {
    background: #30363d;
    border-color: var(--text-secondary);
}

.setting-btn.danger {
    color: var(--danger);
    border-color: rgba(248, 81, 73, 0.4);
}

.setting-btn.danger:hover {
    border-color: var(--danger);
}

.setting-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    color: var(--text-primary);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* --- Global Tooltip --- */
.tooltip {
    position: fixed;
    background: #161b22;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    white-space: pre-wrap;
    line-height: 1.4;
    transition: opacity 0.1s;
}

.tooltip.hidden {
    opacity: 0;
    visibility: hidden;
}

.tooltip-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-cost {
    font-size: 0.9rem;
    color: var(--success);
}

.tooltip-desc {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.tooltip-stat {
    color: var(--text-primary);
    font-weight: 500;
}

/* Building Item Styles */
.building-item {
    display: flex;
    align-items: center;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 80px;
}

.building-item:hover {
    background: #30363d;
    transform: translateX(-5px);
    border-color: var(--accent-color);
}

.building-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.building-item.disabled:hover {
    transform: none;
    border-color: #30363d;
}

.building-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    width: 60px;
    text-align: center;
}

.building-info {
    flex: 1;
}

.building-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.building-cost {
    color: var(--success);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.building-count {
    font-size: 2rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
}

/* --- Tooltips Removed (Using JS Global Tooltip) --- */
.building-item {
    position: relative;
    /* Transformation handled by hover effect */
}

/* --- Particles --- */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.particle {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    animation: particleAnim 1s ease-out forwards;
    z-index: 20;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

@keyframes particleAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) translateY(0) translateX(0) rotate(0deg);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) translateY(-20px) translateX(calc(var(--x-offset, 0px) * 0.2)) rotate(calc(var(--rotation, 0deg) * 0.2));
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) translateY(-120px) translateX(var(--x-offset, 0px)) rotate(var(--rotation, 0deg));
    }
}

/* --- Responsive Design --- */
/* --- Responsive Design (Swipe Swipe) --- */
@media (max-width: 768px) {
    #app {
        flex-direction: column;
        overflow: hidden;
    }

    /* Undo desktop grid */
    .game-layout {
        display: flex;
        flex-direction: row;
        width: 100vw;
        height: calc(100vh - 60px);
        /* Subtract header */
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        /* Momentum scroll */
    }

    /* Force columns to be full width screens */
    .column {
        min-width: 100vw;
        width: 100vw;
        height: 100%;
        scroll-snap-align: start;
        border: none;
        /* Remove borders between 'screens' */
        flex-shrink: 0;
        padding-bottom: 30px;
        /* Space for dots */
    }

    /* Left Column Tweaks */
    #left-column {
        border-right: none;
        box-shadow: none;
        padding: 4rem 1rem;
    }

    #emoji-count {
        font-size: 3.5rem;
    }

    #big-emoji {
        font-size: 10rem;
    }

    /* Middle Column Tweaks */
    #middle-column {
        overflow-y: auto;
    }

    /* Right Column (Store) Tweaks */
    #right-column {
        border-left: none;
        overflow-y: auto;
        padding-bottom: 80px;
        /* Extra space at bottom */
    }

    /* Navigation Dots */
    .mobile-nav-dots {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 10px;
        z-index: 9999;
        background: rgba(22, 27, 34, 0.8);
        padding: 8px 12px;
        border-radius: 20px;
        border: 1px solid #30363d;
        backdrop-filter: blur(4px);
    }

    .mobile-nav-dots.hidden {
        display: none !important;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #30363d;
        transition: all 0.3s;
        cursor: pointer;
    }

    .nav-dot.active {
        background: var(--accent-color);
        transform: scale(1.2);
        box-shadow: 0 0 8px var(--accent-color);
    }
}

/* --- Visual Cursors --- */
#visual-cursors {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 5;
    transform-origin: center center;
    animation: orbit 800s linear infinite;
}

.visual-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    will-change: transform;
}

.cursor-img {
    display: block;
    animation: clickAnim 10s ease-in-out infinite;
    /* transform-origin removed to let it pivot around center */
}

@keyframes clickAnim {

    0%,
    45%,
    55%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(0.9) translateY(-10px);
    }
}

@keyframes orbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Notifications --- */
#notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10001;
}

.notification-toast {
    background: #1f2937;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: #fff;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    min-width: 250px;
    max-width: 350px;
    animation: slideIn 0.3s ease-out forwards;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-toast.closing {
    animation: slideOut 0.3s ease-in forwards;
}

.notification-toast.success {
    border-left-color: var(--success);
}

.notification-toast.error {
    border-left-color: var(--danger);
}

.notification-toast.info {
    border-left-color: var(--accent-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* --- Emoji Change UI --- */
/* --- Emoji Change UI --- */
/* .tools-container removed */

.emoji-change-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #30363d;
    background: #21262d;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    /* Ensure z-index works if needed, but flex handles layout */
}

.emoji-change-btn:hover {
    background: #30363d;
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-color);
}

/* --- Modal Overlay --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: translateY(20px);
}

.modal-content.large {
    max-width: 100vw !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--accent-color);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
}

.close-btn:hover {
    color: var(--danger);
}

.minigame-header-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1rem;
    margin-left: auto;
    /* Push to right */
}

#minigame-coin-display {
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.minigame-emoji-count {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: auto;
    margin-left: 1rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    padding: 1.5rem;
    overflow-y: auto;
}

.emoji-option {
    font-size: 2rem;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    transition: all 0.2s;
}

.emoji-option:hover {
    background: #30363d;
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.emoji-option.selected {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.2);
}

/* --- Data & Cloud Section --- */
.save-control-group {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}

.group-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.setting-btn.compact {
    padding: 0.4rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.small-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Social Login */
/* Social Login */
.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.social-btn {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    /* Standard SSO look often square or small radius */
    padding: 10px 12px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    /* Standard Google font if available, fallback ok */
    font-weight: 500;
    color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align content usually */
    position: relative;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-size: 14px;
}

.social-btn:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.social-btn.google {
    background-color: #131314;
    /* Dark mode Google button background */
    border: 1px solid #8e918f;
    color: #e3e3e3;
}

.social-btn.google:hover {
    background-color: #2b2c2e;
    /* Slightly lighter on hover */
}

.social-btn.microsoft {
    background-color: #2F2F2F;
    border: 1px solid #2F2F2F;
    /* Match bg */
}

.social-btn.microsoft:hover {
    background-color: #3F3F3F;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: transparent;
}

.social-text {
    flex: 1;
    text-align: center;
    /* Center the text properly */
    font-weight: 500;
}

/* User Card */
.user-status-card {
    background: #0d1117;
    border-radius: 6px;
    padding: 0.5rem;
    border: 1px solid #30363d;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #30363d;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 5px var(--success);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.cloud-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.last-sync-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: right;
    font-style: italic;
}

/* --- Mini-Games --- */
.visual-row-icon.interactive {
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.visual-row-icon.interactive:hover {
    border-color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.3);
}

.visual-row-icon.interactive::after {
    content: '🎮';
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 1rem;
    background: var(--bg-color);
    border-radius: 50%;
    padding: 2px;
    border: 1px solid var(--accent-color);
}

.minigame-area {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    flex: 1;
    /* Fill remaining space */
    width: 100%;
}

.modal-content.large .minigame-area {
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
}

.minigame-status {
    text-align: center;
    padding: 1rem;
    font-weight: bold;
    color: var(--text-secondary);
}




/* --- Fireworks --- */
.firework-particle {
    position: fixed;
    /* Fixed to screen, showing above modal */
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;
    /* Above modal (10001 usually) */
    animation: fireworkPop 1s ease-out forwards;
}

@keyframes fireworkPop {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--fx), var(--fy)) scale(0);
        opacity: 0;
    }
}

.minigame-status.win-anim {
    animation: pulseWin 0.5s ease-in-out infinite alternate;
    color: var(--success);
    font-size: 1.2rem;
}

@keyframes pulseWin {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

/* Minigame Reward Animations */
.reward-float {
    position: absolute;
    color: #ffd700;
    font-weight: 900;
    font-size: 3rem;
    /* Larger font */
    pointer-events: none;
    z-index: 2000;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 20px #ffd700;
    /* Glow */
    transition: left 1s ease-in, top 1s ease-in, transform 1s ease-in, opacity 0.5s ease-out;
    /* Separate transitions for sequence */
    opacity: 1;
    transform: translate(-50%, -50%) scale(0);
    /* Start small/centered */
    text-align: center;
    white-space: nowrap;
    width: auto;
}

@keyframes rewardPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.count-pulse {
    animation: countPulse 0.5s ease-in-out;
    color: #00ff00 !important;
}

@keyframes countPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
        color: #ffd700;
    }

    100% {
        transform: scale(1);
    }
}

/* --- Global UI Enhancements (Balatro Style) --- */

/* CRT Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    pointer-events: none;
    background:
        /* Vignette - Medium */
        radial-gradient(circle, rgba(18, 16, 16, 0) 58%, rgba(0, 0, 0, 0.5) 100%),
        /* Scanlines - Medium */
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%),
        /* Chromatic Aberration - Medium */
        linear-gradient(90deg, rgba(255, 0, 0, 0.045), rgba(0, 255, 0, 0.015), rgba(0, 0, 255, 0.045));
    background-size: 100% 100%, 100% 4px, 5px 100%;
    mix-blend-mode: overlay;
    opacity: 0.9;
}

/* Specific CRT for containers (like minigame) */
.crt-container {
    position: relative;
    overflow: hidden;
}

.crt-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Living Icons - Pulse Animation */
@keyframes livingPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.living-icon {
    animation: livingPulse 3s ease-in-out infinite;
}

/* Button Press Animation */
@keyframes btnPress {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(0.9);
        filter: brightness(1.5);
        box-shadow: 0 0 10px var(--accent-color);
    }

    100% {
        transform: scale(1);
    }
}

.btn-press {
    animation: btnPress 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Retro Toggle Switch */
.toggle-switch-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #0d1117;
    border-radius: 6px;
    border: 1px solid #30363d;
    margin-bottom: 0.5rem;
}

.toggle-label {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.toggle-checkbox {
    width: 40px;
    height: 20px;
    appearance: none;
    background: #30363d;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-checkbox:checked {
    background: var(--accent-color);
}

.toggle-checkbox:checked::after {
    transform: translateX(20px);
}

/* Header Alignment Updates */
.modal-header {
    position: relative !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.center-stat {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}