/* Base styles and resets */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    overflow: hidden;
    /* Prevent iOS bounce/rubber-banding */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    /* Support for iOS safe areas (notches, home indicator) */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}

#ComposeTarget {
    width: 100vw;
    height: 100vh;
    /* Use dvh for dynamic viewport height on iOS */
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    /* Allow scrolling within Compose content */
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}

/* Ensure canvas text rendering uses emoji fonts */
canvas {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}

/* Loading indicator */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 18px;
    z-index: 1000;
}

/* Installation Banner (iOS and Android) */
#ios-install-banner,
#android-install-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

#ios-install-banner.show,
#android-install-banner.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.install-content h2 {
    color: #fff;
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
}

.install-content p {
    color: #ccc;
    line-height: 1.6;
    margin: 0 0 16px 0;
    font-size: 16px;
}

.install-steps {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.install-step {
    color: #fff;
    margin: 12px 0;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.install-step::before {
    content: attr(data-step);
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #007AFF;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.install-icon {
    font-size: 32px;
    margin: 0 4px;
    vertical-align: middle;
}

.install-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.install-button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.install-button.primary {
    background: #007AFF;
    color: white;
}

.install-button.primary:active {
    background: #0051D5;
}

.install-button.secondary {
    background: #2a2a2a;
    color: #ccc;
}

.install-button.secondary:active {
    background: #1a1a1a;
}
