/* ==========================================================================
   KrakenTheMeta — shared UI components (the dashboard and the rebuilt public pages)
   Load after kraken.css. Panels, form controls, chips, badges, sheets, menus, toasts,
   deck tiles, deck lists + stats, card search rows, the card detail sheet, card grids.
   ========================================================================== */

:root {
  --danger: #ff8f84;
  --danger-rgb: 255, 143, 132;
  --win: #6fe3a6;
  --loss: #ff8f8f;
  --tab: 0px;   /* the dashboard's phone tab bar height (0 elsewhere) */
  --top: 72px;  /* the fixed top bar height */
}

/* `hidden` always wins over a component's display (the dashboard's builder panes opt out: on desktop they all show) */
[hidden]:not([data-pane]) { display: none !important; }
:where(button) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:where(button:disabled) { cursor: default; }

.cardx__img--none { display: grid; place-items: center; padding: 14px; text-align: center; color: var(--ink-3); }

/* ---------------------------------------------------------------- primitives */

.iconbtn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  flex: none;
  border-radius: 11px;
  color: var(--ink-2);
  transition: background-color 0.2s, color 0.2s;
}
.iconbtn .i { width: 20px; height: 20px; }
.iconbtn:hover { background: rgba(150, 205, 240, 0.08); color: var(--ink); }
.iconbtn--line { border: 1px solid var(--line-2); }
.iconbtn--sm { width: 34px; height: 34px; border-radius: 9px; }
.iconbtn--sm .i { width: 17px; height: 17px; }

.linkbtn { color: var(--glow-hi); font-size: 13.5px; font-weight: 600; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn--block { width: 100%; }
.btn--danger { background: rgba(var(--danger-rgb), 0.12); border-color: rgba(var(--danger-rgb), 0.4); color: var(--danger); }
.btn--danger:hover { background: rgba(var(--danger-rgb), 0.2); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; filter: none; }
.btn.is-busy { pointer-events: none; opacity: 0.8; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 32, 52, 0.5), rgba(6, 18, 32, 0.66));
}
.panel--pad { padding: clamp(16px, 2.4vw, 24px); }

