﻿/* ==========================================
   全体共通
========================================== */

/* 余白をリセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ページ全体 */
body {

    font-family: "Yu Gothic", sans-serif;

    /* 空と地面をイメージした背景 */
    background: linear-gradient(
        to bottom,
        #cdefff 0%,
        #eaf8ff 65%,
        #b8e986 100%
    );

    color: #333;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* ==========================================
   ヘッダー
========================================== */

header {

    text-align: center;

    padding: 20px 15px;

}

header h1 {

    color: #d84315;

    font-size: 2rem;

    margin-bottom: 10px;

}

header p {

    color: #555;

}

/* ==========================================
   メイン
========================================== */

main {

    width: 100%;
    max-width: 430px;

    margin: auto;

    padding: 15px;

}

/* ==========================================
   共通カードデザイン
========================================== */

section {

    background: rgba(255,255,255,0.9);

    border-radius: 15px;

    padding: 10px;

    margin-bottom: 15px;

    box-shadow: 0 4px 10px rgba(0,0,0,0.1);

}

section h2 {

    text-align: center;

    margin-bottom: 12px;

    color: #388e3c;

}

/* ==========================================
   現在地取得ボタン
========================================== */

#locationButton {

    width: 100%;

    height: 35px;

    border: none;

    border-radius: 10px;

    background: #4caf50;

    color: white;

    font-size: 16px;

    cursor: pointer;

    transition: 0.3s;

}

#locationButton:hover {

    background: #43a047;

}

/* ==========================================
   現在地表示
========================================== */

.location-area {

    margin-top: 8px;

    line-height: 2;

}

.location-area span {

    font-weight: bold;

    color: #1565c0;

}

/* ==========================================
   メッセージ表示
========================================== */

#message {

    text-align: center;

    font-weight: bold;

    color: #ff5722;

    min-height: 24px;

}

/* ==========================================
   木エリア
========================================== */

.tree-area {

    position: relative;

    width: 100%;

    max-width: 320px;

    margin: auto;

}

/* 木画像 */

.tree-image {

    width: 100%;

    display: block;

}

/* ==========================================
   りんご共通
========================================== */

.apple {

    position: absolute;

    width: 42px;

    opacity: 0;

    transform: scale(0);

    transition: .4s;

    pointer-events: none;

}

/* JavaScriptで付与 */

.apple.show {

    opacity: 1;

    transform: scale(1);

}

/* ==========================================
   りんご配置
========================================== */

/* 左上 */

.apple1 {

    top: 18%;

    left: 28%;

}

/* 上中央 */

.apple2 {

    top: 12%;

    left: 48%;

    transform: translateX(-50%) scale(0);

}

/* 右上 */

.apple3 {

    top: 22%;

    right: 25%;

}

/* ==========================================
   GET表示
========================================== */

.get-effect {

    position: absolute;

    left: 50%;

    top: 40%;

    transform: translate(-50%, -50%);

    font-size: 34px;

    font-weight: bold;

    color: #ff9800;

    text-shadow:
        2px 2px 4px rgba(0,0,0,.2);

    opacity: 0;

    pointer-events: none;

}

/* JavaScriptで表示 */

.get-effect.show {

    animation: getAnimation .8s ease;

}

/* GETアニメーション */

@keyframes getAnimation {

    0% {

        opacity: 0;

        transform: translate(-50%, -30%) scale(.4);

    }

    40% {

        opacity: 1;

        transform: translate(-50%, -50%) scale(1.4);

    }

    70% {

        opacity: 1;

        transform: translate(-50%, -55%) scale(1);

    }

    100% {

        opacity: 0;

        transform: translate(-50%, -80%) scale(1);

    }

}

/* ==========================================
   スタンプ取得状況
========================================== */

.status-section ul {

    list-style: none;

}

.status-section li {

    padding: 10px;

    border-bottom: 1px solid #ddd;

}

/* JavaScriptで取得済みに付ける */

.status-section .complete {

    color: #2e7d32;

    font-weight: bold;

}

/* ==========================================
   COMPLETE表示
========================================== */

#completeArea {

    display: none;

    text-align: center;

    font-size: 30px;

    font-weight: bold;

    color: #e53935;

    animation: completeAnimation 1s infinite alternate;

}

/* JavaScriptで表示 */

#completeArea.show {

    display: block;

}

/* COMPLETEアニメーション */

@keyframes completeAnimation {

    from {

        transform: scale(1);

    }

    to {

        transform: scale(1.08);

    }

}

/* ==========================================
   フッター
========================================== */

footer {

    text-align: center;

    padding: 15px;

    color: #666;

}

/* ==========================================
   スマホ対応
========================================== */

@media (max-width: 480px) {

    header h1 {

        font-size: 1.7rem;

    }

    .tree-area {

        max-width: 280px;

    }

    .apple {

        width: 36px;

    }

    .get-effect {

        font-size: 28px;

    }

}

#installButton {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: #d84315;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.install-section[hidden] {
    display: none;
}

#installHelp {
    margin-top: 8px;
    text-align: center;
    line-height: 1.6;
}
