/* ================================================================
   Ostereiersuche / Easter Egg Hunt v5.0
   ================================================================ */

/* ── Fortschrittsleiste ──────────────────────────────────────── */
.oei-fortschritt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #3d1c6e, #7b2d8b);
    color: #fff;
    padding: 10px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(61,28,110,.45);
    z-index: 9990;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s, transform .4s;
    font-family: inherit;
    min-width: 200px;
    pointer-events: none;
}

.oei-fortschritt.oei-sichtbar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.oei-fortschritt-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.oei-wip-icon {
    font-size: 20px;
    animation: oei-wippen 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes oei-wippen {
    0%,100% { transform: rotate(-12deg); }
    50%      { transform: rotate(12deg); }
}

.oei-fortschritt-info {
    flex: 1;
    min-width: 0;
}

#oei-fortschritt-text {
    display: block;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-bottom: 5px;
}

.oei-progress-bar {
    height: 5px;
    background: rgba(255,255,255,.25);
    border-radius: 3px;
    overflow: hidden;
}

.oei-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f9e547, #f48fb1);
    border-radius: 3px;
    transition: width .55s cubic-bezier(.34,1.56,.64,1);
}

.oei-reset-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .3s;
    padding: 0;
}

.oei-reset-btn:hover {
    background: rgba(255,255,255,.3);
    transform: rotate(180deg);
}

/* Countdown */
.oei-countdown {
    font-size: 11px;
    text-align: center;
    margin-top: 6px;
    opacity: .85;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,.2);
}

/* ── Ei-Wrapper ──────────────────────────────────────────────── */
.oei-ei {
    position: fixed;
    z-index: 9980;
    cursor: pointer;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.3));
}

.oei-versteckt { display: none !important; }

.oei-pos-oben-links    { top: 80px;    left: 18px; }
.oei-pos-oben-rechts   { top: 80px;    right: 18px; }
.oei-pos-mitte-links   { top: 50%;     left: 18px;  transform: translateY(-50%); }
.oei-pos-mitte-rechts  { top: 50%;     right: 18px; transform: translateY(-50%); }
.oei-pos-unten-links   { bottom: 72px; left: 18px; }
.oei-pos-unten-rechts  { bottom: 72px; right: 18px; }

.oei-ei { animation: oei-schweben 3.5s ease-in-out infinite; }
.oei-pos-mitte-links, .oei-pos-mitte-rechts {
    animation: oei-schweben-mitte 3.5s ease-in-out infinite;
}

@keyframes oei-schweben {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@keyframes oei-schweben-mitte {
    0%,100% { transform: translateY(-50%); }
    50%      { transform: translateY(calc(-50% - 7px)); }
}

.oei-ei:hover { filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)) brightness(1.08); outline: none; }
.oei-ei:hover .oei-ei-inner { animation: oei-wackeln .4s ease infinite alternate; }
@keyframes oei-wackeln {
    from { transform: rotate(-7deg) scale(1.06); }
    to   { transform: rotate(7deg)  scale(1.1); }
}

.oei-ei-inner {
    position: relative;
    display: block;
    width: 58px; height: 72px;
}
.oei-ei-inner img {
    width: 100%; height: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
.oei-glanz {
    position: absolute;
    top: 8px; left: 10px;
    width: 16px; height: 10px;
    background: rgba(255,255,255,.45);
    border-radius: 50%;
    transform: rotate(-35deg);
    pointer-events: none;
}

/* Tooltip */
.oei-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,8,35,.85);
    color: #fff;
    font-size: 12px;
    padding: 5px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    font-family: inherit;
}
.oei-ei:hover .oei-tooltip,
.oei-ei:focus .oei-tooltip { opacity: 1; }

/* ── Sammel-Animationen ──────────────────────────────────────── */

/* 1. Einsammeln (klassisch) */
@keyframes oei-anim-einsammeln {
    0%   { transform: scale(1)   rotate(0deg);  opacity: 1; }
    35%  { transform: scale(1.5) rotate(15deg); opacity: 1; }
    100% { transform: scale(0)   rotate(45deg); opacity: 0; }
}
.oei-anim-einsammeln { animation: oei-anim-einsammeln .65s ease-in forwards !important; }

