/* ============================================================
   OPData — One Piece TCG Market Tracker
   Main Stylesheet
   ============================================================ */

:root {
  --navy:   #0b0e1a;
  --deep:   #0d1220;
  --panel:  #111827;
  --panel2: #161f30;
  --border: #1e2d45;
  --border2:#243350;
  --gold:   #e8b84b;
  --gold2:  #f5d07a;
  --red:    #e03e3e;
  --blue:   #3a9eea;
  --green:  #3fcf8e;
  --purple: #9b6ef3;
  --text:   #d4dce8;
  --muted:  #5a6a80;
  --white:  #f0f4ff;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--navy);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%,  rgba(58,158,234,.07)  0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 88% 100%, rgba(232,184,75,.06)  0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(224,62,62,.04)   0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ── HEADER ── */
header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(11,14,26,.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 60px; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; cursor: pointer; }
.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.logo-text {
  font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 800;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.logo-text span { -webkit-text-fill-color: var(--red); }

nav { display: flex; gap: 2px; }
nav a {
  color: var(--muted); text-decoration: none; font-size: .855rem; font-weight: 500;
  padding: 5px 13px; border-radius: 6px; transition: all .2s; cursor: pointer;
}
nav a:hover, nav a.active { color: var(--white); background: rgba(255,255,255,.07); }

.hdr-right { display: flex; align-items: center; gap: 8px; }

.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 5px 14px; border-radius: 6px; font-size: .83rem; cursor: pointer;
  transition: all .2s; font-family: 'DM Sans', sans-serif; display: inline-flex; align-items: center; gap: 5px;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #c9922a);
  color: #0b0e1a; padding: 5px 14px; border-radius: 6px; font-size: .83rem;
  font-weight: 700; cursor: pointer; border: none; font-family: 'DM Sans', sans-serif;
  transition: opacity .2s;
}
.btn-gold:hover { opacity: .85; }

/* User Menu (logged-in state) */
.hdr-user-menu {
  position: relative; display: none; align-items: center; gap: 8px; cursor: pointer;
}
.hdr-user-menu.visible { display: flex; }
.hdr-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--red));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #0b0e1a; flex-shrink: 0;
}
.hdr-user-name { font-size: .83rem; font-weight: 500; color: var(--text); }
.user-tier {
  font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}
.tier-gold     { background: rgba(232,184,75,.2); color: var(--gold); }
.tier-platinum { background: rgba(155,110,243,.2); color: var(--purple); }
.tier-free     { display: none; }

.hdr-dropdown-arrow { font-size: .7rem; color: var(--muted); transition: transform .2s; }
.hdr-user-menu.open .hdr-dropdown-arrow { transform: rotate(180deg); }

.user-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--panel); border: 1px solid var(--border2); border-radius: 10px;
  min-width: 180px; padding: .4rem; z-index: 300; box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.user-dropdown.open { display: block; }
.dd-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px;
  font-size: .83rem; color: var(--text); cursor: pointer; transition: background .15s;
  text-decoration: none;
}
.dd-item:hover { background: rgba(255,255,255,.06); }
.dd-item.dd-danger { color: var(--red); }
.dd-item.dd-danger:hover { background: rgba(224,62,62,.08); }
.dd-sep { border: none; border-top: 1px solid var(--border); margin: .25rem 0; }

/* ── PAGES ── */
main { position: relative; z-index: 1; }
.page { display: none; }
.page.active { display: block; }

/* ── HERO ── */
.hero {
  padding: 4.5rem 1.5rem 2rem; text-align: center; max-width: 860px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232,184,75,.1); border: 1px solid rgba(232,184,75,.3);
  color: var(--gold); font-size: .75rem; font-weight: 600;
  padding: 4px 14px; border-radius: 100px; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-family: 'Cinzel', serif; font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 1.1rem; color: var(--white);
}
.hero h1 .accent { color: var(--gold); }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 520px; margin: 0 auto 2.2rem; line-height: 1.7; }

/* ── SEARCH ── */
.search-wrap { max-width: 640px; margin: 0 auto 1.2rem; position: relative; }
.search-wrap input {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  color: var(--white); padding: 13px 50px 13px 18px; border-radius: 11px;
  font-size: .975rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s;
}
.search-wrap input:focus { border-color: var(--gold); }
.search-wrap input::placeholder { color: var(--muted); }
.search-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; pointer-events: none; }

