:root {
  --bg: #0f172a;
  --bg-2: #0b1022;
  --bg-3: #070b18;
  --panel: #111827;
  --panel-2: #0e162a;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --accent: #22c55e;
  --accent-2: #60a5fa;
  --danger: #ef4444;
  --warn: #f59e0b;
  --border: #1f2937;
  --card: #0b1220;
  --chart-bar-bg: #0a0f2a;
  --chart-bar-shadow: rgba(255, 255, 255, 0.08);
  --chart-fill-end: rgba(255, 255, 255, 0.15);
  --btn-bg: #0a1222;
  --hover: #0a1222;
  --active: #0a1326;
  --header-bg: rgba(15, 23, 42, 0.8);
  --sidebar-w: 220px;
  --sidebar-collapsed-w: 68px;
  --court-bg-alpha: 0.16;
  --match-bg-alpha: 0.08;
  --badge-idle-bg: #1f2937;
  --gold: #d4af37;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --diamond: #b9f2ff;
}

:root.light {
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --bg-3: #e2e8f0;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --muted: #475569;
  --text: #1f2937;
  --accent: #22c55e;
  --accent-2: #3b82f6;
  --danger: #ef4444;
  --warn: #d97706;
  --border: #d1d5db;
  --card: #ffffff;
  --chart-bar-bg: #cbd5e1;
  --chart-bar-shadow: rgba(0, 0, 0, 0.12);
  --chart-fill-end: rgba(0, 0, 0, 0.12);
  --btn-bg: #e2e8f0;
  --hover: #e2e8f0;
  --active: #cbd5e1;
  --header-bg: rgba(255, 255, 255, 0.8);
  --court-bg-alpha: 0.3;
  --match-bg-alpha: 0.16;
  --badge-idle-bg: #e2e8f0;
  --gold: #d4af37;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --diamond: #b9f2ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--bg), var(--bg-2) 60%, var(--bg-3));
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  height: 100%;
  overflow: hidden;
}

header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  background: var(--header-bg);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
}

#toggleTheme {
  margin-left: auto;
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--muted);
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: transform .03s ease, box-shadow .2s ease, border-color .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn.icon-btn {
  padding: 6px;
  width: 36px;
}

.btn.icon-btn svg {
  width: 20px;
  height: 20px;
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1022;
  border: 0;
}

.btn.ghost {
  background: transparent;
}

.btn.ghost.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 15%, transparent);
}

.btn.black {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn.gray {
  background: var(--muted);
  color: var(--bg);
  border-color: var(--muted);
}

.btn.gray:hover {
  border-color: var(--muted);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px color-mix(in srgb, var(--muted) 40%, transparent);
}

.btn.black:hover {
  border-color: #000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  border-color: var(--accent-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.btn:active {
  transform: translateY(1px);
}

.danger {
  color: var(--danger);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge.ok {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--bg);
}

.badge.warn {
  background: var(--warn);
  color: #111827;
}

.badge.idle {
  background: var(--badge-idle-bg);
  color: var(--muted);
}

.brand .badge {
  font-size: 12px;
  color: var(--bg);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  padding: 2px 8px;
  border-radius: 999px;
}

.layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  min-height: calc(100vh - 54px);
}

.sidebar {
  position: sticky;
  top: 54px;
  height: calc(100vh - 54px);
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  width: var(--sidebar-w);
  transition: width .2s ease;
  overflow: hidden;
  z-index: 10;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
}

.nav {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  color: var(--text);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--hover);
  border-color: var(--muted);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--muted) 40%, transparent);
}

.nav-item.active {
  background: var(--active);
  border-color: var(--border);
}

.nav-item[data-view="display"] {
  grid-template-columns: 28px 1fr 16px;
}

.nav-item[data-view="display"]::after {
  content: '\2197';
  font-size: 0.85em;
  grid-column: 3;
  justify-self: end;
}

.highlight {
  box-shadow: 0 0 0 4px var(--primary);
}

.nav .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav .label {
  display: none;
}

