:root {
  --bg: #030814;
  --panel: #02122b;
  --panel-2: #031a36;
  --card-1: #02142a;
  --card-2: #041f36;
  --card-3: #02213b;
  --muted: #95c6df;
  --line: rgba(255, 255, 255, 0.04);
  --glass: rgba(255, 255, 255, 0.03);
  --accent: #2f6ef3;
  --accent-2: #4ea1ff;
  --danger: #ff4c4c;
  --ok: rgba(52, 211, 153, 0.45);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  --pill-blue: rgba(78, 140, 255, 0.08);
  --select-bg: #021224;
  --select-color: #cfefff;
  --hl-bg: rgba(78, 161, 255, 0.16);
  --hl-color: #dff6ff;
  --pending: #f7d37a;
  --pending-text: #4a2f00;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: linear-gradient(180deg, var(--bg), #000814 95%);
  color: #e7fbff;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

header.appbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.left {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #021;
  padding: 6px;
  font-weight: 800;
}

.brand-txt .title {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  color: #eaf8ff;
}

.center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.search {
  flex: 0.85;
  min-width: 160px;
  display: flex;
  gap: 8px;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: #def8ff;
  font-size: 0.95rem;
}

.navwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

nav#types {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

nav#types::-webkit-scrollbar {
  display: none;
}

nav#types button {
  background: transparent;
  border: 1px solid var(--line);
  color: #bfeeff;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

nav#types button.active {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
}

.right-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
}

.view-btn {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #021;
  box-shadow: var(--shadow);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: #cfefff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  width: 100%;
}

.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  flex-wrap: wrap;
}

.crumbs button {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.member-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.member-chip {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
}

.search-banner {
  position: sticky;
  top: 56px;
  z-index: 190;
  background: linear-gradient(180deg, #021526, #032c3f);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.search-banner .q {
  font-weight: 700;
  color: var(--accent-2);
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, var(--card-1), var(--card-2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: #021327;
}

.tag.type-all {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #021327;
}

.stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}

.stat {
  flex: 1 1 130px;
  min-width: 110px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  align-items: center;
}

.cards-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start;
}

.cat-card {
  background: linear-gradient(180deg, #0a1b36, #07223a);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cat-card:hover {
  transform: translateY(-6px);
}

.cat-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(140deg, #05385e, #1b5fb0);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.cat-title {
  font-weight: 800;
}

.cat-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.p-wrap {
  height: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.p-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  width: 0%;
  transition: width 0.35s ease;
}

.p-label {
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 10px;
  flex-wrap: wrap;
}

.status-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.list-card {
  background: linear-gradient(180deg, #011427, #021d35);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-top: 12px;
}

.row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #021831, #011a2f);
  border: 1px solid rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
  transition: background 0.12s;
  align-items: center;
}

.row:hover {
  background: linear-gradient(180deg, #032046, #012235);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #032a46;
  display: grid;
  place-items: center;
  color: #cfefff;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 56px;
  font-size: 1.05rem;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-extra {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  margin-left: auto;
}

.tiny-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  color: #cfefff;
  font-weight: 700;
  font-size: 0.88rem;
}

.genre-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pill-blue);
  border: 1px solid rgba(78, 140, 255, 0.14);
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: 0.86rem;
  color: #dff6ff;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}

.form-card {
  background: linear-gradient(180deg, #072033, #042a3b);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-top: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

input.ghost,
textarea.ghost,
select.ghost {
  background: var(--select-bg);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--select-color);
  width: 100%;
  font-size: 0.95rem;
  outline: none;
}

textarea.ghost {
  min-height: 80px;
  resize: vertical;
  padding-top: 10px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  color: #021;
  font-weight: 800;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: #cfefff;
}

.danger-btn {
  background: linear-gradient(90deg, #ffb3b3, #ff7b7b);
  color: #3d0202;
  font-weight: 800;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

mark.hl {
  background: var(--hl-bg);
  color: var(--hl-color);
  padding: 0 2px;
  border-radius: 4px;
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 500;
}

.drawer.show {
  display: block;
}

.drawer .panel {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #000812, #001425);
  padding: 26px;
  overflow: auto;
  color: #e9fbff;
}

.drawer .panel h3 {
  margin-top: 6px;
}

.drawer .panel .section {
  margin: 10px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.drawer .panel .nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.drawer .panel .nav-list button {
  padding: 14px 16px;
  border-radius: 10px;
  border: none;
  background: #021426;
  color: #dff6ff;
  font-weight: 700;
  text-align: left;
  font-size: 1.05rem;
}

.float-hamburger {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 600;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: none;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #021;
  font-weight: 900;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 22px;
}

@media (max-width: 720px) {
  .float-hamburger {
    display: grid;
  }
}

.closeFab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: none;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  border: 1px solid var(--line);
  background: #021426;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.drawer.show .closeFab {
  display: grid;
}

@media (max-width: 720px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .thumb {
    width: 100%;
    height: 140px;
    flex: 0 0 auto;
    border-radius: 10px;
    font-size: 1.25rem;
  }

  .row-right {
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-row .stat:first-child {
    min-width: 100%;
  }

  .stats-row .stat {
    min-width: 48%;
    flex-basis: 48%;
  }

  nav#types {
    display: none;
  }

  .search {
    display: none;
  }

  .right-actions {
    display: none;
  }

  header.appbar {
    padding: 8px;
  }
}

@media (min-width: 1400px) {
  main {
    grid-template-columns: 1fr;
  }
}

.row .actions-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.item-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.item-actions .left-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.item-actions .right-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

/* --- Tiled item card (image on top, small card) --- */
.item-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  align-items: start;
}

.item-card {
  background: linear-gradient(180deg, #071731, #021a30);
  border-radius: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 230px;
  position: relative;
  overflow: visible;
}

.item-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}

.item-thumb {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #011827, #02263a);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
}

.item-thumb img {
  width: 20px;
  height: 16px;
  object-fit: cover;
  display: block;
}

.item-card .item-title {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.15;
  /* show full name: allow wrapping */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  text-align: left;
}

.item-card .item-meta {
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.item-card .price {
  font-weight: 800;
  color: var(--accent-2);
  font-size: 0.92rem;
}

.item-card .status {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--muted);
  font-size: 0.8rem;
}

/* cover badge — top-right overlay (status) */
.cover-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  /* moved from left to right */
  left: auto;
  padding: 1px 4px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.76rem;
  color: #021;
  z-index: 5;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.cover-badge.ok {
  background: var(--ok);
  color: #012216;
}

.cover-badge.not {
  background: rgba(255, 76, 76, 0.3);
  color: #3d0202;
}

.cover-badge.pending {
  background: var(--pending);
  color: var(--pending-text);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cover-region {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.03);
  z-index: 5;
  font-weight: 700;
}

@media (max-width: 720px) {
  .item-thumb {
    height: 160px;
  }

  .cover-badge {
    display: block;
  }
}

.tile-card {
  display: flex;
  flex-direction: column;
  background: #1c1c1c;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.tile-card:hover {
  transform: scale(1.03);
}

.tile-thumb {
  position: relative;
  width: 100%;
  padding-top: 140%;
  /* maintain aspect ratio */
  background: #000;
}

.item-thumb img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px 6px 0 0;
}

.tile-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.2em;
  font-weight: bold;
}

.cover-flag {
  width: 20px;
  height: 16px;
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 24px;
  height: auto;
  border-radius: 3px;
}

.tile-body {
  padding: 6px;
  text-align: center;
}

.tile-title {
  font-size: 0.9em;
  font-weight: bold;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Grid layout */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 10px;
}

/* Responsive mobile tweaks */
@media (max-width: 600px) {
  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .tile-title {
    font-size: 0.8em;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

.scanner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 150px;
  transform: translate(-50%, -50%);
  border: 2px dashed red;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  /* Glow effect */
}

#toggleGrid {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 99;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.list-header {
  position: relative;
}

/* minimal visually-hidden helper */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* button style */
.view-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.view-toggle[aria-pressed="true"] {
  background: rgba(0, 0, 0, 0.04);
}

/* ICONS */
.view-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

#stage[data-view="grid"] .item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

#stage[data-view="list"] .item-grid {
  display: block;
}

/* base item card styling (works for both) */
.item-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 8px;
  min-height: 140px;
  align-items: stretch;
}

