/* Dance Floor Game Styles */

* {
    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;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.game-container {
    display: grid;
    grid-template-columns: 250px 1fr 200px;
    grid-template-rows: auto;
    gap: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

/* Game Info Panel */
.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.score-display {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.score-item:last-child {
    margin-bottom: 0;
}

.score-label {
    font-weight: bold;
    color: #495057;
}

#current-score, #current-combo, #perfect-count {
    color: #007bff;
    font-weight: bold;
    font-size: 1.2em;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.control-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.start-btn.active {
    background: #28a745;
    border-color: #28a745;
}

.pause-btn.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.difficulty-selector,
.song-selector {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.difficulty-selector h4,
.song-selector h4 {
    margin-bottom: 10px;
    color: #495057;
    text-align: center;
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-btn {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.difficulty-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.difficulty-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

#song-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    font-size: 1em;
    cursor: pointer;
}

/* Dance Floor */
.dance-floor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #2c3e50;
    border-radius: 15px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

/* Arrow Indicators */
.arrow-indicators {
    width: 100%;
    height: 200px;
    position: relative;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.indicator-row {
    display: flex;
    justify-content: center;
    height: 50%;
    position: relative;
}

.indicator-row:first-child {
    align-items: flex-end;
}

.indicator-row:last-child {
    align-items: flex-start;
}

.indicator {
    position: relative;
    width: 80px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.indicator-bar {
    position: absolute;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.arrow {
    font-size: 2em;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.arrow.active {
    opacity: 1;
    animation: arrowPulse 0.5s ease-in-out;
}

/* Floor Grid */
.floor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    width: 300px;
    height: 300px;
}

.floor-tile {
    background: #34495e;
    border: 3px solid #2c3e50;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.floor-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

.floor-tile.active {
    background: #3498db;
    border-color: #2980b9;
    animation: tilePress 0.2s ease;
}

.floor-tile.correct {
    background: #27ae60;
    border-color: #229954;
    animation: tileCorrect 0.5s ease;
}

.floor-tile.incorrect {
    background: #e74c3c;
    border-color: #c0392b;
    animation: tileIncorrect 0.5s ease;
}

.tile-arrow {
    font-size: 3em;
    z-index: 10;
    pointer-events: none;
}

.tile-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.floor-tile.active .tile-glow {
    opacity: 1;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

.time-display {
    text-align: center;
    margin-top: 10px;
    color: white;
    font-weight: bold;
}

/* Upcoming Moves */
.upcoming-moves {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.upcoming-moves h4 {
    margin-bottom: 10px;
    color: #495057;
    text-align: center;
}

.move-queue {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-queue {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.move-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.move-arrow {
    font-size: 1.5em;
    min-width: 30px;
    text-align: center;
}

.move-timing {
    margin-left: auto;
    font-size: 0.8em;
    color: #6c757d;
}

/* Results Screen */
.results-screen {
    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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.results-screen.show {
    opacity: 1;
    visibility: visible;
}

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

.results-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.final-stats {
    margin-bottom: 30px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: bold;
    color: #495057;
}

.stat-value {
    font-weight: bold;
    font-size: 1.1em;
}

#final-grade {
    font-size: 1.5em;
    padding: 5px 15px;
    border-radius: 20px;
}

#final-grade.S { background: #ffd700; color: #000; }
#final-grade.A { background: #28a745; color: white; }
#final-grade.B { background: #007bff; color: white; }
#final-grade.C { background: #ffc107; color: #000; }
#final-grade.D { background: #fd7e14; color: white; }
#final-grade.F { background: #dc3545; color: white; }

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-btn {
    padding: 12px 25px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.action-btn:hover {
    background: white;
    color: #007bff;
}

/* Instructions */
.instructions {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.instructions h3 {
    margin-bottom: 15px;
    color: #495057;
    text-align: center;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.instructions li:last-child {
    border-bottom: none;
}

.instructions strong {
    color: #007bff;
}

.controls-info {
    margin-top: 20px;
    text-align: center;
}

.controls-info h4 {
    margin-bottom: 15px;
    color: #495057;
}

.control-keys {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.key-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.key-item span {
    font-size: 0.9em;
    color: #495057;
}

/* Animations */
@keyframes arrowPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes tilePress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes tileCorrect {
    0% { background: #27ae60; }
    50% { background: #2ecc71; }
    100% { background: #34495e; }
}

@keyframes tileIncorrect {
    0% { background: #e74c3c; }
    50% { background: #ec7063; }
    100% { background: #34495e; }
}

@keyframes moveSlide {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Message Display */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    max-width: 300px;
}

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

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

.message.info {
    background: #17a2b8;
}

.message.warning {
    background: #ffc107;
    color: #212529;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .upcoming-moves {
        grid-column: 1;
        grid-row: 3;
    }

    .dance-floor {
        grid-column: 1;
        grid-row: 2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .floor-grid {
        width: 250px;
        height: 250px;
    }

    .floor-tile {
        border-radius: 10px;
    }

    .tile-arrow {
        font-size: 2.5em;
    }

    .control-keys {
        flex-direction: column;
        align-items: center;
    }

    .key-item {
        flex-direction: row;
        padding: 8px 15px;
    }

    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .game-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .score-display,
    .difficulty-selector,
    .song-selector {
        flex: 1;
        min-width: 200px;
    }

    .game-controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .control-btn {
        flex: 1;
        min-width: 120px;
    }

    .floor-grid {
        width: 200px;
        height: 200px;
        gap: 10px;
    }

    .tile-arrow {
        font-size: 2em;
    }

    .arrow-indicators {
        height: 150px;
    }

    .indicator {
        width: 60px;
    }

    .arrow {
        font-size: 1.5em;
    }

    .results-content {
        padding: 20px;
    }

    .results-actions {
        flex-direction: column;
    }
}