* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'M PLUS Rounded 1c', 'Kosugi Maru', sans-serif;
}

body {
    background-color: #fce7f3;
    /* 優しいピンク色 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    /* スクロール防止（スマホ向け） */
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    /* スマホアスペクト比固定 */
    height: 100vh;
    max-height: 853px;
    /* 16:9に近いサイズ */
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ヘッダーエリア */
#game-header {
    background: #fbcfe8;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #f472b6;
    z-index: 10;
}

.score-board,
.next-box {
    text-align: center;
    background: white;
    padding: 5px 12px;
    border-radius: 12px;
    border: 2px solid #db2777;
    box-shadow: 0 4px 0 #fbcfe8;
}

.score-label {
    font-size: 12px;
    color: #be185d;
    font-weight: 700;
}

#current-score,
#best-score {
    font-size: 20px;
    font-weight: 700;
    color: #831843;
}

#next-character-display {
    width: 44px;
    height: 44px;
    margin-top: 2px;
}

#next-character-display img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(131, 24, 67, 0.18);
}

/* キャンバス領域 */
#canvas-container {
    flex: 1;
    position: relative;
    background: linear-gradient(to bottom, #f0fdf4, #e0f2fe);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 特殊エフェクト */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* UIオーバーレイ */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.game-title {
    font-size: 42px;
    color: #e11d48;
    text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 4px 4px 0 #fecdd3;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #881337;
    margin-bottom: 30px;
    font-weight: bold;
}

#result-info {
    font-size: 24px;
    color: #be185d;
    font-weight: bold;
    margin-bottom: 20px;
    background: white;
    padding: 15px 30px;
    border-radius: 20px;
    border: 3px solid #fb7185;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.primary-btn {
    background: linear-gradient(to bottom, #fb7185, #e11d48);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 0 #9f1239;
    transition: transform 0.1s, box-shadow 0.1s;
}

.primary-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #9f1239;
}

/* JINSEI PON START UI 2026-07-20 */
:root {
    --ui-pink: #f43f75;
    --ui-pink-dark: #c91855;
    --ui-pink-soft: #ffe1eb;
    --ui-yellow: #ffd95a;
    --ui-blue: #67ccef;
    --ui-ink: #70304e;
}

.hidden { display: none !important; }

.overlay {
    padding: 18px;
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 217, 90, .72) 0 9px, transparent 10px),
        radial-gradient(circle at 87% 18%, rgba(103, 204, 239, .5) 0 13px, transparent 14px),
        linear-gradient(160deg, rgba(255, 240, 246, .97), rgba(238, 250, 255, .97));
    backdrop-filter: blur(7px);
}

.start-card {
    position: relative;
    width: min(100%, 420px);
    padding: 24px 22px 20px;
    text-align: center;
    background: rgba(255, 255, 255, .96);
    border: 4px solid #fff;
    border-radius: 34px;
    box-shadow: 0 12px 0 rgba(244, 63, 117, .13), 0 20px 50px rgba(112, 48, 78, .16);
}

.start-card::before {
    content: '';
    position: absolute;
    inset: -8px;
    z-index: -1;
    border: 3px dashed rgba(244, 63, 117, .34);
    border-radius: 40px;
}

.title-badge {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 14px;
    color: var(--ui-pink-dark);
    font-size: 13px;
    letter-spacing: .06em;
    background: #fff2a9;
    border-radius: 999px;
    transform: rotate(-1deg);
}

.title-lockup {
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    gap: 8px;
    align-items: center;
}

.title-character {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 5px 5px rgba(112, 48, 78, .18));
}

.title-character--baby { transform: rotate(-8deg); }
.title-character--senior { transform: rotate(8deg); }

.game-title {
    margin-bottom: 4px;
    color: var(--ui-pink);
    font-size: 33px;
    line-height: 1.05;
    letter-spacing: -.07em;
    white-space: nowrap;
    text-shadow: 0 4px 0 #ffd2df;
}

.subtitle {
    margin: 0;
    color: var(--ui-ink);
    font-size: 12px;
    font-weight: bold;
}

.growth-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 16px 0 10px;
}

