body {
    margin: 0;
    padding: 0;
    padding-top: 60px; /* ヘッダーの分だけ上部にスペースを確保 */
    background: linear-gradient(to bottom, #0c0c2e, #1a1a3e);
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    position: relative;
    height: 100vh;
}

/* ヘッダースタイル */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(12, 12, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.header-link:hover {
    color: #ffeb3b;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 235, 59, 0.3);
}

.game-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - 60px); /* ヘッダーの高さを引く */
    top: 60px; /* ヘッダーの分だけ下にずらす */
    cursor: crosshair;
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.shooting-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #fff, #ffeb3b);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    z-index: 10;
}

/* 見えない大きなクリック領域 */
.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background: transparent;
    border-radius: 50%;
    z-index: -1;
}

.shooting-star:hover {
    transform: scale(1.5);
    filter: drop-shadow(0 0 8px #ffeb3b);
}

.shooting-star.clicked {
    filter: drop-shadow(0 0 15px #4caf50);
    background: linear-gradient(45deg, #4caf50, #8bc34a);
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.shooting-star.long::after {
    width: 150px;
    background: linear-gradient(to right, transparent, rgba(255, 235, 59, 0.9), transparent);
}

/* 長い流れ星は少し大きめのクリック領域 */
.shooting-star.long::before {
    width: 50px;
    height: 50px;
}

.ui {
    position: absolute;
    top: 20px; /* ゲームコンテナ内の相対位置 */
    left: 20px;
    color: white;
    font-size: 18px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none; /* Safari対応 */
    -moz-user-select: none; /* Firefox対応 */
    -ms-user-select: none; /* IE対応 */
}

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #ffeb3b;
    margin-bottom: 10px;
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.progress {
    color: #4caf50;
    font-weight: bold;
    user-select: none; /* テキスト選択を無効化 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 200;
}

.instructions button {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.instructions button:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #4caf50);
}

.success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4caf50;
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    z-index: 300;
    animation: celebration 1s ease-in-out;
}

@keyframes celebration {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.restart-btn {
    background: linear-gradient(45deg, #ff9800, #ffc107);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.restart-btn:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px #ff9800);
}

/* 願い事入力フィールドのスタイル */
.wish-input-container {
    margin: 20px 0;
    text-align: left;
}

.wish-input-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: #ffeb3b;
    font-weight: bold;
}

#wishInput {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #4caf50;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 8px;
    box-sizing: border-box;
}

#wishInput:focus {
    outline: none;
    border-color: #ffeb3b;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.5);
}

.wish-note {
    font-size: 12px;
    color: #ccc;
    margin: 0;
    font-style: italic;
}

/* 吹き出しスタイル */
.wish-bubble {
    position: absolute;
    background: linear-gradient(135deg, #ffeb3b, #ffc107);
    color: #333;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 235, 59, 0.6);
    z-index: 1000;
    max-width: 200px;
    word-wrap: break-word;
    pointer-events: none;
    animation: wishBubbleAppear 0.3s ease-out;
    position: relative;
}

.wish-bubble::before {
    content: '✨';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 12px;
    animation: sparkle 1s infinite;
}

.wish-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffeb3b;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes wishBubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes wishBubbleDisappear {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
}

/* プラチナメダル用アニメーション */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}