/* grid-mode thumb */
#stage[data-view="grid"] .item-card .item-thumb {
  height: 110px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage[data-view="grid"] .item-card .item-thumb img.cover-flag {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* list-mode: turn cards into rows */
#stage[data-view="list"] .item-card {
  flex-direction: row;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 8px;
  margin-bottom: 10px;
}

#stage[data-view="list"] .item-card .item-thumb {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  margin: 0;
}

#stage[data-view="list"] .item-card .item-thumb img.cover-flag {
  object-fit: cover;
  border-radius: 6px;
}

/* meta/title adjustments */
#stage[data-view="grid"] .item-card .item-title {
  margin: 0 0 6px 0;
  font-weight: 700;
}

#stage[data-view="list"] .item-card .item-title {
  margin: 0;
  font-size: 1rem;
}

body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  background: #011624;
  color: #eaf8ff;
}

#searchBtn {
  margin: 20px;
  padding: 14px 20px;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #0062ff, #002b62);
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
  width: calc(100% - 40px);
}

#searchBtn:hover {
  opacity: 0.85;
}

#openBtn {
  margin: 20px;
  padding: 14px 20px;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #0062ff, #002b62);
  color: #fff;
  cursor: pointer;
  transition: 0.2s;
  width: calc(100% - 40px);
}

#openBtn:hover {
  opacity: 0.85;
}

#searchInput {
  margin: 0 20px 20px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #011624;
  color: #eaf8ff;
  font-size: 1rem;
  width: calc(100% - 40px);
}

#scanner {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1500;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px;
}

#scannerBox {
  background: linear-gradient(180deg, #021426, #011624);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  padding: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#scannerBox strong {
  font-size: 1.2rem;
  margin-bottom: 8px;
  text-align: center;
}

video {
  width: 100%;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
}

.scannerBtn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 8px;
  width: 100%;
}

#closeBtn {
  background: rgba(255, 255, 255, 0.05);
  color: #eaf8ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#closeBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  display: none;
  background: #28a745;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  font-size: 1rem;
  z-index: 9999;
}

#toast.show {
  display: block;
  visibility: visible;
  transition: opacity 0.5s ease, top 0.5s ease;
}

@media (orientation: landscape) {
  #scannerBox {
    flex-direction: row;
    gap: 12px;
  }

  video {
    width: 60%;
    height: auto;
  }

  .scannerControls {
    width: 35%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

#alphaContainer {
  display: none;
}

.alpha-container {
  margin: 10px 0;
  background: linear-gradient(180deg, #011427, #021d35);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  z-index: 100;
}

.alpha-container.sticky {
  position: sticky;
  top: 0;
}

.alpha-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  overflow-x: auto;
}

.alpha-list button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: var(--select-bg, #eee);
  color: var(--select-color, #333);
  cursor: pointer;
  font-weight: 600;
}

.alpha-list button:hover {
  background: var(--accent, #007bff);
  color: #fff;
}
