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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 宇宙背景 */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    z-index: -2;
}

.space-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, #eee, transparent),
        radial-gradient(1px 1px at 50px 160px, #ddd, transparent),
        radial-gradient(1px 1px at 130px 40px, #ddd, transparent),
        radial-gradient(2px 2px at 130px 180px, #eee, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ヘッダー */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(180deg, rgba(27,39,53,0.8) 0%, transparent 100%);
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    color: #88c8ff;
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* 統計パネル */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #88c8ff;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

/* 月面 */
.moon-surface {
    position: relative;
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(100, 200, 255, 0.3);
}

/* 地球ビュー */
.earth-view {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #4a90e2, #1e3a8a);
    border-radius: 50%;
    box-shadow: 
        0 0 50px rgba(74, 144, 226, 0.5),
        inset -10px -10px 20px rgba(0, 0, 0, 0.3);
    animation: rotate 60s linear infinite;
}

.earth-view::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 30%;
    height: 40%;
    background: #2e7d32;
    border-radius: 50%;
    opacity: 0.7;
}

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

/* 月面グリッド */
.lunar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.grid-cell {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grid-cell:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.grid-cell.locked {
    background: rgba(0, 0, 0, 0.6);
    cursor: not-allowed;
}

.grid-cell.planted {
    background: rgba(46, 125, 50, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.grid-cell.watered {
    background: rgba(33, 150, 243, 0.2);
}

.grid-cell.ready {
    animation: pulse 2s infinite;
}

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

.crop-icon {
    font-size: 2rem;
    z-index: 2;
}

.crop-icon.grown {
    font-size: 2.5rem;
}

.lock-icon {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* 進捗バー */
.progress-bar {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
}

/* コントロールパネル */
.control-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.crop-selector h3 {
    margin-bottom: 1rem;
    color: #88c8ff;
}

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

.crop-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    text-align: center;
}

.crop-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.crop-btn.active {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

.crop-btn .crop-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.crop-btn .crop-name {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.crop-btn .crop-cost {
    display: block;
    font-size: 0.8rem;
    color: #ffd700;
}

/* アクションボタン */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.action-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border: none;
    border-radius: 10px;
    padding: 1rem;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.action-btn.active {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #ff6f00, #e65100);
}

.btn-icon {
    font-size: 1.5rem;
}

/* メッセージログ */
.info-panel {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.info-panel h3 {
    margin-bottom: 1rem;
    color: #88c8ff;
}

.message-log {
    max-height: 150px;
    overflow-y: auto;
}

.message-log p {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease;
}

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

/* フッター */
footer {
    text-align: center;
    padding: 2rem;
    color: #88c8ff;
    font-size: 0.9rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .lunar-grid {
        gap: 0.5rem;
    }
    
    .crop-icon {
        font-size: 1.5rem;
    }
    
    .crop-icon.grown {
        font-size: 2rem;
    }
    
    .earth-view {
        width: 100px;
        height: 100px;
        top: -30px;
        right: -30px;
    }
}