* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Hardware acceleration for animations */
    .btn-control,
    .btn-play,
    .fab,
    .playlist-item,
    .lyrics-panel,
    .chat-panel,
    .karaoke-overlay {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform, opacity;
    }
}

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --accent: #ffffff;
    --accent-secondary: #666666;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --border: #2a2a2a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
    overscroll-behavior: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    padding-bottom: env(safe-area-inset-bottom, 30px);
    padding-left: max(30px, env(safe-area-inset-left));
    padding-right: max(30px, env(safe-area-inset-right));
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo svg {
    display: none;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.track-count {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    opacity: 0.7;
}

.telegram-link:hover {
    color: #0088cc;
    opacity: 1;
    transform: scale(1.1);
}

.telegram-link svg {
    display: block;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 40px;
    flex: 1;
    overflow: hidden;
}

.player-section {
    position: sticky;
    top: 30px;
    height: fit-content;
}

.playlist-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.now-playing {
    margin-bottom: 24px;
}

.album-art {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-art svg {
    color: var(--accent-secondary);
    opacity: 0.15;
    width: 60px;
    height: 60px;
}

.track-info {
    text-align: left;
}

.track-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.track-artist {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

.visualizer {
    height: 60px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    overflow: hidden;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

input[type="range"] {
    flex: 1;
    height: 2px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.2s;
    border-radius: 50%;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.5);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    cursor: pointer;
    border: none;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb:active {
    transform: scale(1.5);
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.btn-control,
.btn-play {
    background: transparent;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-play {
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    position: relative;
}

.btn-control:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-secondary);
}

.btn-play:hover {
    background: var(--text-secondary);
}

.btn-control:active,
.btn-play:active {
    transform: scale(0.95);
}

.btn-mode {
    transition: all 0.2s;
}

.btn-mode.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-mode.active svg {
    stroke: var(--bg-primary);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.volume-control svg {
    color: var(--text-secondary);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.playlist-header h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.btn-refresh {
    background: transparent;
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
    transform: rotate(180deg);
}

.playlist {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.playlist::-webkit-scrollbar {
    display: none;
}

.playlist-item {
    background: transparent;
    padding: 16px 0;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 50px 50px 1fr;
    gap: 16px;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.playlist-item:hover {
    background: var(--bg-secondary);
    padding-left: 16px;
    padding-right: 16px;
}

.playlist-item.active {
    background: var(--bg-secondary);
    padding-left: 16px;
    padding-right: 16px;
}

.playlist-item.active .playlist-item-title {
    color: var(--accent);
}

.playlist-item-number {
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.playlist-item-cover {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.playlist-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-item-cover svg {
    width: 20px;
    height: 20px;
    color: var(--accent-secondary);
    opacity: 0.3;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Audio loading states */
.loading-spinner {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 2;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.sync-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 10px;
    color: var(--accent-secondary);
    opacity: 0.5;
    letter-spacing: 0.5px;
}

/* Lyrics Panel */
.lyrics-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.lyrics-panel.open {
    right: 0;
}

.lyrics-header,
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.lyrics-header h3,
.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-close {
    background: transparent;
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-close:hover {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.lyrics-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 14px;
    color: var(--text-primary);
}

.lyrics-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.chat-panel.open {
    right: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.chat-message-username {
    font-weight: 600;
    font-size: 13px;
    color: var(--accent);
}

.chat-message-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.chat-message-text {
    font-size: 14px;
    color: var(--text-primary);
    word-wrap: break-word;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.chat-input input:focus {
    border-color: var(--accent);
}

#chatUsername {
    width: 100px;
    flex-shrink: 0;
}

#chatMessage {
    flex: 1;
}

#sendChatBtn {
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bg-primary);
    transition: all 0.2s;
}

#sendChatBtn:hover {
    background: var(--text-secondary);
}

#sendChatBtn:active {
    transform: scale(0.95);
}

/* Floating Action Buttons */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.fab {
    background: var(--accent);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fab:active {
    transform: scale(0.95);
}

/* Tablet and below */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .player-section {
        position: relative;
        top: 0;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .container {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .header {
        padding-bottom: 12px;
        margin-bottom: 12px;
        flex-shrink: 0;
    }

    .playlist-header {
        display: none !important;
    }

    .logo h1 {
        font-size: 16px;
    }

    .track-count {
        font-size: 10px;
    }

    .track-title {
        font-size: 20px;
    }

    .track-artist {
        font-size: 14px;
    }

    .main-content {
        gap: 24px;
    }

    .album-art {
        margin-bottom: 16px;
    }

    .now-playing {
        margin-bottom: 16px;
    }

    .controls {
        gap: 16px;
    }

    .control-buttons {
        gap: 16px;
    }

    /* Larger touch targets for mobile */
    .btn-control,
    .btn-play {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .btn-play {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
    }

    .btn-refresh,
    .btn-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .playlist-item {
        grid-template-columns: 40px 40px 1fr;
        gap: 12px;
        padding: 12px 0;
    }

    .playlist-item-cover {
        width: 40px;
        height: 40px;
    }

    /* Full-width panels on mobile */
    .lyrics-panel,
    .chat-panel {
        width: 100%;
        right: -100%;
        height: 100%;
        height: 100dvh;
        max-height: -webkit-fill-available;
    }

    .lyrics-panel.open,
    .chat-panel.open {
        right: 0;
    }

    /* Larger FAB for mobile */
    .fab-container {
        bottom: max(16px, env(safe-area-inset-bottom, 16px));
        right: 16px;
    }

    .fab {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
    }

    /* Hide visualizer on mobile to save space */
    .visualizer {
        display: none;
    }

    /* Better scrolling on mobile */
    .playlist {
        -webkit-overflow-scrolling: touch;
    }

    .chat-messages,
    .lyrics-content {
        -webkit-overflow-scrolling: touch;
    }

    /* Chat input adjustments */
    .chat-input {
        padding: 12px;
        padding-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
        gap: 8px;
        flex-shrink: 0;
        background: var(--bg-secondary);
    }

    .chat-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    #chatUsername {
        width: 70px;
        flex-shrink: 0;
    }

    #chatMessage {
        flex: 1;
        min-width: 0;
    }

    #sendChatBtn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .chat-input input {
        font-size: 16px;
        padding: 10px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .logo h1 {
        font-size: 14px;
    }

    .track-title {
        font-size: 18px;
    }

    .track-artist {
        font-size: 13px;
    }

    .control-buttons {
        gap: 12px;
    }

    .btn-control {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .btn-play {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }

    .playlist-item {
        grid-template-columns: 36px 36px 1fr;
        gap: 10px;
    }

    .playlist-item-cover {
        width: 36px;
        height: 36px;
    }

    .playlist-item-number {
        font-size: 12px;
    }

    .playlist-item-title {
        font-size: 14px;
    }

    .playlist-item-artist {
        font-size: 12px;
    }

    #chatUsername {
        display: none;
    }

    .fab-container {
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        right: 12px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .container {
        padding: 12px;
        height: 100vh;
    }

    .header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .main-content {
        grid-template-columns: 300px 1fr;
        gap: 20px;
    }

    .album-art {
        margin-bottom: 12px;
    }

    .now-playing {
        margin-bottom: 12px;
    }

    .controls {
        gap: 12px;
    }

    .control-buttons {
        gap: 12px;
    }

    .btn-control,
    .btn-play {
        width: 36px;
        height: 36px;
    }

    .btn-play {
        width: 44px;
        height: 44px;
    }

    .track-title {
        font-size: 16px;
    }

    .track-artist {
        font-size: 13px;
    }

    .playlist-item {
        padding: 8px 0;
    }
}

/* Karaoke Overlay */
.karaoke-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 13, 13, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.karaoke-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.karaoke-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2001;
}

.karaoke-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.karaoke-close svg {
    color: var(--text-primary);
}

.karaoke-debug {
    position: absolute;
    top: 30px;
    left: 30px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2001;
}

.karaoke-content {
    width: 90%;
    max-width: 1000px;
    text-align: center;
    padding: 40px;
}

.karaoke-track-info {
    margin-bottom: 60px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.karaoke-track-info h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #888888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.karaoke-track-info p {
    font-size: 24px;
    color: var(--text-secondary);
}

.karaoke-lyrics {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
    gap: 20px;
    overflow-y: auto;
    max-height: 50vh;
    padding: 20px;
    padding-top: 100px; /* Add padding at top so first lines are visible */
    padding-bottom: 100px; /* Add padding at bottom */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.karaoke-lyrics::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.karaoke-line {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    padding: 12px 24px;
    border-radius: 12px;
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.karaoke-line.active {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.karaoke-line.past {
    color: rgba(255, 255, 255, 0.5);
}

.karaoke-word {
    display: inline-block;
    transition: all 0.2s ease;
    color: inherit;
}

.karaoke-word.active {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
    animation: wordGlow 0.3s ease;
}

@keyframes wordGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
    }
}

.karaoke-word.past {
    color: rgba(255, 255, 255, 0.7);
}

.karaoke-loading {
    font-size: 24px;
    color: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Active state for karaoke button */
.btn-mode.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent);
}

/* Mobile karaoke adjustments */
@media (max-width: 768px) {
    .karaoke-content {
        width: 100%;
        padding: 20px;
        padding-top: max(20px, env(safe-area-inset-top, 20px));
    }

    .karaoke-track-info {
        margin-bottom: 40px;
    }

    .karaoke-track-info h2 {
        font-size: 24px;
    }

    .karaoke-track-info p {
        font-size: 16px;
    }

    .karaoke-lyrics {
        min-height: 200px;
        max-height: 60vh;
        padding: 16px;
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .karaoke-line {
        font-size: 20px;
        padding: 10px 16px;
        margin: 6px 0;
    }

    .karaoke-close {
        top: max(16px, env(safe-area-inset-top, 16px));
        right: 16px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .karaoke-debug {
        top: max(16px, env(safe-area-inset-top, 16px));
        left: 16px;
        font-size: 10px;
        padding: 4px 8px;
    }

    .karaoke-beta-badge {
        top: max(16px, env(safe-area-inset-top, 16px));
        left: 16px !important;
    }
}

/* Small mobile karaoke */
@media (max-width: 480px) {
    .karaoke-content {
        padding: 16px;
    }

    .karaoke-track-info {
        margin-bottom: 30px;
    }

    .karaoke-track-info h2 {
        font-size: 20px;
    }

    .karaoke-track-info p {
        font-size: 14px;
    }

    .karaoke-lyrics {
        max-height: 65vh;
    }

    .karaoke-line {
        font-size: 18px;
        padding: 8px 12px;
    }

    .karaoke-close {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .karaoke-beta-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    #debugLineCount,
    #debugTime,
    #debugActiveLine {
        display: none;
    }
}

/* Landscape karaoke */
@media (max-width: 896px) and (orientation: landscape) {
    .karaoke-track-info {
        margin-bottom: 20px;
    }

    .karaoke-track-info h2 {
        font-size: 20px;
    }

    .karaoke-track-info p {
        font-size: 14px;
    }

    .karaoke-lyrics {
        max-height: 50vh;
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .karaoke-line {
        font-size: 18px;
        padding: 6px 12px;
        margin: 4px 0;
    }

    .karaoke-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}