.label, .field > .label {
  font: 500 10.5px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hint { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.hint a, .hint .linkbtn { color: var(--glow-hi); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 16px; }
.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  outline: none;
  background: rgba(1, 6, 12, 0.55);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(var(--glow-rgb), 0.6);
  background: rgba(1, 8, 16, 0.85);
  box-shadow: 0 0 0 4px rgba(var(--glow-rgb), 0.12);
}
.textarea { min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.select {
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9bccb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.select option { background: #061524; color: var(--ink); }
.inputwrap { position: relative; display: block; }
.inputwrap > .i { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.inputwrap > .input { padding-left: 40px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--glow); }
.check.is-disabled { opacity: 0.55; cursor: default; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(1, 6, 12, 0.5);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.seg button .i { width: 16px; height: 16px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button.is-on {
  background: rgba(var(--glow-rgb), 0.12);
  color: var(--glow-hi);
  box-shadow: inset 0 0 0 1px rgba(var(--glow-rgb), 0.32);
}
.seg--block { display: flex; width: 100%; }
.seg--block button { flex: 1; justify-content: center; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.is-on { color: var(--glow-hi); border-color: rgba(var(--glow-rgb), 0.4); background: rgba(var(--glow-rgb), 0.1); }
.chip small { font: 500 10.5px var(--font-mono); color: var(--ink-4); }
.chip.is-on small { color: var(--glow); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font: 500 9.5px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.badge--glow { color: var(--glow-hi); border-color: rgba(var(--glow-rgb), 0.35); background: rgba(var(--glow-rgb), 0.1); }
.badge--gold { color: #251600; border-color: transparent; background: var(--gold); }
.badge--lure { color: var(--lure-hi); border-color: rgba(var(--lure-rgb), 0.4); background: rgba(var(--lure-rgb), 0.1); }

.pips { display: inline-flex; align-items: center; gap: 2px; }
.pip { width: 15px; height: 15px; border-radius: 50%; flex: none; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty .i { width: 30px; height: 30px; color: var(--ink-4); }
.empty h3 { color: var(--ink); font-size: 18px; }
.empty p { max-width: 42ch; font-size: 14.5px; }
.empty .btn { margin-top: 8px; }

.skel { position: relative; overflow: hidden; background: rgba(150, 205, 240, 0.06); border-radius: 10px; }
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(150, 205, 240, 0.08), transparent);
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { to { transform: translateX(100%); } }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(var(--glow-rgb), 0.25); border-top-color: var(--glow); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* section heads inside views */
.vhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 20px; }
.vhead__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vhead h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.024em; }
.vhead p { color: var(--ink-3); font-size: 15px; }
.vhead__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.shead h3 { font: 500 11px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.shead a, .shead button { font-size: 13.5px; font-weight: 600; color: var(--glow-hi); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(8, 24, 40, 0.45); }
.tile b { display: block; font: 500 clamp(24px, 3vw, 30px)/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile span { display: block; margin-top: 8px; font: 500 10px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.tile.is-win b { color: var(--win); }
.tile.is-loss b { color: var(--loss); }

/* ---------------------------------------------------------------- sheets + menus */

.layer { position: relative; z-index: 80; }
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(1, 4, 9, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s;
}
.backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 81;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 920px);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 32, 52, 0.98), rgba(5, 16, 28, 0.99));
  box-shadow: var(--shadow-deep), 0 0 80px -40px rgba(var(--glow-rgb), 0.5);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.98);
  transition: opacity 0.25s var(--ease-out), transform 0.3s var(--ease-out);
}
.sheet.is-open { opacity: 1; transform: translate(-50%, -50%); }
.sheet--lg { width: min(820px, calc(100vw - 32px)); }
.sheet__grab { display: none; }
.sheet__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 14px; }
.sheet__head h3 { flex: 1; min-width: 0; font: 500 23px/1.15 var(--font-display); letter-spacing: -0.015em; }
.sheet__head p { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.sheet__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
@media (max-width: 640px) {
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%;
    max-height: 92svh;
    border-radius: 22px 22px 0 0;
    transform: translateY(104%);
  }
  .sheet.is-open { transform: none; }
  .sheet--lg { width: 100%; }
  .sheet__grab { display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: var(--line-3); }
  .sheet__head { padding-top: 12px; }
  .sheet__foot .btn { flex: 1; }
}

.menu-pop {
  position: fixed;
  z-index: 90;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(7, 20, 35, 0.98);
  box-shadow: var(--shadow-deep);
  animation: pop-in 0.16s var(--ease-out);
}
.menu-pop button, .menu-pop a, .actionlist button, .actionlist a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-2);
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.menu-pop .i, .actionlist .i { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.menu-pop button:hover, .menu-pop a:hover, .actionlist button:hover, .actionlist a:hover { background: rgba(150, 205, 240, 0.07); color: var(--ink); }
.menu-pop .is-danger, .actionlist .is-danger, .menu-pop .is-danger .i, .actionlist .is-danger .i { color: var(--danger); }
.menu-pop hr, .actionlist hr { height: 1px; margin: 5px 6px; border: 0; background: var(--line); }
.actionlist { display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab) + 16px + env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(460px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; bottom: 24px; transform: none; align-items: flex-end; } }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(7, 20, 35, 0.97);
  box-shadow: var(--shadow-deep);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease-out);
}
.toast .i { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--glow); }
.toast--ok .i { color: var(--win); }
.toast--err { border-color: rgba(var(--danger-rgb), 0.35); }
.toast--err .i { color: var(--danger); }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- deck cards (library) */

