/* =========================================================================
   تحدي التوقعات — Stadium Night theme
   Palette: pitch-night green/black + floodlight gold + chalk white + whistle red
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@600;800;900&family=Tajawal:wght@400;500;700&display=swap');

.wcp-app {
	--wcp-pitch: #0B1F17;
	--wcp-pitch-2: #102B20;
	--wcp-card: #143329;
	--wcp-card-line: rgba(244, 241, 232, 0.10);
	--wcp-floodlight: #FFC93C;
	--wcp-floodlight-soft: rgba(255, 201, 60, 0.35);
	--wcp-whistle: #FF5A36;
	--wcp-chalk: #F4F1E8;
	--wcp-chalk-dim: rgba(244, 241, 232, 0.62);
	--wcp-green-ok: #3DDC84;

	font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
	background: radial-gradient(120% 140% at 50% -10%, var(--wcp-pitch-2) 0%, var(--wcp-pitch) 55%);
	color: var(--wcp-chalk);
	border-radius: 22px;
	padding: 0 0 28px;
	max-width: 720px;
	margin: 0 auto;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.35);
	position: relative;
}

.wcp-app * { box-sizing: border-box; }

/* faint pitch-line texture on the whole app background */
.wcp-app::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.05;
	background-image: repeating-linear-gradient(0deg, transparent 0 38px, var(--wcp-chalk) 38px 39px);
}

/* ---------------------------------------------------------------- header */

.wcp-app-header {
	position: sticky;
	top: 0;
	z-index: 5;
	padding: 22px 20px 0;
	background: linear-gradient(180deg, var(--wcp-pitch-2) 70%, transparent);
}

.wcp-app-title {
	font-family: 'Cairo', sans-serif;
	font-weight: 900;
	font-size: 19px;
	margin: 0 0 16px;
	text-align: center;
	letter-spacing: 0.2px;
}

.wcp-app-tabs {
	position: relative;
	display: flex;
	background: rgba(0,0,0,0.28);
	border: 1px solid var(--wcp-card-line);
	border-radius: 999px;
	padding: 5px;
	gap: 2px;
}

.wcp-app-tab {
	flex: 1;
	position: relative;
	z-index: 2;
	background: none;
	border: none;
	color: var(--wcp-chalk-dim);
	font-family: 'Cairo', sans-serif;
	font-weight: 800;
	font-size: 14px;
	padding: 11px 4px;
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.25s ease;
}

.wcp-app-tab.active {
	color: #1c1404;
}

.wcp-app-tab-indicator {
	position: absolute;
	top: 5px;
	bottom: 5px;
	left: 0;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--wcp-floodlight), #E8A819);
	box-shadow: 0 0 18px var(--wcp-floodlight-soft);
	transition: transform 0.35s cubic-bezier(.65,0,.35,1), width 0.35s cubic-bezier(.65,0,.35,1);
	z-index: 1;
}

/* ---------------------------------------------------------------- body */

.wcp-app-body {
	position: relative;
	padding: 18px 18px 0;
}

.wcp-app-panel {
	display: none;
	animation: wcpPanelIn 0.38s ease;
}

.wcp-app-panel.active {
	display: block;
}

