/* Sized in vw/vh so the board fills any 16:9 TV without scrolling. */
:root {
  --bg: #0b0b0d;
  --panel: #17171b;
  --slate: #2a2a2f;
  --text: #f5f5f7;
  --muted: #8d8d96;
  --accent: #d5202b;
  --pending: #f2a93b;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  overflow: hidden;
  cursor: none;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 2vh;
  padding: 3vh 2.5vw 2vh;
}

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

.top {
  display: flex;
  align-items: center;
  gap: 1.6vw;
}

.logo { height: 7vh; width: auto; }

.titles { flex: 1; }

h1 {
  font-size: 4.6vh;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service {
  display: flex;
  align-items: center;
  gap: 1vw;
  margin-top: 0.8vh;
  font-size: 2.6vh;
  color: var(--muted);
}

.pill {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5vh 1vw;
  border-radius: 999px;
}

.pill.evening { background: #fff; color: var(--bg); }

.clock { text-align: right; }
#clock-time { font-size: 5.5vh; font-weight: 700; font-variant-numeric: tabular-nums; }
#clock-date { font-size: 2.2vh; color: var(--muted); }

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.6vw;
  min-height: 0;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 1.2vw;
  overflow: hidden;
  min-height: 0;
}

.photo {
  position: relative;
  flex: 1;
  min-height: 0;
  background: linear-gradient(145deg, #2c2c33, #1c1c21);
  display: grid;
  place-items: center;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

.initials {
  font-size: 9vh;
  font-weight: 800;
  color: #4a4a53;
}

.info {
  padding: 1.4vh 1.2vw 1.8vh;
  border-top: 0.5vh solid var(--accent);
}

.mic {
  font-size: 2.4vh;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.name {
  margin-top: 0.4vh;
  font-size: 3.6vh;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: none;
  position: absolute;
  top: 1.4vh;
  right: 1.4vh;
  background: var(--pending);
  color: #1a1200;
  font-size: 1.8vh;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4vh 0.8vw;
  border-radius: 999px;
}

.tile.pending .badge { display: block; }

/* Mic / IEM battery meters */
.batt {
  display: flex;
  gap: 1vw;
  margin-top: 1vh;
}

.batt:empty { display: none; }

.batt .cell {
  display: flex;
  align-items: center;
  gap: 0.45vw;
  flex: 1;
  min-width: 0;
  font-size: 1.7vh;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.batt .tag { color: var(--muted); letter-spacing: 0.08em; }

.batt .meter {
  position: relative;
  flex: 1;
  min-width: 2vw;
  height: 1vh;
  border-radius: 999px;
  background: #2c2c33;
  overflow: hidden;
}

.batt .meter i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: #46c37b;
}

.batt .val { white-space: nowrap; }

.batt .lvl-low .meter i { background: var(--pending); }
.batt .lvl-low .val { color: var(--pending); }
.batt .lvl-critical .meter i { background: #ff4d4f; }
.batt .lvl-critical .val { color: #ff6b6d; }
.batt .lvl-off .val, .batt .lvl-unknown .val { color: var(--muted); }

/* A critical battery makes the whole tile pulse so someone swaps it. */
.tile.batt-critical { animation: batt-pulse 1.6s ease-in-out infinite; }

@keyframes batt-pulse {
  0%, 100% { box-shadow: 0 0 0 0.25vw rgba(255, 77, 79, 0.15); }
  50% { box-shadow: 0 0 0 0.35vw rgba(255, 77, 79, 0.85); }
}

/* Empty position: grey slate */
.tile.empty { background: var(--slate); }
.tile.empty .photo { background: transparent; }
.tile.empty .info { border-top-color: #3a3a40; }
.tile.empty .mic { color: var(--muted); }
.tile.empty .name { color: var(--muted); font-weight: 500; font-style: italic; }

/* ---------- set list ---------- */

.setlist {
  display: flex;
  align-items: center;
  gap: 1.2vw;
  min-width: 0;
}

.setlist[hidden] { display: none; }

.setlist-label {
  flex: none;
  font-size: 1.9vh;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#songs {
  display: flex;
  gap: 0.8vw;
  list-style: none;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 2.5vh; /* shrunk by app.js if a long set doesn't fit */
}

#songs li {
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex: none;
  background: var(--panel);
  border-radius: 999px;
  padding: 0.45em 0.5em 0.45em 0.9em;
  white-space: nowrap;
}

#songs .num { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
#songs .title { font-weight: 700; }

#songs .key {
  min-width: 1.9em;
  padding: 0.1em 0.45em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85em;
  font-weight: 800;
  text-align: center;
}

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

.bottom {
  display: flex;
  justify-content: space-between;
  font-size: 1.9vh;
  color: var(--muted);
}

#status.error { color: var(--pending); }

/* ---------- weekday screen ---------- */

body.weekday { display: block; padding: 0; }
body.weekday > :not(.weekday) { display: none !important; }

.weekday {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.weekday[hidden] { display: none; }

.wk-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(80vw, 140vh);
  transition: transform 20s ease-in-out;
}

.wk-logo { height: 7vh; opacity: 0.55; }

.wk-time {
  margin-top: 4vh;
  font-size: 16vh;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #c9c9d0;
  font-variant-numeric: tabular-nums;
}

.wk-date { margin-top: 1.5vh; font-size: 3.2vh; color: var(--muted); }

.wk-coming {
  width: 100%;
  margin-top: 7vh;
  padding-top: 4vh;
  border-top: 1px solid #26262c;
}

.wk-coming h2 {
  font-size: 2.2vh;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.wk-mics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.2vh 2vw;
  margin-top: 3vh;
  padding: 0;
  list-style: none;
  text-align: left;
}

.wk-mics li { min-width: 0; }

.wk-mics .mic {
  display: block;
  font-size: 1.7vh;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8f2a2f; /* dimmed accent */
}

.wk-mics .who {
  display: block;
  margin-top: 0.3vh;
  font-size: 2.6vh;
  font-weight: 600;
  color: #b4b4bc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wk-mics .who.empty { color: #55555d; font-style: italic; font-weight: 400; }

.wk-songs {
  margin-top: 4vh;
  font-size: 2.1vh;
  color: #77777f;
  line-height: 1.6;
}

.wk-songs:empty { display: none; }