.content {
  padding: 18px;
  height: calc(100vh - 54px);
  overflow-y: auto;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.standings-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.home-cards {
  gap: 16px;
}

.home-cards .card {
  flex: 1;
}

.home-cards a {
  color: var(--accent-2);
  text-decoration: none;
}

.home-title {
  text-align: left;
  margin: 20px 0;
  font-size: 1.6rem;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.divider {
  border-top: 2px solid var(--border);
  margin: 12px 0;
}

.right-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.stat {
  font-size: 12px;
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title svg {
  opacity: .85;
}

label {
  font-size: 12px;
  color: var(--muted);
}

.required-indicator {
  color: var(--danger);
  margin-left: 4px;
}

.search-label {
  position: relative;
  display: block;
  width: 100%;
}

.search-label input {
  width: 100%;
  padding-left: 12px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  outline: none;
}

select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  cursor: pointer;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.dropdown {
  flex: 1;
  min-width: 200px;
}


.select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  pointer-events: none;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transform: translateY(-50%);
}

select::-ms-expand {
  display: none;
}

select option {
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
  border-radius: 4px;
  transition: background-color .15s ease, color .15s ease;
}

select option:hover,
select option:focus {
  background: var(--accent-2);
  color: var(--bg);
}

select option:checked {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--bg);
  font-weight: 600;
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.form-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.chip.team-avg {
  background: color-mix(in srgb, var(--text) 15%, var(--card));
  color: var(--text);
  border: 0;
  font-weight: 600;
}

.chip.brand {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--bg);
  border: 0;
  font-weight: 600;
}

.chip.resting-chip {
  padding: 6px 12px;
  font-size: 14px;
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(96, 165, 250, 0.12);
}

:root.light .chip.resting-chip {
  background: rgba(59, 130, 246, 0.15);
}

.pill-input .handshake {
  padding: 0 4px;
  font-size: 20px;
}

.team-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-input select {
  flex: 1;
  width: auto;
}

.team-input .player-select {
  position: relative;
  flex: 1;
}

.team-input .player-select svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.7;
}

.team-input .player-select select {
  padding-left: 30px;
  width: 100%;
}

.team-gen-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-gen-row .controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-gen-row .controls select {
  flex: 1;
  width: auto;
}

.team-gen-row label {
  white-space: nowrap;
}

.resting-box {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--accent-2);
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.08);
}

:root.light .resting-box {
  background: rgba(59, 130, 246, 0.08);
}

.resting-box .label {
  font-weight: 700;
  color: var(--accent-2);
  margin-right: 10px;
  font-size: 1.05rem;
  letter-spacing: .2px;
}

/* Court badge: uniform accent color */
.court-badge {
  font-weight: 600;
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}


.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.group {
  min-height: 150px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px dashed var(--border);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.group .dropzone {
  min-height: 80px;
  display: grid;
  gap: 8px;
  border-radius: 8px;
}

.group .dropzone.drag-over {
  box-shadow: 0 0 0 3px var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 20%, transparent);
}

.group .item {
  cursor: grab;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.group .item:active {
  cursor: grabbing;
}

.group .item:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.drag-hint {
  text-align: left;
  margin-bottom: 8px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
}

.info-card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.info-card .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.info-card ul {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 12px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 0 40px rgba(0, 255, 234, 0.06);
}

.chart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.chart-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-label {
  width: 260px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar {
  flex: 1;
  height: 26px;
  background: var(--chart-bar-bg);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: inset 0 0 8px var(--chart-bar-shadow);
}

.chart-fill {
  height: 100%;
  border-radius: inherit;
}

.chart-value {
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin: 8px 52px 0 272px;
  font-size: 12px;
  color: var(--muted);
}

#view-standings table {
  border-collapse: separate;
  border-spacing: 0 4px;
}

#view-standings table th,
#view-standings table td {
  padding: 8px 6px;
  border-bottom: none;
}

#view-standings table tr {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

#view-standings table td {
  text-align: center;
}

#view-standings table th:first-child,
#view-standings table td:first-child,
#view-standings table th:nth-child(2),
#view-standings table td:nth-child(2) {
  text-align: left;
}

/* Collapsible day body */
.day-card .day-body {
  margin-top: 26px;
}

.day-card.collapsed .day-body {
  display: none;
}

/* Variant colors per entire Partita card (day-level) */
.day-card.color-1 {
  background: rgba(59, 130, 246, .10);
  border-color: rgba(59, 130, 246, .35);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .10) inset;
}

.day-card.color-2 {
  background: rgba(147, 51, 234, .10);
  border-color: rgba(147, 51, 234, .35);
  box-shadow: 0 0 0 2px rgba(147, 51, 234, .10) inset;
}

