@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Montserrat:wght@400;600;700&family=Caveat:wght@600&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #ead6dd;
    --card:     #FFFFFF;
    --yellow:   #FFC107;
    --teal:     #008B8B;
    --rust:     #B84A00;
    --dark:     #1A1A1A;
    --muted:    #666666;
    --lime:     #D4F06B;
    --pink:     #f64182;
    --lightrose:    #f8e0e9;
    --rose:    #f8bbd2;
    --radius:   14px;
}

body.bg-soft {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(212, 240, 107, 0.22) 0%, transparent 24%),
        radial-gradient(circle at 85% 15%, rgba(0, 139, 139, 0.20) 0%, transparent 28%),
        radial-gradient(circle at 15% 85%, rgba(246, 65, 130, 0.16) 0%, transparent 25%),
        radial-gradient(circle at 88% 82%, rgba(255, 193, 7, 0.16) 0%, transparent 22%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.38) 22%, transparent 42%),
        linear-gradient(135deg, #f8e0e9 0%, #ead6dd 35%, #f8f6f8 68%, #f8bbd2 100%);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

body {
    color: var(--dark);
    font-family: 'Caveat', cursive;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    margin: 0;
    background-color: var(--bg);
    overflow-x: hidden;
    position: relative;
    animation: pageFadeIn 0.4s ease;
}

html, body {
    height: 100%;
    margin: 0;
}

/* Inhalt über der Animation */
.container {
    position: relative;
    z-index: 1;
    bottom: 15px;
}

.container {
    background: var(--card);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}

/* ── Typografie ── */
h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    letter-spacing: 2px;
    color: var(--dark);
    margin-bottom: 0.3rem;
}

h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 1px;
    color: var(--teal);
    margin-bottom: 1rem;
}

h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
}

p {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

/* ── Inputs ── */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.4rem 0;
    border-radius: 10px;
    border: 2px solid #E0E0E0;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    background: var(--lime);
    color: var(--dark);
    transition: border 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--teal);
}

/* ── Buttons ── */
button {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.4rem 0;
    border-radius: 10px;
    border: none;
    background: var(--teal);
    color: white;
    font-size: 1.2rem;
    font-family: 'Caveat';
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.5px;
}

button:hover {
    background: var(--rust);
    transform: translateY(-1px);
}

button.yellow {
    background: var(--yellow);
    color: var(--dark);
}

button.yellow:hover {
    background: #e6aa00;
}

hr {
    margin: 1.2rem 0;
    border: none;
    border-top: 2px solid #F0F0F0;
}

/* ── Nickname-Anzeige ── */
.nickname-big {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    color: var(--rust);
    letter-spacing: 3px;
    margin: 1rem 0;
}

/* ── Nav ── */
.nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.nav button {
    width: auto;
    padding: 0.45rem 1rem;
    background: var(--lime);
    color: var(--dark);
    font-size: 1.0rem;
    border-radius: 30px;
    margin: 0;
}

.nav button.active {
    background: var(--yellow);
    color: var(--dark);
}

.nav button:hover {
    background: var(--teal);
    color: white;
    transform: none;
}

/* ── Avatar ── */
.avatar-small {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 0.8rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--yellow);
    background: var(--bg);
}

.avatar-small img {
    position: absolute;
    top: 0; left: 0;
    width: 90px; height: 90px;
}

.avatar-preview {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 1rem auto;
    border-radius: 16px;
    border: 4px solid var(--teal);
    background: var(--bg);
    overflow: hidden;
}

.avatar-preview img {
    position: absolute;
    top: 0; left: 0;
    width: 200px; height: 200px;
}

/* ── Token-Anzeige ── */
.token-display {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--rust);
    margin-bottom: 1rem;
}

/* ── Chat ── */
#chat-box {
    background: var(--lime);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 1rem;
    height: 280px;
    overflow-y: auto;
    margin-bottom: 1rem;
    text-align: left;
}

.chat-msg {
    animation: msgSlideIn 0.25s ease;
    margin-bottom: 0.8rem;
}

.chat-msg strong {
    color: var(--teal);
    font-weight: 700;
    font-size: 0.85rem;
}

.chat-msg span {
    font-size: 0.88rem;
    color: var(--dark);
}

