/* Base Styles */
:root {
    --primary: #ff6b35;  /* Changed to orange for better contrast */
    --primary-dark: #e05a2b;
    --primary-light: #fff3ef;
    --secondary: #2d7dd2;
    --dark: #2d3436;
    --light: #f8f9fa;
    --gray: #5a6268;
    --light-gray: #e9ecef;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Typography */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #2d3436;
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 1rem;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.factory-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.factory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: var(--pixel-border);
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.2rem;
    margin: 0;
}

.pixel-toothpick {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--dark);
    font-weight: 600;
    position: relative;
    padding: 5px 0;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--primary);
}

/* Buttons */
.cta-button, .secondary-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
}

.cta-button {
    background-color: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background-color: #e65a1a;
    transform: translate(2px, 2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    color: white;
}

.secondary-button {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    margin-left: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background-color: var(--primary-light);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(0, 150, 255, 0.1), transparent 50%);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hero-image {
    position: relative;
    z-index: 1;
    text-align: center;
    margin: 30px 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image .pixel-robot {
    font-size: 150px;
    display: inline-block;
    margin: 0;
    position: relative;
    z-index: 2;
    text-shadow: 8px 8px 0 rgba(0,0,0,0.1);
    animation: float 6s ease-in-out infinite, pulse 4s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s ease;
}

.pixel-robot:hover {
    transform: scale(1.1) rotate(5deg);
    text-shadow: 12px 12px 0 rgba(0,0,0,0.1);
}

.hero-image:hover .pixel-robot {
    transform: rotateY(360deg);
}

/* Hero Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

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

@keyframes spinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

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

/* Gear Positions */
.pixel-gears:nth-child(2) {
    top: 20px;
    left: 20%;
    animation-name: spinReverse;
    font-size: 50px;
}

.pixel-gears:nth-child(3) {
    bottom: 30px;
    right: 20%;
    animation-name: spin;
    font-size: 70px;
}

.pixel-gears:nth-child(4) {
    top: 60%;
    right: 15%;
    animation-name: spinReverse;
    font-size: 40px;
}

/* Featured Products Section */
.featured-products {
    padding: 80px 0;
    background-color: white;
    position: relative;
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

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

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-light);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card:hover .product-image i {
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.product-image {
    height: 180px;
    background: linear-gradient(135deg, #f6f8f9 0%, #e5ebee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.product-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-content h3 {
    margin: 0 0 10px 0;
    color: var(--dark);
    font-size: 1.4rem;
}

.product-content p {
    color: var(--gray);
    margin: 15px 0 20px;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.product-tag {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

/* Animation for product cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Stagger the animations */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.4s; }

/* Process Section */
.process {
    padding: 6rem 1rem;
    background-color: #f9fafb;
    position: relative;
    overflow: hidden;
}

.process::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.process-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.process-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3rem;
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.process-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.step-number {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.step-content {
    flex: 1;
}

.step-icon {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.step-content h3 {
    margin: 0 0 0.8rem 0;
    color: var(--dark);
    font-size: 1.4rem;
}

.step-content p {
    color: var(--gray);
    margin: 0;
    line-height: 1.7;
}

.step-connector {
    display: flex;
    align-items: center;
    padding: 0 2rem;
    color: #d1d5db;
    font-size: 1.5rem;
}

.process-cta {
    text-align: center;
    margin-top: 4rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    .process-step {
        flex-direction: column;
        padding: 1.5rem;
    }
    
    .step-number {
        margin: 0 0 1.5rem 0;
    }
    
    .step-connector {
        display: none;
    }
    
    .process {
        padding: 4rem 1rem;
    }
}

/* Services Section */
.services {
    padding: 4rem 1rem;
    background-color: white;
    border: var(--pixel-border);
    margin: 2rem 0;
    position: relative;
}

.services h2 {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--light-gray);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--dark);
    margin-bottom: 0;
    opacity: 0.9;
}

/* XP Bars */
.xp-bar {
    height: 20px;
    background-color: #eee;
    border: var(--pixel-border);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-color));
    width: 0;
    animation: fillBar 1.5s ease-out forwards;
}

.xp-bar span {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    line-height: 20px;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Projects Section */
.projects {
    padding: 4rem 1rem;
}

.project-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: white;
    border: var(--pixel-border);
    padding: 1.5rem;
    box-shadow: var(--pixel-shadow);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translate(-5px, -5px);
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.2);
}

.project-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
}

/* About Section */
.about {
    padding: 6rem 1rem;
    background-color: #fff;
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.stat {
    background: white;
    padding: 1.8rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
    position: relative;
    z-index: 1;
}

.stat-label {
    color: var(--gray);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.pixel-about {
    font-size: 10rem;
    line-height: 1;
    animation: float 3s ease-in-out infinite;
}

/* Responsive styles for about section */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        gap: 3rem;
    }
    
    .about-text, .about-image {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .about-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat {
        min-width: 120px;
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {
    .stat {
        min-width: calc(50% - 1rem);
    }
}

/* Contact Section */
.contact {
    padding: 6rem 1rem;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.contact-container {
    display: flex;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.contact-info, .contact-form {
    flex: 1;
    padding: 3rem;
}

.contact-info {
    background: linear-gradient(135deg, #2b2d42 0%, #1a1a2e 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.contact-info h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.contact-info p {
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.contact-icon {
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.2rem;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--primary);
}

.contact-method h3 {
    margin: 0 0 0.3rem 0;
    color: white;
    font-size: 1.1rem;
}

.contact-link {
    color: #a8c7ff;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.contact-link:hover {
    color: var(--primary);
}

.contact-form {
    background: white;
}

.contact-form h3 {
    color: var(--dark);
    margin-bottom: 1.8rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-form .cta-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Responsive styles */
@media (max-width: 992px) {
    .contact-container {
        flex-direction: column;
        max-width: 600px;
    }
    
    .contact-info, .contact-form {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .contact-method {
        flex-direction: column;
    }
    
    .contact-icon {
        margin-bottom: 1rem;
    }
}

/* Footer */
.factory-footer {
    background-color: var(--dark);
    color: white;
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-icon {
    display: inline-block;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #aaa;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-15px) rotate(2deg);
    }
    66% {
        transform: translateY(-5px) rotate(-2deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* Responsive Design */
/* Responsive adjustments */
@media (max-width: 768px) {
    .coin-bucket {
        width: 160px;
    }
    
    .coin-bucket-body .cta-button {
        font-size: 0.5rem;
        padding: 6px 8px;
    }
    
    .coin {
        font-size: 1.5rem;
    }
    .factory-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Coin Game */
#coin-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 10px 15px;
    border-radius: 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border: 2px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.coin-icon {
    font-size: 1.2rem;
    animation: coin-pulse 2s infinite;
}

/* Coin Bucket */
.coin-bucket {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bucket-container {
    position: relative;
    width: 100px;
    height: 120px;
}

.bucket-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #8b4513;
    border-radius: 0 0 50% 50%;
    overflow: hidden;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

.bucket-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 30px;
    background: #a0522d;
    border-radius: 50%;
    z-index: 2;
}

.bucket-handle {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: #8b4513;
    border: 3px solid #5d2e0f;
    border-radius: 10px;
    z-index: 1;
}

.bucket-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #ffd700, #ffec8b);
    transition: height 0.5s ease-out;
    opacity: 0.8;
    z-index: 1;
}

.coins-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 10px;
    z-index: 2;
}

.coin-in-bucket {
    font-size: 1.5rem;
    display: none;
    animation: float 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* Bucket UI */
.bucket-ui {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #ffd700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.coin-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: #ffd700;
}

.game-timer {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: #fff;
}

#spill-bucket-btn {
    margin-top: 10px;
    padding: 8px 15px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Coins */
.coin {
    position: fixed;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    z-index: 1000;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    will-change: transform, opacity;
    transform-origin: center;
    transition: transform 0.2s, opacity 0.5s;
    pointer-events: none;
}

.coin.collected {
    pointer-events: none;
}

.timer {
    font-size: 0.6rem;
    color: #fff;
    text-align: center;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 5px;
    border-radius: 3px;
}

/* Coin Styles */
.pixel-gears {
    position: absolute;
    font-size: 60px;
    z-index: 1;
    opacity: 0.9;
    animation-duration: 15s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.coin {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s, opacity 0.5s;
    z-index: 100;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    animation: float 3s ease-in-out infinite, spin-coin 5s infinite linear;
    will-change: transform, opacity;
    transform-origin: center;
    pointer-events: none; /* Will be enabled by JS after animation */
}

.coin.collected {
    transform: scale(0) rotate(360deg);
    opacity: 0;
    pointer-events: none;
}

@keyframes coin-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes spin-coin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes spin-coin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes coin-collect {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    100% { 
        transform: scale(3) translateY(-50px);
        opacity: 0;
    }
}

/* 3D Containers */
.threejs-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#floating-gears {
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
}

#floating-potions {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    z-index: 5;
    opacity: 0.9;
}

#floating-sword {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 300px;
    height: 50vh;
    z-index: 5;
    opacity: 0.9;
}

/* Pixel Art Elements */
.pixel-art {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 8-bit Typography */
.bit-text {
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Factory Elements */
.factory-belt {
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        #888,
        #888 10px,
        #aaa 10px,
        #aaa 20px
    );
    border-top: var(--pixel-border);
    border-bottom: var(--pixel-border);
    margin: 2rem 0;
    position: relative;
}

/* Achievement Badges */
.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0;
    font-size: 0.7rem;
    margin: 0.2rem;
    border: 2px solid #000;
    font-family: 'Press Start 2P', cursive;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-family: 'Roboto', sans-serif;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
