:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;
  background: radial-gradient(circle at top, #111827, #020617 60%);
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.xapp {
  width: 100%;
  min-height: 100vh;
  padding: 8px;  
}

.app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;;
}

/* Header */

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.status-indicator {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #4b5563;
  white-space: nowrap;
}

.status-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fbbf24;
}

/* WebSocket status colors */
.status-indicator[data-state="ok"] {
  border-color: #22c55e;
}

.status-indicator[data-state="ok"]::before {
  background: #22c55e;
}

.status-indicator[data-state="error"] {
  border-color: #ef4444;
}

.status-indicator[data-state="error"]::before {
  background: #ef4444;
}

/* Tree area */

.tree-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-image {
  width: 100%;
  height: calc(100vh - 100px); /* Leaves room for header */
  padding-bottom: 0;
  background-size: contain;
  position: relative;
  
  /*max-width: 960px;*/
  /* max-width: 1200px;*/
  margin: 0 auto;
  
  /* Maintain aspect ratio: adjust padding-bottom depending on your image */
  
  background-image: url("tree.png"); /* <- your tree file */
  
  background-repeat: no-repeat;
  background-position: center bottom;
}

/*
  Branch slots:
  - Positioned absolutely over the tree.
  - Tune top/left values to match your specific tree image.
*/

.xbranch-slot {
  position: absolute;
  width: 10%;      /* size of the hanging photo frame */
  height: 10%;
}

.branch-slot {
  position: absolute;
  width: 7%;
  aspect-ratio: 3 / 4;
}


/* Adjust these four positions to match your tree branches */
.branch-slot-1 {
  top: 30%;
  left: 15%;
}

.branch-slot-2 {
  top: 20%;
  left: 25%;
}

.branch-slot-3 {
  top: 10%;
  left: 35%;
}

.branch-slot-4 {
  top: 15%;
  left: 45%;
}

.branch-slot-5 {
  top: 10%;
  right: 35%;
}

.branch-slot-6 {
  top: 20%;
  right: 25%;
}


.branch-slot-7 {
  top: 30%;
  right: 15%;
}



/* Frame styling */

.slot-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  /*border: 2px solid rgba(148, 163, 184, 0.9);*/
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(15, 23, 42, 0.6);
  overflow: hidden;
}

.slot-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder text when no image yet */

.placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Hidden branch state – fade them out */
.branch-slot.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Smooth fade-in when reappearing */
.branch-slot {
  transition: opacity 0.3s ease;
}

/* Clear button */
.xbtn-clear {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn-clear {
   padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #4b5563;
  white-space: nowrap;
  cursor: pointer;
}


.btn-clear:active {
  transform: translateY(1px);
}

.btn-clear:hover {
  background: #111827;
}



/* Mobile tweaks */

@media (max-width: 640px) {
  .app {
    padding: 12px;
  }

  h1 {
    font-size: 1.4rem;
  }

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

  .tree-image {
    padding-bottom: 90%; /* taller on mobile; adjust if needed */
  }
}