/* 2. Hüpfen */
@keyframes oei-anim-huepfen {
    0%   { transform: translateY(0)    scale(1);   opacity: 1; }
    30%  { transform: translateY(-40px) scale(1.2); opacity: 1; }
    60%  { transform: translateY(10px)  scale(.9);  opacity: .8; }
    100% { transform: translateY(-80px) scale(0);   opacity: 0; }
}
.oei-anim-huepfen { animation: oei-anim-huepfen .7s ease-in forwards !important; }

/* 3. Drehen */
@keyframes oei-anim-drehen {
    0%   { transform: rotate(0deg)   scale(1); opacity: 1; }
    50%  { transform: rotate(360deg) scale(1.3); opacity: .8; }
    100% { transform: rotate(720deg) scale(0); opacity: 0; }
}
.oei-anim-drehen { animation: oei-anim-drehen .7s ease-in forwards !important; }

/* 4. Explodieren */
@keyframes oei-anim-explodieren {
    0%   { transform: scale(1);   opacity: 1;  filter: brightness(1); }
    20%  { transform: scale(1.8); opacity: 1;  filter: brightness(2); }
    100% { transform: scale(0);   opacity: 0;  filter: brightness(3); }
}
.oei-anim-explodieren { animation: oei-anim-explodieren .5s ease-out forwards !important; }

/* ── Partikel ────────────────────────────────────────────────── */
.oei-partikel {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: oei-partikel-burst .9s ease-out forwards;
}
@keyframes oei-partikel-burst {
    0%   { transform: translate(0,0) scale(1.2); opacity: 1; }
    100% { transform: translate(var(--dx),var(--dy)) scale(0); opacity: 0; }
}

/* ── Popup ───────────────────────────────────────────────────── */
.oei-popup-overlay {
    position: fixed; inset: 0;
    background: rgba(8,4,20,.72);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
    animation: oei-overlay-ein .3s ease;
}
.oei-popup-overlay.oei-versteckt { display: none !important; }
@keyframes oei-overlay-ein { from { opacity: 0; } to { opacity: 1; } }

