/* tournament_tree.css */

.tree-page {
  max-width: 600px;
  margin: 2rem auto 0;
  padding: 0 .5rem;
}

/* ---- Header ---- */
.tree-header {
  padding-left: 1rem;
  margin-bottom: .8rem;
}

.tree-header h1 {
  font-size: 1rem;
  font-weight: 800;
  color: #0a0a12;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0;
}

/* ---- Search ---- */
.tree-search {
  display: flex;
  gap: 0;
  margin-bottom: .8rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

#searchInput {
  flex: 1;
  padding: .45rem .6rem;
  border: none;
  background: #0a0a12;
  color: rgba(255, 255, 255, .85);
  font-size: .8rem;
  outline: none;
}

#searchInput::placeholder {
  color: rgba(255, 255, 255, .3);
}

#searchInput:focus {
  background: #13132a;
}

#searchButton {
  padding: .45rem 1rem;
  border: none;
  background: #3B9797;
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

#searchButton:hover {
  background: #2d7a7a;
}

/* ---- Tree container ---- */
.tree-wrap {
  background: #0a0a12;
  border-radius: 10px;
  padding: .6rem .5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

#tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

#tree ul {
  list-style: none;
  padding-left: 1.1rem;
  margin: 0;
  border-left: 1px solid rgba(59, 151, 151, .15);
}

/* ---- Tree node row ---- */
.tree-node {
  display: flex;
  align-items: center;
  padding: .3rem 0;
}

/* ---- Toggle button ---- */
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3B9797;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  margin-right: .4rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
  line-height: 1;
  border: none;
}

.toggle:hover {
  background: #2d7a7a;
}

/* ---- Node content ---- */
.tree-node-content {
  cursor: pointer;
  padding: .2rem .5rem;
  border-radius: 4px;
  color: rgba(255, 255, 255, .75);
  font-size: .78rem;
  font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node-content:hover {
  background: rgba(59, 151, 151, .15);
  color: rgba(255, 255, 255, .95);
}

/* ---- States ---- */
.highlighted {
  background: rgba(255, 214, 102, .2);
  color: #ffd666;
  font-weight: 700;
}

.selected {
  background: rgba(59, 151, 151, .2);
  color: #fff;
  font-weight: 700;
}

/* ---- Footer links ---- */
.tree-footer {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: .8rem;
}

.tree-link {
  padding: .4rem 1.2rem;
  background: #0a0a12;
  color: #ffd666;
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s;
}

.tree-link:hover {
  background: #13132a;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .tree-page {
    padding: 0 2px;
  }

  .tree-header {
    padding-left: .5rem;
  }

  .tree-wrap {
    padding: .4rem .3rem;
  }

  #tree ul {
    padding-left: .8rem;
  }

  .tree-node-content {
    font-size: .72rem;
  }

  .toggle {
    width: 16px;
    height: 16px;
    font-size: .6rem;
  }
}
