/* CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML and Body Styles */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation; /* Improve touch behavior */
}

body, html {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: #000;
    font-family: 'Inter', sans-serif, system-ui;
    border: none;
    outline: none;
    margin-block-end: 0;
    /* Disable pull-to-refresh and other unwanted behaviors */
    overscroll-behavior: none;
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
}

/* Canvas Styles */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: block;
    width: 100vw;
    height: 100vh;
    border: none;
    outline: none;
    background-color: #000;
    touch-action: none; /* Prevent default touch actions on the canvas */
}

/* For devices with notches */
@supports (padding: max(0px)) {
    body {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Notification component */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    text-align: center;
    opacity: 0;
    animation: notificationFadeIn 0.3s ease-out forwards;
}

.notification.error {
    background-color: rgba(220, 53, 69, 0.9);
    color: white;
}

.notification.info {
    background-color: rgba(52, 152, 219, 0.9);
    color: white;
}

.notification.success {
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    margin-left: 10px;
    cursor: pointer;
    vertical-align: middle;
    padding: 0 6px;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1.0; }
    100% { opacity: 0.6; }
}

@keyframes notificationFadeIn {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

/* Navigation hints (only shown on first use) */
.nav-hint {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-hint.visible {
    opacity: 1;
}

.nav-hint.top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.nav-hint.bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}
