/* Team Photo page. The builder inside the modal is styled by
   create-a-player.css - this file is the photo, the panel and the modal shell. */

.tp-photo { padding: 1rem; }

/* The slot buttons are positioned against this, so it has to be exactly the
   size of the canvas - no padding, no inline-gap under the canvas. */
.tp-frame {
  position: relative;
  line-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(30, 136, 229, .25);
}

#tp-canvas { width: 100%; height: auto; display: block; }

/* One transparent button per spot in the line-up, sitting over the player it
   belongs to. Real buttons rather than canvas hit-testing, so the line-up can
   be tabbed through and read out. */
.tp-slots { position: absolute; inset: 0; }

.tp-slot {
  position: absolute;
  border: 2px dashed transparent;
  border-radius: 12px;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.tp-slot:hover, .tp-slot:focus-visible {
  background: rgba(30, 136, 229, .12);
  border-color: rgba(30, 136, 229, .55);
  outline: none;
}

.tp-panel { display: grid; gap: 1rem; }

.tp-fields, .tp-actions, .tp-paste {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: flex-end;
}

.tp-field { display: grid; gap: .25rem; flex: 1 1 12rem; }
.tp-field-wide { flex: 2 1 18rem; }
.tp-field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.tp-field input, .tp-field select {
  padding: .5rem .6rem;
  border-radius: 10px;
  border: 1px solid rgba(30, 136, 229, .3);
  background: var(--surface);
  font: inherit;
  min-height: 44px;
}

/* The poster is the reward for filling every spot, so it is plainly dead until
   the team is complete and plainly the main action once it is. */
#tp-poster:disabled { opacity: .5; cursor: not-allowed; }

/* Both classes plus the id, so this beats the site-wide .button:hover fill -
   which otherwise washes the filled state out to a 10% tint. */
.tp-actions #tp-poster.is-ready,
.tp-actions #tp-poster.is-ready:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.tp-note { font-size: .85rem; }

/* ---- the slot modal ---- */

/* [hidden] loses to display:flex, so the closed state has to say so. */
.tp-modal[hidden] { display: none; }

.tp-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 27, 42, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.tp-modal-card {
  position: relative;      /* the saved-players panel sits over it */
  background: var(--surface, #fff);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(11, 27, 42, .35);
  width: min(920px, 100%);
  margin: auto;
}

.tp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(30, 136, 229, .2);
}
.tp-modal-head h2 { margin: 0; font-size: 1.1rem; }

.tp-modal-x {
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  min-width: 44px;
  min-height: 44px;
}

.tp-modal-body { padding: 1rem; }

@media (max-width: 620px) {
  .tp-photo { padding: .5rem; }
  .tp-actions .button, .tp-paste .button { flex: 1 1 10rem; }
  .tp-modal { padding: 0; }
  .tp-modal-card { border-radius: 0; min-height: 100%; }
}

/* The one action on a shared team that changes anything on this device. */
.tp-actions .is-keep, .tp-actions .is-keep:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* The only control here that destroys anything. Quiet until you reach for it. */
.tp-danger { color: #B3261E; border-color: rgba(179, 38, 30, .35); }
.tp-danger:hover { background: rgba(179, 38, 30, .08); border-color: #B3261E; }

/* ---- the "more" drawer ---- */

.tp-more { border-top: 1px solid rgba(30, 136, 229, .18); padding-top: .75rem; }

.tp-more > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  padding: .5rem 1rem;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  min-height: 44px;
  line-height: 1.7;
}
.tp-more > summary::-webkit-details-marker { display: none; }
.tp-more > summary::after { content: " \25BE"; }
.tp-more[open] > summary::after { content: " \25B4"; }
.tp-more > summary:hover { background: rgba(22, 104, 196, .08); border-color: var(--accent); }

.tp-more-body { display: grid; gap: 1rem; padding-top: 1rem; }

/* The one action the modal exists for. Both containers are listed because the
   slot actions moved out of the builder's own row into a row of their own. */
.cap-actions .is-primary, .cap-actions .is-primary:hover,
.tp-modal-actions .is-primary, .tp-modal-actions .is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.tp-advanced { margin-top: .75rem; font-size: .9rem; }
.tp-advanced > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  min-height: 44px;
  line-height: 44px;
}
.tp-advanced-row { display: flex; gap: .5rem; margin-top: .5rem; }
.tp-advanced-row input { flex: 1 1 auto; padding: .45rem .6rem; border-radius: 10px; border: 1px solid rgba(0,0,0,.15); }

/* ---- the "more" drawer ---- */

.tp-more { border-top: 1px solid rgba(30, 136, 229, .18); padding-top: .75rem; }

.tp-more > summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  padding: .5rem 1rem;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  min-height: 44px;
  line-height: 1.7;
}
.tp-more > summary::-webkit-details-marker { display: none; }
.tp-more > summary::after { content: " \25BE"; }

.tp-advanced { margin-top: .75rem; font-size: .9rem; }
.tp-advanced > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  min-height: 44px;
  line-height: 44px;
}
.tp-advanced-row { display: flex; gap: .5rem; margin-top: .5rem; }
.tp-advanced-row input { flex: 1 1 auto; padding: .45rem .6rem; border-radius: 10px; border: 1px solid rgba(0,0,0,.15); }


/* Slot actions: their own row, under the builder's own buttons. */
.tp-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}

/* The stage reserves a line for the status pill so a message does not shove
   the layout around. In the modal nothing writes to it, so that reserved line
   was just a hole between the two button rows. */
.tp-modal .cap-status:not(.show) { display: none; }
