*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #020617;
    --bg-deep: #020314;
    --heart-pink-1: #fb7185;
    --heart-pink-2: #ec4899;
    --accent-cyan: #22d3ee;
    --accent-violet: #a855f7;
    --glass-border: rgba(248, 250, 252, 0.18);
    --glass-border-strong: rgba(248, 113, 161, 0.5);
    --glass-bg-soft: rgba(15, 23, 42, 0.7);
    --glass-bg-strong: rgba(15, 23, 42, 0.92);
    --glass-bg-card: rgba(10, 16, 34, 0.9);
    --text-main: #fdf2f8;
    --text-soft: #e5e7eb;
    --text-dim: #9ca3af;
    --radius-xl: 1.4rem;
    --radius-lg: 1.1rem;
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.95);
    --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.8);
    --transition-fast: 0.15s ease;
}

/* ============================
   BASE LAYOUT / BACKGROUND
   ============================ */

html,
body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
}

body {
    position: relative;
    overflow-x: hidden;
}

/* Animated gradient behind everything */
.background-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.64) 0, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(56, 189, 248, 0.4) 0, transparent 55%),
        radial-gradient(circle at 0% 100%, rgba(168, 85, 247, 0.35) 0, transparent 55%),
        var(--bg-deep);
    z-index: -2;
    pointer-events: none;
    animation: bg-pulse 24s ease-in-out infinite alternate;
}

@keyframes bg-pulse {
    0% {
        filter: saturate(110%) hue-rotate(0deg);
    }
    50% {
        filter: saturate(130%) hue-rotate(10deg);
    }
    100% {
        filter: saturate(115%) hue-rotate(-6deg);
    }
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

.writer-page {
    justify-content: center;
}

/* ============================
   HEART
   ============================ */

.heart-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

.heart {
    width: 180px;
    height: 180px;
    position: relative;
    cursor: pointer;
    transform-origin: center;
    filter:
        drop-shadow(0 20px 40px rgba(248, 113, 161, 0.9))
        drop-shadow(0 0 40px rgba(236, 72, 153, 0.75));
    animation: heart-beat 1.6s infinite;
    transition:
        transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
        filter 0.6s ease;
}

.heart::before,
.heart::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 140px;
    border-radius: 90px 90px 0 0;
    background:
        radial-gradient(circle at 30% 20%, #ffe4f5 0, transparent 55%),
        linear-gradient(135deg, var(--heart-pink-1), var(--heart-pink-2));
    box-shadow: 0 18px 40px rgba(131, 24, 67, 0.9);
}

.heart::before {
    left: 90px;
    top: 0;
}

.heart::after {
    left: 0;
    top: 0;
    transform-origin: 90px 90px;
    transform: rotate(-90deg);
}

.heart:hover {
    animation-play-state: paused;
    transform: scale(1.07) translateY(-3px);
    filter:
        drop-shadow(0 28px 60px rgba(248, 113, 161, 1))
        drop-shadow(0 0 60px rgba(236, 72, 153, 0.9));
}

.heart.open {
    animation: heart-open 1.6s forwards ease-out;
}

.click-hint {
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #fee2e2;
    opacity: 0.9;
}

/* Heart animations */

@keyframes heart-beat {
    0%,
    100% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.08);
    }
    60% {
        transform: scale(0.96);
    }
}

@keyframes heart-open {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.22) translateY(-40px);
    }
}

/* ============================
   LETTER PANEL (Front-Seite)
   ============================ */

#letter-panel {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none; /* Panel selbst blendet Herz nicht komplett aus */
}

#letter-panel.open {
    display: flex;
}

/* Glassy floating card in front of heart */
.letter-card {
    position: relative;
    max-width: 720px;
    width: min(720px, 96vw);
    max-height: 82vh;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    transition: opacity 0.55s ease, transform 0.55s ease;
    overflow-y: auto;
    background:
        radial-gradient(circle at top, rgba(248, 113, 161, 0.18), transparent 60%),
        rgba(10, 16, 34, 0.76);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(248, 250, 252, 0.22);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    padding: 1.3rem 1.5rem 1.1rem;
    pointer-events: auto;
}

/* Scrollbar styling */
.letter-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(248, 113, 161, 0.6) transparent;
}

.letter-card::-webkit-scrollbar {
    width: 6px;
}

.letter-card::-webkit-scrollbar-track {
    background: transparent;
}

.letter-card::-webkit-scrollbar-thumb {
    background: rgba(248, 113, 161, 0.7);
    border-radius: 999px;
}

