:root {
    --bg-primary: #d5e5f2;
    --bg-gradient-start: #f0f5f9;
    --bg-gradient-end: #d9e4ec;
    --border-color: #b0c4de;
    --border-color-medium: #a0b4ce;
    --border-color-dark: #88a0b8;
    --text-primary: #003366;
    --text-secondary: #333;
    --text-muted: #555;
    --text-highlight: #004488;
    --text-light-shadow: rgba(255, 255, 255, 0.5);
    --text-dark-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    --button-text: #333;
    --button-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    --button-border: rgba(0, 0, 0, 0.3);
    --button-gradient-start: #ffffff;
    --button-gradient-mid1: #f6f6f6;
    --button-gradient-mid2: #ededed;
    --button-gradient-end: #ffffff;
    --button-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --button-active-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    --button-danger-text: #600;
    --button-danger-text-shadow: 0 1px 0 rgba(255, 200, 200, 0.6);
    --button-danger-border: rgba(150, 0, 0, 0.5);
    --button-danger-gradient-start: #ffcccc;
    --button-danger-gradient-mid1: #ffaaaa;
    --button-danger-gradient-mid2: #ff8888;
    --button-danger-gradient-end: #ffcccc;
    --button-danger-active-shadow: inset 0 1px 2px rgba(150, 0, 0, 0.4);
    --timer-ready-color: #00994c;
    --timer-holding-color: #cc8800;
    --timer-running-color: #990000;
    --timer-stopped-color: #003399;
    --timer-bg: #c5d5e2;
    --timer-border: #a0b4ce;
    --timer-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    --scramble-bg: #e8f0f5;
    --scramble-border: #b0c4de;
    --scramble-text: #334155;
    --scramble-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    --history-bg: #e8f0f5;
    --history-scrollbar-thumb: #a0b4ce;
    --history-scrollbar-track: #d9e4ec;
    --history-header-gradient-start: #e8f0f5;
    --history-header-gradient-end: #d8e2eb;
    --history-row-even-bg: #f0f5f9;
    --history-border: #c5d5e2;
    --stats-box-bg: #e0e8f0;
    --stats-box-border: #b0c4de;
    --stats-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --notification-bg-start: #e0f0ff;
    --notification-bg-end: #c0d8ff;
    --notification-border: #003366;
    --notification-text: #003366;
    --notification-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    --select-bg: #e8f0f5;
    --select-border: #b0c4de;
    --select-text: #334155;
    --select-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    --switch-bg-off: linear-gradient(to bottom, #cde1f0, #a5b9c8);
    --switch-bg-on: linear-gradient(to bottom, #90d8f0, #60a5c8);
    --switch-border: rgba(0, 0, 0, 0.2);
    --switch-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.5);
    --switch-knob-bg: linear-gradient(to bottom, #ffffff, #f0f0f0);
    --switch-knob-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
    --switch-knob-border: rgba(0, 0, 0, 0.3);
    --switch-glow-on: 0 0 8px rgba(100, 180, 255, 0.7);
    --input-bg: var(--select-bg);
    --input-border: var(--select-border);
    --input-text: var(--select-text);
    --input-shadow: var(--select-shadow);
    --input-focus-border: #60a5fa;
}
.dark-mode {
    --bg-primary: #1a202c;
    --bg-gradient-start: #2d3748;
    --bg-gradient-end: #1a202c;
    --border-color: #4a5568;
    --border-color-medium: #5a6578;
    --border-color-dark: #718096;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --text-highlight: #90cdf4;
    --text-light-shadow: rgba(0, 0, 0, 0.2);
    --text-dark-shadow: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    --button-text: #e2e8f0;
    --button-text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    --button-border: rgba(255, 255, 255, 0.3);
    --button-gradient-start: #4a5568;
    --button-gradient-mid1: #3a4558;
    --button-gradient-mid2: #2d3748;
    --button-gradient-end: #4a5568;
    --button-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --button-active-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    --button-danger-text: #fecaca;
    --button-danger-text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
    --button-danger-border: rgba(255, 100, 100, 0.5);
    --button-danger-gradient-start: #7f1d1d;
    --button-danger-gradient-mid1: #991b1b;
    --button-danger-gradient-mid2: #b91c1c;
    --button-danger-gradient-end: #7f1d1d;
    --button-danger-active-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
    --timer-ready-color: #6ee7b7;
    --timer-holding-color: #fcd34d;
    --timer-running-color: #f87171;
    --timer-stopped-color: #93c5fd;
    --timer-bg: #2d3748;
    --timer-border: #4a5568;
    --timer-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    --scramble-bg: #2d3748;
    --scramble-border: #4a5568;
    --scramble-text: #cbd5e0;
    --scramble-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    --history-bg: #2d3748;
    --history-scrollbar-thumb: #5a6578;
    --history-scrollbar-track: #1a202c;
    --history-header-gradient-start: #2d3748;
    --history-header-gradient-end: #1f2937;
    --history-row-even-bg: #1f2937;
    --history-border: #4a5568;
    --stats-box-bg: #3a4558;
    --stats-box-border: #5a6578;
    --stats-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --notification-bg-start: #2a4365;
    --notification-bg-end: #1e3a5f;
    --notification-border: #90cdf4;
    --notification-text: #e2e8f0;
    --notification-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    --select-bg: #2d3748;
    --select-border: #4a5568;
    --select-text: #cbd5e0;
    --select-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    --switch-bg-off: linear-gradient(to bottom, #4a5568, #2d3748);
    --switch-bg-on: linear-gradient(to bottom, #3b82f6, #2563eb);
    --switch-border: rgba(255, 255, 255, 0.2);
    --switch-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(255, 255, 255, 0.1);
    --switch-knob-bg: linear-gradient(to bottom, #e2e8f0, #cbd5e0);
    --switch-knob-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
    --switch-knob-border: rgba(0, 0, 0, 0.5);
    --switch-glow-on: 0 0 10px rgba(96, 165, 250, 0.8);
    --input-bg: var(--select-bg);
    --input-border: var(--select-border);
    --input-text: var(--select-text);
    --input-shadow: var(--select-shadow);
    --input-focus-border: #2563eb;
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    background-image: linear-gradient(rgba(100, 100, 100, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 100, 100, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    grid-template-areas: "header header" "main sidebar" "history history";
    min-height: 100vh;
    padding: 1rem;
    gap: 1rem;
    overflow-x: hidden;
    color: var(--text-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
}
@media (min-width: 1024px) {
    body {
        grid-template-areas: "header sidebar" "main sidebar" "history sidebar";
        grid-template-rows: auto auto 1fr;
        padding: 2rem;
        gap: 2rem;
   }
    #history-section {
        margin-top: 0;
   }
}
#main-title {
    grid-area: header;
    color: var(--text-primary);
    text-shadow: 1px 1px 1px var(--text-dark-shadow);
}
#timer-scramble-section {
    grid-area: main;
}
#right-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: start;
}
#history-section {
    grid-area: history;
    margin-top: 1rem;
}
.y-card {
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.y-button {
    border-radius: 15px;
    border: 1px solid var(--button-border);
    font-weight: bold;
    color: var(--button-text);
    text-shadow: var(--button-text-shadow);
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: none;
    background: linear-gradient(to bottom, var(--button-gradient-start) 0%, var(--button-gradient-mid1) 47%, var(--button-gradient-mid2) 53%, var(--button-gradient-end) 100%);
    box-shadow: var(--button-shadow);
}
.y-button::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    border-radius: 15px 15px 0 0;
    z-index: 1;
    opacity: 0.7;
}
.dark-mode .y-button::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}
.y-button span, .y-button img {
    position: relative;
    z-index: 2;
}
.y-button:active, .y-button.active {
    background: linear-gradient(to top, var(--button-gradient-start) 0%, var(--button-gradient-mid1) 47%, var(--button-gradient-mid2) 53%, var(--button-gradient-end) 100%);
    box-shadow: var(--button-active-shadow);
    transform: translateY(1px);
}
.y-button-danger {
    background: linear-gradient(to bottom, var(--button-danger-gradient-start) 0%, var(--button-danger-gradient-mid1) 47%, var(--button-danger-gradient-mid2) 53%, var(--button-danger-gradient-end) 100%);
    border-color: var(--button-danger-border);
    color: var(--button-danger-text);
    text-shadow: var(--button-danger-text-shadow);
}
.y-button-danger::before {
    background: linear-gradient(to bottom, rgba(255, 220, 220, 0.8), rgba(255, 200, 200, 0.2));
}
.dark-mode .y-button-danger::before {
    background: linear-gradient(to bottom, rgba(255, 150, 150, 0.15), rgba(255, 100, 100, 0.05));
}
.y-button-danger:active, .y-button-danger.active {
    background: linear-gradient(to top, var(--button-danger-gradient-start) 0%, var(--button-danger-gradient-mid1) 47%, var(--button-danger-gradient-mid2) 53%, var(--button-danger-gradient-end) 100%);
    box-shadow: var(--button-danger-active-shadow);
}
#historyTable .y-button {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 10px;
}
#historyTable .y-button::before {
    border-radius: 10px 10px 0 0;
}
.toolbar-button {
    padding: 5px 8px;
    font-size: 0.8rem;
    border-radius: 10px;
    font-weight: 500;
}
.toolbar-button::before {
    border-radius: 10px 10px 0 0;
}
.penalty-buttons button {
    padding: 3px 6px;
    font-size: 0.75rem;
}
.popup-content .y-button {
    margin-top: 1rem;
}
.y-button img {
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.3em;
    filter: brightness(0.7) contrast(1.1);
    transition: filter 0.3s ease;
}
.dark-mode .y-button img {
    filter: invert(1) brightness(1.5) contrast(0.9);
}
#historyTable .y-button img {
    width: 1em;
    height: 1em;
    margin-right: 0;
}
.toolbar-button img {
    width: 1em;
    height: 1em;
    margin-right: 0.3em;
}

