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

:root {
    --vw: 1vw;
    --vh: 1vh;
}

html, body {
    width: 100%;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 10;
}

#start-screen h1 {
    color: #e94560;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(233,69,96,0.5);
}

.phone-icon {
    width: 80px;
    height: 120px;
    border: 4px solid #e94560;
    border-radius: 10px;
    margin-bottom: 2rem;
    position: relative;
    animation: tiltPhone 1.5s ease-in-out infinite;
}

.phone-icon::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    background: rgba(233,69,96,0.3);
    border-radius: 4px;
}

.phone-icon::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    background: #e94560;
    border-radius: 2px;
}

@keyframes tiltPhone {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.loading-container {
    width: 200px;
    margin-bottom: 1rem;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #ff6b6b);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

.difficulty-select {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.difficulty-btn {
    padding: 10px 20px;
    border: 2px solid #e94560;
    background: transparent;
    color: #e94560;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.difficulty-btn.selected {
    background: #e94560;
    color: white;
}

.difficulty-btn:hover {
    transform: scale(1.05);
}

.btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    pointer-events: none;
}

#start-btn {
    background: #e94560;
    color: white;
}

#start-btn.ready {
    opacity: 1;
    pointer-events: auto;
}

#start-btn.ready:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(233,69,96,0.5);
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(26, 26, 46, 0.9);
    z-index: 10;
}

#game-over h2 {
    color: #e94560;
    font-size: 3rem;
    margin-bottom: 1rem;
}

#game-over p {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

#restart-btn {
    background: #0f3460;
    color: white;
}

#calibration-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(26, 26, 46, 0.95);
    z-index: 20;
}

#calibration-screen h2 {
    color: #e94560;
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

#calibration-screen p {
    color: #a0a0a0;
    text-align: center;
    padding: 0 2rem;
}