.letter-card::-webkit-scrollbar-thumb:hover {
    background: rgba(248, 113, 161, 0.95);
}

#letter-panel.open .letter-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.letter-title {
    font-size: 1.7rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 0.03em;
}

/* Close button inside letter */

.letter-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.9rem;
    font-size: 1.1rem;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.letter-close-btn:hover {
    opacity: 1;
    transform: translateY(-1px) scale(1.05);
}

/* Letter body transparent so heart glow can shine through */

.letter-body {
    background: transparent;
    border-radius: 1rem;
    padding: 0.9rem 0.2rem 0.2rem;
    font-size: 1rem;
    line-height: 1.7;
    border: none;
    box-shadow: none;
    color: var(--text-soft);
}

.letter-body p + p {
    margin-top: 0.6rem;
}

.letter-body ul {
    padding-left: 1.5rem;
}

.letter-image-wrapper {
    margin: 0.4rem 0 0.9rem;
    display: flex;
    justify-content: center;
}

.letter-image {
    max-width: 100%;
    max-height: 260px;
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(148, 27, 79, 0.85);
}

/* Signature inside letter */

.signature-wrapper {
    margin-top: 0.8rem;
    display: flex;
}

.signature-wrapper.pos-bottom {
    justify-content: center;
}

.signature-wrapper.pos-bottom-right {
    justify-content: flex-end;
}

.signature-wrapper.pos-top-right {
    justify-content: flex-end;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

.signature-wrapper.pos-inline {
    justify-content: flex-start;
}

.signature-image {
    max-width: 220px;
    max-height: 120px;
    border-radius: 0.75rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.letter-footer {
    margin-top: 0.9rem;
    display: flex;
    justify-content: center;
}

.letter-donate {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

/* ============================
   GENERIC GLASS CARD + BUTTONS
   ============================ */

.glass-card {
    background:
        radial-gradient(circle at top left, rgba(248, 113, 161, 0.12), transparent 55%),
        var(--glass-bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.7rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
}

/* Pill buttons / icon buttons */

.glass-icon-btn,
.glass-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.48rem 1.2rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.92),
        rgba(15, 23, 42, 0.7)
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #f9a8d4;
    text-decoration: none;
    font-size: 0.92rem;
    gap: 0.35rem;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        opacity var(--transition-fast);
}

.glass-icon-btn:hover,
.glass-pill-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 1);
    background: linear-gradient(
        135deg,
        rgba(24, 35, 65, 0.96),
        rgba(15, 23, 42, 0.98)
    );
    border-color: rgba(249, 168, 212, 0.9);
    opacity: 1;
}

.glass-icon-btn {
    padding-inline: 0.85rem;
}

/* Generic icon-only button */

.icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0.2rem;
    color: inherit;
}

/* Floating buttons (Admin gear) */

.floating-btn {
    position: fixed;
    bottom: 1.4rem;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.18);
    background:
        radial-gradient(circle at 30% 0, rgba(251, 113, 133, 0.16), transparent 60%),
        rgba(15, 23, 42, 0.96);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-size: 1.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 26px 55px rgba(15, 23, 42, 1);
}

.floating-right {
    right: 1.4rem;
}

/* Admin toggle on main page */

#admin-toggle {
    width: 2.4rem;
    height: 2.4rem;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 1.7rem;
}

#admin-toggle:hover {
    transform: translateY(-2px) rotate(12deg);
}

/* Special admin gear on main page */

.admin-gear-btn {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at top, rgba(236, 72, 153, 0.22), transparent 60%),
        rgba(3, 7, 18, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 40;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.admin-gear-btn:hover {
    background:
        radial-gradient(circle at top, rgba(236, 72, 153, 0.32), transparent 60%),
        rgba(15, 23, 42, 0.96);
    transform: translateY(-2px) scale(1.04);
}

/* ============================
   SIDE MODALS / OVERLAYS
   ============================ */

/* Generic dark glass overlay */
.preview-overlay,
#image-overlay,
#link-overlay,
#link-panel, /* fallback, falls noch verwendet */
#admin-panel-overlay,
#discard-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(251, 113, 133, 0.18) 0, transparent 55%),
        rgba(2, 6, 23, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.3rem;
    z-index: 30;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.preview-overlay.open,
#image-overlay.open,
#link-overlay.open,
#link-panel.open,
#admin-panel-overlay.open,
#discard-overlay.open {
    display: flex;
}

/* Admin login side modal (mobile friendly) */
.side-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 1.2rem;
    z-index: 20;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: radial-gradient(circle at top, rgba(251, 113, 133, 0.18), transparent 55%);
}