.growth-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 0 var(--ui-pink-soft), 0 4px 8px rgba(112, 48, 78, .14);
}

.growth-preview span { color: #ff9b31; font-size: 27px; line-height: 1; }

.goal-pill {
    margin: 0 auto 13px;
    padding: 7px 12px;
    color: #8b451d;
    font-size: 13px;
    background: #fff4bd;
    border: 2px solid #ffd45c;
    border-radius: 14px;
}

.how-to { display: grid; gap: 7px; text-align: left; }

.how-to__item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 6px 10px;
    color: #7a5366;
    font-family: 'Kosugi Maru', sans-serif;
    font-size: 11px;
    line-height: 1.35;
    background: #fff7fa;
    border: 2px solid #ffe0ea;
    border-radius: 15px;
}

.how-to__item b {
    display: block;
    color: var(--ui-pink-dark);
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 13px;
}

.how-to__icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    font-size: 20px;
    background: linear-gradient(145deg, #76d7f4, #4bb8e1);
    border-radius: 12px;
    box-shadow: 0 3px 0 #258eb9;
}

.how-to__item:nth-child(2) .how-to__icon { background: linear-gradient(145deg, #ff9ab7, #f43f75); box-shadow: 0 3px 0 #c91855; }
.how-to__item:nth-child(3) .how-to__icon { background: linear-gradient(145deg, #ffd95a, #ffad32); box-shadow: 0 3px 0 #df7f10; }

#result-info {
    margin: 20px 0;
    padding: 14px 24px;
    color: var(--ui-pink-dark);
    background: #fff6cf;
    border: 3px solid var(--ui-yellow);
    border-radius: 22px;
    box-shadow: none;
}

.result-label { display: block; font-size: 13px; }
#final-score { display: block; font-size: 38px; line-height: 1.1; }

.primary-btn {
    width: 100%;
    margin-top: 16px;
    padding: 15px 20px;
    color: #fff;
    font-size: 19px;
    letter-spacing: .03em;
    background: linear-gradient(to bottom, #ff759a, #f02663);
    border-radius: 20px;
    box-shadow: 0 7px 0 #b9144b, 0 12px 20px rgba(201, 24, 85, .22);
}

.primary-btn span { display: inline-block; margin-right: 5px; color: #fff5a8; font-size: 16px; }
.primary-btn:active { transform: translateY(7px); box-shadow: 0 0 0 #b9144b; }

.start-note { margin-top: 14px; color: #b86486; font-family: 'Kosugi Maru', sans-serif; font-size: 11px; }

.sky-spark {
    position: absolute;
    color: rgba(244, 63, 117, .35);
    font-size: 26px;
    animation: floatSpark 2.8s ease-in-out infinite;
}
.sky-spark--one { top: 8%; left: 7%; }
.sky-spark--two { top: 16%; right: 6%; color: rgba(103, 204, 239, .55); animation-delay: -1s; }
.sky-spark--three { right: 10%; bottom: 8%; color: rgba(255, 185, 52, .55); animation-delay: -2s; }
@keyframes floatSpark { 50% { transform: translateY(-8px) rotate(8deg); } }

.overlay.is-game-over .intro-only { display: none; }
.overlay.is-game-over .start-card { padding-top: 36px; }
.overlay.is-game-over .title-lockup { display: block; }
.overlay.is-game-over .subtitle { margin-top: 10px; font-size: 14px; }

@media (max-height: 720px) {
    .start-card { padding: 16px 18px 14px; border-radius: 28px; }
    .title-badge { margin-bottom: 6px; padding-block: 4px; }
    .title-lockup { grid-template-columns: 50px 1fr 50px; }
    .title-character { width: 50px; height: 50px; }
    .game-title { font-size: 31px; }
    .growth-preview { margin-top: 10px; }
    .growth-preview img { width: 40px; height: 40px; }
    .goal-pill { margin-bottom: 8px; padding-block: 5px; }
    .how-to { gap: 5px; }
    .how-to__item { min-height: 42px; padding-block: 3px; }
    .primary-btn { margin-top: 11px; padding-block: 12px; }
    .start-note { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) { .sky-spark { animation: none; } }

