:root {
  font:
    16px/1.5 "Inter",
    "Noto Sans CJK SC",
    "Microsoft YaHei",
    sans-serif;
  color: #172b2a;
  background: #f3f5f1;
  --dark: #102725;
  --ink: #172b2a;
  --line: #dbe2db;
  --muted: #52665f;
  --lime: #c0f664;
  --green: #52792d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.linkbtn {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
button:hover,
.linkbtn:hover {
  filter: brightness(0.96);
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #669337;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.055em;
  line-height: 1.2;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 16px;
}
.ico {
  width: 19px;
  height: 19px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
.mono,
.timer,
.num,
.val {
  font-family: "Barlow", "Arial", sans-serif;
  font-variant-numeric: tabular-nums;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
}
aside {
  background: var(--dark);
  color: #eaf3ef;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  height: 100vh;
  top: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px 32px;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -1px;
}
.brand small {
  display: block;
  font: 700 10px/1.4 Arial;
  letter-spacing: 2.4px;
  color: #b5c5bc;
}
.logomark {
  display: grid;
  place-content: center;
  gap: 3px;
  width: 35px;
  height: 39px;
  transform: skew(-16deg);
}
.logomark i {
  display: block;
  width: 27px;
  height: 7px;
  background: var(--lime);
}
.logomark i:first-child {
  width: 18px;
  margin-left: 9px;
}
.logomark i:last-child {
  width: 18px;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav button,
.sidefoot button {
  background: transparent;
  border: 0;
  color: #b5c7be;
  justify-content: flex-start;
  padding: 13px 14px;
  font-size: 15px;
}
.nav button.active {
  background: #2e443b;
  color: var(--lime);
}
.sidefoot {
  margin-top: auto;
  border-top: 1px solid #354a43;
  padding: 18px 5px 0;
}
.sidefoot small {
  display: block;
  font: 11px Arial;
  color: #96a9a1;
  letter-spacing: 1px;
  margin-top: 10px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 64px;
  background: #fcfdfa;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 48px);
}
.crumb,
.topright,
.actions,
.row,
.inline {
  display: flex;
  gap: 10px;
  align-items: center;
}
.crumb {
  font-size: 14px;
  color: var(--muted);
}
.crumb b {
  color: var(--ink);
}
.topright {
  font: 600 14px Arial;
  letter-spacing: 0.6px;
}
.avatar {
  background: #e5ecdf;
  border: 1px solid #ccd8c8;
  padding: 5px 8px;
  border-radius: 7px;
  font: 700 13px sans-serif;
}
.main {
  max-width: 1500px;
  margin: auto;
  padding: 30px clamp(18px, 3vw, 48px) 48px;
}
.pagehead,
.sectionhead,
.cardhead,
.between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pagehead {
  margin: 0 0 25px;
  flex-wrap: wrap;
}
.kicker {
  font: 700 11px/1.6 Arial;
  letter-spacing: 2.2px;
  color: #5b7165;
  margin-bottom: 5px;
}
.darkbtn {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}
.lime {
  background: var(--lime);
  color: #192d20;
  border-color: var(--lime);
}
.soft {
  background: #edf2e9;
}
.iconbtn {
  padding: 8px;
}
.panel,
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(285px, 1fr);
  gap: 18px;
  align-items: stretch;
}
.clockcard {
  background: #122e29;
  color: #f3f8ed;
  border-radius: 15px;
  padding: 24px 26px 20px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.clockcard:before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 300px;
  height: 300px;
  right: -139px;
  top: -120px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from -1deg,
    rgba(180, 215, 163, 0.3) 0deg 0.7deg,
    transparent 0.7deg 5deg
  );
  mask-image: radial-gradient(
    circle,
    transparent 47%,
    #000 47.5%,
    #000 65%,
    transparent 65.5%
  );
  transform: rotate(-14deg);
}
.clockcard:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 94% 8%, #355443, transparent 55%),
    linear-gradient(120deg, #132c29, #17382e);
}
.eventname {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: white;
  padding: 0;
  text-align: left;
  font-size: 19px;
  font-weight: 750;
  max-width: 100%;
}
.clocktop .kicker {
  color: #b0c2ae;
  font-size: 10px;
  margin-bottom: 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 3px 9px;
  background: #e8f2dc;
  color: #496830;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.clockcard .tag {
  background: #2f4734;
  color: #d4f6a4;
  border: 1px solid #526748;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.clockmiddle {
  text-align: center;
  padding: 19px 0 11px;
}
.leveltag {
  display: inline-block;
  text-transform: uppercase;
  color: #c3ef84;
  letter-spacing: 2px;
  font: 750 12px Arial;
}
.timer {
  font-weight: 650;
  font-size: clamp(64px, 7.3vw, 112px);
  line-height: 1.04;
  letter-spacing: -0.062em;
  margin: 3px 0 7px;
}
.tickbar {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: #395545;
}
.tickbar i {
  display: block;
  background: var(--lime);
  height: 100%;
  transition: width 0.25s;
}
.blindrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 15px 0;
}
.blindrow > div + div {
  border-left: 1px solid #466052;
  padding-left: 24px;
}
.blindrow small {
  color: #baccc0;
  font-size: 13px;
}
.blindrow strong {
  font-size: clamp(21px, 2.1vw, 32px);
  letter-spacing: -0.04em;
  display: block;
  line-height: 1.2;
}
.blindrow em {
  color: #baccc0;
  font-size: 12px;
  font-style: normal;
}
.clockactions {
  display: flex;
  gap: 7px;
  border-top: 1px solid #395247;
  padding-top: 15px;
}
.clockactions button {
  flex: 1;
  white-space: nowrap;
}
.clockactions .sub {
  color: #e0e9dc;
  background: #29453b;
  border-color: #405b4b;
}
.clockactions .iconbtn {
  flex: 0;
}
.panel {
  padding: 21px;
}
.cardhead {
  margin-bottom: 18px;
}
.iconlabel {
  display: flex;
  align-items: center;
  gap: 9px;
}
.cardhead small,
.muted,
.field small {
  color: var(--muted);
}
.textbtn {
  background: none;
  border: 0;
  padding: 3px;
  color: #476b32;
  font-size: 13px;
}
.schedule table,
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.schedule td,
.schedule th,
.tbl td,
.tbl th {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid #e9ede7;
  white-space: nowrap;
}
.schedule td:last-child,
.schedule th:last-child {
  text-align: right;
}
th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.schedule tr.current td,
.tbl tr.current td {
  background: #eff6e5;
  color: #3a5d24;
  font-weight: 700;
}
.schedule tr.current td:first-child {
  box-shadow: inset 3px 0 #84a94a;
}
.nextbreak {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.sectionhead {
  margin: 24px 0 12px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}
.stat {
  padding: 16px 18px;
}
.stat .statlabel {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #53665e;
  font-size: 14px;
}
.stat .ico {
  color: #647b55;
  width: 16px;
}
.val {
  font-size: clamp(26px, 2.5vw, 40px);
  display: block;
  font-weight: 700;
  letter-spacing: -0.045em;
  margin-top: 7px;
}
.tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tool {
  justify-content: flex-start;
  text-align: left;
  padding: 14px 16px;
  background: white;
}
.tool .boxicon {
  padding: 7px;
  background: #eef3e8;
  color: #527140;
  border-radius: 7px;
}
.tool .chev {
  margin-left: auto;
  color: #91a089;
}
.stack {
  display: grid;
  gap: 12px;
}
.listitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  flex-wrap: wrap;
}
.listitem:last-child {
  border: 0;
}
.listitem small {
  display: block;
  color: var(--muted);
}
.empty {
  padding: 20px 0;
  color: var(--muted);
}
.forms {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
}
.field input,
.field select,
.field textarea,
td input,
td select {
  width: 100%;
  background: white;
  border: 1px solid #bac9bf;
  border-radius: 6px;
  padding: 9px 10px;
  min-width: 0;
  font-size: 16px;
}
.field textarea {
  min-height: 85px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sectionhead .actions,
.cardhead .actions,
.pagehead .actions {
  flex-wrap: wrap;
}
.footerbuttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
}
dialog {
  width: min(560px, 94vw);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0;
  color: var(--ink);
  max-height: 88dvh;
  box-shadow: 0 20px 100px #10272535;
}
dialog.wide {
  width: min(800px, 95vw);
}
dialog::backdrop {
  background: #081a17a6;
}
#modal {
  padding: 24px;
}
#modal .cardhead {
  position: sticky;
  top: -24px;
  background: white;
  z-index: 1;
  padding: 5px 0;
}
.scroll {
  overflow: auto;
}
.editrows input {
  min-width: 54px;
  width: 100%;
  padding: 5px;
}
.editrows td {
  padding: 4px;
}
.danger {
  color: #a23636;
}
.notice {
  padding: 12px;
  border-radius: 8px;
  background: #f0f4e8;
  margin: 10px 0;
  font-size: 14px;
}
.formerror {
  color: #aa3838;
  font-size: 14px;
}
.formerror:empty {
  display: none;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: #1d372e;
  padding: 10px 18px;
  border-radius: 9px;
  pointer-events: none;
  z-index: 20;
  max-width: 90vw;
}
#toast:empty {
  display: none;
}
.tv {
  min-height: 100dvh;
  background: #102c27;
  color: #f5f9ef;
  padding: 4vh 5vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.tv .between {
  width: 100%;
  flex-wrap: wrap;
}
.tv h1 {
  font-size: clamp(32px, 4.6vw, 90px);
}
.tv .timer {
  font-size: clamp(95px, 18vw, 32vh);
  color: #e0f6bc;
}
.tv .blindrow {
  width: min(100%, 1000px);
  margin: auto;
}
.tv .blindrow strong {
  font-size: clamp(30px, 4.5vw, 80px);
}
.tv .blindrow small,
.tv .blindrow em {
  font-size: clamp(16px, 1.5vw, 28px);
}
.tv .leveltag {
  font-size: clamp(16px, 2vw, 36px);
}
.tv .tickbar {
  margin: 1.8vh 0;
}
.tv .score {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1vw 3vw;
  font-size: clamp(17px, 1.8vw, 34px);
  margin: 2vh 0;
}
.tvactions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.tvactions button,
.tvactions a {
  background: #253e35;
  color: #d6e5d4;
  border-color: #486253;
}
.code {
  font: 700 clamp(32px, 7vw, 90px) monospace;
  letter-spacing: 0.12em;
  color: var(--lime);
}
.tv.promo {
  background: #253449;
}
.tv.check {
  background: #312f30;
}
.winnerpic {
  max-height: 35vh;
  max-width: 75%;
  object-fit: contain;
  margin: auto;
}
.tvlogo {
  height: 42px;
  vertical-align: middle;
  margin-right: 10px;
}
.mobilebrand {
  display: none;
}
.hidden {
  display: none !important;
}
#connection {
  font-size: 12px;
  color: #d5e5b7;
}
.help {
  font-size: 14px;
  color: var(--muted);
}
.file {
  max-width: 100%;
}
.listitem .row,
.formgrid .row {
  flex-wrap: wrap;
}
.badgeicon {
  border: 1px solid #cfdbc7;
  border-radius: 9px;
  background: #edf4e4;
  padding: 9px;
  color: #537345;
}
.brandpreview {
  height: 50px;
  max-width: 150px;
  object-fit: contain;
}
.actions select {
  max-width: 190px;
}
.admin-tools {
  padding-top: 20px;
}
@media (min-width: 1450px) {
  .clockmiddle {
    padding: 26px 0 18px;
  }
  .schedule td {
    padding: 13px 6px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 172px minmax(0, 1fr);
  }
  aside {
    padding: 25px 10px;
  }
  .main {
    padding: 24px 20px;
  }
  .clockcard {
    padding: 19px;
  }
  .panel {
    padding: 16px;
  }
  .columns {
    grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr);
    gap: 12px;
  }
  .clockactions button {
    padding: 8px;
    font-size: 13px;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 13px;
  }
  .clockactions .ico {
    width: 15px;
  }
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 68px minmax(0, 1fr);
  }
  aside {
    padding: 24px 6px;
  }
  .brand {
    justify-content: center;
    padding: 0 0 26px;
  }
  .brand span,
  .nav button span,
  .sidefoot {
    display: none;
  }
  .nav button {
    justify-content: center;
  }
  .columns {
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 1fr);
  }
  .blindrow > div + div {
    padding-left: 12px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  aside {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    min-height: 0;
    height: auto;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
  }
  .nav {
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }
  .nav button {
    flex-direction: column;
    gap: 2px;
    padding: 5px 1px;
    font-size: 11px;
  }
  .nav button span {
    display: block;
  }
  .brand {
    display: none;
  }
  .topbar {
    height: 47px;
    padding: 0 16px;
  }
  .topright {
    font-size: 12px;
  }
  .main {
    padding: 20px 14px 88px;
  }
  .pagehead {
    margin-bottom: 16px;
  }
  .pagehead .actions {
    gap: 5px;
  }
  .pagehead .actions button {
    padding: 8px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .clockcard {
    padding: 20px;
  }
  .clockmiddle {
    padding: 18px 0 8px;
  }
  .timer {
    font-size: 83px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool {
    padding: 10px;
    font-size: 13px;
  }
  .sectionhead {
    margin: 19px 0 9px;
  }
  .schedule td {
    padding: 8px;
  }
  .tv {
    padding: 4vh 4vw;
  }
  .tv .timer {
    font-size: 22vw;
  }
  .actiontext {
    display: none;
  }
  .listitem .row {
    gap: 5px;
  }
  .modal {
    padding: 16px;
  }
  .clockactions button {
    font-size: 14px;
  }
  #toast {
    bottom: 77px;
  }
  .mobilebrand {
    display: block;
  }
  .pagehead h1 {
    font-size: 30px;
  }
}

[data-presence]::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.4em;
  vertical-align: 0.08em;
  border-radius: 50%;
  background: #84918a;
}
[data-presence].device-online::before {
  background: #358153;
}
[data-position-clock], .code {
  font-variant-numeric: tabular-nums;
}

