/* ── game.css ───────────────────────────────────────────────────────────────
   Component styles for Kura's Cards.
   All colors reference theme.css variables — never hardcode hex here.
   ─────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@300;400;600;700;800&family=Space+Grotesk:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100dvh;
  background: var(--kc-bg-base);
  color: var(--kc-text-primary);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
.kc-font-display { font-family: 'Oxanium', sans-serif; }

/* ── Layout shell ────────────────────────────────────────────────────────── */
#kc-app {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.kc-topbar {
  background: var(--kc-bg-bar);
  border-bottom: var(--kc-border-bar);
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.kc-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}

.kc-brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.kc-brand-name {
  font-family: 'Oxanium', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--kc-text-primary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.kc-nav {
  display: flex;
  gap: 2px;
  flex: 1;
}

.kc-nav-item {
  font-size: 10px;
  padding: 5px 11px;
  color: var(--kc-text-secondary);
  cursor: pointer;
  font-family: 'Oxanium', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s;
}

.kc-nav-item:hover       { color: var(--kc-text-primary); }
.kc-nav-item.active      { color: var(--kc-nav-active); border-bottom-color: var(--kc-accent); }

.kc-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.kc-gold-pill {
  font-family: 'Oxanium', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--kc-text-gold);
  background: rgba(0,0,0,0.2);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.05em;
}

.kc-notif-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 13px;
}

[data-notif-badge] {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--kc-accent-2);
  border: 2px solid var(--kc-bg-bar);
  font-size: 9px; font-weight: 700;
  color: #fff;
  display: none;
  align-items: center; justify-content: center;
  font-family: 'Oxanium', sans-serif;
}

.kc-avatar-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--kc-accent);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.kc-avatar-btn img { width: 100%; height: 100%; object-fit: contain; }

/* Theme switcher buttons */
.kc-theme-switcher { display: flex; align-items: center; gap: 6px; }
.kc-theme-btn {
  font-family: 'Oxanium', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 20px;
  border: 0.5px solid rgba(255,255,255,0.12);
  padding: 3px 10px;
  cursor: pointer;
  color: var(--kc-text-secondary);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.kc-theme-btn.active { background: var(--kc-accent); color: var(--kc-text-btn); border-color: var(--kc-accent); }

/* ── Page body layout ────────────────────────────────────────────────────── */
.kc-page {
  display: grid;
  grid-template-columns: 1fr 240px;
  flex: 1;
  gap: 0;
}

.kc-main  { padding: 20px; background: var(--kc-bg-base); }
.kc-sidebar {
  padding: 16px;
  background: var(--kc-bg-bar);
  border-left: 0.5px solid var(--kc-border-base);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Section headers ─────────────────────────────────────────────────────── */
.kc-section-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.kc-sh {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kc-text-muted);
  font-family: 'Oxanium', sans-serif;
  font-weight: 600;
}
.kc-sh-link {
  font-size: 9px;
  color: var(--kc-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.kc-sh-link:hover { color: var(--kc-text-primary); }

/* ── Pull banner ─────────────────────────────────────────────────────────── */
.kc-pull-banner {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-base);
  border-left: 3px solid var(--kc-accent-strong);
  border-radius: 8px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.kc-pull-title { font-family: 'Oxanium', sans-serif; font-size: 13px; font-weight: 700; color: var(--kc-text-primary); }
.kc-pull-sub   { font-size: 10px; color: var(--kc-text-secondary); margin-top: 3px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.kc-btn {
  font-family: 'Oxanium', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}
.kc-btn:active { transform: scale(0.97); }

.kc-btn--primary {
  background: var(--kc-accent-strong);
  color: var(--kc-text-btn);
}
.kc-btn--primary:hover { opacity: 0.88; }

.kc-btn--ghost {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.12);
  color: var(--kc-text-primary);
}
.kc-btn--ghost:hover { background: rgba(255,255,255,0.05); }

.kc-btn--gold {
  background: rgba(0,0,0,0.15);
  border: 0.5px solid rgba(255,255,255,0.1);
  color: var(--kc-text-gold);
}

/* ── Cards grid ──────────────────────────────────────────────────────────── */
.kc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 160px);
  gap: 12px;
  justify-content: start;
}

.kc-card {
  border-radius: 8px;
  overflow: hidden;
  border: 0.5px solid var(--kc-border-card);
  background: var(--kc-bg-card);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.kc-card:hover { transform: translateY(-2px); border-color: var(--kc-accent); }

/* Card art area — sized like standard TCG card (roughly 2.5:3.5 ratio) */
.kc-card-art {
  width: 100%;
  aspect-ratio: 5 / 7;
  background: var(--kc-bg-card-art);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
  overflow: hidden;
}

/* Foil shimmer */
.kc-card--foil .kc-card-art::after,
.kc-card--ultra .kc-card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%);
  animation: kcFoilShimmer 3s ease-in-out infinite;
}
@keyframes kcFoilShimmer {
  0%, 100% { transform: translateX(-100%); }
  50%       { transform: translateX(100%); }
}