.y-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background-color: rgba(0, 50, 80, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.y-popup-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

#scramble-heading {
    padding-left: 4%;
}
.y-popup {
    background: linear-gradient(to bottom, var(--bg-gradient-start), var(--bg-gradient-end));
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow), 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1.75rem 2.25rem;
    width: 90%;
    max-width: 550px;
    position: relative;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-secondary);
}
.y-popup-backdrop.show .y-popup {
    transform: scale(1) translateY(0px);
    opacity: 1;
}
.y-popup h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-highlight);
    text-shadow: 1px 1px 1px var(--text-dark-shadow);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color-medium);
}
.y-popup p {
    margin-bottom: 0.6rem;
    font-size: 1rem;
    color: var(--text-secondary);
}
.y-popup strong {
    font-weight: 700;
    color: var(--text-primary);
}
.y-popup span.scramble-stat {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
    display: block;
    margin-top: 0.3rem;
    background-color: var(--scramble-bg);
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--scramble-border);
    box-shadow: var(--scramble-shadow);
}
.y-popup-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--border-color-dark);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}
.y-popup-close-btn:hover {
    color: var(--text-highlight);
    transform: rotate(90deg);
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color-medium);
}
.setting-item label {
    color: var(--text-secondary);
    font-weight: 500;
}
#customCubeList {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color-medium);
    border-radius: 4px;
    background-color: var(--scramble-bg);
}
#customCubeList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
}
#customCubeList li:last-child {
    border-bottom: none;
}
#customCubeList button {
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: 1rem;
}
#addCustomCubePopup .popup-content > div {
    margin-bottom: 1rem;
}
#addCustomCubePopup label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}
#addCustomCubePopup input[type="text"], #addCustomCubePopup input[type="number"], #addCustomCubePopup select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    box-shadow: var(--input-shadow);
    color: var(--input-text);
    transition: border-color 0.2s ease;
}
#addCustomCubePopup input:focus, #addCustomCubePopup select:focus {
    outline: none;
    border-color: var(--input-focus-border);
}
.aero-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.aero-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.aero-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--switch-bg-off);
    border: 1px solid var(--switch-border);
    box-shadow: var(--switch-shadow);
    transition: background 0.4s, box-shadow 0.4s;
    border-radius: 26px;
}
.aero-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--switch-knob-bg);
    border: 1px solid var(--switch-knob-border);
    box-shadow: var(--switch-knob-shadow);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border-radius: 50%;
}
input:checked + .aero-slider {
    background: var(--switch-bg-on);
    box-shadow: var(--switch-shadow), var(--switch-glow-on);
}
input:checked + .aero-slider:before {
    transform: translateX(24px);
}