.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
@media (max-width: 480px) { .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.dcard {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(12, 32, 52, 0.72), rgba(5, 16, 28, 0.94));
  text-align: left;
  transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.4s;
}
.dcard:hover, .dcard:focus-visible { transform: translateY(-4px); border-color: rgba(var(--glow-rgb), 0.35); box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.85), 0 0 36px -14px rgba(var(--glow-rgb), 0.35); }
.dcard__art { position: relative; aspect-ratio: 626 / 400; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, rgba(var(--glow-rgb), 0.18), transparent 60%), var(--abyss-3); }
.dcard__art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) brightness(0.9); transition: transform 1.2s var(--ease-out); }
.dcard:hover .dcard__art img { transform: scale(1.06); }
.dcard__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(5, 16, 28, 0.95) 100%); }
.dcard__art .mark { position: absolute; inset: 0; display: grid; place-items: center; }
.dcard__art .mark svg { width: 38px; height: 38px; opacity: 0.35; }
.dcard__badges { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; display: flex; justify-content: space-between; gap: 6px; }
.dcard__badges .badge { background: rgba(2, 8, 14, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dcard__body { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1; margin-top: -22px; padding: 0 14px 14px; }
.dcard__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 19px/1.18 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dcard__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; font: 400 11.5px/1 var(--font-mono); color: var(--ink-3); }
.dcard__more { position: absolute; top: 8px; right: 8px; z-index: 2; }
.dcard__more .iconbtn { background: rgba(2, 8, 14, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dcard--new { align-items: center; justify-content: center; gap: 10px; min-height: 220px; border-style: dashed; background: rgba(8, 24, 40, 0.3); color: var(--ink-3); font-weight: 600; }
.dcard--new .i { width: 28px; height: 28px; color: var(--glow); }
.dcard--skel { min-height: 240px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .inputwrap { flex: 1 1 240px; }

.meter { width: 90px; height: 5px; overflow: hidden; border-radius: 5px; background: rgba(150, 205, 240, 0.14); }
.meter i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--glow), var(--glow-hi)); box-shadow: 0 0 10px var(--glow); transition: width 0.5s var(--ease-out); }
.meter.is-over i { background: var(--lure); box-shadow: 0 0 10px var(--lure); }
.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(241, 197, 108, 0.3);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(46, 33, 12, 0.5), rgba(10, 20, 30, 0.6));
  animation: toast-in 0.4s var(--ease-out);
}
.strip__text { flex: 1 1 260px; }
.strip__text > b { display: block; font: 500 17px/1.2 var(--font-display); color: var(--gold); }
.strip__text p { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.strip--info { border-color: rgba(var(--glow-rgb), 0.3); background: rgba(var(--glow-rgb), 0.06); }
.strip--info .strip__text > b { color: var(--glow-hi); }
.strip__notes { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.strip > .iconbtn { align-self: flex-start; margin: -4px -6px 0 auto; }
.nudge > .i, .hint > .i { width: 17px; height: 17px; margin-right: 6px; vertical-align: -3px; color: var(--glow); }
/* card preview on hover (mouse only) */
.cpop {
  position: fixed;
  z-index: 70;
  width: 236px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-deep), 0 0 40px -16px rgba(var(--glow-rgb), 0.5);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.14s, transform 0.14s var(--ease-out);
  pointer-events: none;
}
.cpop.is-on { opacity: 1; transform: none; }
.cpop img { display: block; width: 100%; aspect-ratio: 488 / 680; object-fit: cover; background: var(--abyss-3); }
@media (hover: none) { .cpop { display: none; } }
/* deck stats */
.dstats { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; padding: 16px 18px; }
@media (max-width: 640px) { .dstats { grid-template-columns: 1fr; gap: 14px; } }
.dstats h4 { margin-bottom: 10px; font: 500 10px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.curve { display: grid; grid-template-columns: repeat(8, 1fr); align-items: end; gap: 6px; height: 92px; }
.curve div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.curve i { width: 100%; min-height: 2px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--glow-hi), rgba(var(--glow-rgb), 0.3)); box-shadow: 0 0 14px -5px rgba(var(--glow-rgb), 0.9); transition: height 0.6s var(--ease-out); }
.curve em { margin-top: 5px; font: normal 400 9.5px/1 var(--font-mono); color: var(--ink-4); }
.curve b { font: 500 10px/1 var(--font-mono); color: var(--ink-3); margin-bottom: 4px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; font-size: 13.5px; color: var(--ink-3); }
.facts b { display: block; font: 500 17px/1.2 var(--font-display); color: var(--ink); }
.colorbar { display: flex; height: 8px; margin-bottom: 10px; overflow: hidden; border-radius: 6px; background: var(--line); }
.colorbar i { display: block; height: 100%; }

/* deck list */
.dlist { padding: 8px 8px 12px; }
.dlist__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 10px; }
.dgroup { padding: 6px 0; }
.dgroup + .dgroup { border-top: 1px solid var(--line); }
.dgroup h4 { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; font: 500 10px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.dgroup h4 span { color: var(--ink-4); }
.drow {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 4px 10px;
  border-radius: 10px;
  text-align: left;
  transition: background-color 0.15s;
}
.drow:hover, .drow:focus-visible { background: rgba(150, 205, 240, 0.06); }
.drow__qty { font: 500 12.5px/1 var(--font-mono); color: var(--ink-3); }
.drow__name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14.5px; color: var(--ink); }
.drow__name span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drow__name .i { width: 15px; height: 15px; flex: none; color: var(--gold); }
.drow__cost { display: inline-flex; gap: 2px; }
.drow__cost .pip { width: 15px; height: 15px; }
.drow__price { min-width: 52px; text-align: right; font: 400 11.5px/1 var(--font-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.drow.is-flash { animation: flash 0.9s ease; }
@keyframes flash { 0% { background: rgba(var(--glow-rgb), 0.22); } 100% { background: transparent; } }
@media (max-width: 480px) { .drow__price { display: none; } .drow { grid-template-columns: 28px minmax(0, 1fr) auto; } }

.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 6px 8px 8px; }
.dcards button { position: relative; aspect-ratio: 488 / 680; overflow: hidden; border-radius: 10px; background: var(--abyss-3); transition: transform 0.3s var(--ease-out); }
.dcards button:hover { transform: translateY(-3px); }
.dcards img { width: 100%; height: 100%; object-fit: cover; }
.dcards .qty { position: absolute; top: 6px; left: 6px; padding: 3px 6px; border-radius: 6px; background: rgba(2, 8, 14, 0.8); font: 500 11px/1 var(--font-mono); color: var(--ink); }
.dcards .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; font-size: 13px; text-align: center; color: var(--ink-3); }

