/* =========================================================
   Discovery Panel — Meme-Generator (Mobile First)
   ========================================================= */

/* ── Wrapper ──────────────────────────────────────────────── */

.dp-gen-wrap {
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

.dp-gen-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
}

/* ── Sections ─────────────────────────────────────────────── */

.dp-gen-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f9f9fb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.dp-gen-section-heading {
    font-size: .95rem;
    font-weight: 700;
    margin: 0 0 .9rem;
    color: #1a1a1a;
}

/* ── cygnus-x1.net Credit ────────────────────────────────── */

.dp-gen-screencap-credit {
    font-size: .78rem;
    color: #888;
    margin: -.3rem 0 .75rem;
    line-height: 1.4;
}

.dp-gen-screencap-credit a {
    color: #666;
    text-decoration: underline;
}

.dp-gen-screencap-credit a:hover {
    color: #e83d9f;
}

/* ── Serien-Filter ────────────────────────────────────────── */

.dp-gen-series-filter {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: .75rem;
    scrollbar-width: none;
}

.dp-gen-series-filter::-webkit-scrollbar {
    display: none;
}

.dp-gen-series-btn {
    flex-shrink: 0;
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #555;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}

.dp-gen-series-btn--active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

/* ── Screenshots-Grid ─────────────────────────────────────── */

.dp-gen-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 7px;
    max-height: 265px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
}

.dp-gen-ss-thumb {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2.5px solid transparent;
    display: block;
    width: 100%;
    background: #222;
    transition: border-color .12s, transform .1s;
}

.dp-gen-ss-thumb:hover {
    transform: scale(1.04);
}

.dp-gen-ss-thumb--selected {
    border-color: #e83d9f;
    box-shadow: 0 0 0 3px rgba(232, 61, 159, .2);
}

.dp-gen-ss-empty {
    grid-column: 1 / -1;
    color: #999;
    font-size: .85rem;
    padding: 24px 0;
    text-align: center;
    margin: 0;
}

/* ── Modus-Tabs ───────────────────────────────────────────── */

.dp-gen-mode-tabs {
    display: flex;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.dp-gen-mode-btn {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: #fff;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    color: #555;
    transition: background .15s, color .15s;
}

.dp-gen-mode-btn + .dp-gen-mode-btn {
    border-left: 1.5px solid #d1d5db;
}

.dp-gen-mode-btn--active {
    background: #111827;
    color: #fff;
}

/* ── Text-Eingaben ────────────────────────────────────────── */

.dp-gen-label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: #555;
    margin: .9rem 0 .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dp-gen-text-input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: .95rem;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    transition: border-color .15s;
    font-family: inherit;
}

.dp-gen-text-input:focus {
    outline: none;
    border-color: #e83d9f;
    box-shadow: 0 0 0 3px rgba(232, 61, 159, .12);
}

/* ── Frei-Modus Controls ──────────────────────────────────── */

.dp-gen-btn-secondary {
    padding: 8px 18px;
    border: 1.5px solid #555;
    border-radius: 7px;
    background: #fff;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    color: #333;
    transition: background .15s;
}

.dp-gen-btn-secondary:hover {
    background: #f3f4f6;
}

.dp-gen-hint {
    font-size: .78rem;
    color: #999;
    margin: .5rem 0 0;
    line-height: 1.5;
}

.dp-gen-free-box-ctrl {
    display: flex;
    gap: 7px;
    align-items: center;
    margin-top: 8px;
}

.dp-gen-free-box-ctrl input {
    flex: 1;
    padding: 8px 11px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: .88rem;
    font-family: inherit;
    background: #fff;
    color: #111;
    box-sizing: border-box;
}

.dp-gen-free-box-ctrl input:focus {
    outline: none;
    border-color: #e83d9f;
}

.dp-gen-free-box-del {
    flex-shrink: 0;
    padding: 7px 11px;
    border: 1.5px solid #dc2626;
    background: transparent;
    color: #dc2626;
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    transition: background .12s, color .12s;
}

.dp-gen-free-box-del:hover {
    background: #dc2626;
    color: #fff;
}

/* ── Canvas Wrapper ───────────────────────────────────────── */

.dp-gen-section--canvas {
    padding: 1.25rem 0 0;
    background: #0f0f0f;
    border-color: #1a1a1a;
}

.dp-gen-section--canvas .dp-gen-section-heading {
    color: #e5e5e5;
    padding: 0 1.25rem .9rem;
    margin: 0;
}

.dp-gen-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    overflow: hidden;
    touch-action: none;
    /* bottom border radius to match parent section */
    border-radius: 0 0 12px 12px;
}

.dp-gen-canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Draggable Overlay-Textboxen ──────────────────────────── */

.dp-gen-overlay-box {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px 4px 12px;
    background: rgba(0, 0, 0, .45);
    border: 1.5px dashed rgba(255, 255, 255, .55);
    border-radius: 5px;
    cursor: grab;
    user-select: none;
    touch-action: none;
    min-width: 80px;
    z-index: 10;
}

.dp-gen-overlay-box:active {
    cursor: grabbing;
}

