@font-face {
    font-family: misaki;
    src: url("uzura.ttf") format("truetype");
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    z-index: 10000;
    background-color: lightblue;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOut 1s 5s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}


.loading__logo {
    width: 50px;
    opacity: 0;
}

#a{
    animation: appear 1s 1s forwards;
}

#b{
    animation: appear 1s 2.5s forwards;
}

#c{
    animation: appear 1s 4s forwards;
}

@keyframes appear {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}
html{
    text-align: center;
}
body {
    margin: 0;
    font-family: sans-serif;
    background: lightblue;
    color: dimgray;
    position: relative;
    min-height: 100vh;
    font-family: misaki;
    overflow: hidden;
    touch-action: manipulation;
}


/* 2行x3列グリッド */
.character-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    margin: 20px 0;
    justify-items: center;
    align-items: center;
}

.character {
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.character img {
    width: 90%;
    height: auto;
}

.character:hover {
    transform: scale(1.15);
}

.character.selected {
    border: 2px solid #043646;
    background: #f3ecd8;
    transform: scale(1.05);
}

.button-area {
    margin-top: 20px;
}

#confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    background: #ccc;
    color: #fff;
    cursor: not-allowed;
    transition: background 0.2s;
}


#confirm-btn.active {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    background: #136d8a;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

/* 下部インフォメーションバー(右→左にスクロール) */
.info-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    background: #333;
    color: #fff;
    font-size: 0.9em;
    box-sizing: border-box;
    height: 40px;
    line-height: 40px;
    white-space: nowrap;
}

.info-bar-message {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 10s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* モーダルウィンドウ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: left;
    max-width: 300px;
    width: 80%;
}

.modal-content h2 {
    margin-top: 0;
}

/* カードの表裏アニメーション */
.card-container {
    perspective: 1000px;
    margin-top: 10px;
}

.card {
    position: relative;
    width: 100%;
    height: 150px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: #fafafa;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}

.card.flipped {
    transform: rotateY(180deg);
}

.hint {
    font-size: 0.8em;
    color: #888;
    margin-top: 10px;
    text-align: center;
}

/* モーダル内ボタン(はじめる、閉じる) */
.modal-button-area {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.modal-button-area button {
    flex: 1;
    margin: 0 5px;
    padding: 10px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    box-sizing: border-box;
}

.modal-button-area button:hover {
    background: #555;
}

.modal-button-area button:first-child {
    margin-left: 0;
}
.modal-button-area button:last-child {
    margin-right: 0;
}

.start-modal  {
    color: orangered;
}
.game-area {
    position: fixed;
    left: 0;
    bottom: 40px; /* info-barが40px高さの場合、その上に配置 */
    width: 100%;
    height: 230px;
    background: lightblue;
    overflow: hidden;
}

.broccoli {
    position: absolute;
    bottom: 0;
    left: 50px;
    width: 50px;
    height: 50px;
    background: url('Y.WebP') no-repeat center/cover;
    /* JSでbottomを変更してジャンプを表現するためCSSアニメは不要 */
}

.carrot {
    position: absolute;
    bottom: 0;
    width: 40px;
    height: 120px;
    background: url('X.WebP') no-repeat center/cover;
    animation: moveCarrot 3s linear forwards;
}

@keyframes moveCarrot {
    0% { right: -40px; }
    100% { right: 100%; }
}
a{
    color: #043646;
}
#ad{
    font-size: 4vw;
    margin-left: auto;
    margin-right: auto;
}
html {
    touch-action: manipulation;
}