/* The member reserve page (/r/<uuid>/reserves). Item colors, icons and the
   tooltip are in loot.css. */
.reserves-body {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* The page is the site's .container wide, lined up with the header's logo. */
.reserves-main {
  padding-block: 32px 72px;
}

/* The raid on the left, the "Your loot" button on the right; stacked on phones. */
.reserves-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.reserves-heading h1 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.reserves-time,
.reserves-meta,
.reserves-count {
  color: var(--text-secondary);
  font-size: 14px;
}

.reserves-time {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 0;
}

.reserves-heading-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.reserves-loot-button {
  min-height: 40px;
}

.reserves-loot-note {
  color: var(--text-muted);
  font-size: 12px;
}

/* Open, locked or closed, by the start time. */
.reserves-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.reserves-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.reserves-state.is-open {
  border-color: rgba(111, 208, 140, 0.4);
  background: rgba(111, 208, 140, 0.1);
  color: #6fd08c;
}

.reserves-state.is-closed {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.reserves-panel {
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.reserves-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.reserves-panel p {
  margin: 0 0 10px;
}

.reserves-panel .button {
  margin-top: 4px;
}

.reserves-panel .reserves-team {
  color: var(--text-secondary);
}

.reserves-team strong {
  color: var(--text-primary);
}

/* The member's card: who they reserve as, the counter, then their reserves. */
.reserves-me-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.reserves-me-who {
  flex: 1 1 260px;
  min-width: 0;
}

.reserves-me-who p:last-child {
  margin-bottom: 0;
}

.reserves-panel .reserves-used {
  margin: 0;
  text-align: right;
  white-space: nowrap;
  color: var(--text-secondary);
}

.reserves-used strong {
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.reserves-used span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  white-space: normal;
}

.reserves-yours {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.reserves-yours h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

.reserves-yours ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reserves-yours-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
}

.reserves-yours-item.is-invalid .reserves-item-name {
  text-decoration: line-through;
  opacity: 0.7;
}

.reserves-yours-item.is-invalid .reserves-item-meta {
  color: var(--warning);
}

.reserves-panel .reserves-yours-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.reserves-count-badge {
  color: var(--text-secondary);
  font-weight: 500;
}

.reserves-name {
  margin-top: 14px;
}

.reserves-name label {
  font-weight: 600;
}

.reserves-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.reserves-first {
  color: var(--text-secondary);
}

.reserves-name-row input {
  flex: 1 1 160px;
  min-height: 42px;
}

.reserves-notice p {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--bg-elevated);
  font-size: 14px;
}

.reserves-notice .is-ok {
  border-left: 3px solid #6fd08c;
}

.reserves-notice .is-warn {
  border-left: 3px solid #e0a43b;
}

.reserves-notice .is-bad {
  border-left: 3px solid #e05d5d;
}

.reserves-filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}

.reserves-filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.reserves-filters input[type="search"],
.reserves-filters select {
  min-height: 42px;
  width: 100%;
  min-width: 0;
}

.reserves-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
}

.reserves-filters .reserves-check {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
  color: var(--text-primary);
}

.reserves-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

/* The site's full width: items side by side, so the buttons stay near them. */
@media (min-width: 1100px) {
  .reserves-main .reserves-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.reserves-count {
  margin: 14px 0 0;
}

.reserves-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}

.reserves-item.is-mine {
  border-color: var(--accent-border);
  background: var(--bg-warm);
}

.reserves-item-main {
  flex: 1 1 180px;
  min-width: 0;
}

.reserves-item-main p {
  margin: 0;
}

.reserves-item-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.reserves-item-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.reserves-item-by {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px !important;
}

/* A reserver in their class color; the viewer's own is outlined. */
.reserver {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 600;
}

.reserver.is-mine {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.reserver.is-invalid {
  text-decoration: line-through;
  opacity: 0.55;
}

.reserves-none {
  color: var(--text-muted);
  font-size: 12px;
}

/* Same-width buttons, right-aligned; when a row is too narrow they wrap
   under the item, still on the right. */
.reserves-item-actions {
  display: flex;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.reserves-item-actions .button {
  min-width: 96px;
  min-height: 38px;
  padding: 6px 14px;
}

.reserves-item-actions .reserves-more {
  min-width: 52px;
}

@media (max-width: 760px) {
  .reserves-heading-actions {
    justify-items: start;
  }

  .reserves-filters {
    grid-template-columns: 1fr 1fr;
  }

  .reserves-search,
  .reserves-filters label:has([data-filter="source"]) {
    grid-column: 1 / -1;
  }

  /* Icon, name and button on top; who reserved it gets the row's width. */
  .reserves-item,
  .reserves-yours-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 10px;
  }

  .reserves-yours-item {
    padding: 8px 10px;
  }

  .reserves-item > .loot-tip-button,
  .reserves-yours-item > .loot-tip-button {
    grid-row: 1 / span 2;
    align-self: start;
  }

  .reserves-item .reserves-item-main {
    display: contents;
  }

  .reserves-item-main > p {
    grid-column: 1 / -1;
  }

  .reserves-item-main > .reserves-item-name,
  .reserves-item-main > .reserves-item-meta {
    grid-column: 2;
  }

  .reserves-item .reserves-item-actions,
  .reserves-yours-item .reserves-item-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .reserves-item-actions .button {
    min-width: 84px;
    min-height: 36px;
    padding: 6px 10px;
  }

  .reserves-panel .reserves-used {
    text-align: left;
  }

  .reserves-used span {
    display: inline;
    margin-left: 4px;
  }
}

.reserves-won {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.reserves-won strong {
  color: var(--accent);
}

/* A hard-reserved item: who it is for and why; it can't be reserved. */
.reserves-hard {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* The viewer's attendance priority, or why they can't reserve. */
.reserves-tier {
  margin: 4px 0 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.reserves-tier.is-barred {
  color: var(--warning);
}
