body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #38761d;
    padding-top: 30px;
    font-family: sans-serif;
}

#billiards-table {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#rack {
    position: relative;
    width: 200px;
    height: 160px;
    transform: translateY(60px);
}

.ball {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: black;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    z-index: 1;
}

.ball::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    z-index: -1;
}

.ball-1,
.ball-9,
.step-ball-1,
.step-ball-9 {
    --ball-color: #ffcc00;
    background-color: var(--ball-color);
}

.ball-2,
.ball-10,
.step-ball-2,
.step-ball-10 {
    --ball-color: #0033ff;
    background-color: var(--ball-color);
}

.ball-3,
.ball-11,
.step-ball-3,
.step-ball-11 {
    --ball-color: #ff0000;
    background-color: var(--ball-color);
}

.ball-4,
.ball-12,
.step-ball-4,
.step-ball-12 {
    --ball-color: #660099;
    background-color: var(--ball-color);
}

.ball-5,
.ball-13,
.step-ball-5,
.step-ball-13 {
    --ball-color: #ff6600;
    background-color: var(--ball-color);
}

.ball-6,
.ball-14,
.step-ball-6,
.step-ball-14 {
    --ball-color: #006600;
    background-color: var(--ball-color);
}

.ball-7,
.ball-15,
.step-ball-7,
.step-ball-15 {
    --ball-color: #990000;
    background-color: var(--ball-color);
}

.ball-8,
.step-ball-8 {
    background-color: #000000;
    color: black;
    border: 1px solid #333;
}

.striped,
.step-ball-striped {
    background-image: linear-gradient(to top, white 25%, transparent 25%, transparent 75%, white 75%) !important;
    background-color: var(--ball-color) !important;
}

.cue-ball {
    background-color: white;
    margin-bottom: 40px;
    color: transparent;
    border: 3px solid #333;
    z-index: 10;
}

.cue-ball::before {
    content: none;
}

#play-pause-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #ff0000;
    border: 1px solid #333;
    cursor: pointer;
    margin-top: 100px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#play-pause-btn::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    z-index: 1;
}

#play-pause-btn.sequencer-running::after,
#play-pause-btn.sequencer-running::before {
    content: '';
    position: absolute;
    width: 70%;
    height: 3px;
    background: black;
    z-index: 2;
}

#play-pause-btn.sequencer-running::before {
    transform: rotate(45deg);
}

#play-pause-btn.sequencer-running::after {
    transform: rotate(-45deg);
}

#play-pause-btn:not(.sequencer-running)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid black;
    transform: translateX(1px);
    z-index: 2;
}

#bpm-control {
    margin-top: 15px;
    font-size: 12px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#bpm-display {
    display: none;
}

.sequencer-track-container {
    width: 950px;
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.track-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100px;
    margin-right: 15px;
}

.track-label {
    font-weight: bold;
    color: white;
    font-size: 11px;
    margin-bottom: 5px;
}

.vol-slider {
    width: 60px;
    height: 4px;
    cursor: pointer;
}

.sequencer-track {
    display: flex;
    width: 650px;
    justify-content: space-between;
    padding: 5px 0;
}

.step-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    position: relative;
    z-index: 1;
}

.step-ball::before {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: white;
    border-radius: 50%;
    z-index: -1;
}

.step-ball-16 {
    background-color: white !important;
    color: transparent;
}

.step-ball-16::before {
    content: none;
}

.step-ball.armed {
    border: 2px solid gold;
    box-shadow: 0 0 8px gold;
}

.clear-pattern-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f44336;
    border: 2px solid white;
    cursor: pointer;
    margin-left: 20px;
    position: relative;
}

.clear-pattern-btn::before,
.clear-pattern-btn::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 2px;
    background: white;
    top: 13px;
    left: 6px;
}

.clear-pattern-btn::before {
    transform: rotate(45deg);
}

.clear-pattern-btn::after {
    transform: rotate(-45deg);
}

#system-controls {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

#system-controls button {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

#random-btn {
    background: #ffcc00;
    color: #333;
}

#save-btn {
    background: white;
    color: #38761d;
}

#load-btn {
    background: #333;
    color: white;
}

.active-step {
    box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.7) !important;
    border: 3px solid white !important;
}

#engine-toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border: 1px solid white;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #ffcc00;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

.signature {
    color: white;
    margin-top: 10px;
}

.socials {
    display: flex;
    list-style: none;
    padding: 0;
}

.socials li {
    margin-top: 5px;
    padding: 2px;
}