/* «Bordet» på forsiden (home-table.js). Klassene har ht-prefiks. */
.ht-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; max-width: none; }
.ht-head > div { max-width: 600px; }
.ht-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ht-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 14px;
  border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  background: rgba(255, 255, 255, .05); color: #b7c2ca; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: background .2s, color .2s, box-shadow .2s, transform .2s var(--spring);
}
.ht-chip i { font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: #8a96a0; }
.ht-chip:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.ht-chip:active { transform: scale(.96); }
.ht-chip.active { background: linear-gradient(180deg, rgba(120, 190, 255, .24), rgba(71, 159, 235, .1)); color: #fff; box-shadow: inset 0 0 0 1px rgba(140, 200, 255, .5), 0 0 18px -6px rgba(71, 159, 235, .8); }
.ht-chip.active i { background: rgba(140, 200, 255, .22); color: #dff0ff; }
.ht-chip:focus-visible { outline: 2px solid #83c8ff; outline-offset: 2px; }

.ht-view {
  position: relative; isolation: isolate; overflow: hidden;
  height: clamp(460px, 70vh, 700px); border-radius: 26px;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(120% 80% at 50% 0%, #1f2d37 0%, #141b20 55%, #0d1215 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 40px 80px -50px rgba(0, 0, 0, .9);
}
/* Filt: fin struktur som ikke flytter seg, og mørke kanter som gir dybde. */
.ht-view::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 6px);
}
.ht-view::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(130% 110% at 50% 45%, transparent 55%, rgba(6, 9, 11, .75) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.ht-view:focus-visible { outline: 2px solid #83c8ff; outline-offset: 3px; }
.ht-view.grabbing { cursor: grabbing; }
.ht-light { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(460px circle at var(--lx, 50%) var(--ly, 40%), rgba(120, 190, 255, .1), transparent 60%); }
.ht-layer { position: absolute; inset: 0; z-index: 2; }

.ht-card { position: absolute; left: 0; top: 0; width: 196px; height: 262px; display: block; color: inherit; will-change: transform; -webkit-tap-highlight-color: transparent; }
.ht-card:hover { z-index: 5; }
.ht-in {
  position: absolute; left: calc(50% - 70px + var(--jx, 0px)); top: calc(50% - 118px + var(--jy, 0px));
  width: 140px; height: 213px; display: block;
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
  transition: transform .45s var(--spring), filter .3s ease, opacity .25s ease;
}
.ht-in img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.ht-price, .ht-name {
  position: absolute; left: calc(50% + var(--jx, 0px)); white-space: nowrap; pointer-events: none;
  transform: translateX(-50%) rotate(calc(var(--rot, 0deg) * .5));
  transition: opacity .25s ease, transform .45s var(--spring);
}
.ht-price {
  top: calc(50% + 100px + var(--jy, 0px));
  padding: 3px 9px; border-radius: 999px; background: rgba(8, 11, 13, .8); color: #8ff0a0;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.ht-card.pricey .ht-price { color: #ffd66e; box-shadow: inset 0 0 0 1px rgba(255, 214, 110, .35); }
.ht-name {
  top: calc(50% - 146px + var(--jy, 0px)); max-width: 190px; overflow: hidden; text-overflow: ellipsis;
  padding: 4px 10px; border-radius: 8px; background: rgba(8, 11, 13, .88); color: #eef4f7; font-size: 12.5px; font-weight: 700;
  opacity: 0; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .8);
}
.ht-card:hover .ht-in, .ht-card:focus-visible .ht-in {
  transform: rotate(0deg) translateY(-12px) scale(1.09);
  filter: drop-shadow(0 30px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 22px rgba(71, 159, 235, .45));
}
.ht-card:hover .ht-name { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.ht-card:hover .ht-price { transform: translateX(-50%) translateY(4px); }
.ht-view.grabbing .ht-card { pointer-events: none; }
.ht-card.picked { z-index: 6; }
.ht-card.picked .ht-in { transform: rotate(0deg) translateY(-26px) scale(1.2); filter: drop-shadow(0 40px 34px rgba(0, 0, 0, .7)) drop-shadow(0 0 34px rgba(120, 190, 255, .7)); transition-duration: .2s; }

/* Filterbytte: kortene synker ned i bordet, og de nye deles ut fra midten og utover. */
.ht-view.gather .ht-in { transform: rotate(var(--rot)) scale(.5); opacity: 0; transition-duration: .25s; transition-timing-function: ease-in; }
.ht-view.gather .ht-price, .ht-view.gather .ht-name { opacity: 0; }
.ht-view.deal .ht-in { animation: ht-deal .6s var(--spring) both; animation-delay: var(--deal, 0ms); }
.ht-view.deal .ht-price { animation: ht-fade .4s ease both; animation-delay: calc(var(--deal, 0ms) + .25s); }
@keyframes ht-deal { from { transform: translateY(-60px) rotate(calc(var(--rot) - 28deg)) scale(.55); opacity: 0; } }
@keyframes ht-fade { from { opacity: 0; } }

.ht-hint {
  position: absolute; left: 50%; bottom: 22px; z-index: 4; translate: -50% 0; margin: 0;
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(10, 14, 17, .82); color: #dfe8ee; font-size: 13px; font-weight: 650; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 12px 30px -12px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity .4s, translate .4s;
}
.ht-hint.gone { opacity: 0; translate: -50% 12px; }
.ht-hint span { position: relative; width: 22px; height: 22px; border-radius: 50%; background: rgba(140, 200, 255, .2); }
.ht-hint span::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #cfe6ff; animation: ht-drag 2.2s ease-in-out infinite; }
@keyframes ht-drag { 0%, 100% { transform: translate(-5px, 0); } 25% { transform: translate(5px, -3px); } 50% { transform: translate(4px, 4px); } 75% { transform: translate(-4px, 3px); } }
.ht-list { margin-top: 16px; }

@media (max-width: 700px) {
  .ht-view { height: 64vh; min-height: 420px; border-radius: 20px; }
  .ht-filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .ht-chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ht-in, .ht-price, .ht-name { transition: none; }
  .ht-view.deal .ht-in, .ht-view.deal .ht-price, .ht-hint span::after { animation: none; }
}
