@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  src: local("Inter Variable"), local("Inter"),
    url("fonts/InterVariable.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 100 900;
  src: local("Inter Variable Italic"), local("Inter Italic"),
    url("fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --as-slate: #2f3e46;
  --as-teal: #2266bb;
  --as-water: #4ca8d4;
  --as-lime: #a3d900;
  --as-platinum: #c7d0d8;
  --as-orange: #fb9e12;
  --as-white: #ffffff;
  --radius-sm: 0.7rem;
  --radius-md: 0.95rem;
  --radius-lg: 1.2rem;
  --shadow-soft: 0 14px 30px rgba(12, 30, 57, 0.11);
  --shadow-hard: 0 18px 42px rgba(11, 32, 70, 0.23);
  --text-primary: #203140;
  --text-muted: rgba(32, 49, 64, 0.73);
  --text-faint: rgba(32, 49, 64, 0.54);
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --border-soft: rgba(32, 90, 138, 0.18);
  --header-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(228, 236, 244, 0.76));
  --bg-core: radial-gradient(circle at 15% 15%, rgba(76, 168, 212, 0.2), transparent 42%),
    radial-gradient(circle at 84% 10%, rgba(163, 217, 0, 0.14), transparent 33%),
    linear-gradient(160deg, #f8fbfd 0%, #edf2f7 58%, #e5ebf1 100%);
  --bg-image-opacity: 0.14;
  --accent-grad: linear-gradient(95deg, rgba(76, 168, 212, 0.95), rgba(34, 102, 187, 0.94), rgba(163, 217, 0, 0.93));
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e5edf5;
    --text-muted: rgba(229, 237, 245, 0.76);
    --text-faint: rgba(229, 237, 245, 0.5);
    --surface: rgba(18, 33, 56, 0.71);
    --surface-strong: rgba(22, 40, 67, 0.86);
    --border-soft: rgba(76, 168, 212, 0.28);
    --header-bg: linear-gradient(140deg, rgba(14, 34, 61, 0.88), rgba(20, 47, 79, 0.74));
    --bg-core: radial-gradient(circle at 12% 10%, rgba(76, 168, 212, 0.25), transparent 44%),
      radial-gradient(circle at 84% 14%, rgba(163, 217, 0, 0.19), transparent 36%),
      linear-gradient(160deg, #0d1c31 0%, #0f2f66 55%, #163b57 100%);
    --bg-image-opacity: 0.2;
    --shadow-soft: 0 18px 36px rgba(0, 0, 0, 0.35);
    --shadow-hard: 0 26px 56px rgba(0, 0, 0, 0.48);
  }
}

* {
  font-family: "Inter", "Lato", "Helvetica Neue", Arial, sans-serif !important;
}

@keyframes as-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html,
body,
body.ui-mobile-viewport {
  background: var(--bg-core);
  color: var(--text-primary);
}

html.aeroscore-standalone #aerochimpHeader.ui-header {
  padding-top: calc(0.72rem + env(safe-area-inset-top));
}

html.aeroscore-standalone .ui-content {
  padding-bottom: calc(0.72rem + env(safe-area-inset-bottom));
}

.ui-page {
  background: transparent !important;
  color: var(--text-primary);
}

.ui-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-core);
}

.ui-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("images/aeroscore-background.png") center/cover no-repeat;
  opacity: var(--bg-image-opacity);
  pointer-events: none;
}

.ui-page-active {
  animation: as-fade-in 0.32s ease both;
}

.ui-content {
  padding: clamp(0.65rem, 1.75vw, 1.25rem) clamp(0.55rem, 1.45vw, 1.05rem);
}

#aerochimpHeader.ui-header {
  border: 0 !important;
  background: var(--header-bg) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px rgba(13, 35, 64, 0.16);
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  grid-template-areas:
    "logo nav title icon print"
    "logo nav module icon print";
  gap: 0.35rem 0.8rem;
  align-items: center;
  padding: calc(0.5rem + env(safe-area-inset-top)) clamp(0.75rem, 2vw, 1.25rem) 0.5rem;
  min-height: 5rem;
}

