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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling on mobile */
    position: fixed; /* Prevent iOS Safari bouncing */
    overscroll-behavior: none; /* Prevent pull-to-refresh */
    touch-action: none; /* Prevent default touch behaviors */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

#gameCanvas {
    border: 3px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #87CEEB;
    display: block;
    /* Canvas will be sized by JavaScript for responsive scaling */
    max-width: 100%;
    max-height: 100%;
    touch-action: none; /* Prevent touch gestures on canvas */
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #gameCanvas {
        border: 2px solid #333;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    #gameCanvas {
        border: 1px solid #333;
    }
}

/* Nostr UI Overlay */
#nostr-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#player-header {
    pointer-events: auto;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 100;
}

#player-npub {
    color: #fff;
    font-size: 11px;
    font-family: 'Press Start 2P', monospace;
    white-space: nowrap;
}

#nip07-login {
    background: #8B5CF6;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    transition: background 0.2s;
}

#nip07-login:hover:not(:disabled) {
    background: #7C3AED;
}

#nip07-login:disabled {
    background: #6B7280;
    cursor: not-allowed;
}

#publish-btn {
    pointer-events: auto;
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: #8B5CF6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#publish-btn:hover:not(:disabled) {
    background: #7C3AED;
    transform: translateX(-50%) scale(1.05);
}

#publish-btn:disabled {
    background: #6B7280;
    cursor: not-allowed;
    transform: translateX(-50%);
}

#publish-status {
    pointer-events: none;
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-family: 'Press Start 2P', monospace;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    z-index: 100;
    white-space: nowrap;
}

#publish-status.success {
    background: rgba(34, 197, 94, 0.9);
}

#publish-status.error {
    background: rgba(239, 68, 68, 0.9);
}
