/* Shared auth modal — used by shared/auth-modal.js across all games. */

/* Generic sign-in button games can drop into a header. */
.auth-signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.auth-signin-btn:hover { background: #2980b9; }
.auth-signin-btn:active { transform: scale(0.97); }
.auth-signin-btn.compact { padding: 6px 10px; font-size: 0.8rem; }

.auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.auth-overlay.open {
    display: flex;
    animation: auth-fade 0.2s ease both;
}

@keyframes auth-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-box {
    background: #fff;
    color: #2c3e50;
    border-radius: 14px;
    padding: 28px 26px 22px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
    animation: auth-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes auth-pop {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #95a5a6;
    cursor: pointer;
    border-radius: 8px;
}

.auth-close:hover { color: #2c3e50; background: #f0f0f0; }

.auth-title {
    margin: 0 0 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-form { display: flex; flex-direction: column; }

.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #d8dde2;
    border-radius: 8px;
    font-size: 16px; /* >=16px prevents iOS zoom on focus */
    box-sizing: border-box;
    -webkit-appearance: none;
}

.auth-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

.auth-help {
    margin: 0 0 12px;
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.auth-help:empty { display: none; }

.auth-submit,
.auth-cancel {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: filter 0.2s ease, transform 0.1s ease;
}

.auth-submit { background: linear-gradient(180deg, #2790f0, #1565c0); color: #fff; }
.auth-submit:hover:not(:disabled) { filter: brightness(1.08); }
.auth-submit:active:not(:disabled) { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-cancel { background: #ecf0f1; color: #5a6b78; }
.auth-cancel:hover { background: #dfe6e9; }

.auth-message {
    margin: 4px 0 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.auth-message-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.auth-message-success { background: #eafaf1; color: #1e8449; border: 1px solid #c3e6cb; }
.auth-message-info { background: #eaf3fc; color: #2471a3; border: 1px solid #bcdcf5; }

.auth-toggle,
.auth-forgot {
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
    margin: 8px 0 0;
}

.auth-toggle a,
.auth-forgot a {
    color: #3498db;
    cursor: pointer;
    text-decoration: none;
}

.auth-toggle a:hover,
.auth-forgot a:hover { text-decoration: underline; }
