*, *::before, *::after {
	box-sizing: border-box;
	margin:     0;
	padding:    0;
}

@font-face {
	font-family: 'Futura PT Book';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Book'), url('FuturaCyrillicBook.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Light';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Light'), url('FuturaCyrillicLight.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Medium';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Medium'), url('FuturaCyrillicMedium.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Demi';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Demi'), url('FuturaCyrillicDemi.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Heavy';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Heavy'), url('FuturaCyrillicHeavy.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Bold';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Bold'), url('FuturaCyrillicBold.woff') format('woff');
}


@font-face {
	font-family: 'Futura PT Extra Bold';
	font-style:  normal;
	font-weight: normal;
	src:         local('Futura PT Extra Bold'), url('FuturaCyrillicExtraBold.woff') format('woff');
}

:root {
	--bg:           #000000;
	--bg-card:      #141414;
	--bg-card-alt:  #1a1a1a;
	--border:       #2a2a2a;
	--border-light: #333333;
	--text:         #ffffff;
	--text-muted:   #888888;
	--text-dim:     #555555;
	--accent:       #b8e028;
	--accent-dim:   #8aaa1a;
	--live-dot:     #ff3b3b;
	--serve:        #b8e028;
	--won-set:      rgba(184, 224, 40, 0.12);
	--font:         'Futura PT Medium', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
	background:  var(--bg);
	color:       var(--text);
	font-family: var(--font);
	font-size:   18px;
	font-weight: 300;
	line-height: 1.5em;
	height:      100%;
	overflow-x:  hidden;
}

::-webkit-scrollbar {
	width: 4px;
}

::-webkit-scrollbar-track {
	background: var(--bg);
}

::-webkit-scrollbar-thumb {
	background:    var(--border-light);
	border-radius: 2px;
}

#tracker {
	padding:    0;
	min-height: 100vh;
}

/* ── 3-Spalten Widget-Grid ───────────────────────────────────── */
.widgets-grid {
	display:               grid;
	grid-template-columns: repeat(3, 1fr);
	gap:                   0;
	align-items:           start;
	border-top:            1px solid var(--border);
}

/* Schmale Screens: untereinander */
@media (max-width: 700px) {
	.widgets-grid {
		grid-template-columns: 1fr;
	}
}

/* Trennlinie zwischen den Spalten */
.widgets-grid > div + div {
	border-left: 1px solid var(--border);
}

/* ── Widget Sektion ──────────────────────────────────────────── */
.widget-section {
	min-height: 60px;
}

/* ── Widget-Header ───────────────────────────────────────────── */
.widget-header {
	padding:       8px 16px;
	display:       flex;
	align-items:   center;
	gap:           8px;
	border-bottom: 1px solid var(--border);
	position:      sticky;
	top:           37px; /* unterhalb tracker-header */
	z-index:       9;
	background:    var(--bg);
}

.widget-header--live {
	border-top: 2px solid var(--live-dot);
}

.widget-header--schedule {
	border-top: 2px solid rgba(184, 224, 40, 0.5);
}

.widget-header--results {
	border-top: 2px solid var(--border-light);
}

.widget-title-text {
	font-size:      15px;
	font-weight:    700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color:          var(--text);
}

.widget-title-sub {
	font-size:      14px;
	color:          var(--text-dim);
	letter-spacing: 0.05em;
}

/* ── Spielpause-Badge ────────────────────────────────────────── */
.break-badge {
	font-size:      14px;
	font-weight:    700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color:          var(--accent-dim);
}

.widget-subtitle {
	font-size:      14px;
	color:          var(--text-dim);
	letter-spacing: 0.05em;
}

.tracker-header {
	background:      var(--bg);
	border-bottom:   1px solid var(--border);
	padding:         8px 16px;
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	position:        sticky;
	top:             0;
	z-index:         10;
	height:          37px;
}

.tracker-header .title {
	font-size:      16px;
	font-weight:    700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color:          var(--text);
}

.tracker-header .updated {
	font-size:      15px;
	color:          var(--text-muted);
	letter-spacing: 0.05em;
}

.live-badge {
	display:        inline-flex;
	align-items:    center;
	gap:            5px;
	font-size:      15px;
	font-weight:    700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color:          var(--live-dot);
}

.live-badge .dot {
	width:         6px;
	height:        6px;
	border-radius: 50%;
	background:    var(--live-dot);
	animation:     pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity:   1;
		transform: scale(1);
	}
	50% {
		opacity:   0.4;
		transform: scale(0.7);
	}
}

.tournament-group {
	margin-bottom: 0;
}

.tournament-label {
	padding:        8px 16px;
	font-size:      15px;
	font-weight:    700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color:          var(--text-muted);
	background:     var(--bg);
	border-bottom:  1px solid var(--border);
	display:        flex;
	align-items:    center;
	gap:            8px;
}

.tournament-label .level-badge {
	padding:        1px 6px;
	border:         1px solid var(--border-light);
	border-radius:  2px;
	font-size:      14px;
	color:          var(--text-dim);
	letter-spacing: 0.08em;
}

.court-group {
	margin-bottom: 0;
}

.court-label {
	padding:        10px 16px;
	font-size:      13px;
	font-weight:    700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color:          var(--accent);
	background:     var(--bg);
	border-bottom:  1px solid var(--border);
	border-left:    3px solid var(--accent);
	display:        flex;
	align-items:    center;
}

.match-card {
	background:    var(--bg-card);
	border-bottom: 1px solid var(--border);
	padding:       0;
	transition:    background 0.15s;
}

.match-card:hover {
	background: var(--bg-card-alt);
}

