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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    touch-action: manipulation; /* タップで画面が動かないようにする */
    user-select: none; /* テキスト選択を無効にする */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.score-board {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: bold;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

.score, .target {
    color: #495057;
}

.kanban-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .kanban-board {
        gap: 10px;
    }
    
    .column {
        padding: 10px;
    }
    
    .game-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .kanban-board {
        gap: 8px;
    }
    
    .column {
        padding: 8px;
    }
    
    .game-container {
        padding: 10px;
    }
}

.column {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    min-height: 300px;
}

.column h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #495057;
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
}

#todo-column h2 {
    color: #6c757d;
}

#doing-column h2 {
    color: #fd7e14;
}

#done-column h2 {
    color: #28a745;
}

.task-list {
    min-height: 250px;
    position: relative;
    transition: all 0.3s ease;
}

.task {
    background: white;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    position: relative;
    overflow: hidden;
    line-height: 1.3;
}

.task:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.task:active {
    cursor: grabbing;
}

.task.moving {
    opacity: 0.7;
    transform: scale(0.95);
}

.task.doing {
    border-left-color: #fd7e14;
    background: #fff3cd;
}

.task.done {
    border-left-color: #28a745;
    background: #d4edda;
}

.task.fade-out {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s ease;
}

/* ドラッグ&ドロップ用スタイル */
.task.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.05);
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.task-list.drag-over {
    background: rgba(0, 123, 255, 0.1);
    border: 2px dashed #007bff;
    border-radius: 10px;
    transform: scale(1.02);
}

.controls {
    text-align: center;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    font-weight: bold;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

button:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* 紙吹雪のキャンバス */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* クリア画面 */
.clear-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.3s ease;
}

.clear-screen.hidden {
    display: none;
}

.clear-message {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.clear-message h2 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.clear-message p {
    color: #666;
    margin-bottom: 30px;
    font-size: clamp(1rem, 3vw, 1.2rem);
}

#playAgainBtn {
    background: #28a745;
    font-size: clamp(1rem, 3vw, 1.1rem);
    padding: 15px 30px;
}

#playAgainBtn:hover {
    background: #1e7e34;
}

/* アニメーション */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task {
    animation: slideIn 0.3s ease;
}

/* タッチデバイス用の調整 */
@media (hover: none) and (pointer: coarse) {
    .task:hover {
        transform: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    button:hover {
        background: #007bff;
        transform: none;
    }
    
    #playAgainBtn:hover {
        background: #28a745;
    }
    
    .task {
        cursor: pointer;
    }
    
    .task:active {
        cursor: pointer;
    }
}