.dp-gen-overlay-box input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px #000;
    text-transform: uppercase;
    min-width: 60px;
    width: 100%;
    outline: none;
    cursor: text;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

.dp-gen-overlay-box input::placeholder {
    color: rgba(255, 255, 255, .5);
    text-transform: none;
    font-family: sans-serif;
    font-weight: 400;
    font-size: .75rem;
}

.dp-gen-overlay-del-btn {
    flex-shrink: 0;
    background: rgba(220, 38, 38, .75);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: .7rem;
    padding: 2px 5px;
    cursor: pointer;
    line-height: 1.3;
    font-weight: 700;
}

.dp-gen-overlay-del-btn:hover {
    background: #dc2626;
}

/* ── Optionen ─────────────────────────────────────────────── */

.dp-gen-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .9rem;
    cursor: pointer;
    color: #222;
    margin-bottom: .5rem;
}

.dp-gen-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Submit ───────────────────────────────────────────────── */

.dp-gen-section--submit {
    text-align: center;
}

.dp-gen-btn-primary {
    display: inline-block;
    padding: 13px 36px;
    background: #e83d9f;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    min-width: 210px;
    transition: background .15s, opacity .15s;
    font-family: inherit;
}

.dp-gen-btn-primary:hover:not(:disabled) {
    background: #cf2e8e;
}

.dp-gen-btn-primary:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.dp-gen-submit-hint {
    font-size: .78rem;
    color: #999;
    margin: .75rem 0 0;
    line-height: 1.55;
}

/* ── Nachrichten ──────────────────────────────────────────── */

.dp-gen-message {
    margin-top: 1rem;
    padding: 12px 16px;
    border-radius: 7px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.5;
}

.dp-gen-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.dp-gen-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Login-Hinweis ────────────────────────────────────────── */

.dp-gen-login-notice {
    padding: 24px;
    background: #f3f4f6;
    border-radius: 10px;
    text-align: center;
    font-size: .9rem;
    color: #555;
}

.dp-gen-login-notice a {
    color: #e83d9f;
    font-weight: 600;
}

/* ── Responsive: ab 520px mehr Spalten ───────────────────── */

@media (min-width: 520px) {
    .dp-gen-screenshots {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    }
}

/* ── Dark Mode (html.dp-dark) ─────────────────────────────── */

html.dp-dark .dp-gen-section {
    background: #2d1a48 !important;
    border-color: #42286a !important;
}

html.dp-dark .dp-gen-title,
html.dp-dark .dp-gen-section-heading {
    color: #f5f0fa !important;
}

html.dp-dark .dp-gen-screencap-credit {
    color: #9080b0 !important;
}

html.dp-dark .dp-gen-screencap-credit a {
    color: #b8a8d0 !important;
}

html.dp-dark .dp-gen-series-btn {
    background: #1e0f38 !important;
    border-color: #42286a !important;
    color: #c8b8e0 !important;
}

html.dp-dark .dp-gen-series-btn--active {
    background: #f5f0fa !important;
    color: #0f0818 !important;
    border-color: #f5f0fa !important;
}

html.dp-dark .dp-gen-mode-tabs {
    border-color: #42286a !important;
}

html.dp-dark .dp-gen-mode-btn {
    background: #1e0f38 !important;
    color: #c8b8e0 !important;
    border-color: #42286a !important;
}

html.dp-dark .dp-gen-mode-btn + .dp-gen-mode-btn {
    border-color: #42286a !important;
}

html.dp-dark .dp-gen-mode-btn--active {
    background: #f5f0fa !important;
    color: #0f0818 !important;
}

html.dp-dark .dp-gen-label {
    color: #a898c8 !important;
}

html.dp-dark .dp-gen-text-input {
    background: #1e0f38 !important;
    border-color: #42286a !important;
    color: #f5f0fa !important;
}

html.dp-dark .dp-gen-text-input:focus {
    border-color: #e83d9f !important;
}

html.dp-dark .dp-gen-btn-secondary {
    background: #1e0f38 !important;
    border-color: #7060a0 !important;
    color: #e5dff0 !important;
}

html.dp-dark .dp-gen-btn-secondary:hover {
    background: #2d1a48 !important;
}

html.dp-dark .dp-gen-free-box-ctrl input {
    background: #1e0f38 !important;
    border-color: #42286a !important;
    color: #f5f0fa !important;
}

html.dp-dark .dp-gen-hint {
    color: #7060a0 !important;
}

html.dp-dark .dp-gen-section--canvas {
    background: #050210 !important;
    border-color: #0f0818 !important;
}

html.dp-dark .dp-gen-section--canvas .dp-gen-section-heading {
    color: #e5dff0 !important;
}

html.dp-dark .dp-gen-checkbox-label {
    color: #e5dff0 !important;
}

html.dp-dark .dp-gen-submit-hint {
    color: #7060a0 !important;
}

html.dp-dark .dp-gen-message--success {
    background: #0d2112 !important;
    color: #6ee7b7 !important;
    border-color: #166534 !important;
}

html.dp-dark .dp-gen-message--error {
    background: #2d1015 !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

html.dp-dark .dp-gen-login-notice {
    background: #2d1a48 !important;
    color: #c8b8e0 !important;
}