#aerochimpHeader h1,
#aerochimpHeader h2,
#aerochimpHeader .ui-btn,
#aerochimpHeader img {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  margin: 0 !important;
  float: none !important;
}

#aerochimpHeader .app-logo-wordmark {
  grid-area: logo;
  height: clamp(1.35rem, 2.6vw, 1.9rem);
  max-width: min(42vw, 14rem);
  width: auto;
  object-fit: contain;
}

#aerochimpHeader .app-logo-icon {
  grid-area: icon;
  height: 2rem;
  width: 2rem;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.17);
  box-shadow: 0 0 0 3px rgba(76, 168, 212, 0.15);
}

#aerochimpHeader .menuButton,
#aerochimpHeader .printAction {
  border: 1px solid var(--border-soft) !important;
  background: var(--surface) !important;
  border-radius: 999px !important;
  color: var(--text-primary) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  min-height: 2rem;
  font-size: 0.8rem;
}

#aerochimpHeader .menuButton {
  grid-area: nav;
}

#aerochimpHeader .printAction {
  grid-area: print;
}

#aerochimpHeader .headerAction .ui-btn-text {
  font-weight: 600;
}

#aerochimpHeader h1 {
  grid-area: title;
  color: var(--text-primary);
  text-shadow: none;
  font-size: clamp(0.92rem, 1.6vw, 1.2rem);
  font-weight: 700;
  line-height: 1.2;
}

#aerochimpHeader h2 {
  grid-area: module;
  color: var(--text-muted);
  text-shadow: none;
  font-size: clamp(0.72rem, 1.1vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.02em;
}

[data-id="aerochimpFooter"].ui-footer {
  border: 0 !important;
  background: var(--header-bg) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -8px 22px rgba(15, 30, 57, 0.16);
  padding-bottom: calc(0.18rem + env(safe-area-inset-bottom));
}

[data-id="aerochimpFooter"] .ui-navbar ul {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.34rem 0.4rem 0;
}

[data-id="aerochimpFooter"] .ui-navbar li {
  flex: 1 1 0;
}

[data-id="aerochimpFooter"] .ui-navbar a.ui-btn {
  border-radius: 1rem !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  text-shadow: none !important;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

[data-id="aerochimpFooter"] .ui-navbar a.ui-btn:hover {
  border-color: var(--border-soft) !important;
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

[data-id="aerochimpFooter"] .ui-navbar a.ui-btn-active {
  border-color: rgba(76, 168, 212, 0.45) !important;
  background: linear-gradient(135deg, rgba(34, 102, 187, 0.22), rgba(163, 217, 0, 0.18)) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 -3px 0 rgba(76, 168, 212, 0.95);
}

[data-id="aerochimpFooter"] .imprint {
  background: transparent;
  color: var(--text-faint);
  border-top: 1px solid rgba(151, 172, 192, 0.18);
  font-size: 0.72rem;
  height: auto;
  min-height: 1.8rem;
  padding: 0.28rem 0.6rem 0.4rem;
}

[data-id="aerochimpFooter"] .imprint a {
  color: var(--text-muted) !important;
}

h1,
h2,
h3,
h4,
h5,
.listHeader {
  color: var(--text-primary);
  text-shadow: none !important;
}

#mainPage .main-content > tbody > tr > td,
#teamsPage .main-content > tbody > tr > td,
#trainingPage #content,
#presentationPage #content,
#resultsPage .resultContainer {
  background: var(--surface-strong);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

#mainPage .main-content > tbody > tr > td,
#teamsPage .main-content > tbody > tr > td {
  padding: clamp(0.7rem, 1.6vw, 1.2rem);
}

.ui-listview,
.ui-collapsible-content,
.ui-collapsible-set {
  background: transparent !important;
}

.ui-listview > li,
.ui-listview > .ui-li-divider,
.ui-li-static {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-sm);
  margin-bottom: 0.38rem;
  text-shadow: none !important;
}

