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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a3d0a 0%, #001a00 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* ========== 画面管理 ========== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#startScreen {
    z-index: 10;
}

#gameScreen {
    z-index: 100;
    background: linear-gradient(135deg, #1a4d1a 0%, #0d260d 100%);
}

#statsScreen {
    z-index: 200;
    background: linear-gradient(135deg, #2a1a4d 0%, #150d26 100%);
}

/* ========== スタート画面 ========== */
.title-area {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    animation: fadeInDown 0.8s ease;
}

.game-subtitle {
    font-size: 1.2rem;
    color: #9acd32;
    opacity: 0.9;
}

.menu-area {
    margin-bottom: 30px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px;
    font-weight: bold;
}

.btn-start {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.btn-continue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.3);
}

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

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

.instructions {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #9acd32;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    margin: 10px 0;
    padding-left: 10px;
}

.back-link {
    color: #9acd32;
    text-decoration: none;
    margin-top: 20px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* ========== ゲーム画面 ========== */
.game-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 150;
}

.game-header h2 {
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.btn-stats {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #9acd32;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-stats:hover {
    background: rgba(154, 205, 50, 0.2);
    transform: scale(1.05);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.status-panel {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 15px;
    min-width: 400px;
    z-index: 150;
}

.gauge-container {
    margin-bottom: 15px;
}

.gauge-label {
    font-size: 1rem;
    margin-bottom: 5px;
}

.gauge-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.water-gauge {
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

.nutrition-gauge {
    background: linear-gradient(90deg, #F59E0B, #FCD34D);
}

.gauge-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.stage-display {
    text-align: center;
    margin-top: 10px;
    font-size: 1.1rem;
}

.stage-value {
    color: #9acd32;
    font-weight: bold;
}

.action-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 150;
}

.btn-action {
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s;
    flex-direction: column;
    gap: 5px;
}

.btn-water {
    border-color: #3B82F6;
}

.btn-water:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.3);
}

.btn-fertilize {
    border-color: #F59E0B;
}

.btn-fertilize:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.3);
}

.btn-reset {
    border-color: #EF4444;
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.3);
}

.cooldown-text {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========== 統計画面 ========== */
.stats-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 250;
}

.btn-back {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #9acd32;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(154, 205, 50, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 100px 50px 30px;
    max-width: 800px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid rgba(154, 205, 50, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: #9acd32;
    margin-bottom: 10px;
}

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

.log-container {
    max-width: 800px;
    margin: 0 50px;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
}

.log-container h3 {
    margin-bottom: 15px;
    color: #9acd32;
}

.log-list {
    max-height: 300px;
    overflow-y: auto;
}

.log-item {
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
}

.log-empty {
    text-align: center;
    opacity: 0.5;
}

/* ========== トースト通知 ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 1.5rem;
    z-index: 1000;
    display: none;
    animation: fadeInOut 2s ease;
}

/* ========== アニメーション ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
    }
    20%, 80% {
        opacity: 1;
    }
}

/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }

    .status-panel {
        min-width: 300px;
        bottom: 140px;
    }

    .action-panel {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        margin: 100px 20px 30px;
    }

    .log-container {
        margin: 0 20px;
    }
}
