html,body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: black;
}

body {
  box-sizing: border-box;
  background-color: #f9f9f9;
}

header {
  background-color: darkorange;
  font-size: 2.2em;
  padding: 0 24px;
}

input {
  background-color: white;
}

button {
  color: black;
  background-color: rgb(233, 233, 237);
}

main {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

main.scanner {
  align-items: center;
  width: min-content;
  margin: auto;
}

.container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.two-columns {
  grid-template-columns: auto 1fr;
  gap: 16px;
}

.sidebar {
  border: 1px solid #ccc;
  padding: 0px 24px;
  border-left-width: 0px;
}

.badge {
  background-color: orange;
  display: flex;
  min-width: 50px;
  border-radius: 20px;
  padding: 4px;
  text-align: center; 
  position: absolute;
  bottom: 3px;
  font-weight: bold;
}

.badge-left {
  left: 3px;
}

.badge-right {
  right: 3px;
}

.badge button {
  margin: 0 4px;
  font-weight: bold;
  padding: 0;
  border: 1px solid #666;
  border-radius: 20px;
  background-color: white;
}

.badge button.add:hover {
  background-color: lime;
}

.badge button.remove:hover {
  background-color: crimson;
}

.browser {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding-right: 16px;
  scrollbar-gutter: stable;
  padding-bottom: 64px;

  -webkit-mask-image: linear-gradient(transparent 0, black var(--top-mask-size), black calc(100% - var(--bottom-mask-size)), transparent 100%),
    linear-gradient(to right, transparent calc(100% - var(--scrollbar-width)), black calc(100% - var(--scrollbar-width)));
  mask-image: linear-gradient(transparent 0, black var(--top-mask-size), black calc(100% - var(--bottom-mask-size)), transparent 100%),
    linear-gradient(to right, transparent calc(100% - var(--scrollbar-width)), black calc(100% - var(--scrollbar-width)));
  mask-composite: add;
    /* we could define --top-mask-size and --bottom-mask-size using @property rules but since the transition is so abrupt, there is not much difference in animation */
  --top-mask-size: 0px;
  --bottom-mask-size: 0px;
  --scrollbar-width: 16px;

  animation: scroll-fade;
  animation-timeline: scroll(self);
  animation-range: 0 100%;

  scroll-snap-type: y mandatory;
}

div.browser.grid {
  /*display: grid;*/
  /*grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));*/
  gap: 16px;
  /*justify-items: center;*/
  align-items: end;
  display: flex;
  flex-flow: wrap;
  justify-content: space-between;
 }

div.card-container.list {
}

@keyframes scroll-fade {
  0% {
    --top-mask-size: 0px;
    --bottom-mask-size: 48px;
  }

  1% {
    --top-mask-size: 48px;
  }

  99% {
    --bottom-mask-size: 48px;
  }

  100% {
    --top-mask-size: 48px;
    --bottom-mask-size: 0px;
  }
}

div.toolbar {
  margin: 12px 12px;
  display: flex;
  align-items: normal;
  justify-content: space-between;
  gap: 16px;
}

input:focus {
  outline: none;
  border: 1px solid orange;
}

div.toolbar > :first-child {
  flex: 1;
}

.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group > * {
  margin: 0;
  border-radius: 0px;
  border: 1px solid #ccc;
  border-width: 1px 0px 1px 1px;
  min-height: 32px;
  padding: 0px 12px;
}

.btn-group button.active, .btn-group button:hover {
  background-color: orange;
}

.btn-group button:disabled,button[disabled] {
  background-color: #cccccc;
  color: #666666;
}

.btn-group > :first-child {
  margin: 0;
  border-top-left-radius: 0px;
  border-bottom-left-radius: 0px;
}

.btn-group > :last-child {
  margin: 0;
  border-top-right-radius: 0px;
  border-bottom-right-radius: 0px;
  border-right-width: 1px;
}

div.card {
  border: 1px solid black;
  position: relative;
  scroll-snap-align: start;
}

div.card.grid {
  border-radius: 10px;
  width: 300px;
  /*box-shadow: 5px 5px 25px 1px #222;*/
}

div.card.list {
}

div.card img {
  border-radius: 8px;
  width: 100%;
  vertical-align: bottom;
}

div.card > img {
  aspect-ratio: 0.714;
}

div.card.highlight {
  background-color: beige;
}

div.card.selected {
  font-weight: bold;
  border: 1px solid black;
}

li.scanResult {
  scroll-snap-align: start;
  border-bottom: 1px solid gray;
  padding: 4px;
}

li.scanResult:last-child {
  border-bottom: none;
}

.rarity {
  background-color: #555;
  border-radius: 3px;
  padding: 0 5px;
  font-family: "libertinusSans", sans-serif;
}

/* Common */
.rarity-1 {
}

/* Uncommon */
.rarity-2 {
	color: rgb(99, 255, 0);
}

/* Rare */
.rarity-3 {
  color: rgb(82, 184, 255);
}

/* Super Rare */
.rarity-4 {
  color: rgb(133, 51, 255);
}

/* Ultra Rare */
.rarity-5 {
  color: rgb(255, 179, 0);
}

/* Collector Super Rare */
.rarity-7 {
  color: rgb(255, 255, 255);
}

/* Collector Ultra Rare */
.rarity-8 {
  color: rgb(255, 255, 255);
}




  #status {
          text-align: center;
          position: absolute;
          bottom: 16px;
          width: 100%;
          text-shadow: 2px 2px darkorange;
        }

        .image-container {
    display: inline-block;
            flex: 1;
            min-width: 400px;
            border: 1px solid #ccc;
            padding: 10px;
        }

        .image-container h2 {
            margin-bottom: 5px;
            font-size: 12px;
        }

        .image-container img, .image-container canvas {
            height: auto;
            display: block;
        }

        #outputCanvas {
            max-width: 100%;
            height: auto;
        }

        #cameraContainer {
          text-align: center;
          width: max-content;
          position: relative;
        }

        #webcamVideo {
            max-width: 100%;
            border: 1px solid #ddd;
            box-sizing: border-box;
        }