.side-modal.open {
    display: flex;
}

.side-card {
    width: 100%;
    max-width: 380px;
}

.side-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.side-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.side-form label {
    font-size: 0.85rem;
    color: #ffe4f5;
}

.side-form input[type="text"],
.side-form input[type="password"] {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.96);
    padding: 0.6rem 0.85rem;
    color: #fdeaf4;
    outline: none;
    font-size: 0.9rem;
}

.side-form input:focus {
    border-color: var(--heart-pink-1);
    box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.65);
}

/* Generic glass panel for overlays */
.preview-card,
.link-card,
.admin-overlay-card,
.discard-card,
.image-editor {
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 113, 161, 0.15), transparent 60%),
        rgba(10, 16, 34, 0.95);
    border: 1px solid var(--glass-border-strong);
    box-shadow: var(--shadow-xl);
}

/* Link overlay card */
.link-card {
    max-width: 520px;
    width: 100%;
    margin: 0 1.4rem;
    padding: 1.4rem 1.6rem;
}

/* Preview panel */
.preview-card {
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    padding: 1.3rem 1.5rem 1.1rem;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* Admin overlay with iframe */
.admin-overlay-card {
    max-width: 1120px;
    width: 98vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.2rem 1.1rem;
}

.admin-iframe {
    width: 100%;
    border: none;
    flex: 1;
    border-radius: 1rem;
    background: transparent;
}

/* ============================
   WRITER PAGE
   ============================ */

.writer-card {
    width: 100%;
    max-width: 960px;
    background:
        radial-gradient(circle at 0% 0%, rgba(251, 113, 133, 0.18), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.16), transparent 60%),
        rgba(10, 4, 25, 0.97);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(252, 231, 243, 0.45);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    padding: 1.6rem 1.8rem 1.3rem;
}

.writer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.writer-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.writer-title span:first-child {
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #fecdd3;
}

.writer-title span:last-child {
    font-size: 1.1rem;
    color: var(--text-soft);
}

.save-badge {
    font-size: 0.84rem;
    color: #bbf7d0;
}

.writer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.writer-close-btn {
    padding-inline: 0.6rem;
}

/* Inputs */

.writer-card label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #ffe4f5;
}

.writer-card input[type="text"] {
    width: 100%;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.85);
    background: rgba(15, 23, 42, 0.96);
    padding: 0.6rem 0.85rem;
    color: #fdeaf4;
    margin-bottom: 0.8rem;
    font-size: 0.98rem;
}

.writer-card input[type="text"]:focus {
    border-color: var(--heart-pink-2);
    outline: none;
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.6);
}

/* Editor toolbar */

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.7);
    margin-bottom: 0.8rem;
}

.color-btn {
    position: relative;
}

.color-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Editor area */

.editor {
    min-height: 280px;
    max-height: 460px;
    overflow-y: auto;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background:
        radial-gradient(circle at 0 0, rgba(248, 250, 252, 0.18), transparent 60%),
        rgba(15, 23, 42, 0.97);
    padding: 0.95rem 1rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #ffe4f5;
}

.editor:focus {
    outline: none;
    border-color: var(--heart-pink-2);
    box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.6);
}

/* Image editor */

.image-sub {
    font-size: 0.8rem;
    color: #fecdd3;
    margin-bottom: 0.4rem;
}

.image-editor {
    border-radius: 1rem;
    border: 1px dashed rgba(248, 113, 161, 0.9);
    background: rgba(15, 23, 42, 0.96);
    padding: 0.55rem;
}

#imageCanvas {
    width: 100%;
    max-width: 100%;
    border-radius: 0.9rem;
    display: block;
    touch-action: none;
    background: radial-gradient(circle at 50% 0, rgba(252, 231, 243, 0.16), transparent 65%);
}

.image-controls {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
}

.image-controls input[type="range"] {
    margin-left: 0.3rem;
}

/* Signature section */

.signature-section {
    margin-top: 1.1rem;
}

.signature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
}

#signatureCanvas {
    width: 100%;
    max-width: 100%;
    border-radius: 1rem;
    border: 1px dashed rgba(248, 113, 161, 0.95);
    background:
        radial-gradient(circle at top, rgba(248, 113, 161, 0.3), transparent 70%),
        rgba(10, 4, 25, 0.98);
    display: block;
    touch-action: none;
}

.signature-tools {
    margin-top: 0.5rem;
}