.day-card.color-3 {
  background: rgba(8, 145, 178, .10);
  border-color: rgba(8, 145, 178, .35);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, .10) inset;
}

.day-card.color-4 {
  background: rgba(234, 179, 8, .10);
  border-color: rgba(234, 179, 8, .35);
  box-shadow: 0 0 0 2px rgba(234, 179, 8, .10) inset;
}

.day-card.color-5 {
  background: rgba(20, 184, 166, .10);
  border-color: rgba(20, 184, 166, .35);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .10) inset;
}

.day-card.color-6 {
  background: rgba(168, 85, 247, .10);
  border-color: rgba(168, 85, 247, .35);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .10) inset;
}

.warning-banner {
  display: none;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent);
  background: color-mix(in srgb, var(--danger) 15%, var(--card));
  color: var(--danger);
  margin: 8px 0;
}

.warning-banner.show {
  display: block;
}

.section-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.tourney-info {
  margin: 16px 0;
  font-size: 14px;
}


/* Finals bracket */
.bracket {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bracket-round {
  min-width: 260px;
}

.bracket-round h4 {
  margin: 4px 0 8px 0;
  font-weight: 600;
  opacity: .9;
}

.bracket .match-card {
  grid-template-columns: 1fr 160px 1fr;
}

/* Variant colors per match card (rotated by index) */
.match-card.color-1 {
  background: rgba(59, 130, 246, var(--match-bg-alpha));
  border-color: rgba(59, 130, 246, .35);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .12) inset;
}

.match-card.color-2 {
  background: rgba(147, 51, 234, var(--match-bg-alpha));
  border-color: rgba(147, 51, 234, .35);
  box-shadow: 0 0 0 2px rgba(147, 51, 234, .12) inset;
}

.match-card.color-3 {
  background: rgba(8, 145, 178, var(--match-bg-alpha));
  border-color: rgba(8, 145, 178, .35);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, .12) inset;
}

.match-card.color-4 {
  background: rgba(234, 179, 8, var(--match-bg-alpha));
  border-color: rgba(234, 179, 8, .35);
  box-shadow: 0 0 0 2px rgba(234, 179, 8, .12) inset;
}

.match-card.color-5 {
  background: rgba(20, 184, 166, var(--match-bg-alpha));
  border-color: rgba(20, 184, 166, .35);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .12) inset;
}

.match-card.color-6 {
  background: rgba(168, 85, 247, var(--match-bg-alpha));
  border-color: rgba(168, 85, 247, .35);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, .12) inset;
}

.bracket .score-area {
  grid-template-columns: 1fr auto 1fr;
}

.bracket .match-card .meta-block {
  display: none;
}

.match-card {
  display: grid;
  grid-template-columns: 120px 1fr 280px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  margin-top: 8px;
}

.team-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-card .team-title {
  font-size: 24px;
}

.bonus-star {
  color: gold;
  font-size: 0.9em;
  margin-right: 4px;
}

.group-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.group-filter .filter-label {
  font-weight: 600;
}

.group-tabs {
  display: flex;
  gap: 8px;
  margin: 0;
}

.group-tab {
  padding: 6px 10px;
  border: 1px solid var(--muted);
  background: var(--btn-bg);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

.group-tab:hover:not(.active) {
  background: var(--accent-2);
  color: var(--bg);
}

.group-tab.active {
  background: var(--accent-2);
  color: var(--bg);
}

details.schedule-filters {
  margin: 16px 0;
}

details.schedule-filters summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  padding: 4px;
  border-radius: 6px;
}

details.schedule-filters summary:hover {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

details.schedule-filters summary::-webkit-details-marker {
  display: none;
}

details.schedule-filters .filters-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.team-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
}

.score-area {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.score-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-input {
  text-align: center;
}

/* Winner/Loser/Draw coloring for score inputs */

/* Subtle row highlight when a result is present (neutral) */
/* remove neutral/border highlights to keep rows borderless */
.schedule-line.has-result,
.schedule-line.bonus {
  border: none;
  box-shadow: none;
}

.table-card tbody tr.leader {
  background: color-mix(in srgb, var(--accent-2) 20%, transparent);
}

/* ===== Schedule custom layout ===== */
.schedule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  border-radius: 12px;
}
.schedule-line.search-hide {
  display: none;
}

#scheduleSection.no-results::before {
  content: 'Nessuna partita trovata';
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 12px 0;
}

