

/* =======================
   Age Flex / Bars
   ======================= */
.age-flex {
    height: 24px;
    background: orange;
    border-radius: 4px;
    position: relative;
}
.age-flex .bar-label {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-weight: bold;
    font-size: 0.9em;
}

/* =======================
   Grids
   ======================= */
.referee-details-grid {
    display: grid;
    gap: 0.15rem;
    color: #fff;
    text-align: center;
    margin-top: 155px;
    z-index: 3;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
    width: 100%;
}

.referee-l-profiles-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    z-index: 2;
}

.referee-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

/* =======================
   Referee Card
   ======================= */
.referee-card {
    display: flex;
    justify-content: center;
    padding: 1rem;
}
.referee-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.referee-card-top {
    background: #333;
    border-radius: 0.5rem;
    color: #fff;
    max-width: 450px;
    padding: 1.25rem;
    width: 100%;
}


.referee-detail .referee detail-value {
    font-weight: bold;
    font-size: 0.8rem;
}

/* =======================
   Header Row: Name + Photo / Info
   ======================= */
.referee-age,
.referee-born,
.referee-union,
.referee-clubs {
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}
.referee-flex-container,
.referee-info {
    display: flex;
    flex-direction: column;
}
.referee-info { flex: 1; }
.referee-name {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    padding-right: 1rem;
    word-break: break-word;
}

/* Right Column: Photo */
.referee-photo {
    flex-shrink: 0;
    height: 140px;
    width: 140px;
    overflow: hidden;
}
.referee-photo img {
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(200,200,200,1) 60%, rgba(100,100,100,1) 100%);
    border: 3px solid white;
    border-radius: 50%;
    display: block;
    height: 120px;
    width: 120px;
    margin-top: 10px;
    margin-right: 20px;
    object-fit: cover;
}

/* Hero Mask Effects */
.referee-card-themed-hero-mask {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
.referee-card-themed-hero-mask__angle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    transform: rotate(45deg) translate(50%, 50%);
    transform-origin: bottom right;
    transition: transform 0.5s ease, width 0.5s ease, height 0.5s ease;
}
.referee-card-themed-hero-mask:hover .referee-card-themed-hero-mask__angle {
    width: 300%;
    height: 300%;
    transform: rotate(45deg) translate(0%, 0%);
}

/* =======================
   Tabs
   ======================= */