.signature-color-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.sig-color {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    cursor: pointer;
}

.signature-size-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.sig-size {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.98);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sig-size[data-size="1.5"] {
    width: 14px;
    height: 14px;
}

.sig-size[data-size="3"] {
    width: 18px;
    height: 18px;
}

.sig-size[data-size="4.5"] {
    width: 22px;
    height: 22px;
}

.sig-size[data-size="6"] {
    width: 26px;
    height: 26px;
}

.sig-size.active {
    background: #fb7185;
    border-color: #fb7185;
    box-shadow: 0 0 0 1px rgba(248, 113, 161, 0.6);
}

/* Signature position controls */

.signature-position-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.signature-position-row select {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.95);
    padding: 0.35rem 0.75rem;
    color: #fdf2f8;
    font-size: 0.85rem;
}

.hidden-file-input {
    display: none;
}

/* Writer image preview (small thumbnail under image section) */

.writer-image-preview-wrapper {
    margin-top: 0.75rem;
    display: none; /* standard versteckt, JS blendet ein */
    justify-content: flex-start;
}

.writer-image-preview-inner {
    position: relative;
    display: inline-block;
    max-width: 160px;
    border-radius: 18px;
    padding: 6px;
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 113, 161, 0.26), transparent 60%),
        rgba(15, 23, 42, 0.95);
    box-shadow: var(--shadow-soft);
}

.writer-image-preview-inner img {
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
}

.image-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
}

/* Form actions */

.form-actions {
    margin-top: 1.1rem;
}

.form-actions-centered {
    display: flex;
    justify-content: center;
}

.form-actions-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

/* Submit button */

.heart-submit-btn {
    border: none;
    border-radius: 999px;
    padding: 0.85rem 2.2rem;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--heart-pink-1), var(--heart-pink-2));
    color: #fdf2f8;
    cursor: pointer;
    box-shadow: 0 22px 50px rgba(131, 24, 67, 0.98);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.heart-submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 28px 60px rgba(131, 24, 67, 1);
}

/* Donate button on writer page */

.donate-floating {
    margin-top: 0.8rem;
    display: flex;
    justify-content: flex-start;
}

.donate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.45rem 1.4rem;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(248, 113, 161, 0.6);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #f9a8d4;
    box-shadow: var(--shadow-soft);
}

/* ============================
   ADMIN PAGE
   ============================ */

.admin-body {
    background: transparent;
    color: #e5e7eb;
    font-family: inherit;
}

.admin-wrapper {
    min-height: 100vh;
    padding: 1.2rem 1.5rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        radial-gradient(circle at top, rgba(251, 113, 133, 0.18) 0, transparent 55%),
        radial-gradient(circle at bottom, rgba(56, 189, 248, 0.16) 0, transparent 55%),
        rgba(7, 10, 24, 0.98);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.admin-header h1 {
    font-size: 1.2rem;
    margin-bottom: 0.15rem;
}

.admin-header p {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-main {
    display: grid;
    grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.2fr);
    gap: 1rem;
}

.admin-section {
    width: 100%;
    background:
        radial-gradient(circle at 0 0, rgba(248, 113, 161, 0.16), transparent 55%),
        rgba(15, 23, 42, 0.98);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-soft);
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.admin-section-header h2 {
    font-size: 1rem;
}

/* Table */

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border-spacing: 0;
}

.admin-table thead {
    background: rgba(15, 23, 42, 0.98);
}

.admin-table th,
.admin-table td {
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    text-align: left;
    white-space: nowrap;
}

.admin-table th {
    font-weight: 600;
    color: #f9a8d4;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.9);
}

/* Inline actions */

.admin-links {
    display: flex;
    gap: 0.35rem;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.danger-btn {
    border-color: rgba(248, 113, 113, 0.95);
}

/* Log / info boxes */

.info-box {
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.info-box code {
    background: rgba(15, 23, 42, 0.96);
    padding: 0.15rem 0.35rem;
    border-radius: 0.4rem;
}

.info-success {
    color: #bbf7d0;
}

.info-error {
    color: #fecaca;
}

.logs-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.logs-collapsible.open {
    max-height: 420px;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 1024px) {
    .admin-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .heart {
        width: 150px;
        height: 150px;
    }

    .letter-card {
        max-width: 96vw;
        max-height: 82vh;
        padding-inline: 1.1rem;
    }

    .floating-btn,
    .admin-gear-btn {
        width: 2.8rem;
        height: 2.8rem;
        bottom: 1rem;
    }

    .floating-right,
    .admin-gear-btn {
        right: 1rem;
    }

    .writer-card {
        padding: 1.3rem 1.2rem 1.1rem;
        border-radius: 1.1rem;
    }

    .admin-wrapper {
        padding: 1rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: 1rem;
    }

    .letter-card {
        padding: 1.1rem 1rem;
        border-radius: 1rem;
    }

    .writer-card {
        border-radius: 1rem;
    }

    .signature-position-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* =========================================
   FUTURISTISCHER PINKER GLAS-LOOK – NUR PANELS
   ========================================= */

/* Overlay-Hintergrund: dunkler, aber deutlich transparenter + pinker Glow */
.preview-overlay,
#link-panel,
#letter-panel {
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 113, 161, 0.28), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.22), transparent 60%),
        rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