.day-card .day-body .schedule-line:first-child {
  margin-top: 0;
}

.schedule-line .meta-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.schedule-line .meta-group,
.schedule-line .meta-court,
.schedule-line .meta-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.schedule-line .meta-group {
  border: 1px solid #9ca3af;
  background: #fff;
  color: #374151;
}

.schedule-line .meta-court {
  background: #3b82f6;
  color: #fff;
}

.schedule-line .meta-day {
  background: #9ca3af;
  color: #fff;
  min-width: 72px;
}

.schedule-line .match-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.schedule-line .score-block {
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}

.schedule-line .score-block[data-side="h"] {
  border-radius: 0 20px 20px 0;
}

.schedule-line .score-block[data-side="a"] {
  border-radius: 20px 0 0 20px;
}

  .schedule-line .score-block .score-input {
    width: 60px;
    height: 48px;
    box-sizing: border-box;
    padding: 0;
    border-radius: 12px;
    background: var(--card);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    line-height: 44px;
    text-align: center;
  }

.schedule-line .score-block[data-side="h"] .score-input {
  border-radius: 0 20px 20px 0;
}

.schedule-line .score-block[data-side="a"] .score-input {
  border-radius: 20px 0 0 20px;
}

  .schedule-line .score-block.win .score-input {
    background: color-mix(in srgb, var(--accent) 20%, var(--card));
    border-color: var(--accent);
  }

  .schedule-line .score-block.lose .score-input {
    background: color-mix(in srgb, var(--danger) 20%, var(--card));
    border-color: var(--danger);
  }

  .schedule-line .score-block.draw .score-input {
    background: color-mix(in srgb, var(--warn) 20%, var(--card));
    border-color: var(--warn);
  }

  .schedule-line .team-block {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
    color: #000;
    border: 2px solid var(--border);
    box-sizing: border-box;
    min-height: 48px;
  }

.schedule-line .team-block[data-side="h"] {
  border-radius: 20px 0 0 20px;
}

.schedule-line .team-block[data-side="a"] {
  border-radius: 0 20px 20px 0;
}

.schedule-line .team-title {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  width: 100%;
}

  .schedule-line .vs {
    padding: 4px 8px;
    background: var(--badge-idle-bg);
    color: var(--text);
    font-weight: 700;
    border-radius: 4px;
  }

:root.light .schedule-line .team-block {
  border-color: #666;
}

:root.light .schedule-line .vs {
  background: #333;
  color: #fff;
}

/* Color variations for schedule bars */
.schedule-line.color-1 .team-block { background: #bfdbfe; }
.schedule-line.color-2 .team-block { background: #e9d5ff; }
.schedule-line.color-3 .team-block { background: #a5f3fc; }
.schedule-line.color-4 .team-block { background: #fef08a; }
.schedule-line.color-5 .team-block { background: #99f6e4; }
.schedule-line.color-6 .team-block { background: #f5d0fe; }

.timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.timer strong {
  letter-spacing: 1px;
}

.timer .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow .2s ease, background .2s ease;
}

.timer.running {
  border-color: rgba(34, 197, 94, .5);
}

.timer.running .dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(34, 197, 94, .7);
}

.timer.finished {
  border-color: rgba(239, 68, 68, .5);
}

.timer.finished .dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(239, 68, 68, .7);
}

.timer.stopped {
  border-color: rgba(245, 158, 11, .5);
}

.timer.stopped .dot {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(245, 158, 11, .6);
}

/* Progressive warnings 60/30/10 seconds */
.timer.warn60.running {
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .2) inset;
}

.timer.warn30.running {
  border-color: rgba(245, 158, 11, .8);
  box-shadow: 0 0 12px rgba(245, 158, 11, .4);
}

.timer.warn10.running {
  border-color: rgba(239, 68, 68, .9);
  background: color-mix(in srgb, var(--danger) 15%, var(--panel-2));
  box-shadow: 0 0 14px rgba(239, 68, 68, .6);
}

.timer.warn30.running .dot {
  background: var(--warn);
}

.timer.warn10.running .dot {
  background: var(--danger);
}

.timer-controls {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
}

.timer-controls .play {
  color: var(--accent);
}

.timer-controls .pause {
  color: var(--warn);
}

.timer-controls .reset {
  color: var(--danger);
}

.timer-controls .btn:hover {
  border-color: var(--muted);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--muted) 40%, transparent);
}