.kc-card--foil { border-color: var(--kc-rarity-foil) !important; }
.kc-card--ultra { border-color: var(--kc-rarity-ultra) !important; }
.kc-card--foil .kc-card-foot { border-top-color: var(--kc-rarity-foil); }
.kc-card--ultra .kc-card-foot { border-top-color: var(--kc-rarity-ultra); }

.kc-foil-edge {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kc-foil-edge);
}
.kc-foil-corner {
  position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent var(--kc-foil-corner) transparent transparent;
}

.kc-rarity-dot {
  position: absolute; bottom: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--kc-bg-card-art);
}
.kc-rarity-dot--common    { background: var(--kc-rarity-common); }
.kc-rarity-dot--uncommon  { background: var(--kc-rarity-uncommon); }
.kc-rarity-dot--rare      { background: var(--kc-rarity-rare); }
.kc-rarity-dot--epic      { background: var(--kc-rarity-epic); }
.kc-rarity-dot--legendary { background: var(--kc-rarity-legendary); }
.kc-rarity-dot--foil      { background: var(--kc-rarity-foil); }
.kc-rarity-dot--ultra     { background: var(--kc-rarity-ultra); }

.kc-card-foot {
  padding: 6px 8px;
  background: var(--kc-bg-bar);
  border-top: 0.5px solid var(--kc-border-card);
}
.kc-card-name   { font-size: 10px; font-weight: 700; color: var(--kc-text-card); font-family: 'Oxanium', sans-serif; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-card-series { font-size: 8px; color: var(--kc-text-muted); margin-top: 1px; }

/* ── Sidebar widgets ─────────────────────────────────────────────────────── */
.kc-widget {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-panel);
  border-radius: 8px;
  padding: 11px 13px;
}
.kc-widget-title {
  font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--kc-text-muted); margin-bottom: 9px;
  font-family: 'Oxanium', sans-serif; font-weight: 600;
}

/* Streak pips */
.kc-pips { display: flex; gap: 3px; }
.kc-pip {
  flex: 1; height: 22px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; font-family: 'Oxanium', sans-serif;
}
.kc-pip--hit   { background: rgba(0,0,0,0.2); color: var(--kc-accent); border: 0.5px solid var(--kc-accent); opacity: 0.7; }
.kc-pip--today { background: var(--kc-streak-active); color: var(--kc-text-btn); }
.kc-pip--miss  { background: rgba(255,255,255,0.02); color: var(--kc-text-muted); border: 0.5px solid rgba(255,255,255,0.04); }

/* Progress bars */
.kc-progress-wrap { height: 2px; background: rgba(255,255,255,0.04); border-radius: 1px; overflow: hidden; margin-top: 4px; }
.kc-progress-fill { height: 100%; border-radius: 1px; background: var(--kc-progress-fill); transition: width 0.4s ease; }

/* Auction list items */
.kc-auc-item {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 7px;
  border-bottom: 0.5px solid rgba(255,255,255,0.04);
}
.kc-auc-item:last-child { border-bottom: none; padding-bottom: 0; }
.kc-auc-name { font-size: 10px; color: var(--kc-text-card); font-weight: 500; }
.kc-auc-time { font-size: 8px; color: var(--kc-text-muted); margin-top: 1px; }

/* ── Modals (shared — all non-card modals) ───────────────────────────────── */
.kc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 20px;
}
.kc-modal-overlay.kc-modal--open { display: flex; }

.kc-modal-box {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-base);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.kc-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 0.5px solid var(--kc-border-panel);
  flex-shrink: 0;
}
.kc-modal-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--kc-text-primary);
  letter-spacing: 0.04em;
}
.kc-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--kc-text-secondary); font-size: 14px;
  padding: 2px 6px; border-radius: 4px;
  transition: color 0.15s;
}
.kc-modal-close:hover { color: var(--kc-text-primary); }

.kc-modal-body   { padding: 16px 20px; flex: 1; }
.kc-modal-btns   { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 0.5px solid var(--kc-border-panel); justify-content: flex-end; }

/* ── Card modal (special — separate treatment) ───────────────────────────── */
.kc-card-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
}
.kc-card-modal-overlay.kc-modal--open { display: flex; }

.kc-card-modal-box {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-base);
  border-radius: 14px;
  width: 320px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: kcCardReveal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes kcCardReveal {
  from { transform: scale(0.7) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

/* Foil overlay — shimmer sweep */
.kc-card-modal-foil-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(125deg, transparent 20%, rgba(167,139,250,0.08) 40%, rgba(236,72,153,0.06) 60%, transparent 80%);
  animation: kcModalFoilSweep 4s ease-in-out infinite;
}
@keyframes kcModalFoilSweep {
  0%, 100% { transform: translateX(-120%); }
  50%       { transform: translateX(120%); }
}

/* Ultra overlay — more intense */
.kc-card-modal-ultra-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(125deg, transparent 10%, rgba(212,175,55,0.12) 35%, rgba(167,139,250,0.1) 65%, transparent 90%);
  animation: kcModalFoilSweep 2.5s ease-in-out infinite;
}

