.ram-app,
.ram-app * {
    box-sizing: border-box;
}

.ram-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.ram-screen__backdrop {
    position: absolute;
    inset: 0;
    background: #050816;
}

.ram-screen__dialog {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
}

html.ram-lock,
body.ram-lock {
    overflow: hidden !important;
    height: 100% !important;
}

/* Inline */

.ram-inline {
    width: 100%;
    max-width: 520px;
    margin: 24px auto;
}

/* Quiz */

.ram-quiz {
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ram-quiz__top {
    position: relative;
    padding: 18px 20px 0;
}

.ram-quiz__progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.ram-quiz__progress-bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ram-accent, #0021ff);
    border-radius: inherit;
    transition: width 0.25s ease;
}

.ram-quiz__close,
.ram-reward__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.12);
    color: #111827;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
}

.ram-quiz__body {
    padding: 28px 24px 24px;
    text-align: center;
}

.ram-quiz__step-label {
    margin-bottom: 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.ram-quiz__question,
.ram-quiz__form-title {
    margin: 0 0 18px;
    color: #0f172a;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 800;
}

.ram-quiz__form-subtitle {
    margin: -8px 0 18px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
}

.ram-quiz__options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ram-quiz__option {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    border-radius: 14px;
    padding: 15px 16px;
    text-align: left;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.05s ease, background 0.15s ease;
}

.ram-quiz__option:hover {
    border-color: var(--ram-accent, #0021ff);
    background: #f8fafc;
}

.ram-quiz__option:active {
    transform: scale(0.99);
}

.ram-quiz__fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ram-quiz__field {
    text-align: left;
}

.ram-quiz__field label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.ram-quiz__field input,
.ram-quiz__field select,
.ram-quiz__field textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 13px 14px;
    color: #0f172a;
    background: #ffffff;
    font-size: 15px;
    outline: none;
}

.ram-quiz__field textarea {
    min-height: 92px;
    resize: vertical;
}

.ram-quiz__field input:focus,
.ram-quiz__field select:focus,
.ram-quiz__field textarea:focus {
    border-color: var(--ram-accent, #0021ff);
    box-shadow: 0 0 0 3px rgba(0, 33, 255, 0.08);
}

.ram-quiz__submit {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 15px 18px;
    background: var(--ram-accent, #0021ff);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.ram-quiz__submit small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
}

.ram-quiz__error,
.ram-reward__error {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
}

/* Loading */

.ram-quiz__loading,
.ram-reward__loading {
    margin-top: 18px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.ram-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--ram-accent, #0021ff);
    border-radius: 50%;
    animation: ram-spin 0.8s linear infinite;
}

@keyframes ram-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Reward */

.ram-reward {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ram-reward__header {
    min-height: var(--ram-header-height, 120px);
    background: var(--ram-header, #5b1230);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.ram-reward__header img {
    max-width: 82%;
    max-height: var(--ram-image-height, 90px);
    display: block;
}

.ram-reward__body {
    padding: 24px;
    text-align: center;
}

.ram-reward__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ram-accent, #5b1230);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ram-reward__title {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 900;
    text-transform: uppercase;
}

.ram-reward__description {
    margin: 0 0 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.ram-reward__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ram-reward__button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 15px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, transform 0.05s ease, background 0.15s ease;
}

.ram-reward__button:hover {
    border-color: var(--ram-accent, #5b1230);
    background: #f8fafc;
}

.ram-reward__button:active {
    transform: scale(0.99);
}

.ram-reward__button-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.ram-reward__button-text {
    flex: 1;
    color: #1e293b;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
}

.ram-reward__button-arrow {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ram-accent, #5b1230);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
}

.ram-reward__footer {
    margin: 14px 0 0;
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}

/* Helpers */

[hidden] {
    display: none !important;
}

@media (max-width: 480px) {
    .ram-screen {
        padding: 14px;
        align-items: center;
    }

    .ram-screen__dialog {
        max-width: 100%;
    }

    .ram-quiz__body,
    .ram-reward__body {
        padding: 24px 18px 20px;
    }

    .ram-quiz__question,
    .ram-quiz__form-title,
    .ram-reward__title {
        font-size: 20px;
    }
}

.ram-reward--inside-quiz .ram-reward__button {
    background: #16A34A;
    border-color: #16A34A;
}

.ram-reward--inside-quiz .ram-reward__button-text,
.ram-reward--inside-quiz .ram-reward__button-icon {
    color: #ffffff;
}

.ram-reward--inside-quiz .ram-reward__button-arrow {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.ram-reward--inside-quiz .ram-reward__button:hover {
    background: #15803D;
    border-color: #15803D;
}