body {
    background-color: #000000;
    font-family: Arial, sans-serif;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    position: relative;
}

body, * {
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE10+/Edge */
}

#player-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 100;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 1.1em;
    padding: 8px 0 4px 0;
    text-align: center;
    pointer-events: none;
    letter-spacing: 0.03em;
}

#player-header .player-name {
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.1em;
}

#player-header .instrument {
    font-style: italic;
    color: #b0e0e6;
    font-size: 1em;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background-color: #000;
    padding: 10px;
    gap: 10px;
    min-height: 100vh;
    box-sizing: border-box;
}

.menu button {
    flex: 1 1 calc(33.33% - 20px);
    max-width: 120px;
    margin: 5px;
    padding: 15px;
    font-size: 1.2em;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
}

.button-a {
    background-color: #b94429; /* Red */
}

.button-b {
    background-color: #29cc47; /* Green */
}

.button-c {
    background-color: #2a46c2; /* Blue */
}

.button-d {
    background-color: #c7a20d; /* Yellow */
}

.button-e {
    background-color: #8E44AD; /* Purple */
}

.button-f {
    background-color: #E67E22; /* Orange */
}

.button-g {
    background-color: #1ABC9C; /* Teal */
}

.button-h {
    background-color: #bc1a1a; /* Dark Red */
}

.menu button:hover {
    background-color: #555;
    transform: scale(1.05);
}

/* Mobile responsive layout: 2 per row, last one full width */
@media (max-width: 600px) {
    .menu {
        align-content: center;
        padding: 20px 10px;
    }

    .menu button {
        flex: 1 1 calc(50% - 20px); /* 2 per row */
        max-width: 100%;
    }
}
  
.mode-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    color: #fff;
}

.mode-text {
    color: #ffffff;
    user-select: none;
}

.orientation-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    color: #fff;
    width: 100%;
    height: 100%;
}

.orientation-text {
    position: relative;
    color: #ffffff;
    z-index: 2;
    user-select: none;
}

.ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple-animation 1s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    from {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

#tilt-box {
    top: 50%;
    left: 50%;
    margin: 100px auto;
    transform: rotateX(0deg) rotateY(0deg);
    z-index: 1;
    width: 100px;
    height: 100px;
    background-color: red;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    transition: transform 0.1s linear;
    transform-style: preserve-3d;
}

#tilt-cube {
  top: 50%;
  left: 50%;
  margin: 100px auto;
  width: 100px; height: 100px;
  background: #183eff;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(2, 221, 255, 0.5);
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
}

#loop-screen {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    position: absolute;
    top: 0;
    left: 0;
}

#loop-top {
    flex: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
}

#loop-bottom {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: rgba(255, 0, 0, 0.05);
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.loop-text {
    color: white;
    font-size: 1em;
    user-select: none;
}

/* Flash feedback */
.tap-flash {
    animation: flash 0.3s;
}

@keyframes flash {
    from {
        background-color: rgba(255, 255, 255, 0.3);
    }
    to {
        background-color: transparent;
    }
}

/* Loop playing color state */
#loop-top.active {
    background-color: var(--active-color, rgba(255,255,255,0.1));
}


#orientation-arrow {
    width: 60px;
    height: 60px;
    margin: 40px auto;
    border: none;
    background: none;
    position: relative;
}
#orientation-arrow::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    margin: 0 auto;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid #29cc47;
}

#refresh-btn {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  background: rgba(30,30,30,0.92);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.7rem;
  height: 2.7rem;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 12px #0005;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
#refresh-btn:hover {
  background: #09ff00;
  color: #222;
  transform: scale(1.12) rotate(20deg);
}