
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Cherry Bomb One", system-ui;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: manipulation;
}

/* Initial startup screen styles */
#startup-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background-image: url('assets/oiia.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 20dvh;
    z-index: 10000;
}

#start-button {
    font-family: "Cherry Bomb One", system-ui;
    font-size: 80px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    user-select: none;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    text-align: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

#start-button:hover,
#start-button:active {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* Desktop styles */
@media (min-width: 768px) {
    #startup-screen {
        align-items: center;
        /* padding-bottom: 0; */
    }
    
    #start-button {
        font-size: 120px;
        padding: 30px;
    }
}

/* Game container - hidden initially */
#game-container {
    display: none;
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    object-fit: cover;
    transform: scaleX(-1);
    z-index: 1;
    filter: contrast(1.2) saturate(1.3) brightness(1.1) sharpen(1px);
}

#text-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 3;
    pointer-events: none;
    background: transparent;
    padding: 10px;
    font-family: "Cherry Bomb One", system-ui;
    font-size: 40px;
    color: rgb(255, 255, 255);
    opacity: 0.5;
    line-height: 1.1;
    word-wrap: break-word;
    overflow: hidden;
    white-space: pre-wrap;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    #text-box {
        font-size: 60px;
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #text-box {
        font-size: 120px;
    }
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2;
    pointer-events: none;
}

#stage-lights {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2;
    pointer-events: none;
}

/* Stage light effects */
.stage-light {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transform-origin: top center;
}

.light-o {
    top: 0;
    left: 10%;
    width: 300px;
    height: 60vh;
    background: linear-gradient(
        180deg,
        rgba(255, 100, 0, 0.9) 0%,
        rgba(255, 100, 0, 0.6) 30%,
        rgba(255, 100, 0, 0.3) 60%,
        rgba(255, 100, 0, 0.1) 80%,
        transparent 100%
    );
    transform: translateX(-50%) rotate(-30deg);
    clip-path: polygon(35% 0%, 65% 0%, 85% 100%, 15% 100%);
}

.light-i {
    top: 0;
    left: 50%;
    width: 300px;
    height: 60vh;
    background: linear-gradient(
        180deg,
        rgba(0, 150, 255, 0.9) 0%,
        rgba(0, 150, 255, 0.6) 30%,
        rgba(0, 150, 255, 0.3) 60%,
        rgba(0, 150, 255, 0.1) 80%,
        transparent 100%
    );
    transform: translateX(-50%);
    clip-path: polygon(35% 0%, 65% 0%, 85% 100%, 15% 100%);
}

.light-a {
    top: 0;
    right: 10%;
    width: 300px;
    height: 60vh;
    background: linear-gradient(
        180deg,
        rgba(255, 50, 150, 0.9) 0%,
        rgba(255, 50, 150, 0.6) 30%,
        rgba(255, 50, 150, 0.3) 60%,
        rgba(255, 50, 150, 0.1) 80%,
        transparent 100%
    );
    transform: translateX(50%) rotate(30deg);
    clip-path: polygon(35% 0%, 65% 0%, 85% 100%, 15% 100%);
}

/* Tablet and desktop stage lights */
@media (min-width: 481px) {
    .light-o, .light-i, .light-a {
        width: 400px;
        height: 70vh;
    }
}

.stage-light.flash {
    animation: stageFlash 0.6s ease-out forwards;
}

@keyframes stageFlash {
    0% {
        opacity: 0;
        transform: translateX(-50%) rotate(-30deg) scaleY(0.5);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) rotate(-30deg) scaleY(1);
    }
    30% {
        opacity: 0.9;
        transform: translateX(-50%) rotate(-30deg) scaleY(1.1);
    }
    60% {
        opacity: 0.4;
        transform: translateX(-50%) rotate(-30deg) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) rotate(-30deg) scaleY(0.8);
    }
}

.light-i.flash {
    animation: stageFlashCenter 0.6s ease-out forwards;
}

@keyframes stageFlashCenter {
    0% {
        opacity: 0;
        transform: translateX(-50%) scaleY(0.5);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
    }
    30% {
        opacity: 0.9;
        transform: translateX(-50%) scaleY(1.1);
    }
    60% {
        opacity: 0.4;
        transform: translateX(-50%) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scaleY(0.8);
    }
}

.light-a.flash {
    animation: stageFlashRight 0.6s ease-out forwards;
}

@keyframes stageFlashRight {
    0% {
        opacity: 0;
        transform: translateX(50%) rotate(30deg) scaleY(0.5);
    }
    15% {
        opacity: 1;
        transform: translateX(50%) rotate(30deg) scaleY(1);
    }
    30% {
        opacity: 0.9;
        transform: translateX(50%) rotate(30deg) scaleY(1.1);
    }
    60% {
        opacity: 0.4;
        transform: translateX(50%) rotate(30deg) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateX(50%) rotate(30deg) scaleY(0.8);
    }
}

#model-container {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    z-index: 3;
    pointer-events: none;
    max-width: 70vw;
    max-height: 50vh;
    margin-left: 0;
    margin-right: 0;
}

/* Small mobile portrait */
@media (max-width: 480px) and (orientation: portrait) {
    #model-container {
        top: 40%;
        left: 5%;
        transform: translate(-50%, -50%);
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #model-container {
        width: 800px;
        height: 800px;
    }
}

#model-container.angel-glow {
    filter: drop-shadow(0 0 20px #FFFC73);
}

.button {
    position: absolute;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 2px solid #fff;
    font-family: "Cherry Bomb One", system-ui;
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    bottom: max(25px, env(safe-area-inset-bottom));
}

