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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
}

.title {
    font-size: 3em;
    color: #1DB954;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #1DB954;
    color: white;
}

.btn-primary:hover {
    background: #1ed760;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.3);
}

.btn-secondary {
    background: #535353;
    color: white;
}

.btn-secondary:hover {
    background: #3f3f3f;
}

.btn-success {
    background: #1DB954;
    color: white;
}

.btn-success:hover {
    background: #1ed760;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #fb8c00;
}

.btn-large {
    font-size: 1.1em;
    padding: 16px 32px;
}

.spotify-icon {
    font-size: 1.1em;
    margin-right: 8px;
}

/* CTA Section */
.cta {
    margin: 40px 0;
}

/* Info Section */
.info {
    margin-top: 40px;
    text-align: left;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info p {
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
}

.info ol {
    list-style-position: inside;
    font-size: 1em;
    line-height: 1.8;
    color: #555;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: white;
    margin-top: 40px;
}

/* Game Container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #1DB954;
}

/* Card */
.card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Phase Management */
.phase {
    display: none;
}

.phase.active {
    display: block;
}

/* Setup Phase */
.setup-section {
    margin: 30px 0;
}

.setup-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.input-group input:focus {
    outline: none;
    border-color: #1DB954;
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.playlist-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.playlist-info img {
    width: 80px;
    height: 80px;
    border-radius: 6px;
}

.playlist-info h4 {
    color: #333;
    margin-bottom: 5px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.hint {
    color: #ff6b6b;
    font-size: 0.95em;
    margin-bottom: 15px;
}

/* Device List */
.device-list {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.device-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.device-item:hover {
    border-color: #1DB954;
    background: #f8f9fa;
}

.device-item.selected {
    border-color: #1DB954;
    background: #e8f5e9;
}

.device-name {
    font-weight: bold;
    color: #333;
}

.device-type {
    font-size: 0.9em;
    color: #666;
}

/* Game Phase */
.game-info {
    text-align: center;
    margin-bottom: 30px;
}

.game-info h2 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #1DB954;
    transition: width 0.3s ease;
}

.game-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.search-section h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.search-results {
    margin: 20px 0;
}

.song-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-item:hover {
    border-color: #1DB954;
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.song-name {
    font-weight: bold;
    color: #333;
}

.song-artist {
    font-size: 0.9em;
    color: #666;
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Result Section */
.result-section {
    text-align: center;
}

.result-message {
    font-size: 1.2em;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.result-message.failure {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.result-message h3 {
    margin-bottom: 10px;
}

/* Results Phase */
.results-card {
    text-align: center;
}

.results-card h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 600;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.result-stat {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.result-value {
    font-size: 2em;
    font-weight: 600;
    color: #1DB954;
    margin-bottom: 10px;
}

.result-label {
    font-size: 1em;
    color: #666;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1DB954;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1.2em;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
}
