/* Warm Sand UI â€“ komplettes App-Theme */
:root {
    --maxwidth: 1140px;
}

/* Base */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #241d18;
  color: #f7ecdd;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: flex;
  justify-content: center;
}

.app-root {
  width: 100%;
  max-width: var(--maxwidth);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #3a3028 0, #211a15 55%);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

/* App-Bar */
.app-bar {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: linear-gradient(90deg, #3d3129, #4a3a31);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  z-index: 20;
}

.app-bar-left, .app-bar-right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.app-bar-center {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 600;
  font-size: 17px;
  color: #f9e6c6;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}

.app-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.app-icon-btn:last-child{
  margin-right: 0;
}
.app-icon-btn i {
  font-size: 16px;
  color: #ffe6b7;
}
.app-icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(0,0,0,0.35);
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
}
.app-icon-btn.badge::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff6b4a;
  top: 4px;
  right: 4px;
  box-shadow: 0 0 8px rgba(255, 107, 74, 0.9);
}

/* Ressourcenleiste */
.resource-bar-wrapper {
  padding: 5px 8px 4px 8px;
  background: #2f2620;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow-x: auto;
}
.resource-bar {
  display: flex;
  gap: 10px;
  padding-bottom: 3px;
}
.resource-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.resource-pill i {
  font-size: 13px;
  color: #ffd38c;
}
.resource-amount {
  font-weight: 600;
  color: #ffe6b8;
}

/* Content */
.app-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px;
}

/* Form Cards */
.form-card {
  background: #3b3128;
  border-radius: 18px;
  padding: 18px 16px 18px 16px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.05);
}
.form-card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #ffe6c0;
}

/* Forms */
.form-group {
  margin-bottom: 10px;
}
.form-label {
  font-size: 13px;
  margin-bottom: 3px;
  color: #f6e0c5;
}
.form-control {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.55);
  padding: 8px 11px;
  font-size: 14px;
  background: #f7eac4;
  color: #3a2f25;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.form-control:focus {
  outline: none;
  border-color: #f0b873;
  box-shadow: 0 0 0 1px #f0b873;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-weight: 500;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, #f0b66c, #e8913b);
  color: #3c2515;
  box-shadow: 0 10px 18px rgba(0,0,0,0.65);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(0,0,0,0.75);
}
.btn-secondary {
  background: rgba(0,0,0,0.3);
  color: #f9e1c4;
}
.btn-secondary:hover {
  background: rgba(0,0,0,0.45);
}
.btn-text-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #ffb66a;
  cursor: pointer;
}
.btn-text-link:hover {
  text-decoration: underline;
}

