:root {
    --led-off: #808080;
    --led-on: #ffffff;
    --led-glow: rgba(0, 0, 0, 0.2) 0px 0px 7px 1px, inset #404040 0 0 10px, #ffffff 0 0 12px;
    --led-on-edge: #999999;
    --font-color: white;
    --font-color-dim: #888;
    --panel-background: linear-gradient(135deg, hsla(0, 0%, 30%, 1) 0%, hsla(0, 0%, 20%, 1) 100%);
    --button-outer-shadow: #888;
    --msg-background: black;
    --divider-colour: #333;
    --body-background: #777;
    --menu-font-color: black;
    --hr-bottom-color: #ddd;
}
@font-face {
    font-family: 'Bellerose';
    src: url('Bellerose.ttf') format('truetype');
}
@font-face {
    font-family: 'Courier Prime';
    src: url('CourierPrime-Regular.ttf') format('truetype');
}
*:focus-visible {
    outline-color: white;
}
body {
    background-color: var(--body-background);
    min-width: 270px;
    transition: background-color 3s;
}
html, body, div {
    margin: 0;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
}
#container {
    display: flex;
    flex-grow: 1;
    flex-shrink: 1;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 0 10px 5px #333;
}
@keyframes textGlow {
    from {
        color: var(--font-color-dim);
    }
    50% {
        color: var(--font-color);
    }
    to {
        color: var(--font-color-dim);
    }
}

#message, #downloadLink {
    font-family: 'Courier Prime', monospace;
    text-transform: uppercase;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--font-color);
    background-color: var(--msg-background);
    animation: textGlow 5s infinite;
}
#message {
    flex: 0 0 50px;
    white-space: pre;
    overflow-x: hidden;
}
#downloadLink {
    flex: 0 0 50px;
}
#downloadLink a {
    color: inherit;
    text-decoration: none;
}
noscript {
    font-family: 'Bellerose', monospace;
    text-transform: uppercase;
    font-size: 18px;
    text-align: center;
    color: var(--font-color);
    background-color: var(--msg-background);
    animation: textGlow 5s infinite;
    padding: 0 10px;
}
noscript a, noscript a:visited {
    color: var(--font-color);
}
#title {
    display: flex;
    flex-direction: row;
    flex: 0 0 120px;
    align-items: center;
    justify-content: center;
    font-family: Bellerose;
    font-size: 48px;
    margin-top: -24px;
    color: var(--font-color);
    background: var(--panel-background);
    text-shadow: 0px 0px 15px var(--font-color);
    border: 1px solid var(--divider-colour);
    overflow: hidden;
    position: relative;
}
#title h1 {
    flex: 1 1 50%;
    display: flex;
    font-size: 48px;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0;
    height: 100%;
    z-index: 10;
}
#title h1 a, #title h1 a:visited {
    text-decoration: none;
    color: inherit;
}
#title .spacer {
    flex: 0 0 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#title svg {
    fill: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
}
#menuButton {
    background-color: transparent;
    border: none;
    margin-top: 20px;
}
#menuCloseIcon {
    display: none;
}

