/* The touch panel at the door. Big targets: it is used standing, by people
   who have never seen it. */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--r6-night);
  color: var(--r6-pip);
  font: 400 18px/1.5 var(--r6-font-sans);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.panel {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--r6-line);
}

.panel__logo {
  height: 30px;
  width: auto;
}

.panel__product {
  margin-right: 8px;
  color: var(--r6-mist);
  font: 500 13px/1 var(--r6-font-display);
  letter-spacing: .3em;
}

.chip {
  padding: 5px 14px;
  border: 1px solid var(--r6-line-strong);
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
}

.chip--off {
  border-color: var(--r6-danger);
  color: var(--r6-danger-text);
}

.chip--gold {
  border-color: var(--r6-spark);
  color: var(--r6-spark);
}

.panel__tabs {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.tab {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--r6-mist);
}

.tab--on {
  border-color: var(--r6-line-strong);
  background: var(--r6-face);
  color: var(--r6-pip);
}

.notice {
  margin: 0;
  padding: 12px 24px;
  background: var(--r6-danger-soft);
  color: var(--r6-danger-text);
  font-weight: 700;
}

.panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.empty {
  margin: 0;
  padding: 32px 24px;
  color: var(--r6-mist);
}

/* Choosing */
.choices {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 14px;
  padding: 18px 24px 6px;
}

.segment {
  display: flex;
  gap: 8px;
}

.segment__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 72px;
  padding: 12px 16px;
  border: 2px solid var(--r6-line);
  border-radius: var(--r6-radius-control);
  background: var(--r6-face);
  text-align: left;
}

.segment__item strong {
  font-size: 20px;
  font-weight: 900;
}

.segment__item small {
  color: var(--r6-mist);
  font-size: 13px;
  line-height: 1.4;
}

.segment__item--on {
  border-color: var(--r6-glow);
  background: var(--r6-glow-soft);
}

.segment--small .segment__item {
  align-items: center;
  min-height: 64px;
}

.groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 14px 24px 24px;
}

.group__name {
  margin: 0 0 10px;
  color: var(--r6-mist);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 132px;
  padding: 14px 16px;
  border: 2px solid var(--r6-line);
  border-radius: var(--r6-radius-card);
  background: var(--r6-face);
  text-align: left;
}

.game:disabled {
  opacity: .4;
}

.game--on {
  border-color: var(--r6-glow);
  background: var(--r6-glow-soft);
}

.game__no {
  color: var(--r6-glow);
  font-size: 13px;
  font-weight: 700;
}

.game__order {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--r6-glow);
  color: var(--r6-night);
  font-family: var(--r6-font-sans);
  font-size: 13px;
  font-weight: 700;
}

.game__name {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.game__summary {
  font-size: 15px;
  line-height: 1.5;
}

.game__meta {
  margin-top: auto;
  color: var(--r6-mist);
  font-size: 13px;
}

/* Which level of each chosen game */
.levels {
  position: sticky;
  bottom: 97px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 12px 24px;
  border-top: 1px solid var(--r6-line);
  background: var(--r6-night);
}

.levels + .start {
  margin-top: 0;
}

.levels__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.levels__game {
  flex: none;
  width: 7em;
  font-weight: 700;
}

.levels__list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.level {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 96px;
  min-height: 54px;
  padding: 6px 14px;
  border: 2px solid var(--r6-line);
  border-radius: 14px;
  background: var(--r6-face);
  text-align: left;
}

.level strong {
  font-size: 16px;
}

.level small {
  color: var(--r6-mist);
  font-size: 13px;
}

.level--on {
  border-color: var(--r6-glow);
  background: var(--r6-glow-soft);
}

.random {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex: 1;
  padding: 32px 24px;
}

.random__lead {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.random .segment {
  width: min(100%, 420px);
}

.start {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding: 14px 24px;
  border-top: 1px solid var(--r6-line);
  background: var(--r6-night);
}

.start__note {
  flex: 1;
  min-width: 0;
  color: var(--r6-mist);
  font-size: 18px;
}

.start__button {
  min-width: 200px;
  min-height: 68px;
  border: 0;
  border-radius: var(--r6-radius-control);
  background: var(--r6-glow);
  color: var(--r6-night);
  font-size: 26px;
  font-weight: 900;
}

.start__button:disabled {
  background: var(--r6-face-2);
  color: var(--r6-mist);
  cursor: default;
}

/* While a session runs */
.running {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  padding: 32px 24px;
  text-align: center;
}

.running__phase {
  margin: 0;
  color: var(--r6-glow-text);
  font-size: 20px;
}

.running__name {
  margin: 0;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 900;
  line-height: 1.15;
}

.running__meta,
.running__place {
  margin: 0;
  color: var(--r6-mist);
  font-size: 22px;
}

.running__place {
  color: var(--r6-spark);
  font-weight: 700;
}

.name {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: min(100%, 520px);
  margin-top: 12px;
}

.name__label {
  grid-column: 1 / -1;
  color: var(--r6-mist);
  font-size: 16px;
}

.name__input {
  min-height: 60px;
  min-width: 0;
  padding: 0 18px;
  border: 2px solid var(--r6-line-strong);
  border-radius: var(--r6-radius-control);
  background: var(--r6-face);
  font-size: 24px;
}

.name__button,
.stop {
  min-height: 60px;
  padding: 0 24px;
  border: 2px solid var(--r6-line-strong);
  border-radius: var(--r6-radius-control);
  background: var(--r6-face);
  font-size: 20px;
  font-weight: 700;
}

.name__button:not(:disabled) {
  border-color: var(--r6-glow);
  background: var(--r6-glow);
  color: var(--r6-night);
}

.stop {
  margin-top: 28px;
  color: var(--r6-mist);
}

.stop--sure {
  border-color: var(--r6-danger);
  color: var(--r6-danger-text);
}

/* The staff are at it, or the panel is closed: wait */
.wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
  padding: 32px 24px;
  text-align: center;
}

.wait__mark {
  width: 72px;
  height: 72px;
  margin-bottom: 10px;
  opacity: .9;
}

.wait__title {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.25;
}

.wait__note {
  margin: 0;
  min-height: 1.5em;
  color: var(--r6-mist);
  font-size: 22px;
}

/* Boards */
.board-pick {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  overflow-x: auto;
}

.pill {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--r6-line-strong);
  border-radius: 999px;
  background: var(--r6-face);
  white-space: nowrap;
}

.pill--on {
  border-color: var(--r6-glow);
  background: var(--r6-glow-soft);
}

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  padding: 0 24px 24px;
}

.board {
  padding: 18px 20px;
  border: 1px solid var(--r6-line);
  border-radius: var(--r6-radius-card);
  background: var(--r6-face);
}

.board h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.board .empty {
  padding: 8px 0;
}

.board ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: place;
}

.board li {
  display: grid;
  grid-template-columns: 2em 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--r6-line);
  counter-increment: place;
}

.board li::before {
  content: counter(place);
  color: var(--r6-mist);
  font-family: var(--r6-font-display);
  font-size: 14px;
}

.board li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.board li small {
  color: var(--r6-mist);
}

@media (max-width: 720px) {
  .choices {
    grid-template-columns: 1fr;
  }

  .panel__tabs {
    margin-left: 0;
    width: 100%;
  }

  .tab {
    flex: 1;
  }
}