#twisty-player-container {
    display: flex;

    justify-content: center;

    align-items: center;

    width: 100%;
    min-height: 200px;

    padding: 10px;
}

#twisty-player-vis {
    width: 100%;
    max-width: 300px;

    aspect-ratio: 1 / 1;

}
#timer {
    font-family: 'Roboto Mono', monospace;
    color: var(--text-primary);
    text-shadow: 0 1px 1px var(--text-light-shadow);
    padding: 5px 10px;
    background-color: var(--timer-bg);
    border: 1px solid var(--timer-border);
    border-radius: 4px;
    box-shadow: var(--timer-shadow);
    transition: color 0.2s, background-color 0.3s ease, border-color 0.3s ease;
    font-size: clamp(3rem, 12vw, 5rem);
    line-height: 1.1;
}
.timer-ready {
    color: var(--timer-ready-color) !important;
}
.timer-holding {
    color: var(--timer-holding-color) !important;
}
.timer-running {
    color: var(--timer-running-color) !important;
}
.timer-stopped {
    color: var(--timer-stopped-color) !important;
}
.scramble-area {
    margin-bottom: 1rem;
    width: 100%;
}
.scramble-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
#scramble {
    flex-grow: 1;
    font-family: 'Roboto Mono', monospace;
    background-color: var(--scramble-bg);
    border: 1px solid var(--scramble-border);
    color: var(--scramble-text);
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: var(--scramble-shadow);
    line-height: 1.4;
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#scramble-edit-input {
    display: none;
    flex-grow: 1;
    font-family: 'Roboto Mono', monospace;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: var(--input-shadow);
    line-height: 1.4;
    text-align: center;
}
#editScrambleBtn {
    padding: 4px 6px;
    border-radius: 8px;
    line-height: 1;
}
#editScrambleBtn img {
    margin-right: 0;
    width: 1em;
    height: 1em;
}
#historyList {
    scrollbar-width: thin;
    scrollbar-color: var(--history-scrollbar-thumb) var(--history-scrollbar-track);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--history-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
