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

body {
    font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 10px;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.game-header {
    background: linear-gradient(135deg, #6B4423 0%, #8B5A3C 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.greenhouse-section,
.market-section {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #333;
}

.greenhouse {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 8px;
    min-height: 200px;
    background: rgba(139, 90, 60, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.plant {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.plant:hover {
    transform: translateY(-5px);
}

.plant-icon {
    font-size: 2rem;
    margin-bottom: 3px;
}

.plant-stage {
    font-size: 0.65rem;
    color: #666;
}

.greenhouse-actions,
.market-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-success {
    background: #FF9800;
    color: white;
}

.btn-warning {
    background: #FFC107;
    color: #333;
}

.btn-time {
    background: #9C27B0;
    color: white;
}

.cost {
    font-size: 0.75rem;
    opacity: 0.9;
}

.market-info {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

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

.price-label {
    font-size: 0.9rem;
    color: #666;
}

.price-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.price-trend {
    font-size: 1.3rem;
}

.market-history {
    margin-top: 12px;
}

.market-history h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
    background: white;
    padding: 8px;
    border-radius: 6px;
}

.history-item {
    padding: 6px;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    animation: slideIn 0.3s;
}

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

.time-control {
    padding: 0 15px 15px;
    text-align: center;
}

.btn-time {
    min-width: 150px;
}

.goal-section {
    padding: 12px 15px 15px;
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
}

.goal-section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.goal-section p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.progress-bar {
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}

.automation-status {
    margin-top: 12px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.automation-status h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #333;
}

.automation-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.automation-item:last-child {
    border-bottom: none;
}

.automation-item span:first-child {
    color: #666;
}

.automation-item span:last-child {
    font-weight: 600;
}

.achievements-section {
    margin-top: 12px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.achievements-section h4 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #333;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
    cursor: pointer;
    background: #f5f5f5;
}

.achievement-badge.locked {
    opacity: 0.3;
    filter: grayscale(100%);
}

.achievement-badge.unlocked {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    animation: badgeUnlock 0.5s ease;
}

@keyframes badgeUnlock {
    0% {
        transform: scale(0.5) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.achievement-badge:hover {
    transform: translateY(-3px);
}

.achievement-badge-icon {
    font-size: 1.8rem;
    margin-bottom: 3px;
}

.achievement-badge-name {
    font-size: 0.65rem;
    text-align: center;
    font-weight: 600;
    color: #333;
}

.achievement-modal {
    animation: achievementPop 0.5s ease;
}

@keyframes achievementPop {
    0% {
        transform: scale(0.3) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.achievement-icon {
    font-size: 4rem;
    margin: 15px 0;
    animation: iconBounce 0.6s ease infinite alternate;
}

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

.achievement-modal h3 {
    font-size: 1.3rem;
    color: #FFD700;
    margin-bottom: 8px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 450px;
    animation: modalSlideIn 0.3s;
}

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

.modal-content h2 {
    font-size: 1.7rem;
    margin-bottom: 15px;
    color: #4CAF50;
}

.modal-content p {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #666;
}

#winStats {
    font-weight: bold;
    color: #333;
}