/* Rarity top border on the modal box */
.kc-card-modal--foil      { border-top: 3px solid var(--kc-rarity-foil); }
.kc-card-modal--ultra     { border-top: 3px solid var(--kc-rarity-ultra); }
.kc-card-modal--legendary { border-top: 3px solid var(--kc-rarity-legendary); }
.kc-card-modal--epic      { border-top: 3px solid var(--kc-rarity-epic); }
.kc-card-modal--rare      { border-top: 3px solid var(--kc-rarity-rare); }

.kc-card-modal-art {
  width: 100%;
  aspect-ratio: 5 / 7;
  background: var(--kc-bg-card-art);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.kc-card-modal-art-emoji { font-size: 5rem; position: relative; z-index: 1; }
.kc-card-modal-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

.kc-card-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 10;
  background: rgba(0,0,0,0.4); border: none; cursor: pointer;
  color: var(--kc-text-primary); font-size: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.kc-card-modal-info {
  padding: 14px 16px 10px;
  position: relative; z-index: 3;
}
.kc-card-modal-rarity {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  font-family: 'Oxanium', sans-serif; font-weight: 700; margin-bottom: 4px;
}
.kc-rarity--foil      { color: var(--kc-rarity-foil); }
.kc-rarity--ultra     { color: var(--kc-rarity-ultra); }
.kc-rarity--legendary { color: var(--kc-rarity-legendary); }
.kc-rarity--epic      { color: var(--kc-rarity-epic); }
.kc-rarity--rare      { color: var(--kc-rarity-rare); }
.kc-rarity--uncommon  { color: var(--kc-rarity-uncommon); }
.kc-rarity--common    { color: var(--kc-rarity-common); }

.kc-card-modal-name   { font-family: 'Oxanium', sans-serif; font-size: 18px; font-weight: 800; color: var(--kc-text-primary); }
.kc-card-modal-series { font-size: 11px; color: var(--kc-text-secondary); margin-top: 2px; }
.kc-card-modal-desc   { font-size: 11px; color: var(--kc-text-card); margin-top: 8px; line-height: 1.6; }

.kc-card-modal-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px 14px;
  border-top: 0.5px solid var(--kc-border-panel);
  position: relative; z-index: 3;
}

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.kc-toast {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-base);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'Oxanium', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--kc-text-primary);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 180px;
  max-width: 280px;
  letter-spacing: 0.03em;
}
.kc-toast--visible { opacity: 1; transform: translateX(0); }
.kc-toast--success { border-left: 3px solid #34d399; }
.kc-toast--error   { border-left: 3px solid var(--kc-accent); }
.kc-toast--warning { border-left: 3px solid #f59e0b; }
.kc-toast--gold    { border-left: 3px solid var(--kc-text-gold); color: var(--kc-text-gold); }
.kc-toast--card    { border-left: 3px solid var(--kc-rarity-rare); }

/* ── Progress / catalog bars ─────────────────────────────────────────────── */
.kc-prog-bar-wrap { height: 3px; background: rgba(255,255,255,0.04); border-radius: 2px; overflow: hidden; }
.kc-prog-bar-fill { height: 100%; border-radius: 2px; background: var(--kc-accent-strong); transition: width 0.5s ease; }

/* Series tiles */
.kc-series-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 8px; }
.kc-series-tile {
  background: var(--kc-bg-panel);
  border: 0.5px solid var(--kc-border-panel);
  border-radius: 6px;
  padding: 8px 10px;
}
.kc-series-label { font-size: 8px; color: var(--kc-text-muted); font-family: 'Oxanium', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; }
.kc-series-count { font-size: 14px; color: var(--kc-text-card); font-family: 'Oxanium', sans-serif; font-weight: 800; margin-top: 2px; }

/* ── Auth forms ──────────────────────────────────────────────────────────── */
.kc-form-group  { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.kc-form-label  { font-size: 10px; font-family: 'Oxanium', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kc-text-secondary); }
.kc-form-input  {
  background: var(--kc-bg-base);
  border: 0.5px solid var(--kc-border-panel);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--kc-text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.kc-form-input:focus { border-color: var(--kc-accent); }
.kc-form-error { font-size: 11px; color: #f87171; margin-top: 3px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .kc-page { grid-template-columns: 1fr; }
  .kc-sidebar { border-left: none; border-top: 0.5px solid var(--kc-border-base); }
  .kc-nav-item { padding: 5px 7px; font-size: 9px; }
  .kc-brand-name { display: none; }
}