.match-meta {
	padding:       7px 16px 4px;
	display:       flex;
	align-items:   center;
	gap:           10px;
	border-bottom: 1px solid var(--border);
}

.status-indicator {
	font-size:      14px;
	font-weight:    700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding:        2px 6px;
	border-radius:  2px;
}

.status-live {
	background: rgba(255, 59, 59, 0.15);
	color:      var(--live-dot);
	border:     1px solid rgba(255, 59, 59, 0.3);
}

.status-finished {
	background: rgba(255, 255, 255, 0.05);
	color:      var(--text-muted);
	border:     1px solid var(--border);
}

.status-scheduled {
	background: rgba(184, 224, 40, 0.08);
	color:      var(--accent-dim);
	border:     1px solid rgba(184, 224, 40, 0.2);
}

.match-court {
	font-size:      15px;
	color:          var(--text);
	letter-spacing: 0.05em;
}

.match-round {
	font-size:      15px;
	color:          var(--text);
	margin-left:    auto;
	letter-spacing: 0.05em;
}

.match-time-display {
	font-size: 15px;
	color:     var(--text-dim);
}

.score-table {
	padding: 8px 16px 10px;
	width:   100%;
}

.player-row {
	display:     flex;
	align-items: center;
	padding:     4px 0;
	position:    relative;
}

.player-row + .player-row {
	border-top: 1px solid var(--border);
}

.serve-dot {
	width:         6px;
	height:        6px;
	border-radius: 50%;
	background:    var(--serve);
	margin-right:  8px;
	flex-shrink:   0;
	visibility:    hidden;
}

.serve-dot.active {
	visibility: visible;
}

.player-headshots {
	display:      flex;
	margin-right: 6px;
	flex-shrink:  0;
}

.player-headshots .player-headshot {
	margin-right: 0;
}

.player-headshots .player-headshot + .player-headshot {
	margin-left: -8px;
}

.player-headshot {
	width:           28px;
	height:          28px;
	border-radius:   50%;
	object-fit:      cover;
	object-position: top;
	margin-right:    6px;
	flex-shrink:     0;
	border:          1px solid var(--border);
}

.player-flag {
	font-size:    16px;
	margin-right: 6px;
	flex-shrink:  0;
	width:        24px;
	text-align:   center;
}

.player-country {
	font-size:      14px;
	font-weight:    700;
	letter-spacing: 0.08em;
	color:          var(--text-muted);
	margin-right:   6px;
	width:          28px;
	flex-shrink:    0;
}

.player-name {
	font-size:      18px;
	color:          var(--text);
	flex:           1;
	white-space:    nowrap;
	overflow:       hidden;
	text-overflow:  ellipsis;
	letter-spacing: 0.02em;
}

@media screen and (max-width: 600px) {
	.player-name {
		font-size: 14px;
	}
}

.player-name .first-name {
	color:        var(--text-muted);
	font-size:    16px;
	margin-right: 3px;
}

.player-seed {
	font-size:      14px;
	color:          var(--text-dim);
	margin-left:    4px;
	vertical-align: super;
}

.winner-name {
	color: var(--accent);
}

.sets-container {
	display:     flex;
	gap:         3px;
	align-items: center;
	margin-left: 10px;
	flex-shrink: 0;
}

.set-box {
	min-width:       20px;
	height:          24px;
	display:         flex;
	align-items:     center;
	justify-content: center;
	font-size:       18px;
	font-weight:     600;
	color:           var(--text-muted);
	border:          1px solid var(--border);
	border-radius:   2px;
	padding:         0 3px;
	position:        relative;
}

.set-box.won {
	background:   var(--won-set);
	border-color: rgba(184, 224, 40, 0.25);
	color:        var(--text);
}

.set-box .tiebreak {
	position:    absolute;
	top:         -1px;
	right:       -1px;
	font-size:   12px;
	color:       var(--accent-dim);
	background:  var(--bg-card);
	padding:     0 1px;
	line-height: 1;
}

.game-score {
	min-width:       32px;
	height:          28px;
	display:         flex;
	align-items:     center;
	justify-content: center;
	font-size:       19px;
	font-weight:     700;
	margin-left:     6px;
	border-radius:   3px;
	color:           var(--text);
	background:      rgba(255, 255, 255, 0.05);
	border:          1px solid var(--border-light);
	padding:         0 4px;
	flex-shrink:     0;
}

.game-score.serving {
	background:   rgba(184, 224, 40, 0.12);
	border-color: rgba(184, 224, 40, 0.3);
	color:        var(--accent);
}

.state-message {
	padding:    40px 20px;
	text-align: center;
	color:      var(--text-muted);
}

.state-message .icon {
	font-size:     37px;
	margin-bottom: 12px;
	display:       block;
}

.state-message .label {
	font-size:      16px;
	font-weight:    700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color:          var(--text-dim);
}

#loading-overlay {
	position:        fixed;
	inset:           0;
	background:      var(--bg);
	display:         flex;
	align-items:     center;
	justify-content: center;
	z-index:         100;
	transition:      opacity 0.3s;
}

#loading-overlay.hidden {
	opacity:        0;
	pointer-events: none;
}

.spinner {
	width:            24px;
	height:           24px;
	border:           2px solid var(--border-light);
	border-top-color: var(--accent);
	border-radius:    50%;
	animation:        spin 0.7s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

#error-toast {
	position:      fixed;
	bottom:        12px;
	right:         12px;
	background:    #1e0000;
	border:        1px solid #5a0000;
	color:         #ff6b6b;
	font-size:     15px;
	padding:       6px 10px;
	border-radius: 3px;
	display:       none;
	z-index:       200;
}
