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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: 'Courier New', Courier, monospace;
    /* Prevent iOS from scrolling when keyboard opens */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    /* Use dvh for dynamic viewport height on mobile */
    height: 100dvh;
    width: 100dvw;
    /* Account for safe areas on iOS */
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
}

/* Prevent text selection during gameplay */
#game-container {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

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

.loading-content {
    text-align: center;
    color: #e0e0e0;
}

.loading-content h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #c4a35a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-bar {
    width: 300px;
    height: 20px;
    background-color: #0a0a1a;
    border: 2px solid #c4a35a;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

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

#loading-text {
    font-size: 0.9rem;
    color: #888;
}

/* Message box */
#message-box {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.message-content {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #c4a35a;
    border-radius: 8px;
    padding: 15px 25px;
    max-width: 600px;
    min-width: 200px;
}

#message-text {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}
