:root {
    --rr033-ink: #15203a;
    --rr033-muted: #667085;
    --rr033-line: #dfe5ee;
    --rr033-soft: #f3f6fa;
    --rr033-paper: #fff;
    --rr033-accent: #ed5a3d;
    --rr033-accent-dark: #ca3f27;
    --rr033-blue: #1d4f91;
    --rr033-radius: 18px;
}

.rr033-dashboard,
.rr033-single-generator {
    color: var(--rr033-ink);
    font-family: inherit;
}

.rr033-dashboard {
    width: min(100%, 1040px);
    margin: 0 auto;
}

.rr033-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.rr033-profile-avatar,
.rr033-avatar {
    width: 74px;
    height: 74px;
    border-radius: 18px;
}

.rr033-profile-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--rr033-soft);
    border: 1px solid var(--rr033-line);
}

.rr033-profile h2,
.rr033-section-heading h3,
.rr033-single-generator h2,
.rr033-empty h3 {
    color: var(--rr033-ink);
    margin: 3px 0 4px;
    padding: 0;
    line-height: 1.12;
}

.rr033-profile h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.rr033-profile p,
.rr033-section-heading p,
.rr033-empty p {
    color: var(--rr033-muted);
    margin: 0;
}

.rr033-eyebrow {
    display: block;
    font-size: .75rem;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--rr033-blue);
}

.rr033-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 34px;
}

.rr033-stat {
    min-height: 94px;
    padding: 17px 12px;
    border-radius: 14px;
    border: 1px solid var(--rr033-line);
    background: linear-gradient(145deg, #fff, var(--rr033-soft));
    text-align: center;
    box-shadow: 0 8px 22px rgba(21, 32, 58, .045);
}

.rr033-stat strong {
    display: block;
    color: var(--rr033-ink);
    font-size: 1.85rem;
    line-height: 1;
    font-weight: 900;
}

.rr033-stat span {
    display: block;
    margin-top: 8px;
    color: #4b5568;
    font-size: .82rem;
    font-weight: 750;
}

.rr033-primary-section,
.rr033-library,
.rr033-single-generator,
.rr033-login-required,
.rr033-empty {
    border: 1px solid var(--rr033-line);
    border-radius: var(--rr033-radius);
    background: var(--rr033-paper);
    box-shadow: 0 14px 45px rgba(21, 32, 58, .07);
}

.rr033-primary-section,
.rr033-library,
.rr033-single-generator {
    padding: clamp(18px, 3vw, 30px);
}

.rr033-library {
    margin-top: 24px;
}

.rr033-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.rr033-section-heading h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.rr033-open-reto {
    white-space: nowrap;
    color: var(--rr033-blue);
    font-weight: 750;
}

.rr033-card-stage {
    position: relative;
    width: min(100%, 920px);
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    background: #101827;
    box-shadow: 0 18px 60px rgba(15, 23, 42, .2);
}

.rr033-card-stage canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1280 / 720;
    object-fit: contain;
}

.rr033-card-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #fff;
    background: rgba(12, 20, 36, .76);
    font-weight: 750;
    transition: opacity .2s ease, visibility .2s ease;
}

.rr033-card-loading[hidden] {
    opacity: 0;
    visibility: hidden;
}

.rr033-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.rr033-actions-vertical {
    align-items: stretch;
    flex-direction: column;
}

.rr033-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 17px;
    border: 1px solid #cdd5e2;
    border-radius: 11px;
    background: #fff;
    color: var(--rr033-ink);
    font: inherit;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.rr033-button:hover,
.rr033-button:focus-visible {
    color: var(--rr033-ink);
    border-color: #aeb9ca;
    box-shadow: 0 8px 18px rgba(21, 32, 58, .10);
    transform: translateY(-1px);
}

.rr033-button-primary {
    border-color: var(--rr033-accent);
    background: var(--rr033-accent);
    color: #fff;
}

.rr033-button-primary:hover,
.rr033-button-primary:focus-visible {
    border-color: var(--rr033-accent-dark);
    background: var(--rr033-accent-dark);
    color: #fff;
}

