/* ── Overlay ─────────────────────────────────────────────── */
.tp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.tp-overlay.open { display: block; }

/* ── Panel ───────────────────────────────────────────────── */
.tp-panel {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100%;
  background: #f8fafc;
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
  z-index: 1000;
  overflow-y: auto;
  box-sizing: border-box;
  flex-direction: column;
}
.tp-panel.open { display: flex; }

/* ── Header ──────────────────────────────────────────────── */
.tp-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1e293b;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.tp-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}
.tp-close {
  background: rgba(255,255,255,.1);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  line-height: 1;
}
.tp-close:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── Form body ───────────────────────────────────────────── */
.tp-panel form {
  padding: 24px 24px 40px;
  flex: 1;
}

/* ── Labels & inputs ─────────────────────────────────────── */
.tp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 16px 0 5px;
  letter-spacing: .01em;
}
.tp-label:first-child { margin-top: 4px; }

.tp-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 0;
  font-family: inherit;
}
.tp-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.tp-input::placeholder { color: #94a3b8; }

/* ── Add button (inline with input) ─────────────────────── */
.tp-btn-add {
  padding: 9px 16px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.tp-btn-add:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ── Email / player list ─────────────────────────────────── */
.tp-email-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tp-email-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #334155;
}
.tp-email-list li button {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.tp-email-list li button:hover { color: #b91c1c; }

/* ── Error ───────────────────────────────────────────────── */
.tp-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Submit button ───────────────────────────────────────── */
.tp-btn-submit {
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  font-family: inherit;
  letter-spacing: -.01em;
}
.tp-btn-submit:hover { background: #1d4ed8; transform: translateY(-1px); }
.tp-btn-submit:active { transform: translateY(0); }

/* ── Delete button ───────────────────────────────────────── */
.tp-btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.tp-btn-delete:hover { background: #fee2e2; border-color: #fca5a5; }

/* ── Mobile — bottom sheet ───────────────────────────────── */
@media (max-width: 640px) {
  .tp-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 90dvh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
  }
  .tp-header { border-radius: 20px 20px 0 0; }
  .tp-panel form { padding: 20px 20px 40px; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tp-tabs {
  display: flex;
  border-bottom: 1.5px solid #e2e8f0;
  margin: 0 0 20px;
  gap: 2px;
}
.tp-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.tp-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.tp-tab:hover:not(.active) { color: #334155; }

/* ── Player list ─────────────────────────────────────────── */
.tp-player-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
}
.tp-player-item.pending { opacity: 0.65; }
.tp-player-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tp-player-info {
  flex: 1;
  min-width: 0;
}
.tp-player-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-player-sub {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-player-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.tp-captain-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #cbd5e1;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color .15s;
  line-height: 1;
  font-family: inherit;
}
.tp-captain-btn.active { color: #f59e0b; }
.tp-captain-btn:hover  { color: #f59e0b; }
.tp-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #cbd5e1;
  padding: 3px 5px;
  border-radius: 4px;
  transition: color .15s;
  line-height: 1;
}
.tp-remove-btn:hover { color: #ef4444; }

/* ── Add player section ──────────────────────────────────── */
.tp-add-player-section {
  border-top: 1.5px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tp-add-player-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tp-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tp-btn-add-player { width: 100%; }
