/* ============================================================
   Onkofest Frames — scoped to #onkofest-frames-root
   Designed to sit on the dark purple jaga page (#4A0F90).
   ============================================================ */

#onkofest-frames-root {
    --ofr-purple: #4a0f90;
    --ofr-purple-light: #6f2ac0;
    --ofr-orange: #F7B37F;
    --ofr-text: #ffffff;
    --ofr-muted: rgba(255, 255, 255, 0.7);
    --ofr-faded: rgba(255, 255, 255, 0.45);
    --ofr-card-bg: rgba(255, 255, 255, 0.08);
    --ofr-card-border: rgba(255, 255, 255, 0.18);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ofr-text);
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

#onkofest-frames-root[data-loading="true"] {
    text-align: center;
    color: var(--ofr-muted);
    padding: 48px 16px;
}

#onkofest-frames-root *,
#onkofest-frames-root *::before,
#onkofest-frames-root *::after {
    box-sizing: border-box;
}

/* ---- Frame picker (compact, no titles) ---- */
.ofr-frames {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 auto 28px;
    max-width: 360px;
}

.ofr-frame-option {
    cursor: pointer;
    border: 2px solid var(--ofr-card-border);
    border-radius: 10px;
    padding: 4px;
    background: var(--ofr-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    appearance: none;
    color: inherit;
}

.ofr-frame-option:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.ofr-frame-option[aria-pressed="true"] {
    border-color: var(--ofr-orange);
    background: rgba(247, 179, 127, 0.22);
    box-shadow: 0 0 0 2px var(--ofr-orange), 0 4px 14px rgba(247, 179, 127, 0.35);
    transform: translateY(-1px);
}

.ofr-frame-option img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

/* ---- Canvas / preview area ---- */
.ofr-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin: 0 auto 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ofr-card-border);
    border-radius: 12px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.ofr-canvas-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.ofr-canvas-wrap.is-dragging canvas {
    cursor: grabbing;
}

.ofr-canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--ofr-muted);
    text-align: center;
    padding: 24px;
    font-size: 14px;
    pointer-events: none;
}

.ofr-canvas-empty svg {
    opacity: 0.5;
}

.ofr-canvas-empty-btn {
    appearance: none;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.ofr-canvas-empty-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ---- Buttons ---- */
.ofr-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ofr-button {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-height: 46px;
    transition: filter 0.15s, transform 0.05s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 140px;
}

.ofr-button:active {
    transform: scale(0.98);
}

.ofr-button:hover {
    filter: brightness(1.08);
}

.ofr-button svg {
    flex-shrink: 0;
}

.ofr-button-primary {
    background: var(--ofr-orange);
    color: var(--ofr-purple);
}

.ofr-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.ofr-button-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.ofr-button[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hidden file input — triggered by the visible button */
.ofr-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ---- Zoom slider ---- */
.ofr-zoom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 14px;
    color: var(--ofr-muted);
    font-size: 12px;
}

.ofr-zoom-label {
    flex: 1 1 auto;
    min-width: 0;
}

.ofr-zoom input[type="range"] {
    flex: 1 1 200px;
    height: 28px;
    accent-color: var(--ofr-orange);
}

/* ---- Privacy note (sits right under action buttons) ---- */
.ofr-privacy {
    text-align: center;
    color: var(--ofr-faded);
    font-size: 12px;
    margin: 14px auto 0;
    max-width: 320px;
    line-height: 1.4;
}

/* ---- Messages ---- */
.ofr-message {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 12px;
}

.ofr-message-error {
    background: rgba(247, 179, 127, 0.12);
    border-color: rgba(247, 179, 127, 0.4);
}

/* ---- Mobile tweaks ---- */
@media (max-width: 480px) {
    .ofr-frames {
        gap: 8px;
        max-width: 320px;
    }

    .ofr-button {
        font-size: 14px;
        padding: 12px 16px;
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }
}
