/* Beltchecker Brackets: the organizer's tools (functions_brackets_orgtools.php, 1 Dec 2026): copy as a new tournament,
   discount codes, the sign-up's Code field. Loaded by brackets.php, brackets_landing.php and bk_signup.php. */

/* Copy as a new tournament: the dialog */
dialog.bk-copydlg { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--bg, #fff); background-image: linear-gradient(var(--card, transparent), var(--card, transparent)); color: var(--ink, inherit); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
dialog.bk-copydlg::backdrop { background: rgba(8, 8, 14, .55); backdrop-filter: blur(4px); }
dialog.bk-copydlg form { padding: 20px; display: grid; gap: 12px; }
dialog.bk-copydlg h2 { margin: 0; font-size: 20px; display: flex; gap: 10px; align-items: center; }
dialog.bk-copydlg [data-copyfrom] { margin: -6px 0 0; }
dialog.bk-copydlg label { display: grid; gap: 6px; }
dialog.bk-copydlg .bk-copybtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
dialog.bk-copydlg.is-landing { background: var(--bc-surface, #fff); color: var(--bc-ink, #111); }
dialog.bk-copydlg.is-landing label span { font-size: 13px; font-weight: 600; color: var(--bc-muted, #666); }
dialog.bk-copydlg.is-landing input { min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--bc-line-strong, rgba(0, 0, 0, .16)); background: var(--bc-surface, #fff); color: var(--bc-ink, #111); font: inherit; }

/* The start page: a copy button beside each tournament */
.bkl-rowx { position: relative; }
.bkl-rowx.has-copy .bkl-row { padding-right: 58px; }
.bkl-copy { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--bc-line, rgba(0, 0, 0, .08)); background: var(--bc-surface, #fff); color: var(--bc-muted, #666); cursor: pointer; font-size: 15px; }
.bkl-copy:hover { color: var(--bc-ink, #111); border-color: var(--bc-line-strong, rgba(0, 0, 0, .2)); }

/* Settings: the copy card */
.copycard .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.copycard p { margin: 6px 0 0; }

/* Entry and payment: discount codes */
#codes .codelist { display: grid; gap: 8px; margin-bottom: 14px; }
#codes .coderow { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line, rgba(255, 255, 255, .1)); }
#codes .coderow.is-off { opacity: .6; }
#codes .coderow .codemain { display: flex; align-items: center; gap: 10px; min-width: 0; }
#codes .coderow .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#codes .coderow .codeoff { font-weight: 700; white-space: nowrap; }
#codes .coderow .pill { flex: none; }
#codes .coderow .codeuse { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#codes .coderow .btns { display: flex; gap: 6px; justify-content: flex-end; }
#codes .codegrid { display: grid; grid-template-columns: 1.3fr 1.2fr .8fr 1fr auto; gap: 10px; align-items: end; }
#codes .codeval { display: flex; gap: 6px; }
#codes .codeval input { min-width: 0; flex: 1; }
#codes .codeval select { width: auto; flex: 0 0 auto; }
#codes input[name=code] { text-transform: uppercase; }
@media (max-width: 720px) {
	#codes .codegrid { grid-template-columns: 1fr 1fr; }
	#codes .codegrid > button { grid-column: 1 / -1; }
	/* A phone: the code and its state on one line, uses and the buttons on the next; a long code is cut, never pushes */
	#codes .coderow { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 10px 10px 12px; }
	#codes .coderow .codemain { grid-column: 1 / -1; }
	#codes .coderow .codeuse { font-size: 13px; }
}

/* Athletes: the Export button is a small form */
.inline-form { display: inline-flex; margin: 0; }

/* Sign-up: the Code field */
.su-code .su-coderow { display: flex; gap: 8px; }
.su-code .su-coderow input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.su-code .su-sumline.bad { color: var(--red, #f87171); }