.competition-stats { display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.competition-stats h2 { margin: 0; }
.competition-stats .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.competition-stats .stat { border: 0; border-radius: 0; text-align: center; }
.competition-stats .statlabel { justify-content: center; }
.stat-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-controls button { flex: 1 1 120px; }
@media (max-width: 520px) { .clockactions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.screen-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.screen-slot:last-child { padding-bottom: 0; }
.screen-slot-info { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.screen-slot-icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px;
  color: #3d614f; background: #edf3ec; border-radius: 10px;
}
.screen-slot-info h3 { font-size: 1.04rem; line-height: 1.4; }
.screen-slot-info p { margin-top: 3px; color: var(--muted); font-size: .875rem; }
.screen-slot-info [data-position-clock] { white-space: nowrap; font-variant-numeric: tabular-nums; }
.screen-slot-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.screen-slot-tools > * { min-width: 0; min-height: 44px; padding: 7px 10px; color: var(--ink); white-space: nowrap; }
.screen-slot-tools .slot-preview { background: #edf3ec; color: #284c3c; border-color: #d3e1d4; }
.screen-slot .slot-more { color: var(--muted); border: 0; padding: 6px; gap: 4px; min-height: 44px; }
.slot-more .ico { width: 14px; }
.slot-options h3 { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 8px; }
.slot-options > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-options button { min-height: 44px; }
@media (max-width: 720px) {
  .screen-slot { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .screen-slot .slot-more { grid-row: 1; grid-column: 2; align-self: start; }
  .screen-slot-tools { grid-column: 1 / -1; }
}
.columns>.clockcard{padding:16px 20px}
.clockcard .clockmiddle{padding:6px 0 4px}
.clockcard .timer{font-size:clamp(52px,6vw,84px);margin:0}
.clockcard .blindrow{padding-top:8px}
.clockcard .clockactions{padding-top:8px;margin-top:8px}
.columns>.competition-stats{padding:14px;align-self:start;gap:10px}
.competition-stats .stat{padding:8px}
@media(max-width:700px){
  .columns>.clockcard,.columns>.competition-stats{padding:12px}
  .clockcard .timer{font-size:56px}
  .competition-stats .stats{margin:8px 0}
  .competition-stats .stat{padding:6px}
  .competition-stats .val{font-size:20px}
}