@keyframes wcpPanelIn {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.wcp-empty {
	text-align: center;
	padding: 36px 10px;
	color: var(--wcp-chalk-dim);
	font-size: 14px;
}

.wcp-points-hint {
	text-align: center;
	font-size: 12px;
	color: var(--wcp-chalk-dim);
	margin: 0 0 16px;
	padding: 8px 10px;
	border: 1px dashed var(--wcp-card-line);
	border-radius: 10px;
}

/* ---------------------------------------------------------------- match card (signature element) */

.wcp-match-card {
	position: relative;
	background: linear-gradient(160deg, var(--wcp-card), #0e2a21);
	border: 1px solid var(--wcp-card-line);
	border-radius: 16px;
	padding: 16px 16px 14px;
	margin-bottom: 14px;
	transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.wcp-match-card.wcp-card-success {
	border-color: var(--wcp-floodlight);
	box-shadow: 0 0 0 1px var(--wcp-floodlight), 0 0 32px var(--wcp-floodlight-soft);
}

.wcp-match-meta {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--wcp-chalk-dim);
	margin-bottom: 12px;
}

.wcp-match-teams {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.wcp-team {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}

.wcp-flag { font-size: 26px; line-height: 1; }

.wcp-team-name {
	font-family: 'Cairo', sans-serif;
	font-weight: 700;
	font-size: 13px;
}

.wcp-score-board {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	background: rgba(0,0,0,0.35);
	border: 1px solid var(--wcp-card-line);
	border-radius: 12px;
	padding: 8px 8px;
}

.wcp-sep {
	color: var(--wcp-chalk-dim);
	font-weight: 800;
}

.wcp-final-score {
	font-family: 'Cairo', sans-serif;
	font-weight: 900;
	font-size: 22px;
	display: flex;
	gap: 6px;
	padding: 0 6px;
	color: var(--wcp-floodlight);
}

/* digit stepper — the signature interaction */
.wcp-stepper {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.wcp-step-btn {
	width: 26px;
	height: 22px;
	border-radius: 7px;
	border: 1px solid var(--wcp-card-line);
	background: rgba(244,241,232,0.06);
	color: var(--wcp-chalk);
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.wcp-step-btn:hover:not(:disabled) { background: rgba(255,201,60,0.18); }
.wcp-step-btn:active:not(:disabled) { transform: scale(0.88); }
.wcp-step-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.wcp-digit-box {
	width: 40px;
	height: 40px;
	border-radius: 9px;
	background: #08160F;
	border: 1px solid rgba(255,201,60,0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.wcp-digit {
	font-family: 'Cairo', sans-serif;
	font-weight: 900;
	font-size: 22px;
	color: var(--wcp-floodlight);
	text-shadow: 0 0 10px var(--wcp-floodlight-soft);
	display: inline-block;
}

.wcp-digit.wcp-digit-pulse {
	animation: wcpDigitFlip 0.22s ease;
}

@keyframes wcpDigitFlip {
	0%   { transform: translateY(0) scale(1); }
	40%  { transform: translateY(-6px) scale(1.15); }
	100% { transform: translateY(0) scale(1); }
}

.wcp-match-footer {
	margin-top: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 36px;
}

.wcp-btn-predict {
	background: linear-gradient(180deg, var(--wcp-floodlight), #E8A819);
	color: #1c1404;
	border: none;
	padding: 10px 26px;
	border-radius: 10px;
	font-family: 'Cairo', sans-serif;
	font-weight: 800;
	font-size: 13px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(255,201,60,0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wcp-btn-predict:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,201,60,0.35); }
.wcp-btn-predict:active { transform: translateY(0) scale(0.97); }

.wcp-save-msg { font-size: 12px; font-weight: 600; }

.wcp-points-pill {
	background: rgba(61,220,132,0.12);
	color: var(--wcp-green-ok);
	border-radius: 20px;
	padding: 7px 16px;
	font-size: 12px;
	font-weight: 700;
}

.wcp-points-pill.wcp-muted {
	background: rgba(244,241,232,0.06);
	color: var(--wcp-chalk-dim);
}

/* ---------------------------------------------------------------- leaderboard / podium */

.wcp-podium {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 10px;
	margin-bottom: 26px;
	padding-top: 10px;
}

.wcp-podium-step {
	flex: 1;
	max-width: 130px;
	background: linear-gradient(160deg, var(--wcp-card), #0e2a21);
	border: 1px solid var(--wcp-card-line);
	border-radius: 14px 14px 8px 8px;
	text-align: center;
	padding: 14px 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.wcp-podium-1 { padding-top: 22px; order: 2; border-color: var(--wcp-floodlight); box-shadow: 0 0 24px var(--wcp-floodlight-soft); }
.wcp-podium-2 { order: 1; opacity: 0.92; }
.wcp-podium-3 { order: 3; opacity: 0.85; }

.wcp-medal { font-size: 30px; }

.wcp-podium-name {
	font-family: 'Cairo', sans-serif;
	font-weight: 700;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 110px;
}

.wcp-podium-points {
	font-family: 'Cairo', sans-serif;
	font-weight: 900;
	font-size: 20px;
	color: var(--wcp-floodlight);
}

.wcp-leaderboard-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.wcp-leaderboard-table th,
.wcp-leaderboard-table td {
	padding: 11px 10px;
	text-align: right;
	border-bottom: 1px solid var(--wcp-card-line);
}

.wcp-leaderboard-table th {
	color: var(--wcp-chalk-dim);
	font-weight: 600;
	font-size: 11px;
}

.wcp-leaderboard-table tr.wcp-me {
	background: rgba(255,201,60,0.08);
}

.wcp-you-tag {
	color: var(--wcp-floodlight);
	font-size: 11px;
}

/* ---------------------------------------------------------------- my predictions */

.wcp-total-points-banner {
	background: linear-gradient(135deg, #0e2a21, #08160f);
	border: 1px solid var(--wcp-floodlight-soft);
	border-radius: 16px;
	padding: 18px 20px;
	margin-bottom: 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
}

.wcp-total-digit {
	font-family: 'Cairo', sans-serif;
	font-weight: 900;
	font-size: 30px;
	color: var(--wcp-floodlight);
	text-shadow: 0 0 14px var(--wcp-floodlight-soft);
}

.wcp-subheading {
	font-family: 'Cairo', sans-serif;
	margin: 22px 0 10px;
	font-size: 14px;
	color: var(--wcp-chalk-dim);
}

.wcp-mypred-row {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(244,241,232,0.04);
	border: 1px solid var(--wcp-card-line);
	border-radius: 12px;
	padding: 10px 12px;
	margin-bottom: 8px;
	font-size: 12px;
	flex-wrap: wrap;
}

.wcp-mypred-row.wcp-hit-exact { border-color: rgba(61,220,132,0.4); }
.wcp-mypred-row.wcp-hit-partial { border-color: rgba(255,201,60,0.4); }
.wcp-mypred-row.wcp-hit-miss { opacity: 0.7; }

.wcp-mypred-icon { font-size: 16px; }
.wcp-mypred-teams { font-weight: 700; flex: 1; min-width: 140px; }
.wcp-mypred-score, .wcp-mypred-final { color: var(--wcp-chalk-dim); }
.wcp-mypred-points {
	font-family: 'Cairo', sans-serif;
	font-weight: 800;
	color: var(--wcp-floodlight);
	margin-right: auto;
}

/* ---------------------------------------------------------------- login modal (shared) */

.wcp-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(8,15,11,0.72);
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

.wcp-modal-overlay.open { display: flex; }

.wcp-modal {
	background: var(--wcp-pitch-2, #102B20);
	color: var(--wcp-chalk, #F4F1E8);
	border: 1px solid rgba(255,201,60,0.25);
	border-radius: 16px;
	padding: 24px;
	width: 90%;
	max-width: 380px;
	position: relative;
	font-family: 'Tajawal', sans-serif;
}

.wcp-modal-close {
	position: absolute;
	top: 10px;
	left: 14px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--wcp-chalk-dim, #94a3b8);
}

.wcp-tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid rgba(244,241,232,0.12); }

.wcp-tab {
	flex: 1;
	background: none;
	border: none;
	padding: 10px;
	cursor: pointer;
	font-weight: 700;
	font-family: 'Cairo', sans-serif;
	color: var(--wcp-chalk-dim, #94a3b8);
	border-bottom: 2px solid transparent;
}

.wcp-tab.active { color: var(--wcp-floodlight, #FFC93C); border-bottom-color: var(--wcp-floodlight, #FFC93C); }

.wcp-form { display: flex; flex-direction: column; gap: 10px; }

.wcp-form input {
	padding: 11px 12px;
	border: 1px solid rgba(244,241,232,0.18);
	background: rgba(0,0,0,0.25);
	color: var(--wcp-chalk, #F4F1E8);
	border-radius: 9px;
	font-size: 14px;
}

.wcp-btn-primary {
	background: linear-gradient(180deg, var(--wcp-floodlight, #FFC93C), #E8A819);
	color: #1c1404;
	border: none;
	padding: 11px;
	border-radius: 9px;
	font-family: 'Cairo', sans-serif;
	font-weight: 800;
	cursor: pointer;
	margin-top: 4px;
}

.wcp-form-msg { font-size: 13px; color: var(--wcp-whistle, #FF5A36); min-height: 14px; margin: 0; }
.wcp-form-msg.success { color: var(--wcp-green-ok, #3DDC84); }

/* ---------------------------------------------------------------- confetti */

.wcp-confetti-layer {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 999999;
	overflow: hidden;
}

.wcp-confetti-piece {
	position: absolute;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	opacity: 0.95;
	will-change: transform, opacity;
	animation: wcpConfettiFall linear forwards;
}

@keyframes wcpConfettiFall {
	0%   { transform: translate(0,0) rotate(0deg); opacity: 1; }
	100% { transform: translate(var(--wcp-cx), var(--wcp-cy)) rotate(var(--wcp-cr)); opacity: 0; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 480px) {
	.wcp-app-title { font-size: 16px; }
	.wcp-team-name { font-size: 11px; }
	.wcp-digit-box { width: 34px; height: 34px; }
	.wcp-digit { font-size: 18px; }
	.wcp-podium-name { max-width: 80px; }
}

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	.wcp-app-panel,
	.wcp-digit.wcp-digit-pulse,
	.wcp-confetti-piece {
		animation: none !important;
	}
	.wcp-app-tab-indicator { transition: none !important; }
}