.chat-input-row {
    display: flex;
    gap: 8px;
}

.chat-input-row input {
    flex: 1;
    margin: 0;
}

.chat-input-row button {
    width: auto;
    padding: 0.5rem 1rem;
    margin: 0;
}

.chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 85%;
}

.chat-msg.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble {
    background: var(--card);
    border-radius: 14px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    line-height: 1.4;
    max-width: 220px;
    word-break: break-word;
}

.chat-msg.me .chat-bubble {
    background: var(--yellow);
}

.chat-time {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 3px;
}

/* ── Bestellkarten ── */
.item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;
}

.item-card {
    background: var(--lime);
    border-radius: 12px;
    padding: 1rem 0.8rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.1s;
}

.item-card:hover {
    border-color: var(--rust);
    transform: translateY(-2px);
}

.item-card .item-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--dark);
}

.item-card .item-cost {
    color: var(--rust);
    font-size: 0.82rem;
    font-family: 'Caveat', cursive;
    font-size: 1rem;
}

/* ── Bestellhistorie ── */
.order-history {
    background: var(--yellow);
    border-radius: 12px;
    padding: 1rem;
    text-align: left;
    font-size: 0.88rem;
    border: 2px solid #E0E0E0;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-offen    { color: var(--rust); font-weight: 600; }
.status-erledigt { color: var(--teal); font-weight: 600; }

/* ── Sektionslabels (Avatar-Creator) ── */
.section-label {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--teal);
    margin-bottom: 0.3rem;
    text-align: left;
}

.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.option-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    border: 2px solid transparent;
    background: var(--lime);
    color: var(--dark);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    width: auto;
    margin: 0;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--teal);
    background: var(--teal);
    color: white;
    transform: none;
}

.option-btn.active {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--dark);
}

/* ── RSVP-Buttons ── */
#tab-rsvp button {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ── Spotify-Suchergebnisse ── */
#search-results .item-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    text-align: left;
    padding: 0.7rem;
    background: var(--lime);
}

#search-results .item-card button {
    width: auto;
    padding: 0.4rem 0.8rem;
    margin: 0;
    background: var(--teal);
    border-radius: 8px;
    font-size: 0.85rem;
}

/* ── Admin ── */
.logout {
    float: right;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.85rem;
}

th, td {
    padding: 0.7rem 0.5rem;
    border-bottom: 2px solid #F0F0F0;
    text-align: left;
}

th {
    color: var(--teal);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    width: auto;
    margin: 0;
    cursor: pointer;
    border-radius: 20px;
    border: none;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.btn-done   { background: var(--teal); }
.btn-delete { background: var(--rust); }

/* ── Infobox ─────────────────────────────────────────────── */
.info-box {
    background: var(--lime);
    border-radius: 14px;
    padding: 1.2rem;
    text-align: left;
    margin-bottom: 1rem;
}

.info-box h3 {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    gap: 10px;
    margin-bottom: 0.8rem;
    align-items: flex-start;
}

.info-time {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    color: var(--rust);
    min-width: 65px;
    letter-spacing: 1px;
}

.info-text {
    font-size: 0.88rem;
    color: var(--dark);
    line-height: 1.5;
}

.info-note {
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    font-size: 0.85rem;
    color: var(--dark);
    margin-top: 0.5rem;
    border-left: 4px solid var(--rust);
}

/* ── Generator ───────────────────────────────────────────── */
.generator-card {
    background: var(--lime);
    border-radius: 16px;
    padding: 1.8rem 1.4rem;
    margin-bottom: 1.2rem;
    text-align: center;
    animation: fadeSlideIn 0.4s ease;
}

.generator-category {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 3px;
    color: var(--rust);
    margin-bottom: 0.8rem;
}

.generator-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
}

.generator-hint {
    margin-top: 0.8rem;
    text-align: center;
}

/* ── Bubbles Hintergrund ─────────────────────────────────── */
body {
    position: relative;
    overflow-x: hidden;
}

.bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubbles span {
    position: absolute;
    bottom: -150px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    animation: bubbleUp calc(60s / var(--i)) linear infinite;
    animation-delay: calc(var(--i) * -0.5s);
}

