:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111318;
  --muted: #6e737a;
  --quiet: #a5abb3;
  --line: #e7e9ed;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --shadow: 0 24px 90px rgba(21, 27, 35, 0.11);
  --soft-shadow: 0 14px 42px rgba(21, 27, 35, 0.08);
  --good: #208864;
  --warn: #a57121;
  --bad: #b24848;
  --accent: #8b7cf6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(139, 124, 246, 0.14), transparent 38%),
    radial-gradient(circle at 84% 18%, rgba(103, 196, 180, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfbfc 58%, #ffffff 100%);
  color: var(--ink);
}

.confetti-canvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
}

button,
input {
  font: inherit;
}

.page {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 54px) 64px;
}

.fade-in {
  animation: fadeIn 800ms ease both;
}

.delay-1 {
  animation-delay: 110ms;
}

.delay-2 {
  animation-delay: 220ms;
}

.delay-3 {
  animation-delay: 330ms;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  position: relative;
  min-height: 156px;
  display: grid;
  place-items: center;
  padding: 8px 0 18px;
}

.site-mark {
  position: absolute;
  top: 14px;
  left: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0;
  font-weight: 650;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  width: min(920px, 100%);
  text-align: center;
  font-size: clamp(3.3rem, 9vw, 8.4rem);
  line-height: 0.9;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  font-size: 1.04rem;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0;
}

.timer {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 132px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 19, 24, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
  text-align: right;
}

.goal-setting {
  position: absolute;
  right: 0;
  top: 64px;
  display: grid;
  grid-template-columns: auto 88px;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid rgba(17, 19, 24, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.goal-setting span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-setting input {
  width: 88px;
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(139, 124, 246, 0.12);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 780;
  text-align: center;
}

.timer span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.timer strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(420px, 1fr) minmax(260px, 0.82fr);
  gap: clamp(18px, 2.4vw, 34px);
  align-items: start;
  margin: 0 auto 32px;
}

.workspace-column,
.data-column {
  display: grid;
  gap: 18px;
}

.workspace-column {
  justify-items: center;
  position: sticky;
  top: 24px;
  z-index: 2;
}

.data-column {
  align-self: start;
  position: sticky;
  top: 28px;
  display: grid;
  gap: 16px;
}

.data-left {
  padding-top: 26px;
}

.data-right {
  padding-top: 10px;
}

.entry-form {
  position: relative;
  width: min(620px, 100%);
  text-align: center;
}

.entry-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(17, 19, 24, 0.08);
  border-radius: 999px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.entry-row.rejected {
  animation: rejectShake 430ms ease;
  box-shadow: 0 20px 70px rgba(178, 72, 72, 0.2), 0 0 0 1px rgba(178, 72, 72, 0.48);
}

@keyframes rejectShake {
  0%, 100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-9px);
  }

  36% {
    transform: translateX(8px);
  }

  54% {
    transform: translateX(-6px);
  }

  72% {
    transform: translateX(4px);
  }
}

input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 999px;
  padding: 18px 22px;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.25rem, 3vw, 2.15rem);
  line-height: 1;
  text-align: center;
}

input::placeholder {
  color: #b8bdc6;
}

.goal-setting input {
  width: 88px;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(139, 124, 246, 0.12);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 780;
  line-height: 1;
  text-align: center;
}

.entry-row button,
.reset-button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 0 24px;
  min-height: 54px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.entry-row button:hover,
.reset-button:hover {
  transform: translateY(-1px);
  background: #2d3138;
  box-shadow: 0 10px 24px rgba(17, 19, 24, 0.18);
}

.entry-support {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  margin-top: 12px;
}

#entryHelp {
  color: var(--muted);
  font-size: 0.94rem;
  transition: opacity 240ms ease, transform 240ms ease;
}

#entryHelp.is-hidden {
  opacity: 0;
  transform: translateY(-4px);
}

.left-badge {
  position: absolute;
  right: 0;
  top: 50%;
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
}

.left-badge strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.left-badge span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hit-marker {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  min-width: max-content;
  padding: 8px 12px;
  border: 2px solid rgba(178, 72, 72, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(178, 72, 72, 0.2);
  color: var(--bad);
  font-size: 0.82rem;
  font-weight: 860;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
}

.hit-marker.show {
  animation: hitPop 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hitPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }

  14% {
    opacity: 1;
    transform: translate(-50%, -62%) scale(1.04);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -86%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -104%) scale(0.94);
  }
}

.data-left .card-head {
  padding: 0 6px;
}

.data-left .card-head h2 {
  font-size: 1.3rem;
}

.data-left .card-head p {
  max-width: 58%;
}

.submissions {
  position: relative;
  width: min(540px, 100%);
  min-height: 52px;
}

.results-list {
  display: grid;
  gap: 6px;
  padding: 2px 8px 0;
}

.results-list.is-touring {
  max-height: min(62vh, 620px);
  overflow-y: auto;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  padding-right: 12px;
}

.result-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(17, 19, 24, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 26px rgba(21, 27, 35, 0.06);
  backdrop-filter: blur(14px);
  animation: nameFloatIn 260ms ease both;
}

@keyframes nameFloatIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-num {
  color: var(--muted);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.result-main {
  min-width: 0;
}

.result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.04rem;
  font-weight: 720;
}