.timer-controls .btn.active {
  border-color: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 40%, transparent);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#view-copyright .profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

#view-copyright .profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

#view-copyright .contact-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

#view-copyright .contact-links a {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

#view-copyright .contact-links svg {
  width: 24px;
  height: 24px;
}

/* Anchor "Impostazioni" at the bottom of the sidebar */
.sidebar .nav {
  position: relative;
  height: 100%;
  padding-bottom: 120px;
}

.sidebar .nav .nav-item[data-view="settings"] {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 56px;
}

.sidebar .nav .nav-item[data-view="copyright"] {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
}

.sidebar.collapsed .nav {
  padding-bottom: 64px;
}

.sidebar.collapsed .nav .nav-item[data-view="settings"] {
  left: 6px;
  right: 6px;
  bottom: 42px;
}

.sidebar.collapsed .nav .nav-item[data-view="copyright"] {
  left: 6px;
  right: 6px;
  bottom: 6px;
}


/* Settings layout */
/* Inline inputs helper for settings */
.inline-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.inline-inputs .btn.icon svg {
  margin-right: 6px;
}

/* Ensure select and button align nicely */
.inline-inputs select {
  min-height: 38px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 6px;
}

@media (max-width: 1000px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.settings-group {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-group.full-row {
  grid-column: 1 / -1;
}

#timerSettings {
  display: grid;
  gap: 10px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--muted);
  transition: .2s;
  border-radius: 20px;
}

.switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: var(--card);
  border-radius: 50%;
  transition: .2s;
}

.switch input:checked+.slider {
  background: var(--accent-2);
}

.switch input:checked+.slider::before {
  transform: translateX(20px);
}

#enableTimerText {
  min-width: 28px;
  text-align: center;
  color: var(--muted);
}

#showTipsText {
  min-width: 28px;
  text-align: center;
  color: var(--muted);
}

#courtNamesConfig {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.auto-msg {
  font-size: 13px;
  color: var(--accent-2);
}

#impactPreview {
  margin-top: 8px;
}

.group-title {
  font-weight: 600;
  letter-spacing: .2px;
  opacity: .9;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* Danger zone */
.card.danger-zone {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, var(--card));
  margin-top: 12px;
}

.btn.danger {
  background: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 70%, transparent);
  color: #fff;
}

.btn.danger:hover {
  border-color: var(--danger);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--danger) 35%, transparent), 0 0 0 2px color-mix(in srgb, var(--danger) 40%, transparent);
}

.btn.ghost.danger:hover {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 40%, transparent);
}


/* Settings layout extras */
.settings-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  border-radius: 999px;
  margin-left: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  position: relative;
  cursor: help;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  bottom: -6px;
  white-space: normal;
  min-width: 200px;
  max-width: 340px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 20;
}

.tip:hover::after {
  opacity: 1;
}

/* Reset buttons grid */
.reset-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 1100px) {
  .reset-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}