#historyList::-webkit-scrollbar {
    width: 10px;
}
#historyList::-webkit-scrollbar-track {
    background: var(--history-scrollbar-track);
    border-radius: 10px;
}
#historyList::-webkit-scrollbar-thumb {
    background: var(--history-scrollbar-thumb);
    border-radius: 10px;
    border: 1px solid var(--border-color-dark);
}
#historyTable thead {
    background: linear-gradient(to bottom, var(--history-header-gradient-start), var(--history-header-gradient-end));
    border-bottom: 2px solid var(--border-color-medium);
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background 0.3s ease, border-color 0.3s ease;
}
#historyTable th {
    padding: 0.5rem 1rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 1px 0 var(--text-light-shadow);
    text-align: left;
    transition: color 0.3s ease;
}
#historyTable tbody tr {
    border-bottom: 1px solid var(--history-border);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
#historyTable tbody tr:last-child {
    border-bottom: none;
}
#historyTable tbody tr:nth-child(even) {
    background-color: var(--history-row-even-bg);
}

#historyTable td {
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    vertical-align: middle;
    transition: color 0.3s ease;
}
#historyTable td:nth-child(3) {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    max-width: 200px;
}
.penalty-indicator {
    font-size: 0.75rem;
    color: #dc2626;
    font-weight: bold;
    margin-left: 0.25rem;
}
.dark-mode .penalty-indicator {
    color: #f87171;
}
.stats-box {
    background-color: var(--stats-box-bg);
    border: 1px solid var(--stats-box-border);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    box-shadow: var(--stats-box-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.stats-box span {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    transition: color 0.3s ease;
}
.stats-box strong {
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
#notification-area {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 100;
    gap: 0.5rem;
}
.notification-box {
    border-radius: 6px;
    border: 1px solid var(--notification-border);
    background: linear-gradient(to bottom, var(--notification-bg-start), var(--notification-bg-end));
    color: var(--notification-text);
    text-shadow: 0 1px 0 var(--text-light-shadow);
    box-shadow: var(--notification-shadow);
    padding: 0.75rem 1rem;
    opacity: 0;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform: translateX(100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 250px;
    max-width: 350px;
}
.notification-box.show {
    opacity: 1;
    transform: translateX(0);
}
.notification-box button {
    font-weight: bold;
    color: var(--notification-text);
    opacity: 0.7;
    background: none;
    border: none;
    transition: opacity 0.2s;
    margin-left: 1rem;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
}
.notification-box button:hover {
    opacity: 1;
}
select.y-select {
    padding: 6px 10px;
    border: 1px solid var(--select-border);
    border-radius: 6px;
    background-color: var(--select-bg);
    box-shadow: var(--select-shadow);
    color: var(--select-text);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23334155' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
    padding-right: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.dark-mode select.y-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23cbd5e0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}
#toolbar {
    padding: 0.75rem;
}
#toolbar h3 {
    font-weight: bold;
    color: var(--text-highlight);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    transition: color 0.3s ease;
}
.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.penalty-buttons button {
    padding: 3px 6px;
    font-size: 0.75rem;
}

.hidden {
    display: none !important;
}
#metronomePopup .metronome-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}
#metronomePopup .metronome-mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    justify-content: center;
}
#metronomePopup .metronome-mode-selector label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9em;
    cursor: pointer;
}
#metronomePopup .bpm-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}
#metronomePopup .custom-times-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
#metronomePopup label {
    font-weight: 500;
    color: var(--text-secondary);
}
#metronomePopup input[type=number] {
    width: 70px;
    padding: 5px 8px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    box-shadow: var(--input-shadow);
    color: var(--input-text);
    text-align: center;
}
#metronomePopup input[type=text] {
    width: 100%;
    max-width: 250px;
    padding: 5px 8px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background-color: var(--input-bg);
    box-shadow: var(--input-shadow);
    color: var(--input-text);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9em;
}
#metronomePopup input[type=range] {
    width: 150px;
    cursor: pointer;
    accent-color: var(--text-highlight);
}