html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.tg {
  --c-i: #a6ced3;
  --d-i: #429da9;
  --c-o: #d3c9a6;
  --d-o: #a99342;
  --c-t: #c6a6d3;
  --d-t: #8a42a9;
  --c-s: #a6d3b1;
  --d-s: #42a95b;
  --c-z: #d3a6aa;
  --d-z: #a9424a;
  --c-j: #a6b4d3;
  --d-j: #4261a9;
  --c-l: #d3baa6;
  --d-l: #a97042;
  --grid-line: rgba(255, 247, 230, 0.08);
  --flash: #ffd23f;
  --prof-bar: #6ec8ff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.tg__hint {
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.35;
  color: #fff7e6;
}

.tg__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tg__field {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  width: clamp(168px, 46vw, 236px);
  height: clamp(208px, 60vw, 236px);
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 230, 0.14);
  cursor: pointer;
  touch-action: manipulation;
}

.tg__field:focus-visible {
  outline: 2px solid #6ec8ff;
  outline-offset: 2px;
}

.tg__cv {
  display: block;
  width: 100%;
  height: 100%;
}

.tg__side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.tg__count {
  font-weight: 800;
  font-size: clamp(20px, 6vw, 30px);
  line-height: 1;
  color: #ffd23f;
  font-variant-numeric: tabular-nums;
}

.tg__unit {
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  color: rgba(255, 247, 230, 0.82);
}

.tg__scan {
  margin: 8px 0 0;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.5;
  color: rgba(255, 247, 230, 0.82);
}

.tg__scan b {
  font-weight: 700;
  color: #ffd23f;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

.tg__scanUnit {
  color: rgba(255, 247, 230, 0.72);
}

.tg__prof {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 230, 0.12);
  overflow: hidden;
}

.tg__prof canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 340px) {
  .tg {
    gap: 4px;
  }
  .tg__field {
    width: 96px;
    height: 120px;
  }
  .tg__count {
    font-size: 16px;
  }
  .tg__scan {
    margin-top: 0;
    font-size: 8px;
  }
  .tg__prof {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tg.is-still .tg__field {
    cursor: default !important;
  }
}
