/* 楽スタ - 時計読み取りゲーム CSS */

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

body {
    font-family: 'Kosugi Maru', 'Noto Sans JP', 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic', '游ゴシック', 'Meiryo', 'メイリオ', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 20px;
    backdrop-filter: blur(10px);
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 15px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 2s infinite;
    font-weight: 700;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.score-board {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.score, .level {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    backdrop-filter: blur(5px);
    min-width: 80px;
}

/* ゲームエリア */
.game-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* 時計コンテナ */
.clock-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #ffeaa7, #fab1a0);
    border-radius: 20px;
    padding: 20px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 280px;
}

.clock {
    position: relative;
    width: min(280px, 80vw);
    height: min(280px, 80vw);
    max-width: 300px;
    max-height: 300px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.1),
        inset 0 0 20px rgba(0, 0, 0, 0.05);
    border: 6px solid #2d3436;
}

.clock-face {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* 時間マーカー */
.hour-marker {
    position: absolute;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: bold;
    color: white;
    text-align: center;
    width: 30px;
    height: 30px;
    line-height: 30px;
    background: #74b9ff;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 時計の数字を円の外周に正確に配置（アナログ時計らしく） */
/* 各数字を30度間隔で正確に円周上に配置 */

.hour-12 { 
    top: 5%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}
.hour-1 { 
    top: 15%; 
    left: 75%; 
    transform: translate(-50%, -50%); 
}
.hour-2 { 
    top: 32%; 
    left: 90%; 
    transform: translate(-50%, -50%); 
}
.hour-3 { 
    top: 50%; 
    left: 95%; 
    transform: translate(-50%, -50%); 
}
.hour-4 { 
    top: 68%; 
    left: 90%; 
    transform: translate(-50%, -50%); 
}
.hour-5 { 
    top: 85%; 
    left: 75%; 
    transform: translate(-50%, -50%); 
}
.hour-6 { 
    top: 95%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
}
.hour-7 { 
    top: 85%; 
    left: 25%; 
    transform: translate(-50%, -50%); 
}
.hour-8 { 
    top: 68%; 
    left: 10%; 
    transform: translate(-50%, -50%); 
}
.hour-9 { 
    top: 50%; 
    left: 5%; 
    transform: translate(-50%, -50%); 
}
.hour-10 { 
    top: 32%; 
    left: 10%; 
    transform: translate(-50%, -50%); 
}
.hour-11 { 
    top: 15%; 
    left: 25%; 
    transform: translate(-50%, -50%); 
}

/* 針 */
.hand {
    position: absolute;
    background: #2d3436;
    transform-origin: bottom center;
    border-radius: 10px;
    transition: transform 0.5s ease-in-out;
}

.hour-hand {
    width: 4px;
    height: min(70px, 25%);
    left: 50%;
    bottom: 50%;
    margin-left: -2px;
    background: #e17055;
    z-index: 2;
}

.minute-hand {
    width: 3px;
    height: min(95px, 35%);
    left: 50%;
    bottom: 50%;
    margin-left: -1.5px;
    background: #0984e3;
    z-index: 1;
}

.center-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2d3436;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 問題エリア */
.question-area {
    background: linear-gradient(45deg, #a29bfe, #fd79a8);
    border-radius: 20px;
    padding: 20px;
    color: white;
    text-align: center;
}

.question {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.answer-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.answer-button {
    background: white;
    color: #2d3436;
    border: none;
    padding: 15px 20px;
    border-radius: 15px;
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.answer-button:hover,
.answer-button:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #fdcb6e;
    outline: none;
}

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

.answer-button.correct {
    background: #00b894;
    color: white;
    animation: correctPulse 0.6s ease;
}

.answer-button.incorrect {
    background: #e17055;
    color: white;
    animation: shake 0.6s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 結果エリア */
.result-area {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.result-message {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.result-area.correct {
    background: linear-gradient(45deg, #00b894, #55a3ff);
    color: white;
}

.result-area.incorrect {
    background: linear-gradient(45deg, #e17055, #fd79a8);
    color: white;
}

.next-button {
    background: white;
    color: #2d3436;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: clamp(1rem, 3vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.next-button:hover,
.next-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    outline: none;
}

/* コントロールエリア */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px 15px;
    background: linear-gradient(45deg, #fdcb6e, #e17055);
    border-radius: 15px;
    margin-bottom: 20px;
}

.start-button, .level-button {
    background: white;
    color: #2d3436;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    flex: 1;
    max-width: 150px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.start-button:hover, .level-button:hover,
.start-button:focus, .level-button:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #74b9ff;
    color: white;
    outline: none;
}

.timer {
    background: white;
    color: #e17055;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

.level-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.level-option {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 15px 10px;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    min-height: 60px;
    -webkit-tap-highlight-color: transparent;
}

.level-option:hover,
.level-option:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    outline: none;
}

.level-option small {
    display: block;
    font-size: 0.85rem;
    margin-top: 5px;
    opacity: 0.9;
}

.close-modal {
    background: #636e72;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.close-modal:hover,
.close-modal:focus {
    background: #2d3436;
    outline: none;
}

/* 励ましメッセージ */
.encouragement {
    text-align: center;
    padding: 15px;
    border-radius: 15px;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: bold;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.encouragement.show {
    opacity: 1;
    transform: translateY(0);
}

.encouragement.good {
    background: linear-gradient(45deg, #00b894, #55a3ff);
    color: white;
}

.encouragement.excellent {
    background: linear-gradient(45deg, #fdcb6e, #fd79a8);
    color: white;
}

/* タブレット・大画面対応 */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        padding: 30px;
    }
    
    .game-area {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .answer-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .controls {
        flex-direction: row;
        gap: 20px;
    }
    
    .level-options {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .clock {
        width: 300px;
        height: 300px;
    }
    
    .hour-marker {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 1.5rem;
    }
    
    .hour-hand {
        width: 6px;
        height: 80px;
        margin-left: -3px;
    }
    
    .minute-hand {
        width: 4px;
        height: 110px;
        margin-left: -2px;
    }
    
    .center-dot {
        width: 16px;
        height: 16px;
    }
}

/* アニメーション効果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clock.correct-answer {
    animation: clockSuccess 1s ease;
}

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

/* スマホ向け追加スタイル */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 5px;
        border-radius: 15px;
    }
    
    .header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .score-board {
        gap: 10px;
    }
    
    .clock-container {
        padding: 15px;
        min-height: 250px;
    }
    
    .question-area {
        padding: 15px;
    }
    
    .controls {
        padding: 15px 10px;
        gap: 10px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
}

/* 高DPI画面対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .clock {
        border-width: 4px;
    }
    
    .hour-marker {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
}

/* ==================== 冒険モード専用スタイル ==================== */

/* 冒険モードコンテナ */
.adventure-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
    animation: backgroundShift 15s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%); }
    25% { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ff9a9e 100%); }
    50% { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 50%, #d299c2 100%); }
    75% { background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 50%, #c2e9fb 100%); }
}

.adventure-mode::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: floatBackground 20s ease-in-out infinite;
}

@keyframes floatBackground {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-30px, -30px) rotate(90deg); }
    50% { transform: translate(-50px, -50px) rotate(180deg); }
    75% { transform: translate(-30px, -30px) rotate(270deg); }
}

/* 魔法のパーティクルエフェクト */
.magic-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.magic-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ffd700, #ff69b4);
    border-radius: 50%;
    animation: magicFloat 3s ease-in-out infinite;
}

@keyframes magicFloat {
    0% { transform: translateY(100%) scale(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100%) scale(1) rotate(360deg); opacity: 0; }
}

/* ストーリーヘッダー */
.story-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 0;
}

.world-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.world-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stage-name {
    font-size: 1rem;
    opacity: 0.9;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.character-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.player-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stars, .exp {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* ストーリーパネル */
.story-panel {
    background: linear-gradient(135deg, #3d5a80 0%, #293241 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.story-text p {
    margin-bottom: 10px;
}

.story-start-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(238, 90, 36, 0.4);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

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

.story-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(238, 90, 36, 0.6);
}

/* インタラクティブ時計 */
.interactive-clock {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.mission-label {
    background: linear-gradient(45deg, #f39c12, #f1c40f);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(241, 196, 15, 0.4);
}

.target-time {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 25px;
    color: #2c3e50;
}

.target-time .highlight {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    padding: 5px 15px;
    border-radius: 10px;
}

/* ドラッグ可能な時計 */
.draggable-clock {
    position: relative;
    cursor: default;
}

.draggable {
    cursor: grab;
    transition: none !important;
}

.draggable:active {
    cursor: grabbing;
}

.hand-grip {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #3498db;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.draggable:hover .hand-grip {
    background: #3498db;
    transform: translateX(-50%) scale(1.2);
}

/* 現在時刻表示 */
.current-time-display {
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    margin: 20px 0;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 15px;
    display: inline-block;
    width: 100%;
}

/* ゲームコントロールエリア */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 確認ボタン */
.check-button {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
    justify-content: center;
}

.check-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(46, 204, 113, 0.6);
}

/* コントロールボタン（ポーズ・リスタート） */
.control-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
}

.pause-button {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.pause-button:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

.restart-button {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.restart-button:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.pause-icon, .restart-icon {
    font-size: 1.2rem;
}

/* ポーズモーダル */
.pause-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.pause-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.6s ease;
}

.pause-title {
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.pause-message {
    margin-bottom: 30px;
    line-height: 1.6;
}

.pause-message p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.resume-button, .menu-button {
    padding: 15px 30px;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.resume-button {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.resume-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(46, 204, 113, 0.6);
}

.menu-button {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(149, 165, 166, 0.6);
}

.sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(1.2) rotate(180deg); }
}

/* プログレスマップ */
.progress-map {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin-top: 30px;
}

.progress-map h3 {
    color: white;
    margin-bottom: 15px;
}

.map-stages {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.map-stage {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.map-stage.completed {
    background: rgba(46, 204, 113, 0.3);
    border: 2px solid #2ecc71;
}

.map-stage.current {
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f1c40f;
    animation: currentStage 1.5s ease-in-out infinite;
}

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

.map-stage.locked {
    background: rgba(149, 165, 166, 0.3);
    opacity: 0.7;
    cursor: not-allowed;
}

.stage-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.stage-stars {
    font-size: 0.9rem;
    color: #f1c40f;
}

/* パワーアップ */
.power-ups {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
}

.power-up-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.power-up-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.power-icon {
    font-size: 1.5rem;
}

.power-count {
    font-weight: bold;
    color: #e74c3c;
}

/* リザルトモーダル */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.result-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.result-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.stars-earned {
    font-size: 3rem;
    margin-bottom: 30px;
}

.star-icon {
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.5s ease;
}

.star-icon.earned {
    filter: grayscale(0);
    opacity: 1;
    animation: starPop 0.5s ease;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    background: #ecf0f1;
    padding: 15px 25px;
    border-radius: 15px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.retry-button, .next-stage-button {
    padding: 12px 30px;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button {
    background: #95a5a6;
    color: white;
}

.next-stage-button {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.retry-button:hover, .next-stage-button:hover {
    transform: translateY(-2px);
}

/* エフェクト */
.effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* ========== 新しい楽しいギミック ========== */

/* レインボーテキスト効果 */
.rainbow-text {
    position: relative;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dda0dd);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 時間表示のキラキラエフェクト */
.time-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.time-sparkles::before,
.time-sparkles::after {
    content: '✨';
    position: absolute;
    font-size: 1rem;
    animation: sparkleMove 2s ease-in-out infinite;
}

.time-sparkles::before {
    left: 10%;
    animation-delay: 0s;
}

.time-sparkles::after {
    right: 10%;
    animation-delay: 1s;
}

@keyframes sparkleMove {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-10px) scale(1.2) rotate(180deg); opacity: 1; }
}

/* マジックボタン効果 */
.magic-button {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.button-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.8s ease;
}

.magic-button:hover .button-glow {
    left: 100%;
}

.magic-button:active {
    transform: scale(0.95) rotateX(10deg);
}

/* フローティングアイコン */
.floating-icons {
    position: relative;
    margin: 20px 0;
    height: 50px;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    animation: floatIcon 3s ease-in-out infinite;
}

.float-icon:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.float-icon:nth-child(2) {
    left: 50%;
    animation-delay: 1s;
}

.float-icon:nth-child(3) {
    left: 80%;
    animation-delay: 2s;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(5deg); }
    50% { transform: translateY(-20px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(-5deg); }
}

/* パルスボタン */
.pulse-button {
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(238, 90, 36, 0.7);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(238, 90, 36, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(238, 90, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(238, 90, 36, 0); }
}

/* 時計ホバー効果 */
.clock:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
    box-shadow: 
        0 0 30px rgba(116, 185, 255, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.1);
}

/* 数字のポップ効果 */
.hour-marker {
    transition: all 0.3s ease;
}

.hour-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    box-shadow: 0 5px 20px rgba(116, 185, 255, 0.6);
}

/* 針のグロー効果 */
.hand {
    filter: drop-shadow(0 0 5px rgba(52, 152, 219, 0.5));
    transition: filter 0.3s ease;
}

.hand:hover {
    filter: drop-shadow(0 0 15px rgba(52, 152, 219, 0.8));
}

/* 成功時の画面全体エフェクト */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
    pointer-events: none;
    z-index: 998;
    animation: screenFlash 0.8s ease-out;
}

@keyframes screenFlash {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* コンボエフェクト */
.combo-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: comboPopup 1.5s ease-out;
    pointer-events: none;
    z-index: 1000;
}

@keyframes comboPopup {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(-180deg); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(0.8) rotate(180deg); }
}

/* クイックフィードバック */
.quick-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    text-align: center;
    animation: quickFeedbackSlide 1.5s ease-out;
    backdrop-filter: blur(10px);
}

.feedback-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.feedback-details {
    font-size: 1rem;
    opacity: 0.9;
}

@keyframes quickFeedbackSlide {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-30px) scale(0.8); 
    }
    20% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1.05); 
    }
    80% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-20px) scale(0.9); 
    }
}

/* ==================== チュートリアル画面 ==================== */

/* ストーリーボタンのレイアウト */
.story-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.tutorial-btn {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    animation: gentlePulse 3s ease-in-out infinite;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(108, 92, 231, 0.6);
}

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

/* チュートリアル画面 */
.tutorial-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.tutorial-header h2 {
    color: white;
    margin: 0;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tutorial-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tutorial-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 400px;
    position: relative;
}

.tutorial-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    text-align: center;
}

