* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0f0518;
    color: #e0aaff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
}

.hidden {
    display: none !important;
}

/* ============== Splash ============== */

.splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: radial-gradient(ellipse at center, #1a0b2e 0%, #0f0518 100%);
    z-index: 100;
}

.onion-wrap {
    position: relative;
    display: inline-block;
}

.onion {
    animation: pulse 2s ease-in-out infinite, spin 8s linear infinite;
    filter: drop-shadow(0 0 20px rgba(157, 78, 221, 0.4));
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

.splash h1 {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #e0aaff;
    text-shadow: 0 0 20px rgba(157, 78, 221, 0.6);
}

.splash p {
    font-size: 14px;
    color: #c77dff;
    opacity: 0.75;
    text-align: center;
}

.loader {
    width: 180px;
    height: 3px;
    background: rgba(157, 78, 221, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.loader .bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #5a189a, #c77dff);
    border-radius: 3px;
    animation: slide 1.2s ease-in-out infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ============== Error state ============== */

.error {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px;
    background: radial-gradient(ellipse at center, #2e0b1a 0%, #0f0518 100%);
    z-index: 100;
}

.error-icon {
    font-size: 64px;
}

.error h2 {
    font-size: 24px;
    color: #ff7eb6;
    font-weight: 400;
}

.error p {
    font-size: 14px;
    text-align: center;
    color: #ff9ec7;
    opacity: 0.85;
    max-width: 320px;
    line-height: 1.5;
}

.error button {
    margin-top: 16px;
    padding: 12px 32px;
    background: rgba(255, 126, 182, 0.15);
    border: 1px solid rgba(255, 126, 182, 0.4);
    color: #ff9ec7;
    font-size: 15px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.error button:active {
    background: rgba(255, 126, 182, 0.3);
}

/* ============== Browser iframe ============== */

.browser {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    z-index: 1;
}