@keyframes growCircle{
    from {
        transform: translate3d(-50%, -50%, 0) scale(0) rotateZ(360deg);
    }
    to {
        transform: translate3d(-50%, -50%, 0) scale(1) rotateZ(360deg);
    }
}
@keyframes growLargeCircle{
    from {
        transform: translate3d(-50%, -50%, 0) scale(0) rotateZ(360deg);
    }
    to {
        transform: translate3d(-50%, -50%, 0) scale(2) rotateZ(360deg);
    }
}
#titleInner1 {
    animation-delay: 0s;
}
#titleInner2 {
    animation-delay: 0.3s;
}
#titleInner3 {
    animation-delay: 0.6s;
}
#titleInner4 {
    animation-delay: 0.9s;
}
#title div.radioWave {
    position: absolute;
    margin-top: 10px;
    border-radius: 50%;
    border: 1px solid #aaa;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    top:50%;
    left:50%;
    will-change: transform;
    transform: translate3d(-50%, -50%, 0) scale(0);
    animation-name: growCircle;
    animation-timing-function: ease-in;
    animation-duration: 3s;
    animation-iteration-count: infinite;
}
#visualiser {
    display: flex;
    flex: 1 1 200px;
    min-height: 0;
    position: relative;
}
#menu {
    font-family: Bellerose;
    font-size: 24px;
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 20px);
    background-image: linear-gradient(to bottom right, #ffffffee, #aaaaaaee);
    text-align: center;
    height: 0;
    transition: height 1s ease;
    border-radius: 5px;
    overflow-y: scroll;
    margin: 0 10px;
    z-index: 10;
}
#menu.visible {
    height: 100%;
    box-shadow: 0px 0px 10px 5px rgba(255,255,255,0.75);
}
#menu h2 {
    font-size: 24px;
    line-height: 32px;
    margin: 16px 8px 8px 8px;
    text-decoration: underline;
}
#menu p {
    font-size: 18px;
    line-height: 24px;
    margin: 8px 16px;
}
#menu a, #menu a:visited {
    color: var(--menu-font-color)
}
#menu #showList {
    padding: 0;
    line-height: 36px;
    margin-bottom: 0;
    margin-top: 8px;
}
#menu .menuButton {
    font-family: Bellerose;
    background-color: var(--font-color-dim);
    border: 2px solid var(--divider-colour);
    color: var(--menu-font-color);
    border-radius: 10px;
    display: inline-block;
    white-space: nowrap;
    font-size: 16px;
    line-height: 16px;
    padding: 4px 12px 12px 12px;
    cursor: pointer;
    margin: 0px 4px;
    user-select: none;
    outline: none;
}
#menu .menuButton:disabled {
    border-color: var(--font-color-dim);
    background-color: var(--font-color-dim) ! important;
    cursor: default;
}
#menu .menuButton:focus-visible {
    outline: 2px solid white;
}
#menu hr {
    margin-top: 32px;
    border-bottom-color: var(--hr-bottom-color);
}
#menu h3 {
    margin: 8px 0 4px 0;
    text-transform: capitalize;
    font-size: 20px;
}
#menu .menuButton.selected {
    background-color: var(--font-color);
}
#menu .hidden {
    display: none;
}
#volumeControlContainer {
    height: 50px;
    margin: 0 auto;
    display: inline-flex;
    flex-direction: row;
}
#volumeUp, #volumeDown {
    margin: 0 10px;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
}
.raisedButton svg {
    height: 25px;
    width: 25px;
    fill: var(--panel-background);
    pointer-events: none;
}
.raisedButton.disabled svg {
    fill: var(--font-color-dim);
}
#volumeLevel {
    display: flex;
    width: 180px;
    justify-content: space-around;
    align-items: center;
}
.buttonIndicator.miniLed {
    height: 10px;
    width: 10px;
}
.buttonIndicator.miniLed.on {
    background-color: var(--led-on);
    box-shadow: rgba(255, 255, 255, 0.8) 0px 0px 7px 1px;
}
#menu p#showsSelected {
    margin-bottom: 20px;
}
#channelSettings {
    height: auto;
}
#channelSettings h3 {
    text-decoration: underline;
    margin-top: 36px;
}
#channelSettings ul {
    display: flex;
    padding: 0;
    justify-content: center;
    margin: 10px 0 0 0;
}
#channelSettings li {
    display: flex;
    flex-direction: row;
}
#scheduleList, #channelScheduleLinks, #sleepTimerButtons, #visualiserList {
    padding: 0 40px;
}
#scheduleList {
    margin: 10px 0 0 0;
}
#channelScheduleLinks, #visualiserList {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
#channelScheduleLinks .menuButton, #visualiserList .menuButton, #sleepTimerButtons .menuButton {
    text-transform: capitalize;
    margin: 5px 3px;
    cursor: pointer;
}
#scheduleList li {
    display: flex;
    flex-direction: row;
    text-align: left;
    font-size: 14px;
    font-family: 'Courier Prime', monospace;
}
#scheduleList li .scheduleItemTime {
    flex: 0 0 60px;
}
#scheduleList li .scheduleItemName{
    flex-grow: 1;
}
#sleepTimerRunningDisplay {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: -10px;
}
#sleepTimerButtons {
    display: flex;
    justify-content: center;
    margin: 20px 0 0 0;
    flex-wrap: wrap;
}
#sleepTimerTime {
    font-family: 'Courier Prime', monospace;
}
#stationDetails {
    height: auto;
}
#buttons {
    display: flex;
    flex: 0 0 430px;
    flex-direction: row;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    border-width: 0;
    border-left-width: 1px;
    border-right-width: 1px;
    border-style: solid;
    border-color: var(--divider-colour);
    scrollbar-width: none;
}

#buttons:hover, #buttons:focus, #buttons:active {
    scrollbar-width: auto;
}

