*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: #0b0b0b;
  color: #fff;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.stage {
  width: min(100vw, calc(100vh * 9 / 16));
  height: min(100vh, calc(100vw * 16 / 9));
  margin: 0 auto;
  background: #151515;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 3.2% 4% 4%;
}

.header {
  text-align: center;
  flex-shrink: 0;
  z-index: 2;
  margin-bottom: 2.5%;
}

.header .emoji {
  font-size: clamp(18px, 3.2vw, 28px);
  line-height: 1;
  margin-bottom: 0.35em;
}

.header h1 {
  font-size: clamp(18px, 4.6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.header .range {
  margin-top: 0.35em;
  font-size: clamp(12px, 2.8vw, 20px);
  font-weight: 600;
  opacity: 0.9;
}

.chart {
  position: relative;
  flex: 1;
  min-height: 0;
}

.row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  height: 8.2%;
  transition: top 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: top;
}

.bar-wrap {
  flex: 1;
  min-width: 0;
  height: 78%;
  display: flex;
  align-items: center;
}

.bar {
  height: 100%;
  min-width: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  gap: 8px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.identity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.flag {
  width: clamp(16px, 2.8vw, 22px);
  height: clamp(11px, 1.9vw, 15px);
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.name {
  font-size: clamp(11px, 2.5vw, 18px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.logo {
  width: clamp(18px, 3.2vw, 28px);
  height: clamp(18px, 3.2vw, 28px);
  object-fit: contain;
  background: #fff;
  border-radius: 5px;
  padding: 2px;
  flex-shrink: 0;
}

.logo.fallback {
  display: grid;
  place-items: center;
  font-size: clamp(9px, 1.8vw, 12px);
  font-weight: 800;
  color: #222;
}

.value {
  width: 22%;
  padding-left: 8px;
  font-size: clamp(11px, 2.4vw, 17px);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.year {
  position: absolute;
  right: 4%;
  bottom: 3.5%;
  font-size: clamp(42px, 12vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0.95;
  pointer-events: none;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.controls {
  position: absolute;
  left: 4%;
  bottom: 3.8%;
  display: flex;
  gap: 8px;
  z-index: 4;
}

.controls button {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.controls button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.unit-note {
  position: absolute;
  left: 4%;
  bottom: 9.5%;
  font-size: clamp(10px, 2vw, 13px);
  opacity: 0.45;
  z-index: 3;
}

@media (max-height: 700px) {
  .header h1 {
    font-size: clamp(16px, 4vw, 24px);
  }

  .name {
    font-size: clamp(10px, 2.2vw, 14px);
  }
}