/* Google Button */
.btn-google {
  background: #ffffff;
  color: #3c4043;
  border-radius: 14px;
  padding: 8px 14px;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.btn-google img {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}
.btn-google span {
  font-size: 14px;
}

/* Fehlertexte */
.error {
  color: #ffb4a2;
  font-size: 12px;
}

/* Divider "oder" */
.divider-row {
  display: flex;
  align-items: center;
  margin: 14px 0 10px 0;
}
.divider-line {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255,255,255,0.18);
}
.divider-text {
  padding: 0 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

/* Login specific */
.login-subtext {
  margin-top: 8px;
  font-size: 13px;
  text-align: center;
  color: #f5e0c9;
}
.login-subtext a {
  color: #ffb871;
  text-decoration: none;
  font-weight: 500;
}
.login-subtext a:hover {
  text-decoration: underline;
}

/* Bottom Navigation */
.bottom-nav-container {
  position: relative;
  z-index: 25;
}

.bottom-nav {
  height: 74px;
  background: radial-gradient(circle at top, #3b3028 0, #1f1914 70%);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.bottom-nav-item {
  flex: 1 1 0;
  text-align: center;
  color: #f2d3aa;
  font-size: 11px;
  cursor: pointer;
  padding-top: 4px;
  padding-bottom: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.bottom-nav-item i {
  display: block;
  font-size: 20px;
  margin-bottom: 2px;
}
.bottom-nav-item.active {
  color: #ffe1ad;
  transform: translateY(-2px);
}
.bottom-nav-item.active i{
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

/* Bottom-Submenu */
.bottom-submenu-wrapper {
  position: absolute;
  bottom: 74px;
  left: 0;
  right: 0;
  padding: 6px 10px 10px 10px;
  pointer-events: none;
}
.bottom-submenu {
  display: none;
  pointer-events: auto;
  background: #3f332b;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -8px 26px rgba(0,0,0,0.9);
  padding: 10px 12px 8px 12px;
}
.bottom-submenu.visible {
  display: block;
}
.bottom-submenu-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffe6c0;
  margin-bottom: 6px;
}
.bottom-submenu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bottom-submenu-links button {
  flex: 1 1 calc(50% - 8px);
  border-radius: 12px;
  border: none;
  font-size: 13px;
  padding: 7px 9px;
  background: rgba(0,0,0,0.28);
  color: #f8e3c5;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.bottom-submenu-links button:hover {
  background: rgba(0,0,0,0.4);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.6);
}

/* Popup Sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet-overlay.hidden {
  display: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: #3b3128;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -12px 30px rgba(0,0,0,0.9);
  padding: 10px 14px 14px 14px;
  display: flex;
  flex-direction: column;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffe6c0;
}
.sheet-close-x {
  border: none;
  background: transparent;
  color: #f7ecdd;
  font-size: 20px;
  cursor: pointer;
}
.sheet-body {
  margin-top: 6px;
  overflow-y: auto;
  padding-right: 4px;
  max-height: 78vh;
}

/* Chat items */
.event-item, .friend-online, .thread-item, .chat-msg {
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  padding: 7px 9px;
  margin-bottom: 6px;
}
.event-text {
  font-size: 13px;
}
.event-date {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}
.empty-hint {
  font-size: 13px;
  opacity: 0.9;
}

.friend-online {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.friend-online .friend-name {
  flex: 1 1 auto;
  margin-left: 6px;
}
.dot-online {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2ecc71;
  box-shadow: 0 0 8px rgba(46,204,113,0.9);
}
.btn-link {
  border: none;
  background: rgba(0,0,0,0.28);
  color: #f9e1c4;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  cursor: pointer;
}

/* Chat */
.chat-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.86;
}
.chat-msg-body {
  margin-top: 3px;
  font-size: 13px;
}
.chat-msg.own {
  background: linear-gradient(135deg, rgba(255,214,141,0.2), rgba(0,0,0,0.5));
  border: 1px solid rgba(255,214,141,0.4);
}
.chat-input-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.chat-input-row input[type="text"] {
  flex: 1 1 auto;
}

/* Scrollbars */
.app-content::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.resource-bar-wrapper::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}
.app-content::-webkit-scrollbar-thumb,
.sheet-body::-webkit-scrollbar-thumb,
.resource-bar-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
}



/* ==========================================
   Popover / Sprechblase (Warm Sand UI)
   ========================================== */

#app-popover {
  position: fixed;
  z-index: 60;
  display: none;                     /* wird per JS auf block gesetzt */
  min-width: 220px;
  max-width: 320px;
  max-height: 60vh;                  /* wie gewünscht: ~60% Bildschirmhöhe */
  background: #3f332b;
  border-radius: 16px;
  border: 1px solid rgba(255, 220, 160, 0.25);
  box-shadow: 0 6px 18px rgba(0,0,0,0.65),0 0 10px rgba(255, 220, 160, 0.15);
  padding: 10px 12px 10px 12px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

#app-popover.visible {
  display: block;
  opacity: 1 !important;
  transform: translateY(0);          /* kleiner Slide nach unten + Fade */
  pointer-events: auto;
}

#app-popover .popover-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: #3f332b;
  border-left: 1px solid rgba(255, 220, 160, 0.25);
  border-top: 1px solid rgba(255, 220, 160, 0.25);
  pointer-events: none;
}


/* Inhalt der Sprechblase */
.popover-content {
  max-height: 56vh;                  /* etwas kleiner als 60vh wegen Padding */
  overflow-y: auto;
  font-size: 13px;
}

/* Optional leichte Typo-Styles darin */
.popover-content h6 {
  font-size: 14px;
  margin: 0 0 6px 0;
  color: #ffe6c0;
}
.popover-content p {
  margin: 0 0 6px 0;
}




.guest-wrapper {
  display: flex;
  gap: 30px;
  padding: 40px;
  box-sizing: border-box;
  align-items: flex-start;       /* WICHTIG: Login nach oben */
  height: auto;                  /* nicht 100vh erzwingen */
}