.oei-popup {
    background: linear-gradient(160deg, #fff 0%, #fdf8ff 100%);
    border-radius: 24px;
    max-width: 440px; width: 92%;
    box-shadow: 0 25px 70px rgba(0,0,0,.35);
    position: relative; overflow: hidden;
    animation: oei-popup-spring .45s cubic-bezier(.34,1.56,.64,1);
    max-height: 90vh; overflow-y: auto;
}
@keyframes oei-popup-spring {
    from { transform: scale(.65) translateY(40px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

.oei-popup-konfetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.oei-konfetti-stueck {
    position: absolute;
    animation: oei-konfetti var(--dauer) ease-in var(--delay) forwards;
}
@keyframes oei-konfetti {
    0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
    100% { transform: translateY(460px) rotate(720deg); opacity: 0; }
}

.oei-popup-body {
    padding: 30px 26px 26px;
    text-align: center;
    position: relative; z-index: 1;
}

.oei-popup-eier {
    margin-bottom: 14px; min-height: 44px;
    animation: oei-eier-ein .5s ease .15s both;
}
.oei-popup-eier img { display: inline-block; margin: 0 3px; vertical-align: middle; }
@keyframes oei-eier-ein { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.oei-popup-body h2 { font-size: 22px; font-weight: 800; color: #3d1c6e; margin: 0 0 10px; }
.oei-popup-body > p { font-size: 15px; color: #555; margin: 0 0 18px; line-height: 1.6; }

/* Gutschein */
.oei-gutschein {
    background: linear-gradient(135deg, #fffbea, #fff3cc);
    border: 2px dashed #e6a817;
    border-radius: 14px;
    padding: 14px 18px; margin: 0 0 18px;
}
.oei-gutschein-label { font-size: 13px; color: #999; margin: 0 0 6px; }
.oei-gutschein-code  { font-size: 24px; font-weight: 900; letter-spacing: 4px; color: #b8720a; font-family: monospace; margin-bottom: 8px; }
.oei-kopieren-btn {
    background: none; border: 1.5px solid #e6a817; color: #b8720a;
    font-size: 13px; padding: 5px 16px; border-radius: 20px; cursor: pointer;
    transition: all .2s; font-family: inherit;
}
.oei-kopieren-btn:hover { background: #e6a817; color: #fff; }

/* Highscore-Eintrag im Popup */
.oei-highscore-eintrag { margin: 0 0 18px; text-align: left; }
.oei-highscore-eintrag label { font-size: 13px; font-weight: 600; color: #555; display: block; margin-bottom: 6px; }
.oei-highscore-eintrag-zeile { display: flex; gap: 8px; }
.oei-highscore-eintrag input {
    flex: 1; padding: 8px 12px; border: 1.5px solid #ddd;
    border-radius: 8px; font-size: 14px; font-family: inherit;
}
.oei-highscore-eintrag input:focus { outline: none; border-color: #6a3d9a; }
.oei-hs-save-btn {
    background: #6a3d9a; color: #fff; border: none;
    padding: 8px 14px; border-radius: 8px; cursor: pointer; font-family: inherit;
    transition: background .2s;
}
.oei-hs-save-btn:hover { background: #5a2d8a; }

/* Buttons */
.oei-popup-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.oei-btn {
    padding: 11px 24px; border-radius: 30px; font-size: 14px; font-weight: 700;
    cursor: pointer; border: none; transition: all .2s; font-family: inherit;
}
.oei-btn-primary {
    background: linear-gradient(135deg, #5c1fa8, #a84ca0); color: #fff;
    box-shadow: 0 4px 15px rgba(92,31,168,.4);
}
.oei-btn-primary:hover { transform: scale(1.04); }
.oei-btn-secondary {
    background: rgba(92,31,168,.08); color: #5c1fa8;
    border: 1.5px solid #5c1fa8;
}
.oei-btn-secondary:hover { background: #5c1fa8; color: #fff; }

/* ── Highscore Panel ─────────────────────────────────────────── */
.oei-highscore-btn {
    position: fixed; bottom: 20px; right: 20px; z-index: 9985;
    background: linear-gradient(135deg, #f9e547, #f0a500);
    border: none; width: 46px; height: 46px; border-radius: 50%;
    font-size: 20px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(240,165,0,.5);
    transition: transform .2s;
}
.oei-highscore-btn:hover { transform: scale(1.1) rotate(10deg); }

.oei-highscore-panel {
    position: fixed; bottom: 76px; right: 20px; z-index: 9984;
    background: #fff; border-radius: 16px; width: 280px;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    overflow: hidden;
    animation: oei-panel-ein .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes oei-panel-ein {
    from { transform: scale(.8) translateY(20px); opacity: 0; }
    to   { transform: scale(1)  translateY(0);    opacity: 1; }
}

.oei-highscore-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f9e547, #f0a500);
    font-weight: 700; font-size: 14px; color: #333;
}
.oei-hs-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: #555; line-height: 1; padding: 0;
}
.oei-highscore-liste { padding: 10px 12px; max-height: 240px; overflow-y: auto; }
.oei-hs-zeile {
    display: grid; grid-template-columns: 28px 1fr 48px 60px;
    align-items: center; gap: 4px;
    padding: 6px 4px; border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.oei-hs-zeile:last-child { border: none; }
.oei-hs-rang  { font-size: 16px; }
.oei-hs-name  { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oei-hs-zeit  { color: #7b2d8b; font-weight: 700; text-align: right; }
.oei-hs-datum { color: #aaa; font-size: 11px; text-align: right; }
.oei-hs-leer  { color: #aaa; font-size: 13px; text-align: center; padding: 10px 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .oei-ei-inner      { width: 46px; height: 58px; }
    .oei-fortschritt   { min-width: 170px; }
    #oei-fortschritt-text { font-size: 11px; }
    .oei-pos-oben-links, .oei-pos-oben-rechts { top: 65px; }
    .oei-highscore-panel { width: calc(100vw - 40px); right: 20px; }
}

/* ── Admin-Verwaltung im Highscore-Panel ── */
.oei-hs-admin-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #fef9ee;
    border-top: 1px solid #fde68a;
    font-size: 12px;
}

.oei-hs-admin-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.oei-hs-admin-approve {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.oei-hs-admin-delete {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.oei-hs-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.oei-hs-admin-table th {
    background: #f9fafb;
    padding: 6px 8px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.oei-hs-admin-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.oei-hs-pending td {
    background: #fffbeb;
}

.oei-hs-admin-btn-sm {
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #374151;
}

.oei-hs-admin-del {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}
