/* ============================================================
   Game Contest — Frontend Form Styles
   ============================================================ */

.gc-frontend-wrap {
	max-width: 680px;
	margin: 0 auto;
	font-family: inherit;
}

/* ---- Header ------------------------------------------------ */
.gc-contest-header {
	margin-bottom: 28px;
}

.gc-contest-title {
	margin: 0 0 10px;
	font-size: 1.6em;
	line-height: 1.3;
}

.gc-contest-description {
	color: #555;
	font-size: .97em;
	line-height: 1.6;
}

/* ---- Messages ---------------------------------------------- */
.gc-form-messages {
	margin-bottom: 16px;
	min-height: 0;
}

.gc-form-messages:empty {
	display: none;
}

.gc-form-msg {
	padding: 12px 16px;
	border-radius: 5px;
	font-size: .95em;
	line-height: 1.5;
}

.gc-form-msg--success {
	background: #edfaf1;
	border: 1px solid #5cb85c;
	color: #2e6930;
}

.gc-form-msg--error {
	background: #fdf2f2;
	border: 1px solid #d9534f;
	color: #7a1f1f;
}

/* ---- Sections --------------------------------------------- */
.gc-questions-section {
	margin-bottom: 32px;
}

.gc-section-title {
	font-size: 1.05em;
	font-weight: 700;
	margin: 0 0 4px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e2e8f0;
}

.gc-tiebreaker-section .gc-section-title {
	color: #b45309;
	border-color: #fde68a;
}

.gc-tiebreaker-note {
	margin: 4px 0 16px;
	font-size: .875em;
	color: #78716c;
	font-style: italic;
}

/* ---- Fields ----------------------------------------------- */
.gc-field-wrap {
	margin-bottom: 20px;
}

.gc-field-label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	font-size: .95em;
}

.gc-required {
	color: #e53e3e;
	margin-left: 2px;
}

.gc-field-desc {
	margin: 0 0 6px;
	font-size: .875em;
	color: #666;
}

.gc-input {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 5px;
	font-size: .95em;
	font-family: inherit;
	background: #fff;
	color: #1e293b;
	box-sizing: border-box;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}

.gc-input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.gc-input.gc-field-invalid {
	border-color: #e53e3e;
}

.gc-input-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

/* ---- Checkbox group --------------------------------------- */
.gc-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gc-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: normal;
	cursor: pointer;
	font-size: .95em;
	padding: 9px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #fff;
	transition: background .15s, border-color .15s, box-shadow .15s;
}

.gc-checkbox-label:hover {
	border-color: #c7d2fe;
	background: #fafbff;
}

/* Persistent "checked" look — stays visible after the checkbox loses focus,
   so it's clear which option(s) were selected once you click elsewhere. */
.gc-checkbox-label:has(.gc-input-checkbox:checked) {
	background: #eef2ff;
	border-color: #6366f1;
	box-shadow: 0 0 0 1px rgba(99,102,241,.25);
	font-weight: 600;
	color: #4338ca;
}

.gc-input-checkbox {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: #6366f1;
}

/* ---- Field error ------------------------------------------ */
.gc-field-error {
	display: block;
	margin-top: 4px;
	font-size: .85em;
	color: #e53e3e;
	min-height: 0;
}

.gc-field-error:empty {
	display: none;
}

/* ---- Submit ----------------------------------------------- */
.gc-submit-row {
	margin-top: 8px;
	padding-top: 20px;
	border-top: 1px solid #e2e8f0;
}

.gc-submit-btn {
	display: inline-block;
	padding: 11px 28px;
	background: #6366f1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, transform .1s;
	font-family: inherit;
}

.gc-submit-btn:hover {
	background: #4f46e5;
}

.gc-submit-btn:active {
	transform: scale(.98);
}

.gc-submit-btn:disabled {
	opacity: .65;
	cursor: not-allowed;
}

/* ---- States ----------------------------------------------- */
.gc-login-required,
.gc-not-active {
	padding: 20px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	text-align: center;
	color: #475569;
}

.gc-login-required a,
.gc-not-active a {
	color: #6366f1;
}

.gc-no-questions {
	color: #64748b;
	font-style: italic;
}

/* ---- Success state ---------------------------------------- */
.gc-entry-form.gc-submitted {
	opacity: .5;
	pointer-events: none;
}

/* ============================================================
   Contest listing  ([game_contests])
   ============================================================ */

.gc-contests-list {
	display: flex;
	flex-direction: column;
	gap: 40px;
	max-width: 720px;
}