.search { display: flex; flex-direction: column; gap: 10px; }
.colors { display: flex; flex-wrap: wrap; gap: 6px; }
.colors button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; transition: border-color 0.2s, background-color 0.2s, opacity 0.2s; opacity: 0.6; }
.colors button img { width: 20px; height: 20px; }
.colors button.is-on { opacity: 1; border-color: rgba(var(--glow-rgb), 0.5); background: rgba(var(--glow-rgb), 0.1); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.filters .select { min-height: 38px; font-size: 13.5px; padding-left: 10px; padding-right: 28px; background-position: right 8px center; text-overflow: ellipsis; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.results { display: flex; flex-direction: column; gap: 2px; }
.results__meta { padding: 4px 4px 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.rrow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 12px;
  transition: background-color 0.15s;
}
.rrow:hover { background: rgba(150, 205, 240, 0.05); }
.rrow__thumb { width: 44px; height: 32px; border-radius: 6px; object-fit: cover; object-position: 50% 26%; background: var(--abyss-3); cursor: pointer; }
.rrow__main { min-width: 0; cursor: pointer; }
.rrow__name { display: flex; align-items: center; gap: 8px; overflow: hidden; font-size: 14.5px; font-weight: 550; color: var(--ink); }
.rrow__name span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rrow__meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; overflow: hidden; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.rrow__meta .pip { width: 13px; height: 13px; }
.rrow__in { flex: none; padding: 2px 6px; border-radius: 5px; background: rgba(var(--glow-rgb), 0.12); font: 500 9.5px/1.4 var(--font-mono); color: var(--glow-hi); }
.addbtn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(var(--glow-rgb), 0.35);
  border-radius: 11px;
  color: var(--glow-hi);
  background: rgba(var(--glow-rgb), 0.08);
  transition: background-color 0.2s, transform 0.2s var(--ease-out), color 0.2s;
}
.addbtn .i { width: 18px; height: 18px; stroke-width: 2; }
.addbtn:hover { background: rgba(var(--glow-rgb), 0.18); }
.addbtn:active { transform: scale(0.92); }
.addbtn.is-done { color: var(--abyss-1); background: var(--glow); border-color: var(--glow); }
.rskel { height: 44px; margin: 4px 0; }
/* card detail sheet */
.cardx { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
@media (max-width: 560px) { .cardx { grid-template-columns: 1fr; justify-items: center; } }
.cardx__img { width: 100%; max-width: 240px; aspect-ratio: 488 / 680; border-radius: 12px; object-fit: cover; background: var(--abyss-3); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8); }
.cardx__info { display: flex; flex-direction: column; gap: 10px; min-width: 0; width: 100%; }
.cardx__type { font-size: 13.5px; color: var(--ink-3); }
.cardx__text { font-size: 14px; line-height: 1.55; color: var(--ink-2); white-space: pre-line; }
.cardx__text .pip { display: inline-block; width: 15px; height: 15px; margin: 0 1px; vertical-align: -3px; }
.cardx__price { font: 500 22px/1 var(--font-display); }
.qtyctl { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 12px; }
.qtyctl b { min-width: 34px; text-align: center; font: 500 15px/1 var(--font-mono); }
.cardx__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
@media (max-width: 480px) { .cgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.ccard { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ccard__img { position: relative; aspect-ratio: 488 / 680; overflow: hidden; border-radius: 10px; background: var(--abyss-3); transition: transform 0.35s var(--ease-out), box-shadow 0.35s; }
.ccard:hover .ccard__img { transform: translateY(-3px); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.9), 0 0 24px -10px rgba(var(--glow-rgb), 0.5); }
.ccard__img img { width: 100%; height: 100%; object-fit: cover; }
.ccard__qty { position: absolute; top: 6px; left: 6px; padding: 3px 6px; border-radius: 6px; background: rgba(2, 8, 14, 0.82); font: 500 11px/1 var(--font-mono); }
.ccard__bind { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(2, 8, 14, 0.82); color: var(--glow); }
.ccard__bind .i { width: 13px; height: 13px; }
.ccard__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.ccard__price { font: 400 11px/1 var(--font-mono); color: var(--ink-4); }
@media (max-width: 480px) { .ccard__name, .ccard__price { display: none; } }
.ccard__img { display: block; }
.ccard .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 12px; line-height: 1.3; text-align: center; color: var(--ink-3); }
/* ---------------------------------------------------------------- utilities */

.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.muted { color: var(--ink-3); }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: initial; } .show-sm { display: none; } }

