/* ======================================================
   SHOUTBOX – IDENTISCH ZU ANDEREN BOXEN
====================================================== */

#shoutbox {
  position: relative;
  width: 100%;

  background: var(--bg-glass);
  border-radius: var(--box-radius);
  backdrop-filter: blur(14px) saturate(1.3);

  font-family: var(--font-family);
  color: var(--foreground);

  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 18px 18px 20px;

  overflow: hidden; /* NUR FÜR NEON */
  box-shadow:
    0 10px 40px rgba(0,0,0,.55),
    0 0 0 1px rgba(201,241,255,.12) inset;
}

/* ======================================================
   NEON RAHMEN – GLEICH WIE WELCOME / EVENT / PROFIL
====================================================== */

#shoutbox::before,
#shoutbox::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

#shoutbox::before {
  border: 2px solid transparent;
  background:
    linear-gradient(
      90deg,
      var(--primary),
      var(--accent),
      var(--primary-light)
    ) border-box;

  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;

  animation: neo-border 6s linear infinite;
}

#shoutbox::after {
  inset: 6px;
  border-radius: calc(var(--box-radius) - 6px);
  background: radial-gradient(
    circle at top,
    rgba(0,255,136,.18),
    transparent 70%
  );
  opacity: .6;
}

@keyframes neo-border {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}

/* ======================================================
   HEADER
====================================================== */

#shoutbox .box-header {
  text-align: center;
}

#shoutbox .box-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-light);
  text-shadow: 0 0 6px rgba(201,241,255,.5);
}

/* ======================================================
   CONTENT (WICHTIGSTER FIX!)
====================================================== */

#shoutbox .box-content {
  display: flex;
  flex-direction: column;
  gap: 12px;

  overflow: visible; /* 🔥 DAMIT EMOJIS SICHTBAR SIND */
  position: relative;
}

/* ======================================================
   MESSAGE LIST
====================================================== */

.shoutbox-list {
  list-style: none;
  margin: 0;
  padding: 0;

  max-height: 240px;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ======================================================
   SPEECH BUBBLES
====================================================== */

.shoutbox-item {
  display: flex;
  justify-content: flex-start;
  padding-left: 10px;
}

.bubble {
  position: relative;
  max-width: 82%;
  padding: 10px 14px 12px;

  background: rgba(255,77,77,.14);
  border-radius: 14px;

  box-shadow:
    0 4px 14px rgba(0,0,0,.25),
    inset 0 0 0 1px rgba(201,241,255,.08);

  animation: bubble-in .25s ease;
}

.bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid rgba(255,77,77,.14);
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   BUBBLE CONTENT
====================================================== */

.bubble-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .75rem;
  margin-bottom: 4px;
}

.bubble-user {
  font-weight: 700;
  color: var(--accent);
}

.shoutbox-timestamp {
  color: var(--muted);
  font-size: .7rem;
}

.bubble-message {
  font-size: .95rem;
  line-height: 1.45;
}

/* ======================================================
   FORM
====================================================== */

.shoutbox-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shoutbox-form textarea {
  resize: vertical;
  min-height: 70px;

  background: rgba(0,0,0,.35);
  border: 1.5px solid var(--primary);
  border-radius: 10px;

  padding: 10px 12px;
  color: var(--foreground);
  font-family: inherit;
}

/* ======================================================
   EMOJI DROPDOWN (JETZT FEHLERFREI)
====================================================== */

.emoji-dropdown {
  position: relative;
  display: inline-flex;
}

.emoji-toggle {
  background: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;

  font-weight: 700;
  cursor: pointer;
}

.emoji-toggle[aria-expanded="true"] {
  background: var(--accent);
  color: #000;
}

.emoji-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;

  background: #111;
  border: 1px solid var(--primary);
  border-radius: 8px;

  padding: 8px;
  display: none;
  gap: 6px;
  flex-wrap: wrap;

  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}

.emoji-list:not([hidden]) {
  display: flex;
}

.emoji-list span {
  cursor: pointer;
  font-size: 1.2rem;
}

/* ======================================================
   FORMAT & SUBMIT BUTTONS
====================================================== */

.format-buttons {
  display: flex;
  gap: 6px;
}

.format-buttons button,
.submit-button {
  background: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;

  font-weight: 700;
  cursor: pointer;
}

.format-buttons button:hover,
.submit-button:hover {
  background: var(--accent);
  color: #000;
}

/* ======================================================
   LOGIN HINT
====================================================== */

.shoutbox-login-hint {
  text-align: center;
  font-size: .9rem;
  opacity: .8;
}

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

@media (max-width: 700px) {
  .bubble {
    max-width: 100%;
  }
}