/* ---- Section headings ------------------------------------- */
.gc-contests-section {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.gc-contests-section__heading {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1em;
	font-weight: 700;
	margin: 0 0 4px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e2e8f0;
	color: #1e293b;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.gc-contests-section--closed .gc-contests-section__heading {
	color: #94a3b8;
	border-color: #f1f5f9;
}

.gc-status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.gc-status-dot--active {
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}

.gc-status-dot--closed {
	background: #94a3b8;
}

.gc-contests-count {
	margin-left: auto;
	font-size: .78em;
	font-weight: 700;
	background: #e2e8f0;
	color: #475569;
	border-radius: 20px;
	padding: 2px 10px;
	text-transform: none;
	letter-spacing: 0;
}

.gc-contests-section--active .gc-contests-count {
	background: #dcfce7;
	color: #15803d;
}

/* ---- Contest cards ---------------------------------------- */
.gc-contest-card {
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 12px rgba(0,0,0,.06);
	transition: box-shadow .2s, transform .2s;
}

.gc-contest-card--active:hover {
	box-shadow: 0 8px 28px rgba(99,102,241,.14);
	transform: translateY(-2px);
}

.gc-contest-card--closed {
	background: #f8fafc;
	border-color: #e8edf5;
	opacity: .8;
}

/* ---- Card top strip with status pill ---------------------- */
.gc-contest-card__header {
	padding: 12px 20px 0;
}

/* ---- Status pill ------------------------------------------ */
.gc-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .75em;
	font-weight: 700;
	border-radius: 20px;
	padding: 3px 10px;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.gc-status-pill--open {
	background: #dcfce7;
	color: #15803d;
}

.gc-status-pill__dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	animation: gc-pulse 1.8s ease-in-out infinite;
}

@keyframes gc-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .5; transform: scale(.85); }
}

.gc-status-pill--closed {
	background: #f1f5f9;
	color: #94a3b8;
}

/* ---- Card body -------------------------------------------- */
.gc-contest-card__body {
	padding: 14px 20px 16px;
}

.gc-contest-card__title {
	margin: 0 0 8px;
	font-size: 1.15em;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.3;
}

.gc-contest-card--closed .gc-contest-card__title {
	color: #64748b;
}

.gc-contest-card__desc {
	color: #555;
	font-size: .92em;
	line-height: 1.65;
	margin-bottom: 12px;
}

.gc-contest-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: .83em;
	color: #64748b;
}

.gc-meta-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.gc-meta-item svg {
	flexex-shrink: 0;
	color: #94a3b8;
}

.gc-meta-item strong {
	color: #374151;
}

.gc-meta-item--deadline strong {
	color: #b45309;
}

.gc-meta-item--deadline {
	color: #92400e;
}

/* ---- Card footer with action ------------------------------ */
.gc-contest-card__footer {
	padding: 0 20px 20px;
	background: transparent;
}

.gc-contest-card__btn {
	display: inline-block;
	text-decoration: none;
}

/* ---- Toggle button states --------------------------------- */
.gc-toggle-form-btn[aria-expanded="true"] {
	background: #4f46e5;
}

.gc-toggle-form-btn[aria-expanded="true"]::after {
	content: ' ▲';
	font-size: .75em;
}

.gc-toggle-form-btn[aria-expanded="false"]::after {
	content: ' ▼';
	font-size: .75em;
}

/* ---- Inline collapsible form ------------------------------ */
.gc-inline-form-wrap {
	margin: 16px 20px 0;
	padding: 20px;
	border: 1px dashed #c7d2fe;
	border-radius: 8px;
	background: #fafbff;
	overflow: hidden;
}

.gc-inline-form-wrap .gc-frontend-wrap {
	max-width: 100%;
}

/* The standalone entry form gets framed as its own card with a visible shadow */
.gc-contest-board {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 6px 24px rgba(0,0,0,.09);
	padding: 28px 32px 24px;
}

/* ...but when it's nested inside an inline form card (contest list), the
   dashed wrapper already defines that area — don't double up the framing. */
