/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Prevent text selection during play */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #2e1a2e 0%, #1a0b1a 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    touch-action: none; /* Prevent default touch actions like scroll/zoom */
}

/* Canvas */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when possible */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center screens vertically by default */
    align-items: center;
}

/* Screens & HUD */
.screen, #hud, #modal-overlay {
    pointer-events: auto; /* Re-enable clicks for UI elements */
}

.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
}

/* Start Screen */
#start-screen {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 20px;
}

.glow-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ff69b4;
    text-shadow: 0 0 10px #ff69b4, 0 0 20px #ff1493;
    animation: pulse 2s infinite ease-in-out;
}

p {
    font-size: 1.2rem;
    color: #ddd;
    line-height: 1.5;
}

/* Buttons */
button {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    transition: transform 0.1s, box-shadow 0.2s;
}

button:active {
    transform: scale(0.95);
}

.btn-primary {
    background-color: #ff1493;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

.btn-success {
    background-color: #00e676;
    color: #003300;
}

.btn-secondary {
    background-color: #444;
    color: #ccc;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Modal Overlay */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: linear-gradient(135deg, #2a102a, #1a051a);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #ff69b4;
    text-align: center;
    max-width: 90%;
    width: 300px;
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.modal-content h2 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
}

.big-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffc0cb;
}

.btn-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

/* Feedback Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 10px #ff69b4; }
    50% { transform: scale(1.05); text-shadow: 0 0 20px #ff69b4, 0 0 30px #ff1493; }
}

.shake {
    animation: shake-anim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake-anim {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (min-width: 768px) {
    .glow-text { font-size: 4rem; }
    p { font-size: 1.5rem; }
}

.screen-gif {
  width: 100%;
  max-width: 350px;
  margin: 16px auto;
  display: block;
  opacity: 0.9;
  pointer-events: none;
}