/* Ensure buttons don't get cut off on very small screens */
@media (max-height: 600px) {
    .button {
        bottom: max(20px, env(safe-area-inset-bottom));
        width: 75px;
        height: 75px;
        font-size: 28px;
    }
}

/* Very short screens */
@media (max-height: 500px) {
    .button {
        bottom: max(15px, env(safe-area-inset-bottom));
        width: 65px;
        height: 65px;
        font-size: 24px;
    }
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    .button {
        bottom: max(35px, env(safe-area-inset-bottom));
        width: 120px;
        height: 120px;
        border: 3px solid #fff;
        font-size: 50px;
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    .button {
        bottom: 50px;
        width: 220px;
        height: 220px;
        border: 4px solid #fff;
        font-size: 90px;
    }
}

.button.hit {
    transform: scale(1.15);
}

/* Tablet and desktop hit animation */
@media (min-width: 481px) {
    .button.hit {
        transform: scale(1.4);
    }
}

#btn-o {
    left: 15%;
    box-shadow: 2px 2px 1px #ff6400;
}

#btn-o.hit {
    background: rgba(255, 100, 0, 0.8);
    border-color: #ff6400;
    box-shadow: 0 0 10px rgba(255, 100, 0, 0.6);
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    #btn-o {
        left: 12%;
        box-shadow: 4px 4px 2px #ff6400;
    }
    
    #btn-o.hit {
        box-shadow: 0 0 20px rgba(255, 100, 0, 0.6);
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #btn-o {
        left: 10%;
        box-shadow: 8px 8px 4px #ff6400;
    }
    
    #btn-o.hit {
        box-shadow: 0 0 30px rgba(255, 100, 0, 0.6);
    }
}

#btn-i {
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 2px 2px 1px #0096ff;
}

#btn-i.hit {
    background: rgba(0, 150, 255, 0.8);
    border-color: #0096ff;
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.6);
    transform: translateX(-50%) scale(1.15);
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    #btn-i {
        box-shadow: 4px 4px 2px #0096ff;
    }
    
    #btn-i.hit {
        box-shadow: 0 0 20px rgba(0, 150, 255, 0.6);
        transform: translateX(-50%) scale(1.4);
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #btn-i {
        box-shadow: 8px 8px 4px #0096ff;
    }
    
    #btn-i.hit {
        box-shadow: 0 0 30px rgba(0, 150, 255, 0.6);
        transform: translateX(-50%) scale(1.4);
    }
}

#btn-a {
    right: 15%;
    box-shadow: 2px 2px 1px #ff3296;
}

#btn-a.hit {
    background: rgba(255, 50, 150, 0.8);
    border-color: #ff3296;
    box-shadow: 0 0 10px rgba(255, 50, 150, 0.6);
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    #btn-a {
        right: 12%;
        box-shadow: 4px 4px 2px #ff3296;
    }
    
    #btn-a.hit {
        box-shadow: 0 0 20px rgba(255, 50, 150, 0.6);
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #btn-a {
        right: 10%;
        box-shadow: 8px 8px 4px #ff3296;
    }
    
    #btn-a.hit {
        box-shadow: 0 0 30px rgba(255, 50, 150, 0.6);
    }
}

.hand-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff0080;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.fingertip {
    background: #00ff80;
    width: 12px;
    height: 12px;
}

#music-note {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 20px;
    font-size: 80px;
    z-index: 6;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
}

/* Tablet styles */
@media (min-width: 481px) and (max-width: 767px) {
    #music-note {
        top: max(25px, env(safe-area-inset-top));
        left: 25px;
        font-size: 80px;
    }
}

/* Desktop styles for larger screens */
@media (min-width: 768px) {
    #music-note {
        top: 30px;
        left: 30px;
        font-size: 120px;
    }
}

#music-note:hover {
    transform: scale(1.15);
}

#music-note.active {
    color: #ffff00;
    text-shadow: 
        0 0 30px rgba(255, 255, 0, 1.0),
        0 0 60px rgba(255, 255, 0, 0.9),
        0 0 90px rgba(255, 255, 0, 0.7),
        0 0 120px rgba(255, 255, 0, 0.5);
    animation: musicNoteBobIntense 0.6s ease-in-out infinite;
}

@keyframes musicNoteBobIntense {
    0%, 100% { transform: translateY(0px) scale(1.0); }
    50% { transform: translateY(-20px) scale(1.15); }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    
    .button {
        width: 70px;
        height: 70px;
        font-size: 26px;
        bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    #music-note {
        font-size: 80px;
        top: max(15px, env(safe-area-inset-top));
        left: 15px;
    }
    
    #text-box {
        font-size: 30px;
    }
}

.text-box {
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.9);
    color: black;
    font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
    border: 2px solid black;
    box-shadow: 3px 3px 0px black;
    font-size: clamp(13px, 2vw, 15px);
    text-align: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    max-width: 90%;
    box-sizing: border-box;
}

#logo-container {
    position: absolute;
    top: 5px;
    right: 5px;
}

a {
    color: #0000ff !important;
}

a:hover {
    text-decoration: underline;
}

/* Loading indicator */
#loading-indicator {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    text-align: center;
    display: none;
}

/* Error message */
#error-message {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-family: "Cherry Bomb One", system-ui;
    font-size: 16px;
    text-align: center;
    z-index: 10001;
    max-width: 80%;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    display: none;
}

/* Audio unlock message */
#audio-unlock-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 100, 255, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-family: "Cherry Bomb One", system-ui;
    font-size: 18px;
    text-align: center;
    z-index: 10002;
    max-width: 80%;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.5);
    display: none;
}

#unlock-audio-button {
    background: #fff;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 5px;
    font-family: "Cherry Bomb One", system-ui;
    font-size: 16px;
    cursor: pointer;
}