/* Brief-Flyout-Karte */
#letter-panel .letter-card {
    position: relative;
    max-width: 720px;
    width: 100%;
    max-height: 80vh;
    opacity: 1;
    transform: translateY(0) scale(1);
    overflow-y: auto;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(24, 4, 35, 0.9));
    border-radius: 24px;
    border: 1px solid rgba(248, 113, 161, 0.7);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.95),
        0 0 40px rgba(248, 113, 161, 0.6);
}

/* Gemeinsamer Glas-Look für Preview, Link, Bild, Discard, Admin-Overlay-Karten */
.preview-overlay .preview-card.glass-card,
#link-panel .link-card,
#image-overlay .image-card,
#discard-overlay .preview-card.glass-card,
#admin-panel-overlay .admin-overlay-card {
    position: relative;
    border-radius: 24px;
    border: 1px solid rgba(248, 113, 161, 0.7);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(24, 4, 35, 0.9));
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.95),
        0 0 40px rgba(248, 113, 161, 0.55);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    overflow: hidden;
}

/* Leichter Glare oben auf den Karten, wie in typischen Glas-Morphism-Designs */
#letter-panel .letter-card::before,
.preview-overlay .preview-card.glass-card::before,
#link-panel .link-card::before,
#image-overlay .image-card::before,
#discard-overlay .preview-card.glass-card::before,
#admin-panel-overlay .admin-overlay-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.22),
            rgba(255, 255, 255, 0.05),
            transparent 55%
        );
    opacity: 0.28;
    pointer-events: none;
}

/* Inhalt der Karten bleibt normal klickbar */
#letter-panel .letter-card > *,
.preview-overlay .preview-card.glass-card > *,
#link-panel .link-card > *,
#image-overlay .image-card > *,
#discard-overlay .preview-card.glass-card > *,
#admin-panel-overlay .admin-overlay-card > * {
    position: relative;
    z-index: 1;
}
/* =========================================
   HEART GLASS V2 – nur Flyout-Panels
   ========================================= */

/* Overlay-Hintergrund: dunkel, aber durchsichtig, Herz+Background schimmern durch */
.preview-overlay,
#link-overlay,
#link-panel,
#discard-overlay,
#image-overlay,
#admin-overlay,
#letter-panel {
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 113, 161, 0.26), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.2), transparent 60%),
        rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

/* Brief-Flyout-Karte (Frontseite) – starkes pinkes Glas */
#letter-panel .letter-card {
    position: relative;
    max-width: 720px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(24, 6, 31, 0.92));
    border-radius: 24px;
    border: 1px solid rgba(248, 113, 161, 0.75);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.95),
        0 0 40px rgba(248, 113, 161, 0.6);
}

/* Glas-Karten in allen Overlays (Preview, Link, Bild, Verwerfen, Admin) */
.preview-overlay .glass-card,
#link-panel .link-card {
    position: relative;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(24, 6, 31, 0.92));
    border-radius: 24px;
    border: 1px solid rgba(248, 113, 161, 0.75);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.95),
        0 0 40px rgba(248, 113, 161, 0.6);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    overflow: hidden;
}

/* Glare-Effekt oben auf den Karten – typischer Glas-Morphism-Glanz */
#letter-panel .letter-card::before,
.preview-overlay .glass-card::before,
#link-panel .link-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.22),
            rgba(255, 255, 255, 0.05),
            transparent 55%
        );
    opacity: 0.3;
    pointer-events: none;
}

/* Inhalt der Karten über dem Glare */
#letter-panel .letter-card > *,
.preview-overlay .glass-card > *,
#link-panel .link-card > * {
    position: relative;
    z-index: 1;
}
/* =========================================
   GLAS-LOOK – mehr Transparenz nur für Panels
   ========================================= */

