* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   共通ヘッダー
   ============================================ */

.site-header {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.site-logo:hover {
    opacity: 0.8;
}

.current-page {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.8rem 1rem;
    }
    
    .site-logo {
        font-size: 1.2rem;
    }
    
    .current-page {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 400px) {
    .site-logo {
        font-size: 1rem;
    }
    
    .current-page {
        font-size: 0.8rem;
    }
}

/* ============================================
   既存のスタイル
   ============================================ */

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding-bottom: 80px;
}

main {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 2rem;
}

.welcome {
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.welcome h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.welcome p {
    color: #666;
    font-size: 1.2rem;
    line-height: 1.6;
}

/* 折りたたみボタン（固定位置） */
.toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.toggle-btn .arrow {
    display: block;
    transition: transform 0.3s ease;
}

.toggle-btn.expanded .arrow {
    transform: rotate(180deg);
}

/* ゲームフッター */
#game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-top: 3px solid #667eea;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease;
    z-index: 999;
    height: 450px; /* ヘッダー分高さを増加 */
}

#game-footer.collapsed {
    transform: translateY(100%);
}

/* ゲームヘッダー */
.game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.game-title {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-switcher {
    display: flex;
    gap: 0.5rem;
}

.game-switch-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.game-switch-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.game-switch-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-switch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-switch-btn:disabled:hover {
    transform: none;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    height: calc(100% - 70px); /* ヘッダー分を引く */
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* キャラクターセクション */
.character-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 2;
}

.character-container {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bow-character {
    font-size: 80px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
}

.bow-character:active {
    transform: scale(0.95);
}

.bow-character.charging {
    animation: pulse 0.5s ease-in-out infinite;
}

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

/* パワーゲージ */
.power-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.power-gauge {
    width: 200px;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #666;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50 0%, #FFC107 50%, #F44336 100%);
    transition: width 0.05s linear;
    border-radius: 15px;
}

.power-label {
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

/* ターゲットセクション */
.target-section {
    flex: 1;
    height: 300px;
    position: relative;
    margin-left: 3rem;
    min-width: 700px; /* PCでの最小幅 */
}

.target-box {
    position: absolute;
    background: white;
    border: 3px solid #333;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    white-space: nowrap; /* テキストを1行に */
}

.target-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.target-box.hit {
    animation: hit-effect 0.5s ease;
    background: #FFD700;
    border-color: #FFA500;
}

@keyframes hit-effect {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px 10px rgba(255, 215, 0, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Canvas for arrow */
#arrow-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ゲームオーバー画面 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10;
    min-width: 400px;
}

.game-over h2 {
    color: #F44336;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-over p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.retry-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.retry-button:active {
    transform: translateY(0);
}

/* ============================================
   ゲーム2: 風船射撃
   ============================================ */

.game2-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.balloon-bow {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 80px;
    z-index: 2;
}

.bow-icon {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.balloon-area {
    width: 700px;
    height: 300px;
    position: relative;
    margin: 0 auto;
}

.balloon {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.1s ease;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.balloon::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 15px;
    width: 20px;
    height: 25px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    transform: rotate(-45deg);
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 15px;
    background: #666;
}

.balloon.color-1 { background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%); }
.balloon.color-2 { background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%); }
.balloon.color-3 { background: linear-gradient(135deg, #FFE66D 0%, #FFCA3A 100%); }
.balloon.color-4 { background: linear-gradient(135deg, #95E1D3 0%, #38B2AC 100%); }
.balloon.color-5 { background: linear-gradient(135deg, #C779D0 0%, #A855F7 100%); }

.balloon.hit {
    animation: balloon-pop 0.4s ease forwards;
}

@keyframes balloon-pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

#balloon-arrow-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.shoot-btn {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 3;
}

.shoot-btn:hover:not(:disabled) {
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.shoot-btn:active:not(:disabled) {
    transform: translateX(-50%) translateY(-1px);
}

.shoot-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   ゲーム3: カーリング
   ============================================ */

.game3-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem 1rem 2rem;
}

.curling-area {
    width: 100%;
    max-width: 900px;
    height: 250px;
    position: relative;
    background: linear-gradient(to right, 
        rgba(200, 230, 255, 0.3) 0%, 
        rgba(220, 240, 255, 0.5) 50%, 
        rgba(200, 230, 255, 0.3) 100%);
    border-radius: 10px;
    overflow: visible;
}

.stone {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    z-index: 3;
}

.stone-circle {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset -5px -5px 10px rgba(0, 0, 0, 0.2);
    position: relative;
}

.stone-circle::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.brush {
    position: absolute;
    left: 130px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    z-index: 2;
    transition: transform 0.1s ease;
}

.brush.sweeping {
    animation: sweep 0.2s ease-in-out;
}

@keyframes sweep {
    0%, 100% { transform: translateY(-50%) rotate(0deg); }
    50% { transform: translateY(-50%) rotate(-15deg); }
}

.tee {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
}

.tee-circles {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.tee-targets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tee-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 400px;
}

.curling-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 3;
}

.curling-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.curling-btn:active:not(:disabled) {
    transform: translateY(0);
}

.curling-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.curling-btn.sweep-mode {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.curling-power-gauge {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    border: 2px solid #666;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.curling-power-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #FFC107 50%, #F44336 100%);
    border-radius: 15px;
    transition: width 0.05s linear;
}

.tee-label {
    position: absolute;
    background: white;
    border: 3px solid #E53935;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    font-weight: bold;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: default;
    user-select: none;
    white-space: nowrap;
    transform: translateY(-50%);
}

.tee-label.hit {
    animation: tee-hit 0.6s ease;
    background: #FFD700;
    border-color: #FFA500;
}

@keyframes tee-hit {
    0%, 100% { 
        transform: translateY(-50%) scale(1); 
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); 
    }
    50% { 
        transform: translateY(-50%) scale(1.2); 
        box-shadow: 0 0 30px 15px rgba(255, 215, 0, 0); 
    }
}

.curling-controls {
@media (max-width: 768px) {
    #game-footer {
        height: 420px; /* SPでも調整 */
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: flex-start;
    }
    
    .game-title {
        font-size: 1.2rem;
    }
    
    .game-switcher {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .game-switch-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        flex: 0 1 auto;
    }

    .game-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        height: calc(100% - 100px); /* ヘッダーが大きくなる分調整 */
    }

    .target-section {
        margin-left: 0;
        height: 200px;
        width: 100%;
        min-width: 350px; /* SPでの最小幅 */
    }

    .power-gauge {
        width: 150px;
    }

    .game-over {
        min-width: 300px;
        padding: 2rem;
    }
    
    .target-box {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }
    
    /* ゲーム2のレスポンシブ */
    .balloon-area {
        width: 350px;
        height: 250px;
    }
    
    .balloon-bow {
        left: 0.5rem;
        font-size: 60px;
    }
    
    .balloon {
        width: 60px;
        height: 60px;
        font-size: 0.75rem;
    }
    
    .shoot-btn {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
    
    /* ゲーム3のレスポンシブ */
    .curling-area {
        max-width: 100%;
        height: 200px;
    }
    
    .stone {
        width: 50px;
        height: 50px;
        left: 30px;
    }
    
    .brush {
        left: 90px;
        font-size: 40px;
    }
    
    .tee {
        width: 220px;
        height: 220px;
        right: 30px;
    }
    
    .tee-label {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
    
    .curling-btn {
        font-size: 1.1rem;
        padding: 0.6rem 2rem;
    }
    
    .curling-controls {
        max-width: 300px;
    }
}

@media (max-width: 400px) {
    .game-switch-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .target-section {
        min-width: 320px; /* 小さいスマホ対応 */
    }
    
    .target-box {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    /* ゲーム2の小さいスマホ対応 */
    .balloon-area {
        width: 320px;
        height: 220px;
    }
    
    .balloon {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
    
    .shoot-btn {
        font-size: 1rem;
        padding: 0.6rem 1.5rem;
    }
    
    /* ゲーム3の小さいスマホ対応 */
    .curling-area {
        height: 180px;
    }
    
    .stone {
        width: 40px;
        height: 40px;
        left: 20px;
    }
    
    .brush {
        left: 70px;
        font-size: 35px;
    }
    
    .tee {
        width: 180px;
        height: 180px;
        right: 20px;
    }
    
    .tee-label {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }
    
    .curling-btn {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }
}