.result-detail {
  display: none;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-status {
  width: 9px;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  color: transparent;
}

.status-good {
  background: var(--good);
}

.status-warn {
  background: var(--warn);
}

.status-bad {
  background: var(--bad);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.chart-card {
  border: 1px solid rgba(17, 19, 24, 0.07);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 8%, rgba(124, 140, 248, 0.16), transparent 28%),
    radial-gradient(circle at 96% 24%, rgba(102, 199, 180, 0.15), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.64)),
    var(--panel);
  box-shadow: 0 26px 80px rgba(21, 27, 35, 0.1);
  backdrop-filter: blur(22px);
  padding: 16px;
  overflow: hidden;
}

.insight-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 4px 0 0;
}

.chart-card {
  min-height: 384px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head p {
  max-width: 54%;
  color: var(--muted);
  text-align: right;
  font-size: 0.86rem;
}

canvas {
  display: block;
  width: min(100%, 272px);
  height: auto;
  margin: -2px auto 10px;
}

.legend,
.category-bars {
  display: grid;
  gap: 8px;
}

.legend-item,
.bar-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.legend-item strong,
.bar-row strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 16px;
}

.fact-feed {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.fact-item {
  padding: 11px 13px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 0.92rem;
  animation: factIn 320ms ease both;
}

.fact-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(124, 140, 248, 0.16), rgba(255, 255, 255, 0.62));
}

.fact-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(102, 199, 180, 0.14), rgba(255, 255, 255, 0.58));
}

.fact-item strong {
  color: var(--ink);
}

@keyframes factIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metrics div {
  padding: 14px;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.metrics div::before {
  content: "";
  position: absolute;
  inset: auto -20% -34px 42%;
  height: 70px;
  border-radius: 999px;
  background: rgba(124, 140, 248, 0.12);
}

.metrics dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.metrics dd {
  margin: 6px 0 0;
  font-weight: 760;
  position: relative;
  z-index: 1;
}

.bar {
  grid-column: 1 / -1;
  height: 9px;
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.06);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  width: var(--target, 0%);
  animation: fillBar 700ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.bar-row {
  animation: barSpawn 320ms ease both;
}

.finale-panel {
  width: min(1160px, 100%);
  margin: 34px auto 0;
  scroll-margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1fr);
  gap: 18px;
  animation: finaleIn 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.finale-panel[hidden] {
  display: none;
}

.finale-hero,
.finale-board {
  border: 1px solid rgba(17, 19, 24, 0.07);
  border-radius: 36px;
  background:
    radial-gradient(circle at 22% 0%, rgba(242, 179, 109, 0.24), transparent 34%),
    radial-gradient(circle at 92% 10%, rgba(124, 140, 248, 0.18), transparent 36%),
    rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.finale-hero {
  padding: clamp(24px, 4vw, 42px);
}

.finale-hero p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 860;
  text-transform: uppercase;
}

.finale-hero h2 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.finale-stats {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.finale-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--soft-shadow);
}

.finale-stats span {
  color: var(--muted);
  font-size: 0.82rem;
}

.finale-stats strong {
  text-align: right;
}

.finale-board {
  padding: 18px;
}

.finale-board-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.finale-board-head p {
  max-width: 280px;
  color: var(--muted);
  text-align: right;
  font-size: 0.9rem;
}

.streamer-compare-list {
  display: grid;
  gap: 8px;
}

.streamer-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 28px rgba(21, 27, 35, 0.06);
  animation: streamerIn 360ms ease both;
}

.streamer-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(124, 140, 248, 0.14);
  color: var(--accent);
  font-weight: 860;
}

.streamer-name {
  font-weight: 820;
}

.streamer-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.streamer-fit {
  min-width: 72px;
  text-align: right;
  font-size: 1.2rem;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.fit-track {
  grid-column: 2 / -1;
  height: 7px;
  border-radius: 999px;
  background: rgba(17, 19, 24, 0.07);
  overflow: hidden;
}

.fit-track span {
  display: block;
  height: 100%;
  width: var(--target, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #7C8CF8, #66C7B4);
  animation: fillBar 900ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes finaleIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes streamerIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fillBar {
  from {
    width: 0%;
  }

  to {
    width: var(--target, 0%);
  }
}

@keyframes barSpawn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reset-button {
  display: block;
  margin: 22px auto 0;
  padding-inline: 22px;
}

@media (max-width: 1040px) {
  .site-header {
    padding-top: 56px;
  }

  .site-mark {
    left: 50%;
    transform: translateX(-50%);
  }

  .timer {
    left: calc(50% - 86px);
    right: auto;
    transform: translateX(-50%);
    top: 0;
  }

  .goal-setting {
    left: calc(50% + 86px);
    right: auto;
    top: 0;
    transform: translateX(-50%);
  }

  .workbench,
  .chart-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .workspace-column,
  .data-column {
    position: static;
  }

  .workspace-column {
    order: 1;
  }

  .data-left {
    order: 2;
    padding-top: 0;
  }

  .data-right {
    order: 3;
    padding-top: 0;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finale-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .page {
    padding-inline: 12px;
  }

  .entry-row {
    grid-template-columns: 1fr;
    border-radius: 30px;
  }

  .entry-row button {
    min-height: 46px;
  }

  input {
    padding-block: 14px;
  }

  .timer,
  .goal-setting {
    position: static;
    transform: none;
    justify-self: center;
    margin-bottom: 8px;
  }

  .site-header {
    gap: 8px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .finale-board-head {
    display: grid;
  }

  .finale-board-head p {
    max-width: none;
    text-align: left;
  }

  .streamer-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .streamer-fit {
    grid-column: 2;
    text-align: left;
  }

  .fit-track {
    grid-column: 1 / -1;
  }
}
