body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    text-align: center;
    background-color: #29323c;
}

#game {
    padding: 0;
    margin: 0;
    width: 60vh;
    height: 92vh;
    border-style: solid;
    border-width: 2px;
    font-size: 40px;
}

#game .screen {
    width: 100%;
    height: 100%;
    display: none;
    color: #CECEF6;
    background-color: black;
}

#game .screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

ul.menu {
    text-align: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

ul.menu li {
    margin: 0.8em 0;
}

button {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    width: 10em;
    height: 3em;
    background: linear-gradient(to bottom, #485563, #29323c);
    border-radius: 0.5em;
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

ul.menu li button:hover {
    background: linear-gradient(to bottom, #29323c, #485563);
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

#game div h1 {
    font-size: 1em;
    text-align: center;
}

#high-scores ol {
    text-align: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

#game div p {
    font-size: 0.5em;
}

.canvas {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

a {
    border: 1px solid #999;
    padding: 4px 8px;
    display: inline-block;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(to bottom, #485563, #29323c);
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}
  
a:hover {
    background: linear-gradient(to bottom, #29323c, #485563);
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

input {
    border: 1px solid #999;
    padding: 8px;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}
  
input:focus {
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 28px;
}
  
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
  
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}
  
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}
  
input:checked + .slider {
    background-color: #29323c;
}
  
input:focus + .slider {
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
}
  
input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}
  
.slider.round {
    border-radius: 34px;
}
  
.slider.round:before {
    border-radius: 50%;
}

#mobile-controls {
    position: fixed;
    inset: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 10;
}

#mobile-controls .touch-btn {
    position: absolute;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    border: 2px solid rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: bold;
    font-size: 6vmin;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.05s ease-in-out, background 0.05s ease-in-out;
}

#mobile-controls .touch-btn:active,
#mobile-controls .touch-btn.touch-active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.94);
}

#mobile-controls #mobile-pad {
    position: absolute;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6vmin;
    padding: 0 1.6vmin;
    width: 56vmin;
    height: 14vmin;
    right: 3vmin;
    bottom: 5vmin;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(0, 0, 0, 0.6);
    border-radius: 1.6vmin;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

#mobile-controls .pad-arrow {
    width: 0;
    height: 0;
    flex: 0 0 auto;
    border-top: 5vmin solid transparent;
    border-bottom: 5vmin solid transparent;
    transition: filter 0.05s ease-in-out;
}

#mobile-controls .pad-arrow-left {
    border-right: 8vmin solid #29c7f0;
}

#mobile-controls .pad-arrow-right {
    border-left: 8vmin solid #29c7f0;
}

#mobile-controls #mobile-pad.is-left  .pad-arrow-left  { filter: brightness(1.5); }
#mobile-controls #mobile-pad.is-right .pad-arrow-right { filter: brightness(1.5); }

#mobile-controls .pad-bar {
    display: inline-block;
    flex: 1 1 0;
    width: 1.4vmin;
    height: 7vmin;
    background: #29c7f0;
    border-radius: 0.4vmin;
    opacity: 0.35;
    transition: opacity 0.05s ease-in-out;
}

#mobile-controls .pad-bar.is-active {
    opacity: 1;
}

#mobile-controls .touch-btn-fire {
    width: 16vmin;
    height: 16vmin;
    left: 4vmin;
    bottom: 5vmin;
    background: rgba(255, 11, 0, 0.55);
    font-size: 3.6vmin;
    letter-spacing: 0.08em;
}

#mobile-controls .touch-btn-fire:active,
#mobile-controls .touch-btn-fire.touch-active {
    background: rgba(255, 11, 0, 0.85);
}

#mobile-controls .touch-btn-pause {
    width: 9vmin;
    height: 9vmin;
    right: 3vmin;
    top: 3vmin;
    background: rgba(0, 0, 0, 0.45);
    font-size: 3.6vmin;
    border-radius: 1.2vmin;
}

#mobile-controls .touch-btn-pause:active,
#mobile-controls .touch-btn-pause.touch-active {
    background: rgba(255, 255, 255, 0.3);
}

body.touch #mobile-controls {
    visibility: visible;
}

body.touch #game {
    border-width: 1px;
}  
