/* デザインシステム */
:root {
    /* カラーパレット */
    --color-primary: #ff6b6b;
    --color-secondary: #4ecdc4;
    --color-accent: #ffe66d;
    --color-success: #51cf66;
    --color-danger: #ff6b6b;
    
    /* 背景色 */
    --color-bg-sky: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    --color-bg-dark: rgba(0, 0, 0, 0.85);
    --color-bg-overlay: rgba(0, 0, 0, 0.7);
    
    /* テキスト */
    --color-text-primary: #2d3436;
    --color-text-light: #ffffff;
    --color-text-muted: #636e72;
    
    /* シャドウ */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    /* スペーシング */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* ボーダー */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* フォント */
    --font-primary: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
}

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--color-bg-sky);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    overflow: hidden;
}

/* ゲームコンテナ */
.game-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ヘッダー */
.game-header {
    text-align: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.5s ease-out;
}

.game-header h1 {
    color: var(--color-text-light);
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ゲーム情報パネル */
.game-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    animation: slideDown 0.6s ease-out;
}

.info-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    transition: transform 0.2s ease;
}

.info-item:hover {
    transform: translateY(-2px);
}

.info-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* キャンバスラッパー */
.canvas-wrapper {
    position: relative;
    background: var(--color-bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.8s ease-out;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: crisp-edges;
}

/* オーバーレイ画面 */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.overlay-screen.hidden {
    display: none;
}

.screen-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.4s ease-out;
}

.screen-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen-score {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.screen-message {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.controls-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.controls-info h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.controls-info p {
    font-size: 0.95rem;
    margin: var(--spacing-xs) 0;
    color: var(--color-text-primary);
}

/* ボタン */
.game-button {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--color-text-light);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.game-button:active {
    transform: translateY(0);
}

.game-button-primary {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    font-size: 1.3rem;
    padding: var(--spacing-md) var(--spacing-xl);
}

/* フッター */
.game-footer {
    text-align: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: slideUp 0.7s ease-out;
}

.game-footer p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .game-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-value {
        font-size: 1.2rem;
    }
    
    .screen-title {
        font-size: 2rem;
    }
    
    .game-footer p {
        font-size: 0.8rem;
    }
}
