/* =========================================
   全体
========================================= */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;

    background: #FFF8DC;

    font-family:
        "Zen Maru Gothic",
        "Hiragino Maru Gothic ProN",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        sans-serif;

    color: #4A4A4A;

    touch-action: manipulation;
}

button {
    font-family: inherit;
}

button:focus-visible {
    outline: 4px solid #8DB5FF;
    outline-offset: 2px;
}


/* =========================================
   アプリ
========================================= */

.app {
    width: 100%;
    min-height: 100vh;

    display: flex;
    justify-content: center;
}

.screen {
    width: 100%;
    max-width: 1000px;
    min-height: 100vh;

    margin: 0 auto;

    padding:
        clamp(10px, 2vh, 20px)
        clamp(10px, 2vw, 24px)
        24px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none !important;
}


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

.page-header {
    width: 100%;

    text-align: center;

    margin-bottom: clamp(10px, 2vh, 18px);
}

.app-title {
    margin: 0;

    font-size: clamp(28px, 5vw, 44px);
    font-weight: 900;

    letter-spacing: 0.08em;

    color: #5C7CFA;

    line-height: 1.15;

    text-shadow:
        0 2px 0 #FFFFFF,
        0 4px 7px rgba(0, 0, 0, 0.08);
}

.app-subtitle {
    margin:
        6px
        0
        0;

    font-size: clamp(13px, 2.3vw, 18px);
    font-weight: 700;

    color: #777;
}


/* =========================================
   五十音表エリア
========================================= */

.gojuon-area {
    width: 100%;

    background: #FFFFFF;

    border-radius: 24px;

    padding:
        clamp(12px, 2vw, 20px)
        clamp(10px, 2vw, 20px)
        clamp(14px, 2vw, 22px);

    box-shadow:
        0 5px 0 rgba(220, 210, 180, 0.55),
        0 8px 18px rgba(0, 0, 0, 0.06);
}

.section-title {
    margin:
        0
        0
        clamp(9px, 1.5vh, 14px);

    text-align: center;

    font-size: clamp(17px, 3vw, 25px);
    font-weight: 900;

    color: #555;
}


/* =========================================
   五十音表
========================================= */

.gojuon-table {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(10, minmax(0, 1fr));

    grid-template-rows:
        repeat(5, minmax(0, 1fr));

    gap: clamp(5px, 0.9vw, 10px);
}


/* =========================================
   ひらがなボタン
========================================= */

.kana-button {
    width: 100%;

    aspect-ratio: 1 / 1;

    border: none;
    border-radius: clamp(9px, 1.5vw, 16px);

    background: #F4F7FF;

    color: #444;

    font-size: clamp(21px, 4vw, 38px);
    font-weight: 900;

    line-height: 1;

    cursor: pointer;

    box-shadow:
        0 4px 0 #D9E0F5,
        0 5px 9px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.08s ease,
        box-shadow 0.08s ease,
        background 0.15s ease;
}

.kana-button:not(:disabled):active {
    transform: translateY(4px) scale(0.96);

    background: #E9EEFF;

    box-shadow:
        0 1px 0 #D9E0F5,
        0 2px 5px rgba(0, 0, 0, 0.05);
}

@media (hover: hover) {

    .kana-button:not(:disabled):hover {
        background: #EAF0FF;

        transform: translateY(-2px);

        box-shadow:
            0 6px 0 #D9E0F5,
            0 8px 12px rgba(0, 0, 0, 0.07);
    }

}


/* =========================================
   空白
========================================= */

.kana-empty {
    width: 100%;
    aspect-ratio: 1 / 1;
}


/* =========================================
   「を」「ん」
========================================= */

.kana-disabled {
    background: #EEEEEE;

    color: #AAAAAA;

    cursor: default;

    box-shadow:
        0 3px 0 #DDDDDD,
        0 4px 6px rgba(0, 0, 0, 0.03);
}


/* =========================================
   図鑑画面
========================================= */

.dictionary-header {
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;
}

.home-button {
    position: absolute;

    left: 0;
    top: 50%;

    transform: translateY(-50%);

    border: none;
    border-radius: 14px;

    padding:
        9px
        13px;

    background: #FFFFFF;

    color: #666;

    font-size: clamp(13px, 2.2vw, 17px);
    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 4px 0 #D8D8D8,
        0 5px 9px rgba(0, 0, 0, 0.06);
}

.home-button:active {
    transform:
        translateY(calc(-50% + 4px))
        scale(0.97);

    box-shadow:
        0 1px 0 #D8D8D8,
        0 2px 5px rgba(0, 0, 0, 0.04);
}


/* =========================================
   図鑑：ひらがな表示
========================================= */

.picture-area {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.kana-display {
    margin:
        clamp(0px, 1vh, 8px)
        0
        clamp(8px, 1.5vh, 14px);

    font-size: clamp(70px, 14vw, 130px);
    font-weight: 900;

    line-height: 0.9;

    color: #5C7CFA;

    text-shadow:
        0 3px 0 #FFFFFF,
        0 6px 10px rgba(0, 0, 0, 0.08);

    animation: kanaAppear 0.3s ease-out;
}

@keyframes kanaAppear {

    0% {
        opacity: 0;
        transform: scale(0.7);
    }

    70% {
        opacity: 1;
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


/* =========================================
   図鑑：イラスト
========================================= */

.picture-card {
    width: min(80vw, 620px);

    aspect-ratio: 1 / 1;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: clamp(10px, 2vw, 20px);

    background: #FFFFFF;

    border-radius: 28px;

    box-shadow:
        0 5px 0 rgba(220, 210, 180, 0.55),
        0 8px 18px rgba(0, 0, 0, 0.07);

    overflow: hidden;
}

.picture-image {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;

    animation: pictureAppear 0.35s ease-out;
}

@keyframes pictureAppear {

    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    70% {
        opacity: 1;
        transform: scale(1.04);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }

}


/* =========================================
   スマホ縦向き
========================================= */

@media (max-width: 600px) and (orientation: portrait) {

    .screen {
        padding-top: 10px;
    }

    .gojuon-table {
        gap: 4px;
    }

    .kana-button {
        font-size: clamp(18px, 5vw, 30px);
        border-radius: 9px;
    }

    .home-button {
        padding: 7px 9px;
        border-radius: 11px;
    }

    .picture-card {
        width: min(88vw, 500px);
    }

}


/* =========================================
   スマホ横向き・タブレット・PC
========================================= */

@media (orientation: landscape) {

    .screen {
        padding-top: 7px;
        padding-bottom: 14px;
    }

    .page-header {
        margin-bottom: 7px;
    }

    .app-title {
        font-size: clamp(23px, 4vw, 34px);
    }

    .app-subtitle {
        margin-top: 2px;
        font-size: clamp(11px, 1.8vw, 15px);
    }

    .gojuon-area {
        padding:
            9px
            12px
            12px;
    }

    .section-title {
        margin-bottom: 6px;
        font-size: clamp(13px, 2.3vw, 19px);
    }

    .gojuon-table {
        gap: 4px;
    }

    .kana-button {
        font-size: clamp(16px, 3vw, 30px);
        border-radius: 9px;
    }

    .picture-card {
        width: min(55vh, 500px);
    }

    .kana-display {
        font-size: clamp(55px, 13vh, 100px);
        margin-bottom: 7px;
    }

}


/* =========================================
   大きなPC画面
========================================= */

@media (min-width: 900px) and (orientation: landscape) {

    .screen {
        max-width: 1000px;
    }

    .gojuon-area {
        max-width: 960px;
    }

    .kana-button {
        font-size: clamp(24px, 3vw, 38px);
    }

}

