:root {
  --bg: #0b1020;
  --bg2: #131a33;
  --card: #1b2447;
  --card2: #222c55;
  --text: #eef1ff;
  --muted: #9aa5d1;
  --accent: #6c8cff;
  --accent2: #41d8a6;
  --warn: #ffb454;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, #22306b 0%, var(--bg) 55%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- header / footer ---------- */

#topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2vh 2.5vw;
  border-bottom: 1px solid rgba(108, 140, 255, .25);
  background: rgba(11, 16, 32, .6);
  backdrop-filter: blur(6px);
}

#brand { font-size: 2.6vh; font-weight: 700; letter-spacing: .03em; }
#brand .dot { color: var(--accent2); }

#clock { font-size: 2.6vh; color: var(--muted); font-variant-numeric: tabular-nums; }

#bottombar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6vh;
  padding: 1vh 2.5vw;
  border-top: 1px solid rgba(108, 140, 255, .25);
  background: rgba(11, 16, 32, .6);
}

#bottombar button {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(108, 140, 255, .35);
  border-radius: 1vh;
  font-size: 2.4vh;
  line-height: 1;
  padding: .4vh 1.4vh;
  cursor: pointer;
}
#bottombar button:hover { background: var(--card2); }

#dots { display: flex; gap: .9vh; align-items: center; }
.dot {
  width: 1.1vh; height: 1.1vh;
  border-radius: 50%;
  background: rgba(154, 165, 209, .4);
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.dot.active { background: var(--accent); }
.dot.active::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1.1vh;
  border-radius: 50%;
  background: var(--accent2);
  transform-origin: left center;
  animation: tick linear forwards;
}

#pageNum { color: var(--muted); font-size: 1.8vh; margin-left: 2vh; min-width: 6vh; }

/* ---------- stage ---------- */

#stage { flex: 1 1 auto; position: relative; overflow: hidden; }

.screen {
  position: absolute;
  inset: 0;
  padding: 2.2vh 2.5vw;
  display: flex;
  flex-direction: column;
  animation: fadein .35s ease;
  background: var(--bg);
}
.screen[hidden] { display: none !important; }
@keyframes fadein { from { opacity: 0; transform: translateY(1vh); } to { opacity: 1; transform: none; } }
@keyframes tick { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.screen h2 {
  font-size: 3.4vh;
  margin-bottom: 1.8vh;
  display: flex;
  align-items: center;
  gap: 1.2vh;
}
.screen h2 .bar {
  width: .8vh; height: 3.4vh;
  border-radius: .5vh;
  background: linear-gradient(var(--accent), var(--accent2));
}

/* ---------- general ---------- */

#screen-general .wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; max-width: 78vw; }

#screen-general .tagline { color: var(--accent2); font-size: 2.4vh; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
#screen-general .name { font-size: 7vh; line-height: 1.05; font-weight: 800; }
#screen-general .meta { display: flex; gap: 2.5vw; font-size: 2.6vh; color: var(--muted); flex-wrap: wrap; }
#screen-general .meta span::before { content: "— "; color: var(--accent); }
#screen-general .description { font-size: 2.4vh; line-height: 1.55; color: #c9d1f2; max-width: 70vw; }

.facts { display: flex; gap: 1.6vw; flex-wrap: wrap; margin-top: .5vh; }
.fact {
  background: var(--card);
  border: 1px solid rgba(108, 140, 255, .3);
  border-radius: 1.6vh;
  padding: 1.6vh 2vw;
  min-width: 12vw;
}
.fact .label { color: var(--muted); font-size: 1.7vh; text-transform: uppercase; letter-spacing: .08em; }
.fact .value { font-size: 3vh; font-weight: 700; margin-top: .4vh; }

.partners { margin-top: .5vh; color: var(--muted); font-size: 1.9vh; }
.partners b { color: var(--text); font-weight: 600; }

/* ---------- schedule ---------- */

.sched { flex: 1; display: flex; flex-direction: column; gap: 1vh; justify-content: center; }
.sched-row {
  display: grid;
  grid-template-columns: 12vh 1fr 1.2fr;
  gap: 0 2vw;
  align-items: center;
  background: var(--card);
  border-left: .5vh solid var(--accent);
  border-radius: 1.2vh;
  padding: 1.2vh 2vw;
}
.sched-row .time { font-size: 2.8vh; font-weight: 700; color: var(--accent2); font-variant-numeric: tabular-nums; }
.sched-row .title { font-size: 2.5vh; font-weight: 600; }
.sched-row .note { font-size: 2.1vh; color: var(--muted); }

/* ---------- info ---------- */

.cards { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 1.8vh; }
.card {
  background: var(--card);
  border: 1px solid rgba(108, 140, 255, .25);
  border-radius: 1.6vh;
  padding: 2vh 1.6vw;
  display: flex;
  flex-direction: column;
  gap: 1vh;
  justify-content: center;
}
.card .icon { font-size: 4vh; }
.card .title { font-size: 2.6vh; font-weight: 700; }
.card .text { font-size: 2vh; line-height: 1.45; color: var(--muted); }

/* ---------- tasks ---------- */

.tasks { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 1.8vh; }
.task {
  background: var(--card);
  border: 1px solid rgba(108, 140, 255, .25);
  border-radius: 1.6vh;
  padding: 2vh 1.6vw;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}
.task .num {
  width: 4.2vh; height: 4.2vh;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0b1020;
  font-weight: 800;
  font-size: 2.4vh;
  display: flex; align-items: center; justify-content: center;
}
.task .title { font-size: 2.4vh; font-weight: 700; line-height: 1.2; }
.task .text { font-size: 1.9vh; line-height: 1.4; color: var(--muted); flex: 1; }
.task .tags { display: flex; gap: .8vh; flex-wrap: wrap; }
.task .tags span {
  font-size: 1.5vh;
  background: rgba(108, 140, 255, .18);
  color: #aab8ff;
  padding: .3vh 1vh;
  border-radius: 1vh;
}

/* ---------- team ---------- */

.team { flex: 1; display: flex; flex-direction: column; gap: 2.6vh; justify-content: center; max-width: 80vw; }
.team .head { display: flex; align-items: center; gap: 2vw; }
.team .emoji { font-size: 8vh; }
.team .name { font-size: 6vh; font-weight: 800; line-height: 1.05; }
.team .taskline { font-size: 2.6vh; color: var(--accent2); font-weight: 600; }
.team .taskline::before { content: "Задание: "; color: var(--muted); font-weight: 400; }
.team .members { display: flex; flex-wrap: wrap; gap: 1.2vh 1.2vw; margin-top: 1vh; }
.member {
  background: var(--card);
  border: 1px solid rgba(108, 140, 255, .3);
  border-radius: 10vh;
  padding: 1.2vh 2.2vw;
  font-size: 2.6vh;
}
.member::before { content: "● "; color: var(--accent2); font-size: 1.6vh; vertical-align: .3vh; }

/* ---------- misc ---------- */

.error { color: var(--warn); font-size: 2vh; padding: 2vh; }
#reloadNote { color: var(--muted); font-size: 1.6vh; }