/* ── CHIPS ── */
.chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 2.5rem; }
.chip {
  padding: 5px 15px; border-radius: 100px; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .2s; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-family: 'DM Sans', sans-serif;
}
.chip:hover, .chip.active { color: var(--white); border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.chip.red:hover,    .chip.red.active    { background: rgba(224,80,80,.15);  border-color: #e05050; color: #e05050; }
.chip.blue:hover,   .chip.blue.active   { background: rgba(58,158,234,.15); border-color: var(--blue);   color: var(--blue); }
.chip.green:hover,  .chip.green.active  { background: rgba(63,207,142,.15); border-color: var(--green);  color: var(--green); }
.chip.yellow:hover, .chip.yellow.active { background: rgba(232,184,75,.15); border-color: var(--gold);   color: var(--gold); }
.chip.purple:hover, .chip.purple.active { background: rgba(155,110,243,.15);border-color: var(--purple); color: var(--purple); }
.chip.black:hover,  .chip.black.active  { background: rgba(180,180,180,.1); border-color: #aaa; color: #ccc; }

/* ── STATS ROW ── */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 13px; overflow: hidden; max-width: 820px; margin: 0 auto 3.5rem;
}
.stat-cell { background: var(--panel); padding: 1.1rem 1.3rem; text-align: center; }
.stat-num  { font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 800; color: var(--white); }
.stat-label { font-size: .73rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .8px; }

/* ── SECTIONS ── */
.section { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem 3.5rem; }
.section-hdr { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.3rem; }
.section-title { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700; color: var(--white); }
.section-title .dot { color: var(--gold); }
.section-link { font-size: .8rem; color: var(--muted); text-decoration: none; cursor: pointer; transition: color .2s; }
.section-link:hover { color: var(--gold); }

/* ── SETS GRID ── */
.sets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .9rem; }
.set-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; cursor: pointer; transition: all .22s; display: flex; gap: .9rem; align-items: center;
}
.set-card:hover { border-color: rgba(232,184,75,.4); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.set-icon {
  width: 48px; height: 48px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; flex-shrink: 0; border: 1px solid rgba(255,255,255,.06);
}
.set-info { min-width: 0; }
.set-name  { font-weight: 600; font-size: .88rem; color: var(--white); margin-bottom: 2px; line-height: 1.3; }
.set-code  { font-size: .72rem; margin-bottom: 5px; }
.set-meta  { display: flex; gap: 6px; flex-wrap: wrap; }
.set-tag   { font-size: .68rem; padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,.05); color: var(--muted); }