/* Toasts */
.toast-host {
  position: fixed;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 4px solid var(--muted);
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast .title {
  font-weight: 600;
}

.toast.success {
  border-color: #10b981;
  box-shadow: 0 6px 18px rgba(16, 185, 129, .15);
}

.toast.info {
  border-color: rgba(59, 130, 246, .45);
  box-shadow: 0 6px 18px rgba(59, 130, 246, .15);
}

.toast.warn {
  border-color: rgba(245, 158, 11, .55);
  box-shadow: 0 6px 18px rgba(245, 158, 11, .18);
}

.toast.error {
  border-color: rgba(244, 63, 94, .55);
  box-shadow: 0 6px 18px rgba(244, 63, 94, .18);
}

.toast .close {
  margin-left: auto;
  cursor: pointer;
  opacity: .7;
  background: none;
  border: none;
  font: inherit;
}

.toast .close:hover {
  opacity: 1;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.status-badge.saved {
  border-color: rgba(16, 185, 129, .45);
  background: color-mix(in srgb, #10b981 12%, var(--card));
  color: #065f46;
}

.status-badge.dirty {
  border-color: rgba(245, 158, 11, .55);
  background: color-mix(in srgb, #f59e0b 15%, var(--card));
  color: #b45309;
}

.status-badge.draft {
  border-color: rgba(59, 130, 246, .45);
  background: color-mix(in srgb, #3b82f6 15%, var(--card));
  color: #1d4ed8;
}

/* --- Buttons alignment tweaks --- */
.settings-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.settings-footer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reset-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reset-grid .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reset-grid .btn.wide {
  grid-column: 1 / -1;
}

/* full width button spans all columns */


/* Two-column layout for settings */
.settings-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

.left-col {
  display: block;
}

.settings-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-menu li {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-menu li .icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.settings-menu li.active,
.settings-menu li:hover {
  background: var(--hover);
  color: var(--accent-2);
}

.right-col {
  display: block;
}

.settings-pane {
  display: none;
}

.settings-pane.active {
  display: block;
}

/* Keep 3-column grid inside content */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1200px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    flex-direction: row;
    overflow-x: auto;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Toolbar */
.settings-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-toolbar .btn {
  padding: 10px 24px;
}

/* Club details layout */
.club-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.club-details .settings-row {
  justify-content: flex-start;
  gap: 20px;
}

.club-details .settings-row label {
  width: 220px;
}


/* Single-column layout: reset under settings values */
.settings-layout.onecol {
  display: block;
}

.settings-layout.onecol .left-col {
  display: block;
}

.settings-layout.onecol .settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 1200px) {
  .settings-layout.onecol .settings-grid {
    grid-template-columns: 1fr;
  }
}


.settings-layout.onecol .danger-zone {
  margin-top: 14px;
}


/* Collapsible info-card */
details.info-card {
  overflow: hidden;
}

details.info-card summary {
  outline: none;
}

details.info-card summary::-webkit-details-marker {
  display: none;
}

/* Prize draw results */
#prizesList {
  margin-top: 20px;
  display: grid;
  gap: 20px;
}

.prize-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  font-size: 1.4rem;
}

.prize-card .player {
  font-weight: 700;
  font-size: 1.6rem;
}

.prize-card .gift {
  margin-top: 8px;
  color: var(--muted);
}

/* Fireworks effect */
.firework {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: firework 1500ms ease-out forwards;
  z-index: 9999;
  box-shadow: 0 0 24px currentColor;
}

@keyframes firework {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  to {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* Finals designer */
.finals-player {
  padding: 4px 6px;
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: column;
}

.finals-player:hover {
  background: var(--hover);
}

.finals-player.assigned {
  opacity: .5;
}

.finals-player.gold {
  border-color: var(--gold);
}

.finals-player.silver {
  border-color: var(--silver);
}

.finals-player.bronze {
  border-color: var(--bronze);
}

.finals-player.diamond {
  border-color: var(--diamond);
}

.finals-player .fp-name {
  font-weight: 600;
}

.finals-player .fp-sub {
  font-size: .8em;
  color: var(--muted);
}

.finals-player:focus,
.finals-slot:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.finals-player.picked {
  box-shadow: 0 0 0 2px var(--accent-2);
}

#finalsLayout {
  align-items: stretch;
  position: relative;
}

#finalsSources {
  margin-bottom: 12px;
}

#finalsSources .finals-team-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

#finalsDesigner {
  flex: 1;
  overflow: auto;
}

.finals-bracket {
  margin-bottom: 20px;
  padding: 8px;
  border-top: 3px solid transparent;
  width: 100%;
}

.finals-bracket.gold {
  border-color: var(--gold);
}

.finals-bracket.silver {
  border-color: var(--silver);
}

.finals-bracket.bronze {
  border-color: var(--bronze);
}

.finals-bracket.diamond {
  border-color: var(--diamond);
}

.finals-bracket.gold h3 {
  color: var(--gold);
}

.finals-bracket.silver h3 {
  color: var(--silver);
}

.finals-bracket.bronze h3 {
  color: var(--bronze);
}

.finals-bracket.diamond h3 {
  color: var(--diamond);
}

.finals-tabs {
  display: flex;
  width: 100%;
}

.finals-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  border-top: 3px solid transparent;
}

.finals-tab.gold {
  border-color: var(--gold);
  color: var(--gold);
}

.finals-tab.silver {
  border-color: var(--silver);
  color: var(--silver);
}

.finals-tab.bronze {
  border-color: var(--bronze);
  color: var(--bronze);
}

.finals-tab.diamond {
  border-color: var(--diamond);
  color: var(--diamond);
}

.finals-tab.active {
  font-weight: bold;
}

.finals-tab.gold.active {
  background: var(--gold);
  color: #000;
}

.finals-tab.silver.active {
  background: var(--silver);
  color: #000;
}

.finals-tab.bronze.active {
  background: var(--bronze);
  color: #000;
}

.finals-tab.diamond.active {
  background: var(--diamond);
  color: #000;
}

.finals-tabs-content .finals-bracket {
  border-top: none;
}

.finals-flag-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: #000;
}