.ui-listview > .ui-li-divider {
  background: var(--surface-strong) !important;
  color: var(--text-muted) !important;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ui-listview > li,
.ui-li-static {
  animation: as-fade-in 0.3s ease both;
}

.ui-listview > li:nth-child(2n) {
  animation-delay: 0.03s;
}

.ui-li-aside,
.ui-li-count {
  color: var(--text-muted) !important;
  text-shadow: none !important;
}

.ui-btn,
.ui-slider-track,
.ui-collapsible-heading-toggle {
  text-shadow: none !important;
}

.ui-btn {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-soft) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

.ui-btn:hover,
.ui-btn:focus {
  border-color: rgba(34, 102, 187, 0.45) !important;
  background: var(--surface-strong) !important;
}

#mainPage .ui-grid-a.ui-responsive {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 1.8vw, 1.15rem);
}

#mainPage .ui-grid-a.ui-responsive > .ui-block-a,
#mainPage .ui-grid-a.ui-responsive > .ui-block-b {
  float: none !important;
  width: auto !important;
  flex: 1 1 min(26rem, 100%);
  padding: 0 !important;
}

#mainPage .openingContainer-1,
#mainPage .openingContainer-2 {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin: 0 0 0.8rem;
  overflow: hidden;
}

#mainPage .openingContainer-1 .ui-bar,
#mainPage .openingContainer-2 .ui-bar {
  background: var(--surface-strong);
  border: 0;
  border-bottom: 1px solid var(--border-soft);
}

#teamsPage .counterBubble {
  background: var(--accent-grad) !important;
  color: #f6fbff !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 20px rgba(34, 102, 187, 0.3);
}

#teamsPage .teamTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#teamsPage .teamTable th,
#teamsPage .teamTable td {
  border-bottom: 1px solid var(--border-soft);
  padding: 0.58rem 0.42rem;
  color: var(--text-primary);
  text-shadow: none;
}

#teamsPage .teamTable th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.orderPage table.runningOrder {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.78rem;
}

.orderPage table.runningOrder tr.runningOrder.line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.78rem;
}

.orderPage table.runningOrder tr.runningOrder.line > td {
  border: 0 !important;
  background: transparent !important;
  padding: 0;
}

.orderPage table.runningOrder td.item {
  position: relative;
  overflow: hidden;
  flex: 1 1 min(31rem, 100%);
  min-width: min(24rem, 100%);
  width: auto !important;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "number club time"
    "number categorie time"
    "number competitors time";
  gap: 0.34rem 0.85rem;
  padding: 0.92rem 0.95rem 0.82rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft) !important;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface)) !important;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}

.orderPage table.runningOrder td.item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hard);
}

.orderPage table.runningOrder td.item:not(.break)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.28rem;
  background: linear-gradient(180deg, var(--as-water), var(--as-teal), var(--as-lime));
}

.orderPage table.runningOrder td.item:not(.break)::after {
  content: "KG " attr(data-panel);
  position: absolute;
  top: 0.62rem;
  right: 0.78rem;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0.18rem 0.44rem;
  background: rgba(255, 255, 255, 0.08);
}

.orderPage table.runningOrder .item.new-cat {
  border-color: rgba(76, 168, 212, 0.4) !important;
}

.orderPage table.runningOrder .item.lastOf {
  box-shadow: inset 0 -2px 0 rgba(163, 217, 0, 0.55), var(--shadow-soft);
}

.orderPage table.runningOrder .item .number {
  grid-area: number;
  float: none;
  margin-right: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.2rem);
  line-height: 1;
  font-weight: 800;
  color: var(--as-teal);
}

.orderPage table.runningOrder .item .club {
  grid-area: club;
  margin-top: 0.05rem;
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.orderPage table.runningOrder .item .categorie {
  grid-area: categorie;
  font-size: 0.93rem;
  font-weight: 560;
  color: var(--text-muted);
}

.orderPage table.runningOrder .item .competitors {
  grid-area: competitors;
  font-size: 0.86rem;
  line-height: 1.34;
  color: var(--text-muted);
}

.orderPage table.runningOrder .item .time {
  grid-area: time;
  float: none;
  clear: none;
  border-left: 1px solid var(--border-soft);
  padding: 0.42rem 0.62rem 0.82rem;
  min-width: 12.9rem;
  text-align: right;
  color: var(--text-muted);
  position: relative;
  background: transparent !important;
}

.orderPage table.runningOrder .item .time::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  right: 0.62rem;
  bottom: 0.34rem;
  height: 0.24rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(76, 168, 212, 0.95), rgba(34, 102, 187, 0.9) 45%, rgba(163, 217, 0, 0.9));
}

