body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}
.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1, h2 {
    text-align: center;
    margin-bottom: 20px;
}
.button {
    background-color: #8B5CF6;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.button:hover {
    background-color: #7C3AED;
    transform: scale(1.05);
}
.share-results-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    padding: 6px 12px;
    margin-left: 10px;
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: middle;
}
.share-results-button:hover {
    background-color: #7C3AED;
    transform: scale(1.05);
}
.create-game-button {
    background-color: #2196F3;
    margin-top: 15px !important;
    display: inline-block;
    text-decoration: none;
}
.create-game-button:hover {
    background-color: #1976D2;
}
#trackInfo {
    margin-top: 20px;
}
.search-results {
    margin-top: 20px;
}
.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: white;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.track-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}
.album-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    order: 1;
}
.track-info {
    flex-grow: 1;
    min-width: 0;
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.track-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.track-artist {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.track-info-hidden {
    filter: blur(5px);
    user-select: none;
}
.reveal-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: all 0.3s ease;
}
.reveal-button:hover {
    background-color: #7C3AED;
    transform: scale(1.05);
}
.preview-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.seconds-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}
.second-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.second-button:hover {
    background-color: #7C3AED;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.second-button.played {
    background-color: #666;
    transform: scale(0.95);
}
.game-controls {
    margin-top: 20px;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.game-controls p {
    text-align: center;
    width: 100%;
    margin: 10px 0;
}
.play-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    width: 200px;
    height: 45px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    min-width: 200px;
    max-width: 200px;
}
.play-button:hover {
    background-color: #7C3AED;
    transform: scale(1.05);
}
.play-button.playing {
    background-color: white;
    color: #8B5CF6;
    border: 2px solid #8B5CF6;
}
.guess-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin: 10px 0 20px 0;
    position: relative;
    width: 100%;
    max-width: 100%;
}
.guess-input {
    padding: 12px 20px;
    width: 100%;
    max-width: 300px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    text-align: center;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}
.guess-input:focus {
    outline: none;
    border-color: #8B5CF6;
}
.suggestions-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 300px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    box-sizing: border-box;
}
.suggestions-dropdown.active {
    display: block;
}
.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.suggestion-item:hover {
    background-color: #f5f5f5;
}
.suggestion-text {
    flex-grow: 1;
}
.suggestion-artist {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}
.guess-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 200px;
    margin-top: 10px;
}
.guess-button:hover {
    background-color: #7C3AED;
    transform: scale(1.05);
}
.guess-count {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}
.correct-guess {
    color: #8B5CF6;
    font-weight: bold;
    font-size: 20px;
    margin: 10px 0;
    background-color: #F3F4F6;
}
.wrong-guess {
    color: #d32f2f;
    font-size: 16px;
    margin: 10px 0;
}
.share-success {
    color: #059669;
    font-weight: bold;
    margin: 10px 0;
    background-color: #d1fae5;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
}
.preview-badge {
    background-color: #8B5CF6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 10px;
}
.search-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}
.search-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}
input[type="text"] {
    padding: 15px 20px;
    width: 100%;
    max-width: none;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    margin: 0;
    box-sizing: border-box;
}
input[type="text"]:focus {
    outline: none;
    border-color: #8B5CF6;
}
.error {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}
.loading {
    color: #666;
    font-style: italic;
}
.now-playing {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    padding: 30px;
    border-radius: 15px;
    background-color: #F3F4F6;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.now-playing-details {
    width: 100%;
}
audio {
    width: 100%;
    margin-top: 10px;
}
.instructions {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #8B5CF6;
}
.instructions ol {
    margin: 10px 0;
    padding-left: 20px;
}
.instructions li {
    margin: 5px 0;
}
.progress-container {
    width: 80%;
    height: 10px;
    background-color: #ddd;
    border-radius: 5px;
    margin: 15px auto;
    display: flex;
    overflow: hidden;
}
.progress-segment {
    flex: 1;
    height: 100%;
    background-color: #ddd;
    position: relative;
    overflow: hidden;
}
.progress-segment:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: #fff;
    z-index: 2;
}
.progress-segment.unlocked {
    background-color: #F3F4F6;
}
.progress-segment.played {
    background-color: #8B5CF6;
}
.progress-segment .fill {
    width: 0;
    height: 100%;
    background-color: #8B5CF6;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.1s linear;
}
.progress-segment.current {
    background-color: #F3F4F6;
}
.suggestion-item.selected {
    background-color: #f0f0f0;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 15px;
        max-width: 100% !important;
        width: 100% !important;
        justify-content: flex-start;
        margin: 0;
    }
    
    input[type="text"] {
        width: 100% !important;
        max-width: none !important;
        padding: 15px 20px;
        font-size: 16px; /* Prevents zoom on iOS */
        box-sizing: border-box;
    }
    
    .button {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px;
        min-height: 48px; /* Touch-friendly minimum */
    }
    
    .create-game-button {
        width: 100%;
        text-align: center;
    }
    
    .track-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
    }
    
    .track-item img {
        width: 80px;
        height: 80px;
    }
    
    .now-playing {
        padding: 20px;
        margin-top: 15px;
    }
    
    .game-controls {
        padding: 15px;
        margin-top: 15px;
    }
    
    .play-button {
        width: 100%;
        max-width: 250px;
        height: 50px;
        font-size: 20px;
        margin: 15px auto;
    }
    
    .seconds-buttons {
        gap: 8px;
        margin: 10px 0;
    }
    
    .second-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .guess-form {
        gap: 15px;
        margin: 15px 0;
    }
    
    .suggestions-container {
        max-width: 100%;
    }
    
    .guess-input {
        width: 100%;
        max-width: none;
        padding: 15px 20px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .suggestions-dropdown {
        width: 100%;
        max-width: none;
        left: 0;
        transform: none;
        max-height: 150px;
    }
    
    .suggestion-item {
        padding: 12px 15px;
        min-height: 48px;
    }
    
    .guess-button {
        width: 100%;
        max-width: 250px;
        padding: 15px 20px;
        min-height: 48px;
    }
    
    .reveal-button {
        width: 100%;
        max-width: 250px;
        padding: 15px 20px;
        min-height: 48px;
    }
    
    .progress-container {
        width: 100%;
        height: 8px;
        margin: 10px auto;
    }
    
    .progress-segment {
        min-width: 20px;
    }
    
    .instructions {
        padding: 12px;
        margin: 15px 0;
    }
    
    .instructions ol {
        padding-left: 15px;
    }
    
    .correct-guess,
    .wrong-guess {
        font-size: 18px;
        margin: 8px 0;
        padding: 10px;
        border-radius: 8px;
    }
    
    .correct-guess {
        background-color: #e8f5e9;
    }
    
    .wrong-guess {
        background-color: #ffebee;
    }
    
    .preview-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .track-item img {
        width: 60px;
        height: 60px;
    }
    
    .second-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .suggestions-dropdown {
        max-height: 120px;
    }
}

