:root {
    --body-bg-color: #eef2ff;
    --dark-text-color: #34495E;
    --light-text-color: #545454;
    --dark-bg-color: #1D273B;
    --light-bg-color: #34495e;
    --light-border-color: #CED4DA;
    --dark-border-color: #b2bec3;
    --purple-color: #727CF5;
    --purple-bg-color: rgba(114, 124, 245, 0.1);
    --purple-border-color: rgba(114, 124, 245, 0.5);
    --setting-color: #00B894;
    --green-color: #34A853;
    --red-color: #EA4335;
    --box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
    --purple-shadow: 0px 4px 8px rgba(114, 124, 245, 0.4);
    --piano-color: #3e4345;
    /* 👇 CSS variables */
    --white-key-width: calc(100% / 7);
    --black-key-width: calc(var(--white-key-width) * 0.6);
}

*,
:after,
:before {
    box-sizing: border-box;
    margin: 0;
    font-family: Overpass, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    height: 100vh;
    background: var(--body-bg-color);
    color: var(--dark-text-color);
    overflow-x: hidden;
}

header {
    height: 48px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 16px;
    box-shadow: var(--box-shadow);
}




hr {
    width: 100%;
    border: 0;
    height: 1px;
    background: var(--dark-border-color);
}

select {
    height: 36px;
    background-color: var(--purple-bg-color);
    border: 1px solid var(--light-border-color);
    font-size: 15px;
    font-weight: 500;
    color: var(--light-text-color);
    display: inline-block;
    outline: none;
    cursor: pointer;
    border-radius: 4px;
    word-wrap: normal;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23545454' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right;
    background-repeat: no-repeat;
    background-size: 24px;
    padding-left: 8px;
    padding-right: 24px;
    transition: all ease 200ms;
}

select.hide-icon {
    background: #fff;
    padding-left: 10px;
}


#logo {
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--dark-text-color);
    text-decoration: none;
}

#logo img {
    margin-right: 8px;
}

#logo span {
    color: var(--purple-color);
}

#show-massage {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s 0.5s;
    text-align: center;
    line-height: 40px;
    max-width: 600px;
    width: 100%;
    padding: 0 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    margin: 20px auto 0 auto;
    background: var(--red-color);
}

#show-massage.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 500ms ease;
}

.container {
    max-width: 600px;
    margin: 20px auto 0 auto;
    border: 1px solid var(--light-border-color);
    background-color: #fff;
    border-radius: 4px;
    padding: 32px;
    width: 100%;
}

.container h1 {
    font-size: 24px;
    text-align: center;
}

.container h2 {
    font-size: 20px;
}

.container h3 {
    font-size: 16px;
}

.container p {
    line-height: 1.6;
    color: var(--light-text-color);
}

.container a {
    color: var(--purple-color);
    font-weight: 500;
}

.column {
    display: flex;
    flex-direction: column;
}

.flex {
    display: flex;
    flex-wrap: wrap;
}

.row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

.center {
    align-items: center;
}

.label {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-text-color);
}

.gap-8 {
    gap: 8px;
}

.gap-16 {
    gap: 16px;
}

.gap-20 {
    gap: 20px;
}

.gap-32 {
    gap: 32px;
}

.note {
    color: #595f62;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--dark-border-color);
    transition: all 300ms ease-in-out;
    background-color: var(--purple-bg-color);
    width: 40px;
}

.note.active {
    background-color: var(--purple-color);
    color: #fff;
    border: 1px solid var(--purple-border-color);
}

.note>div {
    padding: 6px 0;
    text-align: center;
}

.action-btn {
    background-color: var(--purple-color);
    padding: 12px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 300ms ease-in-out;
    outline: none;
}

.action-btn:hover {
    box-shadow: var(--purple-shadow);
}

.stop {
    background-color: #ff7675;
}

.correct {
    background-color: var(--green-color);
    color: #fff;
    border: 1px solid var(--green-color);
}

.wrong {
    background-color: var(--red-color);
    color: #fff;
    border: 1px solid var(--red-color);
}

.result-area {
    display: flex;
    gap: 16px;
    align-items: center;
}

.result-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-text-color);
}

.identify-notes {
    display: flex;
    gap: 8px;
    font-weight: 600;
    color: #8e989c;
}

.result-area span {
    font-size: 18px;
    font-weight: 600;
    color: #8e989c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.how-to-use {
    display: flex;
    gap: 16px;
}

.how-to-use span {
    font-size: 32px;
    font-weight: 700;
    color: var(--purple-color);
    margin-top: -2px;
}

footer {
    height: 48px;
    border-top: 1px solid var(--light-border-color);
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: #fff;
}

footer a {
    text-decoration: none;
    color: var(--dark-text-color);
    font-size: 14px;
    font-weight: 500;
    transition: all 300ms ease-in-out;
}

footer a:hover {
    color: var(--purple-color);
}

@media (min-width: 768px) and (max-width: 991px) {
    #show-massage {
        width: calc(100% - 32px);
    }

    .container {
        width: calc(100% - 32px);
        padding: 24px;
    }
}

@media (max-width: 768px) {
    #show-massage {
        width: calc(100% - 32px);
    }

    .container {
        width: calc(100% - 32px);
        margin-top: 16px;
        padding: 16px;
    }

    footer {
        margin-top: 16px;
    }
}

/* switch button */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.25s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.25s;
}

input:checked + .slider {
    background-color: var(--purple-color);
}

input:checked + .slider::before {
    transform: translateX(22px);
}

/* piano css */
.piano {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 900px;
    height: 260px;
    border-radius: 2px;
    background: var(--dark-border-color);
    border: 1px solid var(--dark-border-color);
}


.piano .key {
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    padding-bottom: 4px;
    transition: all 300ms ease-in-out;
}

.piano .key hr {
    width: 80%;
    border-radius: 2px;
    margin: 8px 0;
}

/* White keys */
.white-key {
    margin-right: 1px;
    background-color: #fff;
    color: #444;
    border-radius: 0 0 4px 4px;
    font-size: 12px;
}

.white-key:first-child {
    border-radius: 2px 0 4px 2px;
}

.white-key:last-child {
    margin-right: 0;
    border-radius: 0 2px 2px 4px;
}

/* White press */
.white-key.pressed {
    background-color: #d6dae6;
}


/* Black keys */
.black-key {
    position: absolute;
    top: 0px;
    width: 6%;
    height: 58%;
    background: #3e4345;
    border-radius: 0 0 2px 2px;
    color: #eaeaea;
    z-index: 10;
    font-size: 10px;
}

/* Black press */
.black-key.pressed {
    background-color: #787b7d;
}

/* Black key positions (same as before) */
.b1 {
    left: 10.5%;
}

.b2 {
    left: 33.5%;
}

.b3 {
    left: 48%;
}

.b4 {
    left: 71%;
}

.b5 {
    left: 85.5%;
}

/* Mobile */
@media (max-width: 600px) {
    .piano {
        height: 180px;
    }

    .black-key {
        width: 10%;
    }

    .b1 {
        left: 9.2%;
    }

    .b2 {
        left: 31%;
    }

    .b3 {
        left: 47%;
    }

    .b4 {
        left: 68.2%;
    }

    .b5 {
        left: 84.5%;
    }
}