body {
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
}

/* タイトル画面のスタイル */
.title-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    text-align: center;
    animation: fadeIn 1s ease-in;
}

.title-content {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.game-title {
    font-size: 3.5em;
    margin: 0 0 20px 0;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

.title-decoration {
    font-size: 2em;
    margin: 10px 0;
    animation: bounce 2s infinite;
}

.title-description {
    font-size: 1.2em;
    margin: 20px 0 30px 0;
    opacity: 0.9;
}

.title-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.start-button, .settings-button {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255,107,107,0.4);
}

.settings-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.start-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255,107,107,0.6);
}

.settings-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102,126,234,0.6);
}

.title-controls {
    margin-top: 30px;
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.8;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255,107,107,0.5); }
    to { text-shadow: 0 0 30px rgba(78,205,196,0.8); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 設定画面のスタイル */
.settings-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.settings-content {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-title {
    font-size: 2em;
    margin: 0 0 30px 0;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tetrimino-settings {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.tetrimino-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.tetrimino-preview {
    font-family: monospace;
    font-size: 12px;
    line-height: 1;
    width: 60px;
    text-align: left;
    font-weight: bold;
}

.tetrimino-i { color: #FF6B6B; }
.tetrimino-o { color: #4ECDC4; }
.tetrimino-t { color: #45B7D1; }
.tetrimino-s { color: #96CEB4; }
.tetrimino-z { color: #FFEAA7; }
.tetrimino-j { color: #DDA0DD; }
.tetrimino-l { color: #FFB347; }

.tetrimino-setting label {
    font-size: 16px;
    font-weight: bold;
    min-width: 120px;
    text-align: left;
}

.probability-slider {
    width: 150px;
    height: 8px;
    border-radius: 5px;
    background: rgba(255,255,255,0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.probability-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.probability-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.settings-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.settings-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(102,126,234,0.4);
}

.settings-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(102,126,234,0.6);
}

.settings-description {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.6;
}

.settings-description p {
    margin: 5px 0;
}

@media (max-width: 600px) {
    .tetrimino-setting {
        flex-direction: column;
        text-align: center;
    }
    
    .probability-slider {
        width: 200px;
    }
}

.game-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-board {
    position: relative;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    overflow: hidden;
}

canvas {
    display: block;
    background: rgba(0,0,0,0.8);
}

.info-panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    min-width: 200px;
}

.score, .level, .lines {
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.next-piece, .hold-piece {
    margin: 20px 0;
}

.next-canvas, .hold-canvas {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(0,0,0,0.3);
}

.controls {
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.particle {
    position: absolute;
    pointer-events: none;
}

/* ゲームオーバー画面の新しいスタイル */
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(30,60,114,0.95));
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    animation: gameOverFadeIn 0.8s ease-out;
    overflow: hidden;
}

.game-over-content {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 400px;
    width: 90%;
    position: relative;
    z-index: 10;
    animation: gameOverSlideUp 0.8s ease-out 0.2s both;
}

.game-over-header {
    margin-bottom: 30px;
}

.game-over-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: iconPulse 2s ease-in-out infinite;
}

.game-over-title {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0 0 10px 0;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 3px;
}

.game-over-subtitle {
    font-size: 1.1em;
    opacity: 0.8;
    color: #fff;
    margin-bottom: 20px;
}

.game-over-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78,205,196,0.5);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
    font-weight: bold;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.game-over-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.retry-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    box-shadow: 0 4px 15px rgba(255,107,107,0.4);
}

.home-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    box-shadow: 0 4px 15px rgba(78,205,196,0.4);
}

.game-over-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 1.2em;
}

.btn-text {
    font-weight: bold;
}

/* 背景エフェクト */
.game-over-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.falling-tetrimino {
    position: absolute;
    top: -50px;
    font-size: 2em;
    color: rgba(255,255,255,0.1);
    animation: fallDown 3s linear infinite;
}

/* アニメーション */
@keyframes gameOverFadeIn {
    from {
        opacity: 0;
        background: linear-gradient(135deg, rgba(0,0,0,0), rgba(30,60,114,0));
    }
    to {
        opacity: 1;
        background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(30,60,114,0.95));
    }
}

@keyframes gameOverSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fallDown {
    from {
        top: -50px;
        transform: rotate(0deg);
    }
    to {
        top: 100%;
        transform: rotate(360deg);
    }
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .game-over-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .game-over-title {
        font-size: 2em;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .game-over-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-over-btn {
        width: 200px;
    }
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    transition: transform 0.2s;
}

button:hover {
    transform: scale(1.05);
}