/* Linke Infospalte (nur Desktop sichtbar) */
.guest-info {
  flex: 1 1 60%;
  background: rgba(0,0,0,0.25);
  padding: 30px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.guest-info h1 {
  margin-top: 0;
  color: #ffe6c0;
  font-size: 28px;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}

.guest-info p {
  margin: 12px 0 16px 0;
  color: #f5e0c9;
  font-size: 16px;
  line-height: 1.45;
}

.guest-info ul {
  margin: 0 0 22px 0;
  padding-left: 18px;
  color: #f6e7d0;
  font-size: 15px;
}

.guest-info li {
  margin-bottom: 6px;
  opacity: 0.95;
}

/* Rechter Loginbereich */
.guest-login {
  flex: 0 0 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

/* --- Tablet / Mobile / App-WebView --- */
@media (max-width: 900px) {

  .guest-wrapper {
    flex-direction: column;
    padding: 20px 16px;
  }

  /* Info komplett ausblenden auf App */
  .guest-info {
    display: none;
  }

  .guest-login {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .form-card {
    width: 100%;
  }
}

/* --- Sehr kleine Geräte (Smartphones) --- */
@media (max-width: 520px) {
  .guest-wrapper {
    padding: 14px;
  }

  .form-card {
    padding: 16px 14px;
  }
}


/* Mobile default */
.mobile-only { display: block; }
.desktop-only { display: none; }

.layout {
  display: flex;   /* nebeneinander */
  height: 100vh;   /* optional */
}

.app-content {
  flex: 1;         /* nimmt restlichen Platz ein */
  width: auto;     /* überschreibt 100% */
}



.desktop-resource-panel {
  display: none;  /* Panel im Mobile ausgeblendet */
}

/* Ab Desktop-Breite (z. B. ab 1024px) */
@media (min-width: 1024px) {
  .layout {
    display: flex;   /* nebeneinander */
    height: 100vh;   /* optional */
  }

  .app-content {
    flex: 1;         /* nimmt restlichen Platz ein */
    width: auto;     /* überschreibt 100% */
  }

  .desktop-resource-panel {
    display: block;  /* Panel sichtbar */
    flex: 0 0 20%;   /* feste 20% Breite */
  }
  
  .resource-bar-wrapper{
    display:none !important;
  }
}




/* ==========================================
   Desktop Resource Panel – Modernes Design
   ========================================== */

.desktop-resource-panel {
    padding: 16px;
    box-sizing: border-box;
    border-left: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
}

/* Kategorieblock */
.resource-category {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 14px 12px;
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(0,0,0,0.35);
}

/* Titel einer Kategorie */
.resource-category-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffe6c0;
    margin-bottom: 10px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Einzelnes Ressourcen-Element */
.resource-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 5px 10px;
    margin-bottom: 4px;
    border-radius: 12px;
    transition: background 0.15s ease, transform 0.12s ease;
}

/* Hover-Effekt */
.resource-item:hover {
    background: rgba(0,0,0,0.35);
    transform: translateX(2px);
}

/* Icon */
.resource-item i {
    font-size: 17px;
    color: #ffd38c;
    margin-right: 8px;
    width: 22px;
}

/* Label links */
.resource-label {
    flex: 1;
    color: #f7e6d0;
    font-size: 11px;
}

/* Wert rechts */
.resource-value {
    font-weight: 700;
    color: #ffe7b4;
    font-size: 12px;
    text-shadow: 0 0 6px rgba(0,0,0,0.7);
}


.res-expand-btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: #f8e5c7;
    padding: 3px 6px;
    cursor: pointer;

    font-size: 10px;
    letter-spacing: 0.3px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    transition: background 0.15s ease, transform 0.15s ease;
}

.res-expand-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.res-expand-btn i {
    font-size: 13px;
    opacity: 0.85;
}





/* ============================
   Fullscreen Popup Overlay
   ============================ */

.fs-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.fs-popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Panel */
.fs-popup-panel {
    background: #3b3128;
    border-radius: 18px;
    border: 1px solid rgba(255, 220, 160, 0.28);
    box-shadow: 0 8px 32px rgba(0,0,0,0.65),
                0 0 14px rgba(255, 220, 160, 0.2);

    width: 92%;
    height: 92%;

    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.fs-popup-overlay.visible .fs-popup-panel {
    opacity: 1;
    transform: translateY(0);
}

/* Header */
.fs-popup-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.25);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.fs-popup-title {
    margin: 0;
    font-size: 18px;
    color: #ffe6c0;
}

/* Close Button */
.fs-popup-close {
    background: none;
    border: none;
    color: #f7e8d5;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
}
.fs-popup-close:hover {
    color: #ffcf9a;
}

/* Content Area */
.fs-popup-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    color: #f6e7d0;
    font-size: 14px;
}

/* Scrollbar */
.fs-popup-content::-webkit-scrollbar {
    width: 6px;
}
.fs-popup-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
}

/* ============================
   Responsive tuning
   ============================ */
@media (max-width: 700px) {
    .fs-popup-panel {
        width: 96%;
        height: 94%;
    }

    .fs-popup-title {
        font-size: 17px;
    }
}

/* Desktop: Popup nur so breit wie das App-Design */
@media (min-width: 1100px) {

    .fs-popup-overlay {
        justify-content: center;
        align-items: center;
        padding: 0; /* kein extra Abstand */
    }

    .fs-popup-panel {
        width: 100%;
        max-width: var(--maxwidth);     /* gleiche Breite wie .app-root */
        height: 92%;           /* Höhe bleibt wie gehabt */
    }
}