/* Overlay-Hintergrund: transparenter, Herz & BG scheinen stärker durch */
.preview-overlay,
#link-overlay,
#link-panel,
#discard-overlay,
#image-overlay,
#admin-panel-overlay,
#letter-panel {
    background:
        radial-gradient(circle at 0% 0%, rgba(248, 113, 161, 0.20), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.18), transparent 60%),
        rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Karten selbst: deutlich transparenteres Glas */
#letter-panel .letter-card,
.preview-overlay .glass-card,
.preview-overlay .preview-card,
#link-overlay .link-card,
#link-panel .link-card,
#image-overlay .image-editor,
#discard-overlay .discard-card,
#admin-panel-overlay .admin-overlay-card {
    position: relative;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(24, 6, 31, 0.68));
    border-radius: 22px;
    border: 1px solid rgba(248, 113, 161, 0.65);
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.9),
        0 0 32px rgba(248, 113, 161, 0.55);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    overflow: hidden;
}

/* Glare oben – noch etwas dezenter */
#letter-panel .letter-card::before,
.preview-overlay .glass-card::before,
.preview-overlay .preview-card::before,
#link-overlay .link-card::before,
#link-panel .link-card::before,
#image-overlay .image-editor::before,
#discard-overlay .discard-card::before,
#admin-panel-overlay .admin-overlay-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.18),
            rgba(255, 255, 255, 0.03),
            transparent 55%
        );
    opacity: 0.25;
    pointer-events: none;
}

/* Inhalt über dem Glare */
#letter-panel .letter-card > *,
.preview-overlay .glass-card > *,
.preview-overlay .preview-card > *,
#link-overlay .link-card > *,
#link-panel .link-card > *,
#image-overlay .image-editor > *,
#discard-overlay .discard-card > *,
#admin-panel-overlay .admin-overlay-card > * {
    position: relative;
    z-index: 1;
}
/* =========================================
   ADMIN: mobile Darstellung
   ========================================= */

@media (max-width: 900px) {
    .admin-wrapper {
        padding: 0.9rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .admin-main {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .admin-section {
        padding: 0.8rem 0.85rem;
        border-radius: 18px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .admin-table th,
    .admin-table td {
        font-size: 0.78rem;
        padding: 0.35rem 0.45rem;
        white-space: nowrap;
    }
}
/* Admin-Overlay im Startscreen auf Handy bildschirmfüllend */

@media (max-width: 768px) {
    #admin-panel-overlay .admin-overlay-card {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        padding: 0.6rem 0.4rem 0.8rem;
    }

    #admin-panel-overlay .admin-iframe {
        border-radius: 14px;
    }
}
/* =========================================
   FIX: Vollständiges Herz mit Spitze
   ========================================= */

.heart {
    position: relative;
    width: 160px;
    height: 160px;
    cursor: pointer;
    transform-origin: center center;
    /* Dreieck-/Rauten-Basis des Herzens (unterer Teil) */
    background: linear-gradient(135deg, var(--heart-pink-1), var(--heart-pink-2));
    border-radius: 32px;
    box-shadow:
        0 22px 45px rgba(248, 113, 161, 0.95),
        0 0 40px rgba(236, 72, 153, 0.85);
    transform: rotate(-45deg);
    animation: heart-beat 1.8s infinite;
}

/* Die beiden runden „Ohren“ oben am Herz */
.heart::before,
.heart::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    background:
        radial-gradient(circle at 30% 20%, #ffe4f5 0, transparent 55%),
        linear-gradient(145deg, var(--heart-pink-1), var(--heart-pink-2));
    border-radius: 50%;
}

/* linke obere Rundung */
.heart::before {
    top: -80px; /* halbe Höhe nach oben */
    left: 0;
}

/* rechte obere Rundung */
.heart::after {
    top: 0;
    left: 80px; /* halbe Breite nach rechts */
}

/* Hover nur Glow ändern, nicht die Form zerstören */
.heart:hover {
    box-shadow:
        0 28px 60px rgba(248, 113, 161, 1),
        0 0 60px rgba(236, 72, 153, 0.92);
}

/* Herzschlag – immer mit Rotation kombiniert */
@keyframes heart-beat {
    0%,
    100% {
        transform: rotate(-45deg) scale(1);
    }
    30% {
        transform: rotate(-45deg) scale(1.06);
    }
    60% {
        transform: rotate(-45deg) scale(0.96);
    }
}
