/* CatMint 98: the build-a-cat NFT "minter". */
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; margin: 0; }

.work { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 6px 6px 4px; }

/* ---- left: the cat and the Mint button ---- */
.cm-left { width: 296px; flex: none; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.stage { width: 100%; aspect-ratio: 1; background: var(--field); overflow: hidden; position: relative; flex: none; }
.stage svg { display: block; }
.side { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cat-name { font-weight: bold; font-size: 14px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-sub { text-align: center; color: var(--text-disabled); font-size: 11px; min-height: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick { justify-content: center; flex-wrap: wrap; }
.quick label.check { display: inline-flex; align-items: center; gap: 3px; }

.mint-btn {
  position: relative; overflow: hidden; width: 100%; min-height: 46px; padding: 4px 10px;
  font: bold 22px/1 "Arial Black", Arial, sans-serif; letter-spacing: 4px; color: #fff;
  text-shadow: 1px 1px 0 #2b5a00, 2px 2px 0 rgba(0, 0, 0, .35);
  border: none; border-radius: 0; cursor: default; touch-action: manipulation;
  background: linear-gradient(180deg, #b8ffb0 0%, #4fd06a 38%, #1f9e48 60%, #47c46b 100%);
  box-shadow: inset -1px -1px var(--face-dark), inset 1px 1px #eaffea,
              inset -2px -2px #11692e, inset 2px 2px #9ff0a8, 0 0 0 1px var(--face-dark);
}
.mint-btn:active:not(:disabled) { box-shadow: inset 1px 1px var(--face-dark), inset 2px 2px #11692e; padding: 6px 9px 2px 11px; }
.mint-btn:focus-visible { outline: 1px dotted #fff; outline-offset: -6px; }
.mint-btn:disabled { filter: grayscale(.8); opacity: .8; }
.mint-label { position: relative; z-index: 1; }
.mint-shine {
  position: absolute; top: -20%; bottom: -20%; width: 34px; left: -60px; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
  animation: mint-shine 2.8s ease-in-out infinite;
}
@keyframes mint-shine { 0%, 55% { left: -60px; } 100% { left: calc(100% + 60px); } }
@media (prefers-reduced-motion: reduce) { .mint-shine { animation: none; display: none; } }
.price { text-align: center; font-size: 11px; }
.parts { flex: 1; min-height: 44px; overflow-y: auto; padding: 1px; }
.parts .row { display: flex; gap: 6px; padding: 1px 4px; cursor: default; white-space: nowrap; }
.parts .row span:first-child { width: 74px; flex: none; color: var(--text-disabled); }
.parts .row span:last-child { overflow: hidden; text-overflow: ellipsis; }
.parts .row.selected span:first-child { color: inherit; }

/* ---- right: the picker ---- */
.cm-right { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pick { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.filters label.f-slot { display: flex; align-items: center; gap: 4px; flex: 1 1 210px; min-width: 0; }
.filters label.f-slot select { flex: 1; min-width: 0; }
.filters .f-search { flex: 1 1 110px; min-width: 80px; }
.filters .f-tier { flex: 0 1 120px; min-width: 0; }
.filters .f-who { flex: 1 1 150px; min-width: 0; }
.pick.chars label.f-slot { display: none; }

.grid {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; align-content: start;
}
.pick.chars .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px 5px; text-align: center;
  background: var(--face); color: var(--text); cursor: default; position: relative; min-width: 0;
  box-shadow: inset -1px -1px var(--face-dark), inset 1px 1px var(--face-hi), inset -2px -2px var(--face-shadow), inset 2px 2px var(--face-light);
  border-top: 4px solid var(--t-common);
}
.tile:focus-visible { outline: 1px dotted var(--text); outline-offset: -4px; }
.tile.uncommon { border-top-color: var(--t-uncommon); }
.tile.rare { border-top-color: var(--t-rare); }
.tile.mythic { border-top-color: var(--t-mythic); }
.tile .pic { width: 100%; aspect-ratio: 1; background: var(--field); box-shadow: inset 1px 1px var(--face-shadow), inset -1px -1px var(--face-hi); display: grid; place-items: center; overflow: hidden; }
.tile .pic img { width: 100%; height: 100%; display: block; }
.tile .pic.none { color: var(--text-disabled); font-size: 11px; }
.tile b { font-weight: normal; font-size: 11px; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tile i { font-style: normal; font-size: 9px; font-weight: bold; text-transform: uppercase; letter-spacing: .04em; color: var(--t-common); }
.tile.uncommon i { color: var(--t-uncommon); }
.tile.rare i { color: var(--t-rare); }
.tile.mythic i { color: var(--t-mythic); }
.tile em { font-style: normal; font-size: 10px; color: var(--text-disabled); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tile.on { background: var(--hilite); color: var(--hilite-text); }
.tile.on i, .tile.on em { color: var(--hilite-text); }
.grid .empty { grid-column: 1 / -1; padding: 24px 6px; text-align: center; color: var(--text-disabled); }

:root { --t-common: #6f7a90; --t-uncommon: #2f8f6b; --t-rare: #c2571a; --t-mythic: #7b3fd1; }

/* Where the thumbnails and the minted picture are drawn, out of sight. */
.paint-host { position: fixed; left: -10000px; top: 0; width: 256px; height: 256px; overflow: hidden; pointer-events: none; }
.paint-host > div { width: 256px; height: 256px; }

/* ---- phones and narrow windows ---- */
@media (max-width: 640px) {
  .work { flex-direction: column; gap: 6px; padding: 4px; }
  .cm-left { width: auto; flex-direction: row; gap: 8px; align-items: stretch; }
  .stage { width: 42%; max-width: 190px; align-self: flex-start; }
  .side { flex: 1; justify-content: center; }
  .cat-name { white-space: normal; font-size: 13px; }
  .mint-btn { min-height: 44px; font-size: 20px; }
  .pick { padding: 6px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 5px; padding: 5px; }
  .pick.chars .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  #st-count { display: none; }
  .parts { display: none; }
}
