:root {
    --color-0: #65c285;
    --color-1: #43743e;
    --color-2: #5c2d17;
    --color-3: #b54c56;
    --color-4: #7b3349;
    --color-5: #222222;
    --color-6: #372c53;
    --color-7: #222222;
    --color-8: #3b4b6e;
    --color-9: #222222;
    --color-10: #1e3e47;
    --color-11: #222222;
    --color-12: #65c285;

    --header-bg: #222;
    --body-bg: #000;
    --grid-bg: #111;
    --text-color: #fff;

    --background-color: #1a1a1a;
    --header-background: #2a2a2a;
    --grid-background: #333333;
    --grid-cell-hover: #444444;
    --grid-cell-active: #555555;
    --modal-background: rgba(0, 0, 0, 0.8);
    --modal-content: #2a2a2a;
}

html {
    height: 100%;
    width: 100%;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#orientation-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-color);
    color: var(--text-color);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
}

@media screen and (orientation: portrait) {
    /* Allow portrait usage by keeping app visible */
    #orientation-message {
        display: none !important;
    }
    main {
        display: flex !important;
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 10px 20px;
    background-color: var(--header-bg);
    color: var(--text-color);
    height: 60px;
    position: relative;
    border-bottom: 1px solid #333;
}

.freq-diff-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    /* border: 2px solid rgba(255, 255, 255, 0.2); */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.freq-diff-circle.active {
    background-color: rgba(255, 255, 255, 0.2);
    /* border-color: rgba(255, 255, 255, 0.4); */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

header h1 {
    font-family: "Impact", Arial, sans-serif;
    font-size: 24px;
    margin: 0;
    color: var(--text-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-right: auto; /* push following buttons to the right */
}

.controls {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.toggle-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.toggle-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toggle-button:active {
    transform: translateY(0);
}

.toggle-button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.layout-toggle.np-mode {
    font-family: 'Impact', Arial, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1px;
    font-weight: bold;
    animation: rainbow-strobe 1.5s linear infinite;
}

@keyframes rainbow-strobe {
    0%, 100% { color: #ff0000; text-shadow: 0 0 6px rgba(255, 0, 0, 0.5); }
    16% { color: #ff8800; text-shadow: 0 0 6px rgba(255, 136, 0, 0.5); }
    33% { color: #ffff00; text-shadow: 0 0 6px rgba(255, 255, 0, 0.5); }
    50% { color: #00ff00; text-shadow: 0 0 6px rgba(0, 255, 0, 0.5); }
    66% { color: #00aaff; text-shadow: 0 0 6px rgba(0, 170, 255, 0.5); }
    83% { color: #aa00ff; text-shadow: 0 0 6px rgba(170, 0, 255, 0.5); }
}

@media (max-width: 600px) {
    header {
        padding: 0.4rem 0.75rem;
        height: 3rem;
        gap: 0.35rem;
    }

    .freq-diff-circle {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.65rem;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .toggle-button {
        font-size: 1rem;
        padding: 0.25rem;
        min-width: 1.6rem;
        height: 1.6rem;
    }
}

.keyboard-instructions {
    margin-top: 20px;
    line-height: 1.6;
    text-align: left;
}

.keyboard-instructions code {
    background-color: #333;
    padding: 2px 5px;
    border-radius: 3px;
}

@media (orientation: landscape) and (max-height: 600px) {
    .piano-container {
        height: 100vh;
        overflow:hidden;
    }

    /* Hide all octaves by default (override inline flex) */
    .piano-octave {
        display: none !important;
        height: 50%;
    }

    /* Show only middle two octaves (2nd and 3rd in DOM order) */
    .piano-octave:nth-child(2),
    .piano-octave:nth-child(3) {
        display: flex !important;
    }

    /* Hide header for immersive playing area */
    header {
        display: none;
    }

    /* Make visible octaves fill the viewport height */
    .piano-container {
        display: flex !important;
        flex-direction: column;
    }

    .piano-octave:nth-child(2),
    .piano-octave:nth-child(3) {
        flex: 1 1 50% !important; /* each takes half height */
        height: 50% !important;
    }
} 