:root {
  --Fold0: #d32f2f;
  --Fold1: #f39b9b;
  --Fold2: #f0ae59;
  --Fold3: #f1ca5d;
  --Fold4: #9dcd78;
  --Fold5: #8ab6e2;
  --Fold6: #aaa5db;
  --Fold7: #d399cf;
  --Fold8: #cda485;
  --Fold9: #b9c0c7;
  --FoldA: #f0aaaa;
  --FoldB: #f1b86f;
  --FoldC: #7acc93;
  --FoldD: #87c9d9;
  --FoldE: #96abde;
  --FoldF: #eb9fc9;
}

body {
  background: #f5f5f5;
}

main {
  font-family: Arial, sans-serif;
  padding: 0 2rem;
}

.section#round1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #D60900;
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.section#round1 img {
  margin-left: 2rem;
  width: 200px;
  object-fit: scale-down;
}

input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  margin-bottom: 1rem;
}

a {
  all: unset;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: white;
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #eee;
}

.name {
  font-weight: bold;
  margin-top: 0.5rem;
}

.series {
  font-style: italic;
  cursor: default;
}

.character {
  font-size: 0.8rem;
  color: #666;
  cursor: default;
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 20px black;
  background: #fff;
}

.summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  background: #f3f3f3;
  border-radius: 8px;
}

.summary div {
  font-size: 0.95rem;
}

.card .pricing {
  margin-top: 10px;
  font-size: 0.9rem;
}

.card .price {
  font-weight: bold;
}

.card .sale-price {
  color: green;
}

.card .list-price {
  text-decoration: line-through;
  color: #888;
  margin-right: 5px;
}

.card .discount {
  color: red;
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 5px;
}

#tabs {
  background-color: var(--tabs-bg);
  padding: 1rem;
  transition: background-color 0.2s ease;
}

.tab {
    all: unset;
    padding: 3px 10px;
    border-radius: 5px 5px 0px 0px;
    color: #000;
    cursor: pointer;
}

/* Each tab defines its own color */
#tab-all {
    --tab-color: var(--Fold0);
    background-color: var(--tab-color);
}

#tab-figure {
    --tab-color: var(--Fold2);
    background-color: var(--tab-color);
}

#tab-plush {
    --tab-color: var(--Fold4);
    background-color: var(--tab-color);
}

#tab-card {
  --tab-color: var(--Fold5);
  background-color: var(--tab-color);
}

#tab-keychain {
  --tab-color: var(--Fold6);
  background-color: var(--tab-color);
}

#clearSearch {
  all: unset;
  position: absolute;
}

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 15px;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  z-index: 1000;
}

@media (orientation: portrait) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  main {
    padding: 0 0.5rem;
  }

  #tabs {
    padding: 0.5rem;
  }

  .card {
    padding: 0.5rem;
  }

  .summary {
    justify-content: center;
  }

  .section#round1 {
    flex-direction: row;
    justify-content: center;
  }

  .section#round1 img {
    margin-left: 0;
  }

  .tab-container {
    display: flex;
    justify-content: space-between;
  }
}