.referee-card-tabs {
    display: grid;
    gap: 0.25rem;
    grid-template-columns: repeat(5, 1fr);
    margin-top: 1rem;
}
.referee-tab-btn {
    background: #ffffff22;
    border-radius: 0.3rem;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 0;
    text-align: center;
    transition: background 0.2s;
    user-select: none;
}
.referee-tab-btn.active { background: #ffffff55; }
.referee-tab-btn:hover { background: #ffffff33; }

/* =======================
   Tab Content
   ======================= */
.referee-details { margin-bottom: 65px; }
.referee-detail .detail-label { color: white; font-size: 0.5625rem; }
.referee-detail .detail-value { font-size: 0.75rem; font-weight: bold; }
.refereeDetails { border-radius: 1rem; }
.referee-tab-content {
    display: none;
    transform: translateY(20px);
    transition: 0.4s ease;
}
.referee-tab-content.active {
    display: block;
    margin-bottom: 65px;
    padding-bottom: 65px;
}
.referee-tab-content.show {
    opacity: 1;
    transform: translateY(0);
}

/* =======================
   Referee Boxes
   ======================= */
.referee-box {
    flex: 1 1 250px;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.referee-box h3 { font-size: 1.1rem; font-weight: 600; text-align: left;}
.referee-box h3.box-title { margin-bottom: 0.8em; margin-top: 0px;}
.referee-box:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }

/* Career / Debut / Latest / Extreme / Average Boxes */
.career-box {color: #333; }
.debut-box { background: var(--primary-color); color: #fff; }
.most-box { background: var(--primary-color); color: white; max-width: 250px; }
.fewest-box { background: var(--secondary-color); color: white; max-width: 250px; }

.average-box { 
	background: #fff;
	color: #333;	
	display: flex;
	flex-direction: column;	 
 	justify-content: space-between;
 	height: 100%;
	max-width: 250px; 
	margin: 0 auto; 
	position: relative;
	padding-bottom: 10px;
	height: 220px;
}

.average-box:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.avg-big { font-size: 2rem; font-weight: 700; color: var(--primary-color); }
.avg-details { font-size: 0.9rem; color: #666; line-height: 1.3; margin-top: 0.25rem; }

.average-box .avg-big,
.average-box .stat-label {
    display: block;
    width: 100%;
}

.average-box .stat-label {
    margin-top: 0.25rem;   /* adjust space as needed */
}


/* =======================
   Career / Stats Layout
   ======================= */

.career-stats { 
	display: flex; 
	justify-content: space-around; 
	gap: 20px; 
	align-items: flex-start; 
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    align-items: flex-start;
}

.stat-column { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-size: 14px; color: var(--primary-color); }
.debut-row { display: flex; justify-content: center; align-items: center; gap: 20px; }
.team-column { display: flex; flex-direction: column; align-items: center; text-align: center; }
.team-column img { width: 40px; height: 40px; margin-bottom: 4px; }
.score-column .score { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.match-date { font-size: 0.8em; text-align: center; }

/* Games per Season Bars */
.games-season-box .progress-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.season-label { width: 60px; font-size: 0.8em; text-align: right; }

.progress-segment {
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: var(--primary-color);
    transition: width 1s ease;
}
.progress-count { min-width: 30px; width: 30px; font-size: 0.8em; font-weight: bold; color: var(--secondary-color); text-align: left; }

/* Game Details / Extreme Games */
.game-details { display: flex; flex-direction: row; align-items: center; justify-content: center; text-align: center; gap: 8px; margin-top: 10px; }
.game-details img { width: 25px; height: 25px; object-fit: contain; margin: 0 4px; }

/* Latest Games Sparkline */
.sparkline { display: flex; flex-wrap: nowrap; gap: 5px; justify-content: space-between; overflow-x: auto; padding-bottom: 5px; }
.match-column { font-family: sans-serif; min-width: 50px; text-align: center; flex: 1; }
.opposition-crest { display: block; height: 30px; width: 30px; margin: 0 auto 5px; }
.match-score { font-size: 14px; color: #222; }

/* Competition Helper */
.competition { display: flex; align-items: center; margin-top: 0.5rem; }
.competition img { width: 24px; height: 24px; margin-right: 0.5rem; }
.competition-row { margin-bottom: 4px; font-size: 0.8em; }



/* =======================
   Games per Season Bars
   ======================= */

.games-season-box {
    max-width: 350px;
    width: 100%;
    margin: 0 auto;
}

.games-season-box h3 {
    color: var(--primary-color);
    text-align: left;
}

.games-season-box .season-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.games-season-box .progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.games-season-box .progress-row span.season-label {
    font-size: 0.5em;
    width: 80px;
    text-align: center;
    flex-shrink: 0; /* keep label fixed width */
}

.games-season-box .progress-bar {
    flex: 1;
    height: 12px;
    border-radius: 4px;
    background: #eee;
    overflow: hidden;
    position: relative;
}

.games-season-box .progress-bar div[data-width] {
    height: 100%;
    width: 0; /* animate with JS */
    border-radius: 4px;
    transition: width 1s ease;
    background: var(--primary-color);
}

/* Totals after bar */
.games-season-box .seasonTotals {
    font-size: 0.5em;
    color: var(--secondary-color);
    font-weight: bold;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.5s ease;
    margin-left: 5px;
}


.game-date {
	font-size: 0.8em;
}


/* --------
 Watermark
----------*/

/* Referee Card Watermark */
.referee-card-themed-hero-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* allows clicks through the mask */
    overflow: hidden;
    border-radius: 0.5rem; /* match your card rounding */
    z-index: 0;
}

.referee-card-themed-hero-mask__angle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    transform: rotate(45deg) translate(50%, 50%);
    transform-origin: bottom right;
    opacity: 0.15; /* watermark transparency */
    background: #fff; /* fallback */
}

.referee-card-themed-hero-mask__logo {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 80px;
    height: 80px;
    opacity: 0.08; /* subtle watermark */
    z-index: 0;
    pointer-events: none;
}



/* =======================
   Media Queries
   ======================= */
@media (max-width: 600px) { .referee-box { flex: 1 1 100%; } }
@media (max-width: 400px) {
    .calendar-date { height: 60px; width: 48px; }
    .referee-card-header { flex-direction: column; align-items: center; }
    .referee-info { margin-bottom: 0.5rem; text-align: center; }
    .referee-photo { height: 120px; width: 120px; margin-top: 0.5rem; }
    .match-column { min-width: 50px; }
}