.gc-inline-form-wrap .gc-contest-board {
	background: transparent;
	border: none;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

.gc-inline-form-wrap .gc-contest-header {
	display: none;
}

/* ---- No contests ------------------------------------------ */
.gc-no-contests {
	color: #64748b;
	font-style: italic;
	text-align: center;
	padding: 24px 0;
}

/* ============================================================
   Standings / Leaderboard  ([game_contest_standings])
   ============================================================ */

.gc-standings-wrap {
	max-width: 720px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.gc-standings-block {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 6px 24px rgba(0,0,0,.10);
	padding: 24px 28px 20px;
	overflow: hidden;
}

.gc-standings-block + .gc-standings-block {
	margin-top: 0;
}

.gc-standings-title {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
	color: #1e293b;
}

.gc-table-responsive {
	overflow-x: auto;
}

.gc-standings-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .92em;
}

.gc-standings-table th,
.gc-standings-table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.gc-standings-table thead th {
	font-weight: 700;
	color: #475569;
	background: #f8fafc;
	font-size: .82em;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.gc-standings-table tbody tr:last-child td {
	border-bottom: none;
}

.gc-standings-table tbody tr:hover {
	background: #f8fafc;
}

.gc-standings-rank {
	width: 56px;
	font-weight: 700;
	color: #64748b;
}

.gc-standings-score {
	font-weight: 700;
	color: #1e293b;
}


/* Top 3 highlight */
.gc-rank-top .gc-standings-rank {
	display: inline-block;
}

.gc-rank-1 { background: #fffbeb; }
.gc-rank-1 .gc-standings-rank { color: #b45309; }

.gc-rank-2 { background: #f8fafc; }
.gc-rank-2 .gc-standings-rank { color: #475569; }

.gc-rank-3 { background: #fdf6f0; }
.gc-rank-3 .gc-standings-rank { color: #9a3412; }

/* ============================================================
   Standings — Premium Design Enhancements
   ============================================================ */

/* Header row: title + search side by side */
.gc-standings-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 2px solid #e2e8f0;
}

.gc-standings-header .gc-standings-title {
	margin: 0;
	padding: 0;
	border: none;
}

/* Search input */
.gc-standings-controls {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gc-standings-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.gc-search-icon {
	position: absolute;
	left: 10px;
	color: #94a3b8;
	display: flex;
	pointer-events: none;
}

.gc-standings-search {
	padding: 7px 12px 7px 32px;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	font-size: .85em;
	font-family: inherit;
	background: #f8fafc;
	color: #1e293b;
	width: 200px;
	transition: border-color .15s, box-shadow .15s, width .2s;
	outline: none;
}

.gc-standings-search:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,.12);
	background: #fff;
	width: 240px;
}

/* Table */
.gc-standings-table {
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e8edf5;
}

.gc-standings-table thead th {
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	font-size: .78em;
	letter-spacing: .06em;
	padding: 12px 16px;
	color: #64748b;
}

.gc-standings-table td {
	padding: 11px 16px;
}

.gc-standings-table tbody tr {
	transition: background .12s;
}

.gc-standings-table tbody tr:hover {
	background: #f0f4ff;
}

/* Medals */
.gc-medal {
	font-size: 1.1em;
	line-height: 1;
}

/* Rank number for non-top-3 */
.gc-rank-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	background: #f1f5f9;
	border-radius: 50%;
	font-size: .8em;
	font-weight: 700;
	color: #64748b;
}

/* Top 3 rows — refined */
.gc-rank-1 {
	background: linear-gradient(90deg, #fffbeb 0%, #fef9ec 100%);
}

.gc-rank-1 td {
	border-bottom-color: #fde68a;
}

.gc-rank-2 {
	background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
}

.gc-rank-2 td {
	border-bottom-color: #e2e8f0;
}

.gc-rank-3 {
	background: linear-gradient(90deg, #fff7ed 0%, #fdf6f0 100%);
}

.gc-rank-3 td {
	border-bottom-color: #fed7aa;
}

/* Empty state */
.gc-standings-empty {
	text-align: center;
	color: #94a3b8;
	font-style: italic;
	padding: 28px 16px !important;
}

/* Footer: info + pagination */
.gc-standings-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.gc-standings-info {
	font-size: .82em;
	color: #94a3b8;
}

/* Pagination */
.gc-standings-pagination {
	display: flex;
	align-items: center;
	gap: 4px;
}

.gc-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	font-size: .82em;
	font-weight: 600;
	cursor: pointer;
	transition: background .12s, border-color .12s, color .12s;
	font-family: inherit;
}

.gc-page-btn:hover:not(:disabled):not(.gc-page-btn--active) {
	background: #f0f4ff;
	border-color: #6366f1;
	color: #6366f1;
}

.gc-page-btn--active {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
	cursor: default;
}

.gc-page-btn--disabled {
	opacity: .4;
	cursor: not-allowed;
}

.gc-page-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	color: #94a3b8;
	font-size: .85em;
}

@media (max-width: 480px) {
	.gc-standings-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.gc-standings-search {
		width: 100%;
	}

	.gc-standings-search:focus {
		width: 100%;
	}

	.gc-standings-footer {
		flex-direction: column;
		align-items: flex-start;
	}
}