/* ── SET DETAIL HERO ── */
.set-detail-hero {
  background: linear-gradient(135deg, rgba(17,24,39,.97), rgba(11,14,26,.97));
  border-bottom: 1px solid var(--border); padding: 2rem 1.5rem 1.5rem;
  position: relative; overflow: hidden;
}
.set-detail-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(232,184,75,.06), transparent);
  pointer-events: none;
}
.set-detail-inner { max-width: 1300px; margin: 0 auto; position: relative; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--gold); }
.set-detail-header { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.set-detail-icon {
  width: 68px; height: 68px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; border: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.set-detail-info h1 { font-family: 'Cinzel', serif; font-size: 1.7rem; font-weight: 800; color: var(--white); margin-bottom: .3rem; }
.set-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.meta-badge { font-size: .73rem; padding: 3px 10px; border-radius: 5px; font-weight: 600; }

/* ── CARDS FILTER BAR ── */
.cards-bar {
  max-width: 1300px; margin: 0 auto; padding: 1.2rem 1.5rem .8rem;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.cards-search { flex: 1; min-width: 180px; max-width: 300px; }
.cards-search input {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  color: var(--white); padding: 9px 14px; border-radius: 8px; font-size: .875rem;
  font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s;
}
.cards-search input:focus { border-color: var(--blue); }
.cards-search input::placeholder { color: var(--muted); }
.filter-sel {
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-size: .82rem;
  font-family: 'DM Sans', sans-serif; cursor: pointer; outline: none;
}
.filter-sel:focus { border-color: var(--blue); }
.cards-count { font-size: .8rem; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ── CARDS GRID ── */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: .85rem; max-width: 1300px; margin: 0 auto; padding: 0 1.5rem 3rem;
}
.card-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s;
  position: relative;
}
.card-item:hover { transform: translateY(-4px); border-color: rgba(232,184,75,.45); box-shadow: 0 14px 36px rgba(0,0,0,.45); }
.card-img {
  aspect-ratio: 3/4.2; background: linear-gradient(135deg, #151e2e, #1a2540);
  position: relative; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.card-item:hover .card-img img { transform: scale(1.05); }
.card-img-ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); }
.card-img-ph .sym { font-size: 2.2rem; }
.card-img-ph .cid { font-size: .65rem; letter-spacing: 1px; }
.color-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 2; }
.type-bdg {
  position: absolute; bottom: 7px; left: 7px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
  font-size: .62rem; font-weight: 700; letter-spacing: .4px; padding: 2px 6px;
  border-radius: 4px; text-transform: uppercase; color: var(--text); z-index: 2;
}
.rar-bdg {
  position: absolute; bottom: 7px; right: 7px;
  font-size: .62rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; z-index: 2;
}
.card-info { padding: 9px 10px 11px; }
.card-name { font-weight: 600; font-size: .83rem; color: var(--white); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-id-txt { font-size: .68rem; color: var(--muted); margin-bottom: 5px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.c-price { font-size: .88rem; font-weight: 700; color: var(--gold); }
.c-price.na { color: var(--muted); font-weight: 400; font-size: .76rem; }


/* ── LOADING / EMPTY ── */
.loading-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 2rem; gap: 1.2rem; color: var(--muted);
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-msg { text-align: center; padding: 3.5rem 2rem; color: var(--muted); }
.empty-msg .ico { font-size: 2.8rem; margin-bottom: .7rem; }

/* ── CARD MODAL ── */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(5,8,18,.88); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--panel); border: 1px solid var(--border2);
  border-radius: 18px; max-width: 700px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(18px); transition: transform .22s; position: relative;
}
.overlay.open .modal { transform: translateY(0); }
.modal-grid { display: grid; grid-template-columns: 200px 1fr; }
.modal-left { padding: 1.4rem; border-right: 1px solid var(--border); }
.modal-img-box {
  border-radius: 10px; overflow: hidden; aspect-ratio: 3/4.2;
  background: linear-gradient(135deg, #151e2e, #1a2540); margin-bottom: .9rem;
}
.modal-img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-img-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; }
.modal-stats-list { display: flex; flex-direction: column; gap: 7px; }
.msl-row { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; }
.msl-row label { color: var(--muted); }
.msl-row value { font-weight: 600; color: var(--white); }
.modal-right { padding: 1.4rem; display: flex; flex-direction: column; min-height: 0; }
.m-close {
  position: absolute; top: .85rem; right: .85rem;
  background: rgba(255,255,255,.07); border: none; color: var(--muted);
  width: 30px; height: 30px; border-radius: 6px; font-size: .9rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.m-close:hover { color: var(--white); background: rgba(255,255,255,.12); }

/* Modal tabs */
.modal-tabs { display: flex; gap: 4px; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.modal-tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 5px 12px; border-radius: 6px; font-size: .8rem; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.modal-tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.modal-tab.active { color: var(--white); background: rgba(255,255,255,.08); border-color: var(--border); }

.modal-panel { flex: 1; }

.m-name  { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--white); margin-bottom: .2rem; line-height: 1.2; padding-right: 2rem; }
.m-id    { font-size: .76rem; color: var(--muted); margin-bottom: .9rem; }
.m-price-main { font-size: 1.9rem; font-weight: 800; font-family: 'Cinzel', serif; color: var(--white); }
.m-price-inv  { font-size: .8rem; color: var(--muted); margin: .15rem 0 .7rem; }
.m-source {
  display: inline-flex; align-items: center; gap: 5px; font-size: .7rem;
  background: rgba(58,158,234,.12); border: 1px solid rgba(58,158,234,.25);
  color: var(--blue); padding: 3px 9px; border-radius: 5px; margin-bottom: .85rem;
}
.m-sub   { font-size: .76rem; color: var(--muted); margin-bottom: .7rem; }
.m-text-box {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  padding: .75rem; font-size: .81rem; line-height: 1.6; color: var(--text);
  margin-bottom: .9rem; max-height: 120px; overflow-y: auto;
}
.divider { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }
.tcgbtn {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  background: linear-gradient(135deg, #3a7bd5, #2058c0); color: #fff; padding: 10px;
  border-radius: 9px; font-size: .88rem; font-weight: 600; text-decoration: none;
  transition: opacity .2s; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.tcgbtn:hover { opacity: .88; }

/* Modal action buttons */
.modal-actions { display: flex; gap: 8px; margin-top: .75rem; }
.modal-action-btn {
  flex: 1; padding: 9px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s;
  border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--text);
}
.modal-action-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(232,184,75,.07); }
.modal-action-btn.wl { border-color: var(--border); color: var(--text); }
.modal-action-btn.wl:hover { border-color: var(--blue); color: var(--blue); background: rgba(58,158,234,.07); }

/* ── RARITY BADGES ── */
.r-L   { background: rgba(255,215,0,.15);  color: #ffd700; }
.r-C   { background: rgba(170,170,170,.1); color: #aaa; }
.r-UC  { background: rgba(63,207,142,.12); color: var(--green); }
.r-R   { background: rgba(58,158,234,.12); color: var(--blue); }
.r-SR  { background: rgba(155,110,243,.15);color: var(--purple); }
.r-SEC { background: rgba(232,184,75,.15); color: var(--gold); }
.r-TR  { background: rgba(224,62,62,.15);  color: #ff6060; }

/* ── TRENDING TABLE ── */
.t-table { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.trow {
  display: grid; grid-template-columns: 38px 1fr 95px 80px 90px;
  align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--border);
  gap: 10px; cursor: pointer; transition: background .15s;
}
.trow:last-child { border-bottom: none; }
.trow:hover { background: rgba(255,255,255,.03); }
.trow.th { font-size: .7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; cursor: default; }
.trow.th:hover { background: transparent; }
.t-rank { color: var(--muted); font-size: .82rem; text-align: center; }
.t-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.t-thumb {
  width: 33px; height: 44px; border-radius: 4px; overflow: hidden;
  background: linear-gradient(135deg, #1a2540, #0f1829); flex-shrink: 0;
}
.t-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-name { font-size: .85rem; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub  { font-size: .69rem; color: var(--muted); }
.t-pr   { font-size: .88rem; font-weight: 700; color: var(--white); }
.t-set  { font-size: .77rem; color: var(--muted); }

/* ── CTA ── */
.cta {
  background: linear-gradient(135deg, rgba(232,184,75,.08), rgba(224,62,62,.05));
  border: 1px solid rgba(232,184,75,.2); border-radius: 15px; padding: 2.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.cta h2 { font-family: 'Cinzel', serif; font-size: 1.35rem; color: var(--white); margin-bottom: .45rem; }
.cta p  { color: var(--muted); font-size: .9rem; max-width: 400px; line-height: 1.6; }
.feat-list { display: flex; flex-direction: column; gap: 6px; margin-top: .8rem; }
.feat-item { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--text); }
.feat-item .ck { color: var(--green); }
.btn-start {
  background: linear-gradient(135deg, var(--gold), #c9922a); color: #0b0e1a;
  padding: 11px 25px; border-radius: 9px; font-size: .9rem; font-weight: 700;
  cursor: pointer; border: none; font-family: 'DM Sans', sans-serif;
  transition: opacity .2s; white-space: nowrap;
}
.btn-start:hover { opacity: .85; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border); padding: 1.8rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .78rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }

/* ── PRICE CHART ── */
.chart-container { padding: .5rem 0; min-height: 180px; }
.chart-controls { display: flex; gap: 6px; margin-bottom: .75rem; }
.chart-btn {
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--muted); padding: 3px 10px; border-radius: 5px;
  font-size: .75rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.chart-btn:hover { color: var(--text); border-color: var(--border2); }
.chart-btn.active { color: var(--gold); border-color: var(--gold); background: rgba(232,184,75,.08); }
.chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 160px; gap: .5rem;
}

/* ── AUTH MODAL ── */
#authOverlay .modal { max-width: 420px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.auth-tab {
  flex: 1; padding: .8rem; text-align: center; font-size: .88rem; font-weight: 600;
  cursor: pointer; color: var(--muted); background: transparent; border: none;
  font-family: 'DM Sans', sans-serif; border-bottom: 2px solid transparent;
  transition: all .2s; margin-bottom: -1px;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--white); border-bottom-color: var(--gold); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-form { display: flex; flex-direction: column; gap: .85rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.form-input {
  background: var(--panel2); border: 1px solid var(--border); color: var(--white);
  padding: 10px 14px; border-radius: 8px; font-size: .9rem;
  font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: var(--muted); }
.form-btn {
  background: linear-gradient(135deg, var(--gold), #c9922a); color: #0b0e1a;
  padding: 11px; border-radius: 8px; font-size: .9rem; font-weight: 700;
  cursor: pointer; border: none; font-family: 'DM Sans', sans-serif;
  transition: opacity .2s; margin-top: .3rem;
}
.form-btn:hover { opacity: .85; }
.form-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-error { font-size: .78rem; color: var(--red); min-height: 1.2em; margin-top: .2rem; }
.auth-switch { font-size: .8rem; color: var(--muted); text-align: center; margin-top: .75rem; }
.auth-switch a { color: var(--gold); cursor: pointer; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-modal-inner { padding: 1.8rem 1.6rem 1.5rem; }
.auth-logo { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: .3rem; text-align: center; }
.auth-subtitle { font-size: .83rem; color: var(--muted); text-align: center; margin-bottom: 1.4rem; }

/* ── AUTH GATE (protected page, not logged in) ── */
.auth-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5rem 2rem; gap: 1rem; text-align: center;
}
.auth-gate-icon { font-size: 3.5rem; margin-bottom: .5rem; }
.auth-gate h3 { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--white); }
.auth-gate p  { color: var(--muted); font-size: .9rem; max-width: 360px; line-height: 1.6; }

/* ── PORTFOLIO PAGE ── */
.page-inner { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-title { font-family: 'Cinzel', serif; font-size: 1.6rem; font-weight: 800; color: var(--white); }
.page-subtitle { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

.portfolio-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem;
}
.port-stat { background: var(--panel); padding: 1rem 1.2rem; }
.port-stat-val { font-family: 'Cinzel', serif; font-size: 1.25rem; font-weight: 800; color: var(--white); }
.port-stat-lbl { font-size: .7rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .6px; }

.pnl-up { color: var(--green) !important; }
.pnl-dn { color: var(--red)   !important; }

.port-table-wrap { overflow-x: auto; }
.port-table { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 640px; }
.port-row {
  display: grid; grid-template-columns: 1fr 55px 80px 80px 80px 100px 40px;
  align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border);
  gap: 8px; cursor: pointer; transition: background .15s;
}
.port-row:last-child { border-bottom: none; }
.port-row:hover { background: rgba(255,255,255,.02); }
.port-head {
  font-size: .68rem; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; cursor: default !important; background: transparent !important;
}
.port-card-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.port-thumb {
  width: 28px; height: 38px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
  background: var(--panel2);
}
.port-thumb-ph { width: 28px; height: 38px; border-radius: 4px; background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.port-name { font-size: .83rem; font-weight: 500; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-meta { font-size: .68rem; color: var(--muted); }
.port-val  { font-size: .83rem; color: var(--text); }
.port-actions { display: flex; justify-content: flex-end; }
.port-del-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  width: 26px; height: 26px; border-radius: 5px; cursor: pointer;
  font-size: .8rem; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.port-del-btn:hover { color: var(--red); border-color: rgba(224,62,62,.4); background: rgba(224,62,62,.08); }

.empty-portfolio {
  display: flex; flex-direction: column; align-items: center; padding: 4rem 2rem; gap: .8rem; text-align: center;
}

/* ── WATCHLIST PAGE ── */
.wl-table { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.wl-row {
  display: grid; grid-template-columns: 1fr 110px 95px 130px 110px 40px;
  align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); gap: 8px;
}
.wl-row:last-child { border-bottom: none; }
.wl-head {
  font-size: .68rem; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.wl-alert { background: rgba(232,184,75,.06); }
.wl-dir   { font-size: .78rem; color: var(--muted); }
.wl-badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.wl-triggered { background: rgba(232,184,75,.2); color: var(--gold); }
.wl-watching  { background: rgba(63,207,142,.12); color: var(--green); }
.wl-paused    { background: rgba(255,255,255,.06); color: var(--muted); }

/* ── SEALED PRODUCTS PAGE ── */
.sealed-filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 1.5rem; }
.sealed-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;
}
.sealed-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.sealed-card:hover { border-color: rgba(232,184,75,.3); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.sealed-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1rem .4rem;
}
.sealed-type-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; background: rgba(58,158,234,.12); color: var(--blue);
}
.sealed-owned-badge {
  font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  background: rgba(63,207,142,.12); color: var(--green);
}
.sealed-card-body { padding: .4rem 1rem .8rem; }
.sealed-name  { font-weight: 600; font-size: .88rem; color: var(--white); margin-bottom: .2rem; line-height: 1.35; }
.sealed-set   { font-size: .72rem; color: var(--muted); margin-bottom: .8rem; }
.sealed-prices { display: flex; gap: .5rem; }
.sealed-prices > div { flex: 1; }
.sealed-price     { font-size: .9rem; font-weight: 700; color: var(--white); }
.sealed-price-lbl { font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }
.sealed-card-footer { padding: .6rem 1rem; border-top: 1px solid var(--border); }
.sealed-add-btn {
  width: 100%; padding: 7px; border-radius: 7px; font-size: .82rem; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text);
}
.sealed-add-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(232,184,75,.07); }

/* ── PRICING PAGE ── */
.pricing-toggle {
  display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 2rem;
}
.toggle-label { font-size: .85rem; color: var(--muted); }
.toggle-switch {
  width: 44px; height: 24px; background: var(--border2); border-radius: 12px;
  position: relative; cursor: pointer; transition: background .2s;
}
.toggle-switch.on { background: var(--gold); }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  background: var(--white); border-radius: 50%; transition: left .2s;
}
.toggle-switch.on .toggle-knob { left: 22px; }
.annual-save { font-size: .72rem; font-weight: 700; color: var(--green); background: rgba(63,207,142,.12); padding: 2px 7px; border-radius: 4px; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.2rem;
  max-width: 900px; margin: 0 auto;
}
.pricing-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.8rem; position: relative; overflow: hidden;
}
.pricing-card.popular {
  border-color: rgba(232,184,75,.5); background: linear-gradient(160deg, rgba(232,184,75,.05), var(--panel));
}
.pricing-card.platinum {
  border-color: rgba(155,110,243,.4); background: linear-gradient(160deg, rgba(155,110,243,.05), var(--panel));
}
.popular-badge {
  position: absolute; top: 1rem; right: 1rem;
  font-size: .65rem; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold), #c9922a); color: #0b0e1a;
  padding: 3px 10px; border-radius: 20px;
}
.tier-name    { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: .5rem; }
.tier-price   { font-family: 'Cinzel', serif; font-size: 2.2rem; font-weight: 800; color: var(--white); }
.tier-price span { font-size: .95rem; font-weight: 400; color: var(--muted); }
.tier-period  { font-size: .75rem; color: var(--muted); margin-bottom: 1.2rem; }
.tier-desc    { font-size: .83rem; color: var(--muted); line-height: 1.6; margin-bottom: 1.2rem; }
.tier-features { display: flex; flex-direction: column; gap: 7px; margin-bottom: 1.5rem; }
.tier-feature { display: flex; align-items: flex-start; gap: 8px; font-size: .82rem; color: var(--text); line-height: 1.4; }
.tier-feature .fi-ck   { color: var(--green); flex-shrink: 0; }
.tier-feature .fi-dash { color: var(--muted);  flex-shrink: 0; }
.tier-cta {
  width: 100%; padding: 11px; border-radius: 9px; font-size: .9rem; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .2s; border: none;
}
.tier-cta.free     { background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text); }
.tier-cta.free:hover { background: rgba(255,255,255,.1); }
.tier-cta.gold     { background: linear-gradient(135deg, var(--gold), #c9922a); color: #0b0e1a; }
.tier-cta.gold:hover     { opacity: .85; }
.tier-cta.platinum { background: linear-gradient(135deg, var(--purple), #7a4fcc); color: var(--white); }
.tier-cta.platinum:hover { opacity: .85; }

/* ── SMALL MODALS (add to portfolio / watchlist / sealed) ── */
.small-modal { background: var(--panel); border: 1px solid var(--border2); border-radius: 16px; max-width: 400px; width: 100%; }
.sm-header { padding: 1.2rem 1.4rem .6rem; }
.sm-title  { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--white); }
.sm-card-ref { display: flex; align-items: center; gap: 10px; padding: .5rem 1.4rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.sm-card-img { width: 36px; height: 48px; border-radius: 5px; object-fit: cover; background: var(--panel2); }
.sm-card-name { font-size: .85rem; font-weight: 600; color: var(--white); }
.sm-card-id   { font-size: .7rem; color: var(--muted); }
.sm-body { padding: .6rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .8rem; }
.sm-row  { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.sm-footer { padding: 0 1.4rem 1.4rem; display: flex; gap: .6rem; }
.sm-btn-cancel {
  flex: 1; padding: 9px; border-radius: 8px; font-size: .85rem; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif; background: rgba(255,255,255,.04);
  border: 1px solid var(--border); color: var(--text); transition: all .15s;
}
.sm-btn-cancel:hover { background: rgba(255,255,255,.07); }
.sm-btn-add {
  flex: 2; padding: 9px; border-radius: 8px; font-size: .85rem; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  background: linear-gradient(135deg, var(--gold), #c9922a); color: #0b0e1a; border: none;
  transition: opacity .2s;
}
.sm-btn-add:hover { opacity: .85; }
.sm-btn-add:disabled { opacity: .5; cursor: not-allowed; }

/* ── TOAST NOTIFICATIONS ── */
#toastContainer { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-radius: 9px; font-size: .83rem; font-weight: 500; color: var(--white);
  background: var(--panel); border: 1px solid var(--border2);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  transform: translateY(10px); opacity: 0; transition: all .25s; pointer-events: all;
  max-width: 320px;
}
.toast.toast-visible { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--blue); }

/* ── MARKET TABS ── */
.market-tabs { display: flex; gap: 4px; }
.market-tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 4px 13px; border-radius: 6px; font-size: .8rem; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all .15s;
}
.market-tab:hover { color: var(--text); border-color: var(--border2); }
.market-tab.active { color: var(--gold); border-color: var(--gold); background: rgba(232,184,75,.08); }


/* ── RECENTLY VIEWED ── */
.rv-list {
  display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .4rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.rv-card {
  flex: 0 0 72px; cursor: pointer; transition: transform .15s;
}
.rv-card:hover { transform: translateY(-2px); }
.rv-card img { width: 72px; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.rv-ph {
  width: 72px; height: 100px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.rv-name {
  font-size: .6rem; color: var(--muted); margin-top: .3rem;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px;
}

/* ── QUICK-ADD BUTTONS ON CARD TILES ── */
.card-quick-add {
  display: flex; gap: 4px; margin-top: 5px;
  opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .15s;
}
.card-item:hover .card-quick-add { opacity: 1; transform: translateY(0); }
.qab {
  flex: 1; font-size: .63rem; padding: 3px 4px; border-radius: 5px; cursor: pointer;
  border: 1px solid rgba(232,184,75,.3); background: rgba(232,184,75,.1); color: var(--gold);
  font-family: 'DM Sans', sans-serif; transition: background .12s;
}
.qab:hover { background: rgba(232,184,75,.22); }
.qab.qab-wl { border-color: rgba(58,158,234,.3); background: rgba(58,158,234,.1); color: var(--blue); }
.qab.qab-wl:hover { background: rgba(58,158,234,.22); }

/* ── PORTFOLIO VALUE CHART ── */
.port-chart-wrap {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.1rem 1.2rem; margin-bottom: 1.2rem;
}
.port-chart-title { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .8rem; }

/* ── SET BREAKDOWN ── */
.set-breakdown { margin-top: 1.5rem; }
.set-breakdown-title {
  font-size: .72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.sb-row { margin-bottom: .85rem; }
.sb-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .3rem; }
.sb-set-name { font-size: .82rem; color: var(--text); }
.sb-stat { font-size: .75rem; color: var(--muted); }
.sb-track { height: 5px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.sb-fill { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .6s ease; }

/* ── SET VALUE BADGE ── */
#sdTotalValue { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .wl-row  { grid-template-columns: 1fr 90px 80px 40px; }
  .wl-row  span:nth-child(4),
  .wl-row  span:nth-child(5) { display: none; }
  .port-row { grid-template-columns: 1fr 50px 70px 70px 40px; }
  .port-row span:nth-child(5) { display: none; }
}
@media (max-width: 640px) {
  header { padding: 0 1rem; }
  nav { display: none; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-left { border-right: none; border-bottom: 1px solid var(--border); }
  .trow { grid-template-columns: 30px 1fr 82px 70px; }
  .t-set { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
}
