/* Jump Stack - スタイルシート */

:root {
    /* プライマリーカラー */
    --bg-primary: #1A1A1A;
    --bg-secondary: #2D2D2D;
    --surface: #404040;
    
    /* テキスト */
    --text-primary: #FAFAFA;
    --text-secondary: #C0C0C0;
    
    /* アクセント */
    --accent-blue: #00D9FF;
    --accent-green: #00FF88;
    --accent-purple: #8B5CF6;
    --accent-orange: #FF6B35;
    
    /* グラデーション */
    --gradient-sunset: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
    --gradient-cyber: linear-gradient(135deg, #00D9FF 0%, #8B5CF6 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* Canvas */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* 画面管理 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* ガラスモーフィズムパネル */
.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* タイトル */
.title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.2;
}

.title-jump {
    display: block;
    background: var(--gradient-sunset);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite;
}

.title-stack {
    display: block;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes glow {
    0%, 100% { 
        filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.5)); 
    }
    50% { 
        filter: drop-shadow(0 0 20px rgba(255, 107, 53, 0.8)); 
    }
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
    font-weight: 500;
}

/* ボタン */
.btn-play {
    width: 100%;
    height: 64px;
    border: none;
    border-radius: 16px;
    background: var(--gradient-cyber);
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-play:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.btn-icon {
    font-size: 24px;
}

.btn-secondary {
    width: 100%;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(0.98);
}

/* ハイスコア表示 */
.high-score {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.high-score .label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.high-score .value {
    display: block;
    font-size: 36px;
    font-weight: 900;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* アイコンボタン */
.menu-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn-icon-only {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon-only:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.btn-icon-only.muted {
    opacity: 0.5;
}

/* ゲームオーバー画面 */
.gameover-title {
    text-align: center;
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 32px;
    color: var(--accent-orange);
    text-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
}

.score-display {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.score-item {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.score-item.highlight {
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--accent-green);
}

.score-item.new-record {
    animation: pulse 0.5s ease-in-out;
}

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

.score-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.score-value {
    display: block;
    font-size: 32px;
    font-weight: 900;
}

/* インゲームUI */
.ingame-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.score-panel {
    position: absolute;
    top: env(safe-area-inset-top, 20px);
    top: 40px;
    left: 0;
    right: 0;
    text-align: center;
}

.score-panel .score-value {
    font-size: 48px;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.combo-display {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 2px 8px rgba(0, 255, 136, 0.5);
    animation: comboAppear 0.3s ease-out;
}

@keyframes comboAppear {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.combo-display:empty {
    display: none;
}

/* タップヒント */
.tap-hint {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: bounce 1s ease-in-out infinite;
    pointer-events: none;
}

.tap-hint.hidden {
    display: none;
}

.hand-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.tap-hint p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

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

/* フィードバックテキスト */
.feedback-text {
    position: absolute;
    font-size: 32px;
    font-weight: 900;
    pointer-events: none;
    z-index: 100;
    animation: feedbackFloat 1s ease-out forwards;
}

@keyframes feedbackFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

/* レスポンシブ対応 */
@media (max-width: 360px) {
    .glass-panel {
        padding: 32px 24px;
    }
    
    .title {
        font-size: 40px;
    }
    
    .btn-play {
        height: 56px;
        font-size: 18px;
    }
    
    .score-panel .score-value {
        font-size: 40px;
    }
}

/* 横画面警告 */
@media (orientation: landscape) and (max-height: 500px) {
    body::after {
        content: '📱 縦向きでプレイしてください';
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 20px 40px;
        border-radius: 12px;
        font-size: 18px;
        z-index: 1000;
    }
}