.orderPage table.runningOrder .item .time .headers {
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 0.22rem;
}

.orderPage table.runningOrder .item .time .ui-grid-b,
.orderPage table.runningOrder .item .time .ui-grid-c {
  display: flex;
  gap: 0.36rem;
  justify-content: flex-end;
}

.orderPage table.runningOrder .item .time .ui-grid-b > div,
.orderPage table.runningOrder .item .time .ui-grid-c > div {
  flex: 1 1 auto;
  min-width: 2.4rem;
  text-align: right;
  padding: 0 !important;
}

.orderPage table.runningOrder .item .time .starttime {
  color: var(--as-lime);
  font-weight: 760;
}

.orderPage table.runningOrder .item .time .warmuptime {
  color: var(--as-water);
}

.orderPage table.runningOrder .item .time .waitingtime {
  color: var(--as-orange);
}

.orderPage table.runningOrder td.item.break {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.86rem 1rem;
}

.orderPage table.runningOrder td.item.break .number {
  font-size: 1.08rem;
  color: var(--text-primary);
}

.orderPage table.runningOrder td.item.break .time {
  min-width: 0;
  margin-left: auto;
  border-left: 0;
  padding: 0;
  font-size: 0.82rem;
}

.orderPage table.runningOrder td.item.break .time::after {
  display: none;
}

.orderPage table.runningOrder td.item.break .categorie {
  font-style: italic;
}

.orderPage table.runningOrder td.empty {
  display: none;
}

.orderPage table.runningOrder .solo {
  width: 100% !important;
  font-size: inherit;
}

.orderPage .panelHead,
#judgesPanelPage td.listHeader,
#judgesPanelPage .panelHead {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface-strong) !important;
}

#resultsPage .resultContainer,
#presentationPage #content,
#trainingPage #content,
#judgesPanelPage .main-content {
  padding: clamp(0.7rem, 1.7vw, 1.1rem);
}

.resultsPage .resultTable {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.resultsPage .resultTable th,
.resultsPage .resultTable td {
  border-bottom: 1px solid var(--border-soft);
  text-shadow: none;
}

.resultsPage .resultTable th {
  background: var(--surface-strong);
  color: var(--text-muted);
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resultsPage .resultTable td.rank {
  background: linear-gradient(120deg, rgba(34, 102, 187, 0.2), rgba(163, 217, 0, 0.2));
}

#presentationPage .liveView {
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(0.8rem, 1.8vw, 1.2rem);
}

#presentationPage .scores.ui-collapsible {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.aerochimpFooter {
  margin-top: 0.65rem;
  color: var(--text-muted);
}

.aerochimpFooter img {
  height: 1.1rem;
  width: auto;
}

.federation-logo {
  height: 1.25rem;
  width: auto;
  max-width: 10rem;
}

.printonly .federation-logo,
.printonly.aerochimpFooter img {
  filter: grayscale(0.2);
}

@media (max-width: 54em) {
  #aerochimpHeader.ui-header {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "logo title title icon"
      "nav module module print";
  }

  #aerochimpHeader .app-logo-wordmark {
    max-width: 44vw;
  }

  #aerochimpHeader .menuButton,
  #aerochimpHeader .printAction {
    font-size: 0.73rem;
    min-height: 1.86rem;
  }

  .orderPage table.runningOrder td.item {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "number club"
      "number categorie"
      "number competitors"
      "time time";
  }

  .orderPage table.runningOrder .item .time {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
    padding-top: 0.52rem;
    margin-top: 0.22rem;
    min-width: 0;
  }
}