.tutorial-explanation {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: center;
}

.tutorial-text {
    line-height: 1.8;
}

.tutorial-text p {
    margin-bottom: 15px;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: #2c3e50;
}

.tutorial-text strong {
    color: #e74c3c;
    font-weight: bold;
}

/* 時間の例 */
.time-examples {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.time-example {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 5px 15px rgba(116, 185, 255, 0.3);
}

.time-example .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.time-example .time {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.time-example .action {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* デモ時計 */
.demo-clock {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
}

.demo-clock-face {
    width: 100%;
    height: 100%;
    border: 4px solid #2c3e50;
    border-radius: 50%;
    background: white;
    position: relative;
}

.demo-numbers {
    position: relative;
    width: 100%;
    height: 100%;
}

.demo-number {
    position: absolute;
    font-weight: bold;
    font-size: 1.2rem;
    color: #2c3e50;
    transform: translate(-50%, -50%);
}

.demo-hour-hand, .demo-minute-hand {
    position: absolute;
    background: #e74c3c;
    transform-origin: bottom center;
    border-radius: 10px;
    left: 50%;
    bottom: 50%;
}

.demo-hour-hand {
    width: 4px;
    height: 60px;
    margin-left: -2px;
    background: #e74c3c;
    animation: hourHandDemo 8s linear infinite;
    z-index: 2;
}

.demo-minute-hand {
    width: 2px;
    height: 80px;
    margin-left: -1px;
    background: #3498db;
    animation: minuteHandDemo 2s linear infinite;
    z-index: 1;
}

.demo-center {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2c3e50;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

@keyframes hourHandDemo {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
    100% { transform: rotate(360deg); }
}

@keyframes minuteHandDemo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hand-labels {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hand-label {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    padding: 5px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hour-label {
    top: 20%;
    right: -10%;
    color: #e74c3c;
}

.minute-label {
    bottom: 20%;
    left: -10%;
    color: #3498db;
}

/* 読み方の例 */
.reading-examples {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.reading-example {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(116, 185, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
}

.example-clock {
    width: 80px;
    height: 80px;
    border: 3px solid #2c3e50;
    border-radius: 50%;
    background: white;
    position: relative;
}

.example-hour-hand, .example-minute-hand {
    position: absolute;
    background: #e74c3c;
    transform-origin: bottom center;
    border-radius: 5px;
    left: 50%;
    bottom: 50%;
}

.example-hour-hand {
    width: 3px;
    height: 25px;
    margin-left: -1.5px;
    background: #e74c3c;
}

.example-minute-hand {
    width: 2px;
    height: 35px;
    margin-left: -1px;
    background: #3498db;
}

.example-center {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #2c3e50;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.step-by-step div {
    margin-bottom: 5px;
    font-weight: bold;
}

.step-by-step .result {
    color: #27ae60;
    font-size: 1.1rem;
    padding: 5px 10px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
}

/* 練習エリア */
.practice-area {
    text-align: center;
}

.target-display {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.practice-clock {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    position: relative;
}

.practice-clock-face {
    width: 100%;
    height: 100%;
    border: 4px solid #2c3e50;
    border-radius: 50%;
    background: white;
    position: relative;
}

.practice-numbers {
    position: relative;
    width: 100%;
    height: 100%;
}

.practice-number {
    position: absolute;
    font-weight: bold;
    font-size: 0.9rem;
    color: #2c3e50;
}

.practice-hour-hand, .practice-minute-hand {
    position: absolute;
    transform-origin: bottom center;
    border-radius: 10px;
    left: 50%;
    bottom: 50%;
    cursor: grab;
    transition: filter 0.3s ease;
}

.practice-hour-hand {
    width: 4px;
    height: 60px;
    margin-left: -2px;
    background: #e74c3c;
    z-index: 2;
}

.practice-minute-hand {
    width: 2px;
    height: 80px;
    margin-left: -1px;
    background: #3498db;
    z-index: 1;
}

.practice-hour-hand:hover, .practice-minute-hand:hover {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(52, 152, 219, 0.8));
}

.practice-center {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2c3e50;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.practice-check {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
    transition: all 0.3s ease;
}

.practice-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(46, 204, 113, 0.6);
}

/* ナビゲーション */
.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

.step-indicators {
    display: flex;
    gap: 10px;
}

.step-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: white;
    transform: scale(1.2);
}

/* レスポンシブ対応 */
@media (min-width: 768px) {
    .tutorial-explanation {
        grid-template-columns: 1fr 1fr;
    }
    
    .story-buttons {
        flex-direction: row;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .tutorial-content {
        padding: 20px;
    }
    
    .time-examples {
        flex-direction: column;
    }
    
    .demo-clock, .practice-clock {
        width: 150px;
        height: 150px;
    }
    
    .tutorial-navigation {
        padding: 10px 15px;
    }
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .story-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .player-info {
        flex-direction: column;
    }
    
    .character-icon {
        font-size: 2rem;
    }
    
    .map-stages {
        flex-direction: column;
        gap: 15px;
    }
    
    .power-ups {
        bottom: 10px;
        right: 10px;
    }
    
    .interactive-clock {
        padding: 20px;
    }
    
    .target-time {
        font-size: 1.2rem;
    }
    
    .current-time-display {
        font-size: 1.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-button {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .pause-content {
        padding: 30px 20px;
    }
    
    .pause-title {
        font-size: 1.5rem;
    }
}

/* ==================== ステージ選択画面 ==================== */
.stage-select-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff6b6b 100%);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeInScale 0.5s ease;
}

.stage-select-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.stage-select-header h2 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.stage-select-header p {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

.stage-select-close {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stage-select-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.stage-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.stage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.stage-card:hover::before {
    left: 100%;
}

.stage-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stage-card:active {
    transform: translateY(-5px) scale(0.98);
}

/* ステージカードの状態別スタイル */
.stage-card.locked {
    background: rgba(200, 200, 200, 0.7);
    cursor: not-allowed;
    opacity: 0.6;
}

.stage-card.locked:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stage-card.locked::before {
    display: none;
}

.stage-card.locked .stage-info h3 {
    color: #95a5a6;
}

.stage-card.locked .stage-info p {
    color: #bdc3c7;
}

.stage-card.locked .stage-description {
    color: #bdc3c7;
}

.stage-card.cleared {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(46, 204, 113, 0.3);
}

.stage-card.current {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid rgba(52, 152, 219, 0.5);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.2);
}

.stage-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1.5s infinite;
}

.stage-info h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.stage-info p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 600;
}

.stage-description {
    font-size: 0.95rem;
    color: #95a5a6;
    line-height: 1.4;
    margin-bottom: 20px;
}

.stage-stars {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.stage-stars .star {
    font-size: 1.2rem;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.stage-stars .star.earned {
    opacity: 1;
    animation: starTwinkle 2s infinite;
}

.stage-select-footer {
    text-align: center;
    margin-top: 40px;
}

.back-to-story-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.back-to-story-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

/* ==================== ホームボタンスタイル ==================== */
.home-button {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 18px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.home-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
}

.home-button:hover::before {
    width: 200px;
    height: 200px;
}

.home-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.home-button:active {
    transform: translateY(-1px);
}

.home-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* ==================== 全体的なデザイン改善 ==================== */

/* より現代的なグラデーション */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #667eea 50%, #764ba2 75%, #667eea 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* コンテナのモダン化 */
.container {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

/* ヘッダーの改善 */
.header {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
    background-size: 200% 200%;
    animation: gradientMove 8s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 時計のモダン化 */
.clock {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(240, 240, 240, 0.9) 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 針のスタイル改善 */
.hour-hand {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.minute-hand {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* ボタンの全体的な改善 */
.magic-button {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
}

.magic-button:hover {
    box-shadow: 0 12px 35px rgba(243, 156, 18, 0.4);
}

/* 新しいアニメーション */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes starTwinkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* ゲームコントロールのレイアウト改善 */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ==================== モダンコントロールボタン ==================== */
.modern-control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    min-width: 80px;
    gap: 4px;
    padding: 10px 15px;
    border-radius: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.modern-check-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    min-width: 120px;
    gap: 6px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
    position: relative;
    overflow: hidden;
}

.modern-check-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.modern-check-btn:hover::before {
    left: 100%;
}

.modern-check-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(243, 156, 18, 0.4);
}

.control-icon, .check-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.control-text, .check-text {
    font-size: 0.75rem;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.check-text {
    font-size: 0.9rem;
    font-weight: 700;
}

/* 各コントロールボタンの色分け */
.home-button.modern-control-btn {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    color: white;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 15px 20px;
    border-radius: 25px;
    min-width: 120px;
}

.home-button.modern-control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
    background: linear-gradient(135deg, #c0392b, #d35400);
}

/* ストーリー画面のホームボタン */
.home-btn.modern-btn {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    color: white;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.home-btn.modern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
    background: linear-gradient(135deg, #c0392b, #d35400);
}

.pause-button.modern-control-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.pause-button.modern-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.restart-button.modern-control-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.restart-button.modern-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

/* ==================== モダンボタンスタイル ==================== */
.modern-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    gap: 8px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.modern-start-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.modern-start-btn:hover {
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

.btn-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.btn-text {
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

/* ストーリーボタンレイアウト改善 */
.story-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.story-buttons .home-btn {
    order: -1;
    margin-bottom: 10px;
}

/* ==================== モダンアイコンスタイル ==================== */
.modern-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 4rem;
    margin-bottom: 20px;
    animation: modernBounce 2s infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes modernBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ステージカード情報のスタイル改善 */
.stage-info h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}

.stage-info p {
    font-size: 1.1rem;
    color: #34495e;
    margin-bottom: 8px;
    font-weight: 600;
}

.stage-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.3;
    margin-bottom: 20px;
}

/* レスポンシブ対応の追加 */
@media (max-width: 768px) {
    .stage-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .stage-card {
        padding: 25px 20px;
    }
    
    .modern-icon {
        font-size: 3rem;
    }
    
    .game-controls {
        gap: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px 10px;
    }
    
    .control-button {
        min-width: 100px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .home-button.modern-control-btn {
        min-width: 110px;
        padding: 14px 18px;
        font-size: 1rem;
    }
    
    .modern-control-btn {
        flex-direction: row;
        gap: 8px;
        min-height: 50px;
        min-width: 120px;
        justify-content: center;
    }
    
    .modern-check-btn {
        flex-direction: row;
        gap: 8px;
        min-height: 55px;
        min-width: 140px;
    }
    
    .control-text, .check-text {
        font-size: 0.8rem;
    }
    
    .control-icon, .check-icon {
        font-size: 1.2rem;
    }
    
    .story-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .modern-btn {
        min-width: 200px;
        max-width: 280px;
    }
    
    .btn-text {
        font-size: 0.85rem;
    }
    
    .btn-icon {
        font-size: 1.6rem;
    }
}
}