#buttonsContainer {
    display: flex;
    flex: 0 0 200px;
    flex-direction: row;
    justify-content: center;
    background: var(--panel-background);
}
.buttonContainerPadding {
    flex: 1 0 10px;
    z-index: 1;
}
#buttonContainerPaddingLeft {
    box-shadow: 5px 0px 5px 0px rgba(0,0,0,0.5);
}
#buttonContainerPaddingRight {
    box-shadow: -5px 0px 5px 0px rgba(0,0,0,0.5);
}
.buttonBox {
    display: flex;
    flex: 0 0 100px;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    border-color: var(--divider-colour);
    border-width: 0 1px;
    border-style: solid;
    margin: 0 -1px 0 0;
    scroll-snap-align: center;
}
#buttons.fewerChannels {
    justify-content: center;
}
@keyframes blinkGreen {
    from {
        background-color: var(--led-off);
    }
    50% {
        background-color: var(--led-on);
        box-shadow: var(--led-glow);
    }
    to {
        background-color: var(--led-off);
    }
}
.buttonIndicator {
    display: flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--led-off);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 7px 1px, inset #333333 0 0 10px;
    border: 1px solid var(--divider-colour);
}
.buttonBox.channelLoading .buttonIndicator {
    animation: blinkGreen 2s infinite;
}
.buttonBox.channelPlaying .buttonIndicator {
    background-color: var(--led-on);
    box-shadow: var(--led-glow);
}
.raisedButton, .raisedButton.disabled:active {
    display: flex;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    background-image: linear-gradient(to bottom right, #fff, #444);
    color: #a7a7a7;
    box-shadow: 1px 1px 6px var(--button-outer-shadow), inset 2px 2px 3px #fff;
    border: 1px solid var(--divider-colour);
}
.raisedButton:active {
    box-shadow: 1px 1px 6px var(--button-outer-shadow);
    background-image: linear-gradient(to bottom right, #d8d8d8, #2a2a2a);
    border-width: 2px;
}
.buttonLabel {
    display: flex;
    flex: 0 0 20px;
    align-items: center;
    color: var(--font-color);
    text-shadow: 0px 0px 10px var(--font-color);
    padding: 5px;
    font-family: Bellerose;
    text-transform: capitalize;
    font-size: 24px;
    line-height: 24px;
    margin-top: -10px;
    border: none ! important;
    white-space: nowrap;
}
canvas {
    width: 100%;
    height: 100%;
    background-color: var(--msg-background);
}
#visualiserCanvas, #playingNowCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
#playingNowCanvas {
    display: none;
    background-color: rgba(0, 0, 0, 0);
    filter: blur(25px) brightness(0%);
    z-index: 5;
}
#preferenceToggles {
    display: inline-grid;;
    grid-template-columns: 70% 30%;
    margin: 0 auto;
    justify-items: center;
    align-items: center;
    grid-gap: 0 10px;
}
#preferenceToggles label {
    font-size: 18px;
    margin-bottom: 10px;
    white-space: nowrap;
}
@keyframes pulse {
    0% {
        filter: blur(25px) brightness(30%);
    }
    30% {
        filter: blur(0) brightness(100%);
    }
    70% {
        filter: blur(0) brightness(100%);
    }
    100% {
        filter: blur(25px) brightness(30%);
    }
}
/* Styles for after sleep timer is triggered */
body.sleeping {
    background-color: #111;
}
body.sleeping #title div.radioWave {
    animation-name: growLargeCircle;
    animation-duration: 10s;
    border: 1px solid #444;
}
body.sleeping #titleInner2 {
    animation-delay: 1s;
}
body.sleeping #titleInner3 {
    animation-delay: 2s;
}
body.sleeping #titleInner4 {
    animation-delay: 3s;
}
body.sleeping #buttonsContainer {
    display: none;
}
body.sleeping #visualiser {
    display: none;
}
body.sleeping #title {
    background: var(--msg-background);
    flex-grow: 1;
    transition: flex-grow 3s;
}
body.sleeping #downloadLink {
    display: none;
}
body.sleeping #title .spacer {
    display: none;
}

@media screen and (max-width: 500px) {
    #title h1 {
        padding-top: 8px;
        font-size: 36px;
    }
    #message {
        white-space: normal;
        text-align: center;
        flex-basis: 50px;
    }
    #menu p {
        font-size: 18px;
        line-height: 20px;
        margin: 8px 16px;
    }
    #buttonsContainer {
        flex: 0 0 180px;
    }
    .buttonBox {
        flex: 0 0 80px;
    }
    #buttons {
        flex: 0 0 90%;
    }
    #scheduleList li .scheduleItemTime {
        flex: 0 0 50px;
    }
}
@media screen and (min-width: 350px) and (max-width: 500px) {
    #title {
        flex: 0 0 100px;
    }
    .buttonLabel {
        font-size: 20px;
    }
    #title svg {
        margin-top: 10px;
    }
    noscript {
        line-height: 30px;
    }
    #scheduleList, #channelScheduleLinks {
        padding: 0;
        margin: 10px;
    }
    #buttons {
        flex: 0 0 90%;
    }
}
@media screen and (max-width: 349px) {
    #title {
        flex: 0 0 80px;
        margin-top: -16px;
    }
    #title .spacer {
        flex: 0 0 40px;
    }
    #title h1 {
        padding-top: 0;
        white-space: nowrap;
        font-size: 32px;
    }
    #buttonsContainer {
        flex: 0 0 150px;
    }
    .buttonLabel {
        font-size: 16px;
    }
    .raisedButton {
        flex: 0 0 40px;
    }
    .raisedButton, .buttonIndicator {
        height: 40px;
        width: 40px;
    }
    #downloadLink {
        flex: 0 0 30px;
    }
    noscript {
        line-height: 20px;
    }
    noscript h2 {
        line-height: 30px;
        margin-top: 0;
    }
    #scheduleList, #channelScheduleLinks {
        padding: 0;
        margin: 10px;
    }
    #buttons {
        flex: 0 0 90%;
    }
    .buttonBox {
        flex: 0 0 70px;
    }
}