.rr033-network {
    min-width: 52px;
}

.rr033-feedback {
    min-height: 1.5em;
    margin: 12px 0 0;
    text-align: center;
    color: var(--rr033-muted);
    font-size: .9rem;
}

.rr033-share-link {
    width: min(100%, 760px);
    margin: 16px auto 0;
    padding: 15px;
    border: 1px solid var(--rr033-line);
    border-radius: 13px;
    background: var(--rr033-soft);
}

.rr033-share-link[hidden] {
    display: none;
}

.rr033-share-link label {
    display: block;
    margin-bottom: 8px;
    color: var(--rr033-ink);
    font-size: .9rem;
    font-weight: 800;
}

.rr033-share-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.rr033-share-link input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cdd5e2;
    border-radius: 10px;
    background: #fff;
    color: var(--rr033-ink);
    font: inherit;
}

.rr033-share-link p {
    margin: 9px 0 0;
    color: var(--rr033-muted);
    font-size: .85rem;
}

.rr033-share-link-compact {
    margin-top: 14px;
    padding: 12px;
}

.rr033-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.rr033-mini-card {
    overflow: hidden;
    border: 1px solid var(--rr033-line);
    border-radius: 15px;
    background: #fff;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.rr033-mini-card.is-primary {
    border-color: var(--rr033-accent);
    box-shadow: 0 12px 30px rgba(237, 90, 61, .14);
}

.rr033-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(21, 32, 58, .10);
}

.rr033-mini-image {
    position: relative;
    aspect-ratio: 1.65 / 1;
    overflow: hidden;
    background: #101827;
}

.rr033-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rr033-mini-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(10, 17, 30, .82);
    color: #fff;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.rr033-mini-body {
    padding: 14px;
}

.rr033-mini-body h4 {
    min-height: 2.5em;
    margin: 0 0 12px;
    padding: 0;
    color: var(--rr033-ink);
    font-size: 1rem;
    line-height: 1.25;
}

.rr033-mini-body .rr033-button {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    font-size: .82rem;
}

.rr033-single-generator {
    margin-top: 36px;
}

.rr033-single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 26px;
    align-items: center;
}

.rr033-single-generator .rr033-card-stage {
    width: 100%;
}

.rr033-single-controls label {
    display: block;
    margin-bottom: 7px;
    color: var(--rr033-ink);
    font-weight: 800;
}

.rr033-single-controls select {
    width: 100%;
    min-height: 48px;
    padding: 10px 40px 10px 12px;
    border: 1px solid #cdd5e2;
    border-radius: 10px;
    background: #fff;
    color: var(--rr033-ink);
    font: inherit;
}

.rr033-login-required,
.rr033-empty {
    padding: 34px;
    text-align: center;
}

.rr033-login-required p {
    margin: 0 0 18px;
}

/* Ajuste defensivo para la tarjeta 0.3.2: nunca recortar la vista previa. */
.rr-card-preview img,
.rr-card-preview canvas,
.rrc-card-preview img,
.rrc-card-preview canvas,
[class*="retoretro-card-preview"] img,
[class*="retoretro-card-preview"] canvas {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

@media (max-width: 780px) {
    .rr033-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rr033-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rr033-single-layout { grid-template-columns: 1fr; }
    .rr033-section-heading { display: block; }
    .rr033-open-reto { display: inline-block; margin-top: 10px; }
}

@media (max-width: 480px) {
    .rr033-profile { align-items: flex-start; }
    .rr033-profile-avatar,
    .rr033-avatar { width: 58px; height: 58px; border-radius: 14px; }
    .rr033-stat { min-height: 82px; }
    .rr033-card-grid { grid-template-columns: 1fr; }
    .rr033-actions { align-items: stretch; flex-direction: column; }
    .rr033-actions .rr033-button { width: 100%; }
    .rr033-share-link-row { grid-template-columns: 1fr; }
    .rr033-share-link-row .rr033-button { width: 100%; }
}