/* Touch-friendly improvements for all touch devices */
@media (hover: none) and (pointer: coarse) {
    .button,
    .play-button,
    .guess-button,
    .reveal-button,
    .second-button {
        min-height: 44px;
    }
    
    .guess-input,
    input[type="text"] {
        min-height: 44px;
    }
    
    .suggestion-item {
        min-height: 44px;
    }
    
    /* Increase touch targets */
    .button:hover,
    .play-button:hover,
    .guess-button:hover,
    .reveal-button:hover,
    .second-button:hover {
        transform: none;
    }
    
    .button:active,
    .play-button:active,
    .guess-button:active,
    .reveal-button:active,
    .second-button:active {
        transform: scale(0.98);
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }
    
    .search-input-group {
        flex-direction: row;
        gap: 10px;
        max-width: 100% !important;
        width: 100% !important;
        justify-content: center;
        margin: 0;
    }
    
    input[type="text"] {
        width: 60% !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    
    .button {
        width: 40% !important;
        box-sizing: border-box;
    }
    
    .now-playing {
        padding: 15px;
    }
    
    .game-controls {
        padding: 10px;
    }
    
    .seconds-buttons {
        gap: 5px;
    }
    
    .second-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .track-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .button:hover,
    .play-button:hover,
    .guess-button:hover,
    .reveal-button:hover,
    .second-button:hover {
        transform: none;
    }
}

/* Compact styles for share.html results */
.results {
    margin-top: 20px;
}

.track-item:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.results .play-button, .results .share-button {
    background-color: #8B5CF6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    order: 3;
}

.results .play-button:hover, .results .share-button:hover {
    background-color: #7C3AED;
    transform: scale(1.1);
}

.results .play-button.playing {
    background-color: white;
    color: #8B5CF6;
    border: 2px solid #8B5CF6;
}

.results .share-button.copied {
    background-color: #059669;
}

.tooltip {
    position: fixed;
    background-color: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

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

.no-results {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

/* Mobile optimizations for compact results */
@media (max-width: 768px) {
    .track-item {
        padding: 6px 10px;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .album-thumbnail {
        width: 35px;
        height: 35px;
    }
    
    .track-title {
        font-size: 13px;
    }
    
    .track-artist {
        font-size: 11px;
    }
    
    .results .play-button, .results .share-button {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .track-item {
        padding: 5px 8px;
        gap: 6px;
    }
    
    .album-thumbnail {
        width: 30px;
        height: 30px;
    }
    
    .track-title {
        font-size: 12px;
    }
    
    .track-artist {
        font-size: 10px;
    }
    
    .results .play-button, .results .share-button {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
}

/* Keep share page track items horizontal on mobile */
.results .track-item {
    flex-direction: row;
    text-align: left;
    gap: 12px;
    padding: 8px 12px;
}

.results .track-item img {
    width: 40px;
    height: 40px;
}

/* Keep share page track items horizontal on small mobile */
.results .track-item img {
    width: 40px;
    height: 40px;
}

/* Override main play button styles for results page */
.results .play-button {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Make share button wider to fit "Share" text */
.results .share-button {
    width: auto !important;
    min-width: 50px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    border-radius: 14px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    color: #6b7280;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.footer p {
    margin: 5px 0;
    text-align: center;
}

.footer a {
    color: #8B5CF6;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}