:root {
  --green: #94dd94;
  --width: 88%;
}

body, html {
    font-family: monospace;
    background: #222;
    color: #eee;
    margin: 0;
    padding: 0;
    font-size: 18px;
}

#main {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 0.8rem;
    box-sizing: border-box;
}

#top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

#image {
    width: 3rem;
    border-radius: 25%;
    user-select: none;
    transition: filter 3s ease;
    cursor: pointer;
}

#image:hover {
    outline: 1px solid rgb(82, 120, 152);
}

#title {
    font-size: 1.8rem;
    text-shadow: 0 0 0.18rem currentcolor;
    user-select: none;
}

#top-controls {
    margin-left: 1rem;
    margin-bottom: -8px;
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

#scope-wrapper {
    width: var(--width);
    display: flex;
    justify-content: left;
}

#scope-visualizer {
    width: 100%;
    height: 120px;
    padding: 0.4rem;
    margin: 0.5rem 0;
    border: 1px solid #444;
    border-radius: 0.4rem;
    background: #151515;
    box-shadow: inset 0 0 0.6rem rgba(0, 0, 0, 0.8);
    display: none;
}

#scope-visualizer.active {
    display: flex;
}

#scope-visualizer canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#scope-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    user-select: none;
}

#scope-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#volume-control {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.95rem;
    user-select: none;
}

#volume-slider {
    width: 10rem;
    accent-color: var(--green);
    transition: accent-color 3s ease;
}

#volume-value {
    min-width: 3rem;
    text-align: left;
    color: var(--green);
    transition: color 3s ease;
}

#tempo-control {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.95rem;
    user-select: none;
}

#tempo-slider {
    width: 10rem;
    accent-color: var(--green);
    transition: accent-color 3s ease;
}

#tempo-value {
    min-width: 4rem;
    text-align: left;
    color: var(--green);
    transition: color 3s ease;
}

#code-input {
    width: var(--width);
    height: 360px;
    background: #111;
    color: var(--green);
    border: 1px solid #444;
    padding: 10px;
    min-height: 80px;
    min-width: 500px;
    font-size: 1.1rem;
    max-width: 96%;
    max-height: 620px;
    outline: none;
    transition: color 3s ease;
    box-sizing: border-box;
}

button {
    padding: 5px 12px;
    cursor: pointer;
    font-weight: bold;
    font-weight: normal;
    background-color: #424242;
    color: rgb(225, 225, 225);
    font-size: 1.1rem;
    border-color: #888;
}

button:hover {
    color: rgb(255, 255, 255);
    border-color: rgb(207, 207, 207);
    box-shadow: inset 0 0 0 1px grey;
}

#controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    height: 2rem;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
}

#status {
    color: var(--green);
    margin-left: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    transition: color 3s ease;
    max-width: 30rem;
    word-break: break-all;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #2a2a2a;
    border: 2px solid #555;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#about-modal .modal-content {
    max-width: 720px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #444;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--green);
}

#songs-filter-wrapper {
    padding: 1rem;
    border-bottom: 1px solid #444;
}

#songs-filter {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
}

#songs-filter:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#modal-close,
#about-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-close:hover,
#about-close:hover {
    color: #fff;
    box-shadow: none;
}

.songs-list {
    padding: 1rem;
    overflow-y: auto;
    max-height: 60vh;
}

.song-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.song-item:hover {
    background-color: #444;
    border-color: var(--green);
    color: var(--green);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #888;
}

#song-picker-title {
    font-size: 1.2rem;
    color: var(--green);
    user-select: none;
}

#songs-list {
    user-select: none;
}

#about-title {
    font-size: 1.2rem;
    color: var(--green);
    user-select: none;
}

#about-body {
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.4;
    color: #ddd;
}

#about-body p {
    margin: 0 0 1rem 0;
}

#about-body p:last-child {
    margin-bottom: 0;
}

a.popup:visited, a.popup:link, a.popup:hover {
    color: white;
    text-decoration: underline;
}

a.popup:hover {
    font-weight: bold;
}