.finals-flag-label:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.finals-flag-icon {
  font-size: 1em;
}

.finals-round {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-right: 16px;
  flex: 1;
}

.finals-match {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.finals-round:first-child .finals-match {
  margin: 40px 0;
}

.finals-slot {
  width: 100%;
  height: 48px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finals-slot.filled {
  border-style: solid;
}

.finals-slot.loser {
  text-decoration: line-through;
  opacity: .6;
}

.finals-score {
  display: flex;
  gap: 8px;
  margin: 4px 0;
  justify-content: center;
  width: 100%;
  align-items: center;
}

.finals-score input {
  width: 100px;
  font-size: 1.5em;
  padding: 2px 4px;
  text-align: center;
}

.finals-score .vs {
  padding: 4px 8px;
  background: #333;
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
}

.medal {
  margin-left: 4px;
}

#finalsSources.collapsed .finals-team-list,
#finalsSources.collapsed .hint {
  display: none;
}

#showFinalsSources {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0;
}

.finals-winner {
  margin-top: 8px;
  font-weight: 600;
  text-align: center;
}

.home-logo-wrapper {
  text-align: center;
  margin-top: 20px;
}

.home-logo {
  max-width: 400px;
  max-height: 400px;
  border-radius: 10px;
}

.logo-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 10px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card);
  color: var(--text);
  padding: 30px;
  border-radius: 10px;
  max-width: 420px;
  width: 95%;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.modal-header h3 {
  margin: 0;
}

.modal-icon svg {
  width: 24px;
  height: 24px;
}

.modal p {
  text-align: center;
  margin: 0 0 32px;
}

.modal label {
  display: block;
  margin-top: 8px;
}

.modal input:not([type='checkbox']),
.modal select {
  width: 100%;
  margin-top: 4px;
}

.modal label.checkbox-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal .actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Tournaments */
.tournament-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tournament-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.tournament-item.selected {
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 40%, transparent);
}

.tournament-item:hover {
  background: var(--hover);
  border-color: var(--accent-2);
}

.tournament-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* schedule actions dropdown */
details.actions-menu {
  position: relative;
  display: inline-block;
}

details.actions-menu summary {
  list-style: none;
}

details.actions-menu summary::-webkit-details-marker {
  display: none;
}

details.actions-menu .menu-items {
  position: absolute;
  right: 0;
  margin-top: 4px;
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 10;
}

details.actions-menu[open] .menu-items {
  display: flex;
}

#scheduleDisplay {
  background: #000;
  color: #fff;
  min-height: 85vh;
  font-size: 2.6rem;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  justify-content: center;
  align-items: stretch;
  position: relative;
}

#scheduleDisplay .display-empty {
  margin: auto;
  text-align: center;
  color: #fff;
}

#scheduleDisplay .display-header {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 1.4rem;
  font-weight: 700;
}

#scheduleDisplay .display-row {
  display: grid;
  grid-template-columns: 260px 1fr 80px 1fr;
  align-items: center;
  gap: 40px;
  width: 100%;
}

#scheduleDisplay .display-team {
  font-weight: 700;
}

#scheduleDisplay .display-team.left {
  text-align: right;
}

#scheduleDisplay .display-team.right {
  text-align: left;
}

#scheduleDisplay .display-meta {
  font-size: 1.3rem;
  text-align: right;
  padding-right: 20px;
  color: #ffd700;
  white-space: nowrap;
}

#scheduleDisplay .display-vs {
  font-size: 1.5rem;
  justify-self: center;
}

#view-display {
  position: relative;
}

#displayControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#displayControls .display-btn {
  font-size: 1rem;
  padding: 4px 20px;
  min-width: 80px;
  height: 32px;
  border-radius: 6px;
}

#displayControls .display-btn:active {
  transform: scale(0.98);
}

/* Mobile notice overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  z-index: 1000;
}

.mobile-overlay p {
  font-size: 1.2rem;
  line-height: 1.4;
}
