/* ==================== リセット・基本設定 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kosugi Maru', 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    color: #333;
}

/* ==================== コンテナ ==================== */
.pet-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ==================== ヘッダー ==================== */
.pet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.home-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.pet-name-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.pet-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
}

.pet-level {
    font-size: 0.9rem;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 10px;
}

.header-center {
    text-align: center;
}

.current-date {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.next-evolution {
    font-size: 0.9rem;
    color: #e74c3c;
    background: #ffebee;
    padding: 4px 12px;
    border-radius: 15px;
    margin-top: 5px;
}

.points-display {
    text-align: right;
}

.points-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.points-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #f39c12;
}

/* ==================== メインエリア ==================== */
.pet-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ==================== ペット表示エリア ==================== */
.pet-display-area {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 400px;
}

.pet-environment {
    position: relative;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 70%, #90EE90 100%);
    border-radius: 20px;
    overflow: hidden;
    padding: 40px;
}

.background-scene {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.decoration {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.decoration.tree {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.decoration.flower {
    top: 60%;
    right: 15%;
    animation-delay: 1s;
}

.decoration.grass {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

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

.pet-sprite-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    z-index: 10;
}

.pet-sprite {
    display: grid;
    grid-template-columns: repeat(16, 15px);
    grid-template-rows: repeat(16, 15px);
    gap: 0;
    margin-bottom: 20px;
    animation: petBreathe 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

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

.pixel {
    width: 15px;
    height: 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ピクセル色の定義 */
.pixel.transparent { background: transparent; border: none; }
.pixel.green-dark { background: #228b22; }
.pixel.green { background: #90ee90; }
.pixel.green-light { background: #98fb98; }
.pixel.brown { background: #8b4513; }
.pixel.beige { background: #f5deb3; }
.pixel.yellow { background: #ffd700; }
.pixel.orange { background: #ffa500; }
.pixel.blue { background: #4169e1; }
.pixel.blue-light { background: #87ceeb; }
.pixel.purple { background: #9370db; }
.pixel.pink { background: #ffb6c1; }
.pixel.red { background: #ff6b6b; }
.pixel.black { background: #000; }
.pixel.white { background: #fff; }

.pet-status-bubbles {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.status-bubble {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: bubble 2s ease-in-out infinite;
}

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

.interaction-area {
    text-align: center;
}

.pet-interaction-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.pet-interaction-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.interaction-icon {
    font-size: 1.3rem;
}

/* ==================== ステータスパネル ==================== */
.status-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.status-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 12px;
}

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

.status-label {
    font-weight: bold;
    color: #2c3e50;
    min-width: 60px;
}

.status-bar {
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.status-fill.happiness {
    background: linear-gradient(90deg, #f39c12, #f1c40f);
}

.status-fill.knowledge {
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.status-value {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: bold;
    min-width: 50px;
    text-align: right;
}

/* ==================== アイテムショップ ==================== */
.item-shop {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.shop-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.shop-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.item-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.item-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.item-effect {
    font-size: 0.9rem;
    color: #27ae60;
    margin-bottom: 5px;
}

.item-price {
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 15px;
}

.buy-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.buy-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 日替わりミッション ==================== */
.daily-missions {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.missions-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.mission-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mission-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.mission-item.completed {
    background: #d5f4e6;
    border: 2px solid #27ae60;
}

.mission-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mission-icon {
    font-size: 2rem;
}

.mission-details h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.mission-details p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.mission-reward {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-weight: bold;
}

/* ==================== 進化履歴 ==================== */
.evolution-history {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.history-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.history-item.unlocked {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border: 2px solid #3498db;
}

.history-sprite {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    background: #ecf0f1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.history-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c3e50;
}

/* ==================== 進化演出モーダル ==================== */
.evolution-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.evolution-content {
    background: white;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    animation: slideUp 0.5s ease;
}

.evolution-animation {
    margin-bottom: 30px;
}

.sparkles {
    font-size: 2rem;
    animation: sparkle 1s ease-in-out infinite;
}

.evolution-sprites {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.old-sprite,
.new-sprite {
    width: 100px;
    height: 100px;
    background: #f8f9fa;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.evolution-arrow {
    font-size: 2rem;
    color: #3498db;
    animation: pulse 1s ease-in-out infinite;
}

.evolution-message h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.evolution-message p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

.evolution-close-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.evolution-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* ==================== アニメーション ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

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

/* ==================== レスポンシブ対応 ==================== */
@media (max-width: 768px) {
    .pet-main {
        grid-template-columns: 1fr;
    }
    
    .pet-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .shop-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .evolution-sprites {
        flex-direction: column;
        gap: 20px;
    }
    
    .evolution-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .pet-container {
        padding: 10px;
    }
    
    .shop-items {
        grid-template-columns: 1fr;
    }
    
    .pixel {
        width: 12px;
        height: 12px;
    }
    
    .pet-sprite {
        grid-template-columns: repeat(16, 12px);
        grid-template-rows: repeat(16, 12px);
    }
}