/*#if (SampleContent)*/
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

/*#endif*/
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: #f7f7f7;
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

/* Loading page styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: white;
    gap: 20px;
}

.loading-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    animation: loading-bounce 1.5s ease-in-out infinite;
}

.loading-text {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
}

@keyframes loading-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/*playtime*/

.keyboard {
    position: relative;
    width: 21em; /* Width for 1 full octave (7 white keys * 3em) */
    max-width: 100%;
    margin: 2em auto;
    height: 12em;
    background: #f5f5f5;
    border: 0px;
    box-sizing: border-box;
}

.keyboard-two-octaves {
    width: 42em; /* Width for 2 octaves (14 white keys * 3em) */
    max-width: 100%;
}

.white-key {
    position: relative;
    display: inline-block;
    width: 3em; /* Fixed width */
    min-width: 0;
    height: 12em;
    background: white;
    border: 1px solid black;
    text-align: center;
    z-index: 1;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
    transition: background-color 0.1s ease, transform 0.1s ease;
    box-sizing: border-box;
}

.white-key.key-pressed {
    background: #e0e0e0;
    transform: translateY(2px);
}

.white-key.key-correct {
    background: #4CAF50 !important; /* Bright green */
    animation: flash-green 0.6s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.white-key.key-wrong {
    background: #F44336 !important; /* Bright red */
    animation: flash-red 0.6s ease;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
}

.white-key.middle-c-key {
    position: relative;
}

.white-key.middle-c-key::before {
    content: '';
    position: absolute;
    bottom: -0.4em;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.4em;
    height: 1.4em;
    border: 2px solid #ccc;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

@keyframes flash-green {
    0% { background: #4CAF50; box-shadow: 0 0 10px rgba(76, 175, 80, 0.6); }
    50% { background: #66BB6A; box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
    100% { background: #4CAF50; box-shadow: 0 0 10px rgba(76, 175, 80, 0.6); }
}

@keyframes flash-red {
    0% { background: #F44336; box-shadow: 0 0 10px rgba(244, 67, 54, 0.6); }
    50% { background: #EF5350; box-shadow: 0 0 15px rgba(244, 67, 54, 0.8); }
    100% { background: #F44336; box-shadow: 0 0 10px rgba(244, 67, 54, 0.6); }
}

.black-key.key-correct {
    background: #4CAF50 !important; /* Bright green */
    animation: flash-green 0.6s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.black-key.key-wrong {
    background: #F44336 !important; /* Bright red */
    animation: flash-red 0.6s ease;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.6);
}

/* Game UI */
.game-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100vh;
    box-sizing: border-box;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    flex-wrap: wrap;
    gap: 10px;
}

.game-hud-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.game-hud-info > div {
    color: #333;
    font-size: 0.95em;
}

.game-hud-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.game-hud-inline {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    font-weight: bold;
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px 20px;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 200px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.start-screen h2 {
    margin-bottom: 40px;
    font-size: 2em;
    color: #333;
}

.score-display {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
}

/* Stars Display */
.stars-display-large {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: 3px solid #ffd700;
}

.stars-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stars-value {
    font-size: 4em;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Scoreboard */
.scoreboard {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #dee2e6;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 300px);
}

.scoreboard h3 {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
    font-weight: bold;
}

.scoreboard-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scoreboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.scoreboard-item.scoreboard-new-record {
    background: #e7f3ff;
    border-color: #007bff;
    border-width: 2px;
    animation: pulse 1s ease-in-out;
}

.scoreboard-label {
    font-weight: 500;
    color: #666;
    font-size: 1em;
}

.scoreboard-value {
    font-weight: bold;
    color: #007bff;
    font-size: 1.2em;
}

.new-record-badge {
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 10px;
    animation: bounce 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.best-score-summary {
    background: #e7f3ff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.best-score-summary h3 {
    margin: 0 0 15px 0;
    color: #007bff;
    font-size: 1.3em;
}

.best-score-summary div {
    margin: 8px 0;
    font-size: 1.1em;
    color: #333;
}

.best-score-summary strong {
    color: #007bff;
    font-size: 1.2em;
}

.debug-info {
    text-align: center;
    padding: 5px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 0.9em;
    color: #856404;
}

.game-main-area {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 20px;
}

.game-left-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.game-stave-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-middle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-keyboard-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-right-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

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

.audio-banner {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #ffcc00;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
}

#music-output {
    margin: 20px auto;
    text-align: center;
}

.feedback-indicator-container {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation: feedback-pop 0.3s ease;
}

.feedback-correct {
    background: #4CAF50;
    color: white;
}

.feedback-wrong {
    background: #F44336;
    color: white;
}

.feedback-symbol {
    font-size: 80px;
    font-weight: bold;
    line-height: 1;
}

@keyframes feedback-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.level-selector {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.level-buttons, .mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 2px solid #007bff;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    color: #007bff;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
}

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

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

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    background: white;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background: #f0f8ff;
    border-color: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.key-label {
    position: absolute;
    bottom: 0.2em; /* Adjusted to move the text lower */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1em; /* Adjust as needed */
}

.black-key {
    position: absolute;
    top: 0;
    width: 2em; /* Fixed width */
    min-width: 0;
    height: 8em; /* Shorter height than white keys */
    background: #1a1a1a;
    border: 1px solid #000;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    border-radius: 0 0 3px 3px;
    cursor: pointer;
    opacity: 1;
    transition: background-color 0.1s ease, transform 0.1s ease;
    box-sizing: border-box;
}

.black-key:hover {
    background: #2a2a2a;
}

.black-key.key-pressed {
    background: #3a3a3a;
    transform: translateY(2px);
}

.black-key.key-correct {
    background: #4CAF50 !important; /* Bright green */
    animation: flash-green 0.4s ease;
}

.black-key.key-wrong {
    background: #F44336 !important; /* Bright red */
    animation: flash-red 0.4s ease;
}
/* Selection Page */
.selection-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100vh;
}

.selection-container h1 {
    margin-bottom: 40px;
    font-size: 2.5em;
    color: #333;
    font-weight: bold;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.level-selector, .mode-selector, .clef-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selector-label {
    font-size: 1em;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
    flex-shrink: 0;
}

.level-buttons, .mode-buttons, .clef-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.btn {
    padding: 8px 14px;
    border: 2px solid #007bff;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    color: #007bff;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    width: auto;
    min-width: 80px;
    flex: 0 0 auto;
}

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

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

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    background: white;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background: #f0f8ff;
    border-color: #0056b3;
}

.start-button-container {
    margin-top: 30px;
    text-align: center;
}

.best-score-display {
    margin: 20px 0;
    padding: 15px 20px;
    background: #e7f3ff;
    border-radius: 8px;
    border: 2px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.best-score-display h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #007bff;
    font-weight: bold;
}

.best-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #b3d9ff;
}

.best-score-item:last-child {
    border-bottom: none;
}

.best-score-label {
    font-weight: 500;
    color: #333;
}

.best-score-value {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9em;
}

/* .back-button-hud is now part of .game-hud-actions */

.stave-feedback-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Responsive Styles for Smaller Screens */
@media screen and (max-width: 1200px) {
    .keyboard {
        max-width: 90%;
        font-size: 0.9em;
    }
    
    .keyboard-two-octaves {
        max-width: 90%;
        font-size: 0.85em;
    }
}

@media screen and (max-width: 900px) {
    .keyboard {
        max-width: 100%;
        font-size: 0.8em;
        transform: scale(0.9);
        transform-origin: center;
    }
    
    .keyboard-two-octaves {
        max-width: 100%;
        font-size: 0.75em;
        transform: scale(0.85);
        transform-origin: center;
    }
}

/* Mobile Landscape Responsive Styles - Optimized for 844x390 */
@media screen and (max-width: 900px) and (orientation: landscape) {
    /* Selection Page - Mobile Landscape */
    .selection-container {
        padding: 8px 10px;
        max-width: 100%;
        max-height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .selection-container h1 {
        font-size: 1.4em;
        margin: 0;
        line-height: 1.2;
    }
    
    .page-header {
        margin-bottom: 6px;
        gap: 10px;
        align-items: center;
    }
    
    .page-header .btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .profile-selector {
        margin-bottom: 6px;
        padding: 6px 10px;
    }
    
    .current-profile-display {
        gap: 8px;
        font-size: 0.9em;
    }
    
    .profile-label, .profile-name {
        font-size: 0.9em;
    }
    
    /* Horizontal layout for selectors - buttons in one row */
    .level-selector, .mode-selector, .clef-selector {
        padding: 8px 10px;
        margin-bottom: 6px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    .selector-label {
        font-size: 0.85em;
        min-width: 90px;
        flex-shrink: 0;
        font-weight: 600;
    }
    
    .level-buttons, .mode-buttons, .clef-buttons {
        gap: 6px;
        flex-wrap: nowrap;
        flex: 1;
        display: flex;
        justify-content: flex-start;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.85em;
        min-width: 70px;
        flex: 0 0 auto;
        border-width: 2px;
    }
    
    /* Hide best score display on landscape phones to save space */
    .best-score-display {
        display: none;
    }
    
    .start-button-container {
        margin-top: 6px;
    }
    
    .start-button-container .btn {
        padding: 10px 24px;
        font-size: 1em;
        font-weight: 600;
    }
    
    .btn-large {
        padding: 10px 24px;
        font-size: 1em;
    }
    
    /* Specific optimization for 844x390 landscape phones */
    @media screen and (max-width: 900px) and (orientation: landscape) and (max-height: 400px) {
        .selection-container {
            padding: 6px 8px;
            gap: 4px;
        }
        
        .selection-container h1 {
            font-size: 1.2em;
            margin: 0;
        }
        
        .page-header {
            margin-bottom: 4px;
            gap: 8px;
        }
        
        .page-header .btn {
            padding: 5px 10px;
            font-size: 0.8em;
        }
        
        .profile-selector {
            margin-bottom: 4px;
            padding: 4px 8px;
        }
        
        .current-profile-display {
            gap: 6px;
            font-size: 0.85em;
        }
        
        .profile-label, .profile-name {
            font-size: 0.85em;
        }
        
        .level-selector, .mode-selector, .clef-selector {
            padding: 6px 8px;
            margin-bottom: 4px;
            gap: 8px;
        }
        
        .selector-label {
            font-size: 0.8em;
            min-width: 80px;
        }
        
        .level-buttons, .mode-buttons, .clef-buttons {
            gap: 5px;
        }
        
        .btn {
            padding: 5px 10px;
            font-size: 0.8em;
            min-width: 60px;
        }
        
        .start-button-container {
            margin-top: 4px;
        }
        
        .start-button-container .btn {
            padding: 8px 20px;
            font-size: 0.9em;
        }
        
        /* Game HUD optimization for 844x390 */
        .game-container {
            padding: 2px 3px;
        }
        
        .game-hud {
            padding: 3px 3px;
            margin: 0;
            margin-bottom: 3px;
            gap: 3px;
        }
        
        .game-hud-info {
            gap: 4px;
            font-size: 0.85em;
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }
        
        .game-hud-info > div {
            font-size: 0.85em;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .game-hud-actions {
            gap: 3px;
            flex-shrink: 0;
        }
        
        .game-hud-actions .btn {
            padding: 3px 6px;
            font-size: 0.7em;
            min-width: 48px;
        }
        
        /* Ensure start screen fits width */
        .start-screen {
            padding: 6px 3px;
            max-height: calc(100vh - 70px);
            overflow: hidden;
        }
        
        .start-screen h2 {
            font-size: 1.2em;
            margin-bottom: 8px;
        }
        
        .best-score-display {
            margin: 8px 0;
            padding: 8px 10px;
            overflow: hidden;
        }
        
        .best-score-display h3 {
            font-size: 1em;
            margin: 0 0 6px 0;
        }
        
        .best-score-item {
            padding: 4px 0;
            font-size: 0.9em;
        }
        
        .score-display {
            gap: 10px;
            margin-bottom: 12px;
            width: 100%;
            max-width: 100%;
        }
        
        .score-item {
            min-width: auto;
            padding: 10px;
            flex: 1;
            max-width: 100%;
        }
    }
    
    /* Game Page - Mobile Landscape */
    .game-container {
        padding: 4px 4px;
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .game-hud {
        padding: 4px 4px;
        margin: 0;
        margin-bottom: 4px;
        gap: 4px;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .game-hud-info {
        gap: 6px;
        font-size: 0.95em;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .game-hud-info > div {
        font-size: 0.95em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .game-hud-actions {
        gap: 4px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    .game-hud-actions .btn {
        padding: 4px 8px;
        font-size: 0.75em;
        min-width: 55px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .game-hud-inline {
        padding: 5px;
        margin-top: 10px;
        font-size: 0.85em;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Start screen 3-column layout - matches game layout structure */
    .start-screen-left {
        flex: 1;
        min-width: 0;
    }
    
    .start-screen-right {
        width: 120px;
        flex-shrink: 0;
    }
    
    .start-screen-center {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding: 4px;
        box-sizing: border-box;
    }
    
    .start-screen {
        min-height: auto;
        padding: 8px 12px;
        max-height: calc(100vh - 80px);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .start-screen h2 {
        font-size: 1.4em;
        margin-bottom: 10px;
    }
    
    .start-screen-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        margin-top: 15px;
    }
    
    .start-screen-actions .btn {
        width: auto;
        min-width: 150px;
    }
    
    .score-display {
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .score-item {
        min-width: 120px;
        padding: 15px;
    }
    
    .score-value {
        font-size: 1.5em;
    }
    
    .game-main-area {
        flex-direction: row;
        gap: 5px;
        margin-bottom: 0;
        display: flex !important;
        visibility: visible !important;
        flex: 1;
        min-height: 0;
        max-height: calc(100vh - 50px);
        align-items: flex-start;
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .game-left-section {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        gap: 0;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        max-width: calc(100% - 128px);
        box-sizing: border-box;
        padding: 0;
    }
    
    .game-stave-section {
        flex: 0 0 50%;
        display: flex !important;
        visibility: visible !important;
        width: 100%;
        min-height: 0;
        max-height: 50%;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        border: 2px solid red;
    }
    
    .stave-feedback-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 0;
        margin: 0;
        border: 2px solid orange;
        box-sizing: border-box;
    }
    
    .feedback-indicator-container {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }
    
    #music-output {
        border: 1px dashed #999;
        box-sizing: border-box;
        min-width: 200px;
        min-height: 100px;
    }
    
    .game-keyboard-section {
        flex: 0 0 50%;
        display: flex !important;
        visibility: visible !important;
        width: 100%;
        min-height: 0;
        max-height: 50%;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
        border: 2px solid blue;
    }
    
    /* Keyboard styling moved to mobile landscape section below */
    
    .game-right-section {
        width: 120px;
        flex-shrink: 0;
        display: flex !important;
        flex-direction: column;
        visibility: visible !important;
        align-items: stretch;
        padding: 4px;
        overflow: hidden;
        gap: 4px;
        border: 2px solid green;
        box-sizing: border-box;
    }
    
    /* HUD in right section */
    .game-hud-right {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 4px;
        background: #f9f9f9;
        border-radius: 4px;
        font-size: 0.75em;
    }
    
    .game-hud-info-right {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .game-hud-info-right > div {
        font-size: 0.75em;
        color: #333;
    }
    
    .game-hud-actions-right {
        display: flex;
        flex-direction: column;
        gap: 3px;
        margin-top: 4px;
    }
    
    .game-hud-actions-right .btn {
        padding: 4px 8px;
        font-size: 0.7em;
        width: 100%;
    }
    
    /* Score items in right section */
    .game-scores-right {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 4px;
        background: #f0f8ff;
        border-radius: 4px;
    }
    
    .score-item-right {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.8em;
    }
    
    .score-label-right {
        color: #007bff;
        font-weight: 600;
    }
    
    .score-value-right {
        color: #007bff;
        font-weight: bold;
    }
    
    /* Ladder in right section */
    .game-ladder-right {
        flex: 1;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .game-ladder-right .streak-ladder-container {
        width: 100%;
        height: 100%;
    }
    
    .game-ladder-right .ladder-wrapper {
        width: 100% !important;
        transform: scale(0.6);
        transform-origin: center;
    }
    
    /* Hide duplicate streak text in ladder since we show it separately */
    .game-ladder-right .streak-text {
        display: none;
    }
    
    .streak-ladder-container {
        display: flex !important;
        visibility: visible !important;
        width: 100%;
        height: 100%;
    }
    
    .ladder-wrapper {
        width: 70px !important;
        height: auto !important;
        flex-shrink: 0;
        transform: scale(0.5);
        transform-origin: top right;
    }
    
    .ladder-svg {
        width: 100% !important;
        height: 100% !important;
    }
    
    #music-output {
        margin: 0;
        transform: scale(1);
        transform-origin: center;
        width: 100%;
        height: 100%;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Keyboard - Mobile Landscape - Use standard keyboard, scale to fit 2 octaves */
    .game-keyboard-section {
        overflow: hidden;
        text-align: center;
        padding: 0;
    }
    
    /* Use standard keyboard styling, calculate font-size to fit both width and height */
    /* Section B: width ≈ calc(100vw - 128px - 8px), height ≈ 50% of (100vh - HUD) */
    /* Standard keyboard: 42em width, 12em height */
    /* Use min() to pick the smaller constraint (width or height) */
    /* For grand stave, reduce to 70% height to fit */
    .game-keyboard-section .keyboard-two-octaves {
        width: 42em !important;
        height: 12em !important;
        margin: 0 auto !important;
        /* Use the smaller of: width constraint or height constraint (70% of available for grand stave) */
        font-size: min(
            calc((100vw - 136px) / 42),
            calc(((100vh - 60px) * 0.5 * 0.7) / 12)
        ) !important;
        max-width: 100%;
    }
    
    /* For 1 octave */
    .game-keyboard-section .keyboard:not(.keyboard-two-octaves) {
        width: 21em !important;
        height: 12em !important;
        margin: 0 auto !important;
        font-size: min(
            calc((100vw - 136px) / 21),
            calc(((100vh - 60px) * 0.5 * 0.8) / 12)
        ) !important;
        max-width: 100%;
    }
    
    /* Keep standard key styling - don't override */
    .game-keyboard-section .white-key {
        /* Use standard styling from .white-key */
    }
    
    .game-keyboard-section .black-key {
        /* Use standard styling from .black-key */
    }
    
    /* Stave and Feedback - Mobile Landscape */
    .stave-feedback-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .feedback-indicator-container {
        width: 50px;
        height: 50px;
    }
    
    .feedback-indicator {
        width: 50px;
        height: 50px;
    }
    
    .feedback-symbol {
        font-size: 30px;
    }
    
    .game-controls {
        margin-top: 10px;
    }
    
    .audio-banner {
        top: 5px;
        right: 5px;
        padding: 5px;
        font-size: 0.8em;
    }
    
    /* Scoreboard - Mobile Landscape */
    .stars-display-large {
        padding: 15px;
        margin: 15px 0;
    }
    
    .stars-title {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .stars-value {
        font-size: 2.5em;
    }
    
    .scoreboard {
        padding: 15px;
        margin: 15px 0;
    }
    
    .scoreboard h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .scoreboard-item {
        padding: 10px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .scoreboard-label {
        font-size: 0.9em;
    }
    
    .scoreboard-value {
        font-size: 1.1em;
    }
}

/* Global Scrollbar Styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

*::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Ensure content areas can scroll when needed */
.start-screen {
    overflow: hidden;
}

.scoreboard {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 300px);
}

.score-display {
    overflow-x: auto;
    overflow-y: hidden;
}

.best-score-display {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 400px);
}
