:root {
    --park-primary: #A0C6D3;
    --park-primary-dark: #6F9FAF;
    --park-accent: #E29B45;
    --park-highlight: #F1C40F;
    --park-background: #F8FBFB;
    --park-text: #333333;
    --park-white: #FFFFFF;
}

/* 全ゲーム共通：トップページの配色と「大冒険」の丸みのあるUI */
body {
    background-color: var(--park-background);
    color: var(--park-text);
    font-family: 'Helvetica Neue', Arial, 'Hiragino Maru Gothic ProN', 'Meiryo', sans-serif;
}

header {
    background-color: var(--park-primary);
    box-shadow: 0 2px 5px rgba(66, 104, 116, 0.18);
    min-height: 58px;
    padding: 15px 12px;
}

header h1 {
    color: var(--park-white);
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0;
}

.screen {
    background-color: var(--park-background);
    text-align: center;
}

#start-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: clamp(24px, 6vh, 56px);
    touch-action: pan-y;
}

.hero-image,
.hero-image[style] {
    animation: park-bounce 2s infinite ease-in-out;
    height: auto;
    margin-bottom: 20px;
    width: 150px !important;
}

@keyframes park-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

#start-screen > p,
.game-description {
    color: #4B4B4B;
    font-size: 1rem;
    line-height: 1.75;
    margin: 0 0 4px;
}

.hint-text {
    animation: park-pulse 2s infinite;
    background-color: var(--park-highlight);
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(91, 77, 0, 0.16);
    color: var(--park-text);
    display: inline-block;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 10px;
    padding: 5px 15px;
}

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

.primary-btn,
.secondary-btn,
.line-btn {
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(66, 104, 116, 0.14);
    font-size: 1.15rem;
    max-width: 300px;
    padding: 15px 30px;
    transition: background-color 0.2s, transform 0.1s;
    width: 80%;
}

.primary-btn {
    background-color: var(--park-primary);
    color: var(--park-white);
}

.primary-btn.is-connecting {
    animation: game-start-gradient 1.5s linear infinite;
    background: linear-gradient(110deg, var(--park-primary-dark) 10%, var(--park-accent) 45%, var(--park-primary-dark) 80%);
    background-size: 220% 100%;
    cursor: wait;
    opacity: 1;
}

.primary-btn.is-connecting::before {
    animation: game-start-bento 0.8s ease-in-out infinite alternate;
    content: "🍱";
    display: inline-block;
    margin-right: 8px;
}

.primary-btn.is-connecting::after {
    animation: game-start-dots 1.2s steps(4, end) infinite;
    content: "";
    display: inline-block;
    overflow: hidden;
    text-align: left;
    vertical-align: bottom;
    width: 1.5em;
}

.game-start-status {
    align-items: center;
    animation: game-start-status-in 0.25s ease-out;
    background: #fff8e9;
    border: 1px solid rgba(226, 155, 69, 0.45);
    border-radius: 999px;
    color: #735225;
    display: flex;
    font-size: 0.85rem;
    gap: 7px;
    justify-content: center;
    margin: 0 0 8px;
    min-height: 34px;
    padding: 7px 14px;
}

.game-start-status-icon {
    animation: game-start-icon 1s ease-in-out infinite;
    display: inline-block;
}

@keyframes game-start-gradient {
    to { background-position: -220% 0; }
}

@keyframes game-start-bento {
    from { transform: rotate(-8deg) translateY(1px); }
    to { transform: rotate(8deg) translateY(-2px); }
}

@keyframes game-start-dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75%, 100% { content: "..."; }
}

@keyframes game-start-status-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes game-start-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .primary-btn.is-connecting,
    .primary-btn.is-connecting::before,
    .primary-btn.is-connecting::after,
    .game-start-status,
    .game-start-status-icon {
        animation: none;
    }
}

.primary-btn:active {
    background-color: var(--park-primary-dark);
    transform: scale(0.95);
}

.secondary-btn {
    background-color: var(--park-white);
    border: 2px solid var(--park-primary);
    color: var(--park-primary-dark);
}

.secondary-btn:active {
    background-color: #EDF5F7;
    transform: scale(0.95);
}

.game-header {
    color: var(--park-primary-dark);
    font-size: 1.1rem;
    max-width: 480px;
}

.game-header > div {
    background: transparent;
    border: 0;
    min-width: 0;
    padding: 6px 8px;
}

#game-canvas {
    border: 4px solid var(--park-primary);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(66, 104, 116, 0.2);
}