/* Farbe 1: Teal */
.bubbles span:nth-child(3n) {
    background: rgba(0, 139, 139, 0.5);
    box-shadow: 0 0 10px rgba(0,139,139,0.3),
                0 0 50px rgba(0,139,139,0.4),
                0 0 100px rgba(0,139,139,0.3);
    width: 25px;
    height: 25px;
}

/* Farbe 2: Gelb */
.bubbles span:nth-child(3n+1) {
    background: rgba(255, 193, 7, 0.5);
    box-shadow: 0 0 10px rgba(255,193,7,0.3),
                0 0 50px rgba(255,193,7,0.4),
                0 0 100px rgba(255,193,7,0.3);
    width: 20px;
    height: 20px;
}

/* Farbe 3: Rostbraun */
.bubbles span:nth-child(3n+2) {
    background: rgba(184, 74, 0, 0.45);
    box-shadow: 0 0 10px rgba(184,74,0,0.3),
                0 0 50px rgba(184,74,0,0.4),
                0 0 100px rgba(184,74,0,0.3);
    width: 15px;
    height: 15px;
}

/* Zufällige horizontale Positionen */
.bubbles span:nth-child(1)  { left: 5%; }
.bubbles span:nth-child(2)  { left: 10%; }
.bubbles span:nth-child(3)  { left: 18%; }
.bubbles span:nth-child(4)  { left: 25%; }
.bubbles span:nth-child(5)  { left: 32%; }
.bubbles span:nth-child(6)  { left: 40%; }
.bubbles span:nth-child(7)  { left: 47%; }
.bubbles span:nth-child(8)  { left: 53%; }
.bubbles span:nth-child(9)  { left: 60%; }
.bubbles span:nth-child(10) { left: 67%; }
.bubbles span:nth-child(11) { left: 73%; }
.bubbles span:nth-child(12) { left: 79%; }
.bubbles span:nth-child(13) { left: 85%; }
.bubbles span:nth-child(14) { left: 90%; }
.bubbles span:nth-child(15) { left: 95%; }
.bubbles span:nth-child(16) { left: 15%; }
.bubbles span:nth-child(17) { left: 35%; }
.bubbles span:nth-child(18) { left: 55%; }
.bubbles span:nth-child(19) { left: 75%; }
.bubbles span:nth-child(20) { left: 92%; }

@keyframes bubbleUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-50vh) scale(1.05);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-110vh) scale(0.8);
        opacity: 0;
    }
}

/* Container über Bubbles */
.container {
    position: relative;
    z-index: 1;
}

/* ── Gästeliste ──────────────────────────────────────────── */
.guest-card {
    background: var(--lime);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.guest-avatar {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--yellow);
    background: var(--bg);
}

.guest-avatar img {
    position: absolute;
    top: 0; left: 0;
    width: 56px; height: 56px;
}

.guest-info {
    flex: 1;
    text-align: left;
}

.guest-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--dark);
}

.guest-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-badge {
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.reaction-tooltip {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
}

.reaction-badge:hover .reaction-tooltip {
    display: block;
}

.guest-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guest-actions button {
    width: auto;
    padding: 0.4rem 0.7rem;
    margin: 0;
    font-size: 1.1rem;
    border-radius: 10px;
    line-height: 1;
}

.btn-hug  { background: #ff6b9d; }
.btn-poop { background: #8B6914; }

/* ── Tab-Ladeanimation ─────────────────────────────────────── */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab.active {
    animation: fadeSlideIn 0.25s ease forwards;
}

/* ── Animationen ─────────────────────────────────────────── */

/* Tab Ein-/Ausblenden */
.tab {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}
.tab.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Ripple */
button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: ripple-effect 0.5s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Avatar wackelt bei Änderung */
@keyframes avatarPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08) rotate(-2deg); }
    70%  { transform: scale(0.96) rotate(1deg); }
    100% { transform: scale(1); }
}
.avatar-pop {
    animation: avatarPop 0.35s ease;
}

/* Bestellkarte springt */
@keyframes cardBounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.93); }
    70%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.card-bounce {
    animation: cardBounce 0.3s ease;
}

/* Chat-Nachricht gleitet rein */
@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.chat-msg {
    animation: msgSlideIn 0.25s ease;
}
