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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 1rem;
}

.container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    padding: 2.5rem 2rem;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

header .tagline {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

main {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* States */
.state {
    display: none;
    width: 100%;
}

.state.active {
    display: block;
}

/* Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

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

/* Secret display */
.secret-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-wrap: break-word;
    word-break: break-word;
}

.secret {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 1rem;
    line-height: 1.5;
    transition: filter 0.3s ease;
    user-select: none;
    width: 100%;
}

.secret.blurred {
    filter: blur(10px);
    user-select: none;
}

.secret.revealed {
    filter: blur(0);
    user-select: text;
}

/* Reveal button */
.reveal-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.reveal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.reveal-button:active,
.reveal-button.active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a6fd6, #6a4192);
}

.info-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #888;
}

/* App link */
.app-link {
    margin-top: 1rem;
}

.app-link a {
    display: inline-block;
    background: #f0f0f0;
    color: #667eea;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.app-link a:hover {
    background: #e8e8e8;
}

/* Error state */
.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#error-state h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 0.5rem;
}

#error-state p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

footer p {
    color: #aaa;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.8rem;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 520px) {
    body {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .container {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .secret {
        font-size: 0.9rem;
    }
}