#card-board {
    background: var(--park-white);
    border: 4px solid var(--park-primary);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(66, 104, 116, 0.2);
    padding: 10px;
}

.card-front {
    border-color: var(--park-primary);
}

.card-back {
    background: linear-gradient(135deg, var(--park-primary), var(--park-primary-dark));
    border-color: var(--park-primary-dark);
}

.guide-text {
    background: rgba(51, 51, 51, 0.62);
    border-radius: 20px;
    color: var(--park-white);
    padding: 10px 20px;
    text-shadow: none;
}

#clear-screen,
#gameover-screen {
    overflow-y: auto;
    padding-top: 28px;
}

#clear-screen h2,
#gameover-screen h2 {
    color: var(--park-primary-dark);
    margin-bottom: 12px;
}

.keyword-box {
    border-color: var(--park-primary);
    color: var(--park-primary-dark);
}

.result-detail {
    background: #EDF5F7;
}

.result-detail span {
    color: var(--park-primary-dark);
}

/* 抽選：期待感のあるカプセル演出と結果表示 */
#lottery-container {
    overflow: hidden;
    position: relative;
}

#draw-lottery-btn.is-drawing {
    cursor: wait;
    visibility: hidden;
}

.lottery-animation {
    align-items: center;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    min-height: 132px;
    position: relative;
}

.lottery-glow {
    animation: lottery-glow 0.9s ease-in-out infinite alternate;
    background: radial-gradient(circle, rgba(241, 196, 15, 0.5), rgba(241, 196, 15, 0) 68%);
    height: 120px;
    position: absolute;
    width: 120px;
}

.lottery-capsule {
    animation: lottery-shake 0.38s ease-in-out infinite;
    display: block;
    filter: drop-shadow(0 7px 5px rgba(102, 76, 0, 0.22));
    font-size: 3.5rem;
    line-height: 1;
    position: relative;
}

.lottery-animation-text {
    color: #8a6100;
    font-size: 1rem;
    font-weight: bold;
    position: relative;
}

.lottery-dots { display: flex; gap: 5px; position: relative; }
.lottery-dots i {
    animation: lottery-dot 0.75s ease-in-out infinite alternate;
    background: var(--park-highlight);
    border-radius: 50%;
    height: 7px;
    width: 7px;
}
.lottery-dots i:nth-child(2) { animation-delay: 0.15s; }
.lottery-dots i:nth-child(3) { animation-delay: 0.3s; }

.lottery-result-reveal { animation: lottery-result-pop 0.65s cubic-bezier(.2, 1.6, .45, 1); }
.lottery-result-reveal.is-win { text-shadow: 0 2px 12px rgba(241, 196, 15, 0.5); }
.lottery-result-reveal.is-lose { animation-name: lottery-result-soft; }

.lottery-confetti { inset: 0; overflow: hidden; pointer-events: none; position: absolute; z-index: 5; }
.lottery-confetti i {
    animation: lottery-confetti-fall 1.8s ease-out var(--confetti-delay) forwards;
    background: var(--confetti-color);
    left: var(--confetti-x);
    opacity: 0;
    position: absolute;
    top: -12px;
    height: 10px;
    width: 7px;
}

@keyframes lottery-shake {
    0%, 100% { transform: rotate(-7deg) translateY(0); }
    50% { transform: rotate(7deg) translateY(-5px) scale(1.04); }
}
@keyframes lottery-glow { from { opacity: .45; transform: scale(.75); } to { opacity: 1; transform: scale(1.2); } }
@keyframes lottery-dot { from { opacity: .3; transform: translateY(2px); } to { opacity: 1; transform: translateY(-2px); } }
@keyframes lottery-result-pop { from { opacity: 0; transform: scale(.35) rotate(-3deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes lottery-result-soft { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lottery-confetti-fall {
    0% { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(250px) rotate(var(--confetti-spin)); }
}

@media (prefers-reduced-motion: reduce) {
    .lottery-glow, .lottery-capsule, .lottery-dots i,
    .lottery-result-reveal, .lottery-confetti i { animation: none; }
    .lottery-confetti { display: none; }
}

.notice-content {
    border-color: var(--park-primary);
}

.notice-btn {
    background-color: var(--park-primary);
}

.ad-space {
    margin-top: 20px;
}

@media (max-height: 700px) {
    #start-screen {
        padding-top: 18px;
    }

    .hero-image,
    .hero-image[style] {
        margin-bottom: 12px;
        width: 120px !important;
    }
}
