/* Prediction panel: the number, its character and pinyin, the confidence bar
   and the runner-up. Heights are fixed so the panel never jumps. */

.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--su-line);
  border-radius: var(--su-radius);
  background: var(--panel);
}

/* "// prediction", "// hand shapes" */
.panel h2 {
  margin: 0 0 14px;
  color: var(--muted);
  font: 500 12px var(--mono);
  letter-spacing: 0;
  text-transform: lowercase;
}

.panel h2::before {
  content: "// ";
  color: var(--brand-text);
}

.reading {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Fixed heights, so the panel does not move when a number appears. */
.number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2ch;
  height: 120px;
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.number.none {
  color: var(--dim);
}

.number.egg {
  font-size: 96px;
}

.details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.caption {
  display: flex;
  align-items: center;
  height: 44px;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.caption .char {
  font-family: var(--cjk);
  font-size: 34px;
  margin-right: 10px;
}

.caption.none {
  color: var(--dim);
}

.bar {
  position: relative;
  height: 44px;
  border-radius: 10px;
  background: var(--track);
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  width: 0;
  border-radius: 10px;
  background: var(--accent);
}

.bar .fill.sure {
  background: var(--sure);
}

.bar .percent {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 700;
}

.next {
  display: grid;
  grid-template-columns: auto 2ch 1fr 4ch;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.next .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-percent {
  text-align: right;
}

.track {
  height: 8px;
  border-radius: 4px;
  background: var(--track);
  overflow: hidden;
}

.track .fill {
  height: 100%;
  width: 0;
  background: color-mix(in srgb, var(--brand) 55%, transparent);
}

@media (max-width: 860px) {
  .panel {
    gap: 12px;
    padding: 14px;
  }

  .panel h2 {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .reading {
    gap: 16px;
  }

  .number {
    height: 60px;
    font-size: 60px;
  }

  .number.egg {
    font-size: 46px;
  }

  .details {
    gap: 8px;
  }

  .caption {
    height: 24px;
    font-size: 16px;
  }

  .caption .char {
    font-size: 20px;
  }

  .bar {
    height: 26px;
  }

  .bar .percent {
    font-size: 14px;
  }

  .next {
    font-size: 14px;
  }
}
