/* ============================================================
   L2 CARD GAME — PREMIUM DARK FANTASY UI
   Inspired by: Lineage 2, Diablo, Elden Ring, MTG, Hearthstone
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700;900&family=Uncial+Antiqua&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  /* Base */
  --bg:          #0B0B0D;
  --bg2:         #111116;
  --bg3:         #16161C;
  --bg4:         #1C1C24;

  /* Gold system */
  --gold:        #D4AF37;
  --gold2:       #F0CC55;
  --gold3:       #B8941E;
  --gold-dim:    #6B5010;
  --gold-glow:   rgba(212,175,55,0.35);

  /* Rarity colors */
  --common-c:    #8A9BB0;
  --common-glow: rgba(138,155,176,0.25);
  --rare-c:      #3A7BFF;
  --rare-glow:   rgba(58,123,255,0.35);
  --epic-c:      #A855F7;
  --epic-glow:   rgba(168,85,247,0.35);
  --legend-c:    #FFD700;
  --legend-glow: rgba(255,215,0,0.45);

  /* UI */
  --red:         #C0392B;
  --green:       #27AE60;
  --text:        #C8D4E0;
  --text-dim:    #4A5A6A;
  --text-bright: #EAEAEAx;

  /* Fonts */
  --font-display: 'Cinzel Decorative', serif;
  --font-title:   'Cinzel', serif;
  --font-body:    'Uncial Antiqua', serif;

  --radius: 4px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-title);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Atmospheric layered background */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(212,175,55,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 0% 100%,  rgba(58,123,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(168,85,247,0.03) 0%, transparent 50%);
}

/* Subtle noise texture overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold3); }

/* ─── HEADER ─── */
#header {
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  background: linear-gradient(180deg, rgba(212,175,55,0.06) 0%, transparent 100%);
  flex-shrink: 0; flex-wrap: wrap; gap: 12px;
  position: relative;
}
#header::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 300px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold3), transparent);
}
.header-logo {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 30px);
  color: var(--gold);
  text-shadow: 0 0 30px var(--gold-glow), 0 0 60px rgba(212,175,55,0.1);
  letter-spacing: 4px;
  font-weight: 900;
}
.header-logo span { color: rgba(212,175,55,0.4); font-size: 0.6em; }
.header-user {
  font-family: var(--font-title);
  font-size: 11px; letter-spacing: 2px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 14px;
}
.header-user .username { color: var(--gold); font-weight: 600; }
.btn-reset {
  font-family: var(--font-title); font-size: 9px; letter-spacing: 2px;
  color: var(--text-dim); background: none;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 4px 10px; cursor: pointer; border-radius: 2px; transition: all 0.2s;
}
.btn-reset:hover { color: var(--red); border-color: rgba(192,57,43,0.4); }

/* ─── NAV ─── */
#nav {
  display: flex; gap: 2px; padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(11,11,13,0.8); flex-wrap: wrap; flex-shrink: 0;
}
.nav-tab {
  font-family: var(--font-title); font-size: 11px; letter-spacing: 3px;
  text-transform: uppercase; padding: 10px 22px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-dim); cursor: pointer; transition: all 0.2s;
  position: relative; clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
}
.nav-tab::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; background: var(--gold); transition: width 0.3s;
}
.nav-tab:hover { color: var(--text); border-color: rgba(212,175,55,0.2); }
.nav-tab.active { color: var(--gold); border-color: rgba(212,175,55,0.3); background: rgba(212,175,55,0.06); }
.nav-tab.active::after { width: 60%; }

/* ─── STATS BAR ─── */
#stats-bar {
  display: flex; gap: 0; padding: 0;
  background: var(--bg2); border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap; flex-shrink: 0; overflow: hidden;
}
.sb-item {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 18px;
  border-right: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-title); font-size: 11px; letter-spacing: 1px;
}
.sb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sb-dot.common    { background: var(--common-c); }
.sb-dot.rare      { background: var(--rare-c); box-shadow: 0 0 6px var(--rare-glow); }
.sb-dot.epic      { background: var(--epic-c); box-shadow: 0 0 6px var(--epic-glow); }
.sb-dot.legendary { background: var(--legend-c); box-shadow: 0 0 8px var(--legend-glow); }
.sb-label { color: var(--text-dim); }
.sb-value { color: var(--gold); font-weight: 700; min-width: 20px; }
.sb-dc-icon { font-size: 14px; }

/* ─── MAIN / TABS ─── */
#main { flex: 1; overflow-y: auto; }
.tab-content { display: none; padding: 28px 22px; max-width: 1500px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ─── SECTION HEADERS ─── */
.section-hdr {
  font-family: var(--font-title);
  font-size: 12px; letter-spacing: 6px; text-transform: uppercase;
  color: var(--gold3); margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
}
.section-hdr::before, .section-hdr::after {
  content: ''; flex: 1; height: 1px;
}
.section-hdr::before { background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3)); }
.section-hdr::after  { background: linear-gradient(90deg, rgba(212,175,55,0.3), transparent); }

/* ─── BUTTONS ─── */
.btn {
  font-family: var(--font-title); font-size: 11px; letter-spacing: 3px;
  text-transform: uppercase; padding: 11px 24px;
  border: 1px solid rgba(212,175,55,0.3); background: transparent;
  color: var(--text); cursor: pointer; transition: all 0.2s;
  clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.08), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.btn:hover { border-color: var(--gold3); color: var(--gold); }
.btn:hover::before { opacity: 1; }
.btn.primary {
  color: var(--gold); border-color: var(--gold3);
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04));
  box-shadow: 0 0 20px rgba(212,175,55,0.1), inset 0 1px 0 rgba(212,175,55,0.2);
}
.btn.primary:hover { box-shadow: 0 0 30px rgba(212,175,55,0.25), inset 0 1px 0 rgba(212,175,55,0.3); }
.btn.danger { color: var(--red); border-color: rgba(192,57,43,0.4); }
.btn.sm { font-size: 10px; padding: 7px 16px; letter-spacing: 2px; }
.btn.full { width: 100%; text-align: center; display: block; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── PACK SHOP ─── */
.packs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-bottom: 40px;
}

.pack-box {
  position: relative; overflow: hidden; cursor: pointer;
  padding: 30px 22px 22px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
  clip-path: polygon(14px 0%,100% 0%,calc(100% - 14px) 100%,0% 100%);
  border: 1px solid;
}
.pack-box::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -10%, var(--pg,rgba(255,255,255,0.05)) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.pack-box::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--pt,rgba(255,255,255,0.2)), transparent);
}
.pack-box:hover { transform: translateY(-6px); }
.pack-box:hover::before { opacity: 1; }

.pack-box.novato {
  --pg: rgba(138,155,176,0.15); --pt: rgba(138,155,176,0.3);
  border-color: rgba(138,155,176,0.2);
  background: linear-gradient(160deg, #131318, #0d0d11);
}
.pack-box.novato:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px rgba(138,155,176,0.12); }

.pack-box.giran {
  --pg: rgba(58,123,255,0.2); --pt: rgba(58,123,255,0.4);
  border-color: rgba(58,123,255,0.25);
  background: linear-gradient(160deg, #0d1525, #090e1a);
}
.pack-box.giran:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px rgba(58,123,255,0.2); }

.pack-box.epico {
  --pg: rgba(168,85,247,0.2); --pt: rgba(168,85,247,0.4);
  border-color: rgba(168,85,247,0.3);
  background: linear-gradient(160deg, #120d1e, #0c0913);
}
.pack-box.epico:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 30px rgba(168,85,247,0.2); }

.pack-box.legendario {
  --pg: rgba(255,215,0,0.2); --pt: rgba(255,215,0,0.5);
  border-color: rgba(212,175,55,0.4);
  background: linear-gradient(160deg, #1a1500, #100d00);
  animation: packLegendBreath 4s ease-in-out infinite;
}
.pack-box.legendario:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 40px rgba(255,215,0,0.25); }
@keyframes packLegendBreath {
  0%,100% { box-shadow: 0 0 15px rgba(212,175,55,0.1); }
  50%      { box-shadow: 0 0 30px rgba(212,175,55,0.2); }
}

.pack-icon { font-size: 60px; display: block; margin-bottom: 14px; position: relative; z-index: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.pack-title { font-family: var(--font-display); font-size: 14px; letter-spacing: 2px; font-weight: 700; margin-bottom: 10px; }
.pack-box.novato    .pack-title { color: var(--common-c); }
.pack-box.giran     .pack-title { color: var(--rare-c); text-shadow: 0 0 20px var(--rare-glow); }
.pack-box.epico     .pack-title { color: var(--epic-c); text-shadow: 0 0 20px var(--epic-glow); }
.pack-box.legendario .pack-title { color: var(--legend-c); text-shadow: 0 0 20px var(--legend-glow); }
.pack-desc  { font-size: 11px; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px; }
.pack-odds  { font-family: var(--font-title); font-size: 10px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 14px; }
.pack-odds span { color: var(--gold2); }
.pack-price { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.pack-box.novato    .pack-price { color: var(--common-c); }
.pack-box.giran     .pack-price { color: var(--rare-c); }
.pack-box.epico     .pack-price { color: var(--epic-c); }
.pack-box.legendario .pack-price { color: var(--legend-c); }

/* ─── YU-GI-OH TRADING CARD DESIGN ─── */

/* === OUTER STRUCTURE === */
.ygo-card {
  width: 180px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34,1.2,0.64,1), filter 0.2s;
  user-select: none;
  border-radius: 8px;
  /* Physical card shadow */
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.7));
}
.ygo-card:hover { transform: translateY(-10px) scale(1.04) rotate(-0.5deg); }
.ygo-card.selected { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 10px; }

/* Common - worn dark bronze */
.ygo-card.common:hover { filter: drop-shadow(0 12px 28px rgba(90,70,40,0.5)); }
/* Rare - polished steel blue */
.ygo-card.rare:hover   { filter: drop-shadow(0 12px 32px rgba(58,123,255,0.5)); }
/* Legendary - gold aura */
.ygo-card.legendary:hover { filter: drop-shadow(0 12px 40px rgba(255,215,0,0.6)); }

/* The physical outer frame */
.ygo-outer-frame {
  border-radius: 8px;
  padding: 6px;
  display: flex; flex-direction: column;
  height: 100%; min-height: 280px;
  position: relative; overflow: hidden;
  border: 3px solid;
}

/* COMMON: dark iron / worn bronze */
.ygo-card.common .ygo-outer-frame {
  border-color: #4A3C28;
  background:
    linear-gradient(135deg, #2A2018 0%, #1A1408 50%, #221A0A 100%);
  box-shadow:
    inset 0 1px 0 rgba(160,120,60,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    inset 2px 0 0 rgba(100,80,40,0.2),
    inset -2px 0 0 rgba(0,0,0,0.3);
}
/* Worn texture overlay */
.ygo-card.common .ygo-outer-frame::before {
  content: '';
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.01) 3px, rgba(255,255,255,0.01) 4px),
    repeating-linear-gradient(0deg,  transparent, transparent 4px, rgba(0,0,0,0.05) 4px, rgba(0,0,0,0.05) 5px);
}

/* RARE: polished steel with blue edge */
.ygo-card.rare .ygo-outer-frame {
  border-color: #1A4A8A;
  background:
    linear-gradient(135deg, #0A1830 0%, #060E1E 50%, #0A1428 100%);
  box-shadow:
    inset 0 1px 0 rgba(58,123,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    0 0 20px rgba(58,123,255,0.12);
}
.ygo-card.rare .ygo-outer-frame::before {
  content: '';
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none; z-index: 0;
  background: linear-gradient(135deg, rgba(58,123,255,0.08) 0%, transparent 50%, rgba(58,123,255,0.04) 100%);
}

/* LEGENDARY: gold with animation */
.ygo-card.legendary .ygo-outer-frame {
  border-color: #8A6A00;
  background:
    linear-gradient(135deg, #201500 0%, #150E00 50%, #1C1200 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,215,0,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    inset 2px 0 0 rgba(212,175,55,0.25),
    inset -2px 0 0 rgba(212,175,55,0.15),
    0 0 30px rgba(255,215,0,0.15);
  animation: legendFrameBreath 3s ease-in-out infinite;
}
@keyframes legendFrameBreath {
  0%,100% { box-shadow: inset 0 1px 0 rgba(255,215,0,0.5), inset 0 -1px 0 rgba(0,0,0,0.6), 0 0 30px rgba(255,215,0,0.15); }
  50%     { box-shadow: inset 0 1px 0 rgba(255,215,0,0.7), inset 0 -1px 0 rgba(0,0,0,0.6), 0 0 50px rgba(255,215,0,0.30); }
}
/* Gold shimmer sweep */
.ygo-card.legendary .ygo-outer-frame::before {
  content: '';
  position: absolute; inset: 0; border-radius: 6px; pointer-events: none; z-index: 0;
  background: linear-gradient(105deg,
    transparent 0%, transparent 40%,
    rgba(255,215,0,0.08) 50%,
    transparent 60%, transparent 100%);
  animation: goldSweep 4s ease-in-out infinite;
}
@keyframes goldSweep {
  0%,100% { transform: translateX(-100%); }
  50%     { transform: translateX(100%); }
}

/* Count badge */
.ygo-count-badge {
  position: absolute; top: -8px; right: -8px; z-index: 20;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #000;
  font-family: var(--font-title); font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* === NAME BAR === */
.ygo-name-bar {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
  border-radius: 4px 4px 0 0;
  padding: 7px 10px 6px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
/* Engraved plate effect */
.ygo-card.common .ygo-name-bar   { background: linear-gradient(180deg, rgba(60,45,20,0.9), rgba(30,22,8,0.8)); border-bottom-color: rgba(160,120,60,0.2); }
.ygo-card.rare .ygo-name-bar     { background: linear-gradient(180deg, rgba(10,25,60,0.95), rgba(6,14,30,0.85)); border-bottom-color: rgba(58,123,255,0.2); }
.ygo-card.legendary .ygo-name-bar { background: linear-gradient(180deg, rgba(40,28,0,0.95), rgba(20,14,0,0.85)); border-bottom-color: rgba(212,175,55,0.3); }

.ygo-name {
  font-family: var(--font-title);
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  line-height: 1.1; flex: 1; padding-right: 4px;
  /* Metallic gold with bevel */
  -webkit-text-stroke: 0.3px rgba(0,0,0,0.5);
}
.ygo-card.common .ygo-name   { color: #C8A850; text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 8px rgba(200,168,80,0.3); }
.ygo-card.rare .ygo-name     { color: #88BBFF; text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 12px rgba(58,123,255,0.5); }
.ygo-card.legendary .ygo-name { color: var(--gold2); text-shadow: 0 1px 0 rgba(0,0,0,0.9), 0 0 16px rgba(255,215,0,0.6), 0 -1px 0 rgba(255,215,0,0.3); }

.ygo-stars {
  font-size: 8px; letter-spacing: 1px; flex-shrink: 0;
  text-shadow: 0 0 6px currentColor;
}
.ygo-card.common .ygo-stars   { color: #8A7A50; }
.ygo-card.rare .ygo-stars     { color: var(--rare-c); }
.ygo-card.legendary .ygo-stars { color: var(--legend-c); }

/* === ART FRAME === */
.ygo-art-frame {
  margin: 5px;
  border: 2px solid;
  position: relative; overflow: hidden;
  flex: 1; min-height: 110px;
  border-radius: 3px;
  z-index: 1;
}
.ygo-card.common .ygo-art-frame   { border-color: #5A4520; background: linear-gradient(160deg, #1A1408, #0C0A04); }
.ygo-card.rare .ygo-art-frame     { border-color: #1A3A7A; background: linear-gradient(160deg, #080E1C, #040810); box-shadow: inset 0 0 20px rgba(58,123,255,0.08); }
.ygo-card.legendary .ygo-art-frame { border-color: #6A5000; background: linear-gradient(160deg, #140E00, #0A0800); box-shadow: inset 0 0 30px rgba(255,215,0,0.06); }

/* Inner art inset like Yu-Gi-Oh illustration window */
.ygo-art-frame::before {
  content: '';
  position: absolute; inset: 3px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1px; pointer-events: none; z-index: 3;
}

.ygo-art-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

.ygo-art-glow {
  position: absolute; inset: 0;
}
.ygo-art-glow.common   { background: radial-gradient(ellipse at 50% 60%, rgba(160,120,60,0.2), transparent 65%); }
.ygo-art-glow.rare     { background: radial-gradient(ellipse at 50% 60%, rgba(58,123,255,0.25), transparent 65%); }
.ygo-art-glow.legendary { background: radial-gradient(ellipse at 50% 60%, rgba(255,215,0,0.3), transparent 65%); }

/* Vignette */
.ygo-art-inner::after {
  content: '';
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 25%, transparent 65%, rgba(0,0,0,0.5) 100%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.4) 100%);
}

.ygo-mob-icon {
  font-size: 62px; position: relative; z-index: 3; line-height: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.8));
  transition: transform 0.2s;
}
.ygo-card:hover .ygo-mob-icon { transform: scale(1.1); }

.ygo-element-badge {
  position: absolute; bottom: 5px; right: 6px; z-index: 4;
  display: flex; flex-direction: column; align-items: center;
  background: rgba(0,0,0,0.7); border-radius: 3px;
  padding: 2px 4px; border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
}
.ygo-el-icon  { font-size: 12px; line-height: 1; }
.ygo-el-label { font-family: var(--font-title); font-size: 6px; letter-spacing: 1px; color: var(--text-dim); margin-top: 1px; }

/* === TYPE LINE === */
.ygo-type-line {
  font-family: var(--font-title);
  font-size: 8px; letter-spacing: 1.5px;
  padding: 4px 10px; text-align: left;
  position: relative; z-index: 1; flex-shrink: 0;
}
.ygo-card.common .ygo-type-line   { color: rgba(160,130,70,0.8); }
.ygo-card.rare .ygo-type-line     { color: rgba(88,150,255,0.8); }
.ygo-card.legendary .ygo-type-line { color: rgba(212,175,55,0.9); }

/* === DESCRIPTION BOX === */
.ygo-desc-box {
  margin: 0 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 3px;
  min-height: 44px; flex-shrink: 0;
  position: relative; z-index: 1;
}
/* Parchment/engraved plate background */
.ygo-card.common .ygo-desc-box {
  background:
    linear-gradient(180deg, rgba(25,18,8,0.95), rgba(15,10,4,0.95));
  border-color: rgba(120,90,40,0.3);
}
.ygo-card.rare .ygo-desc-box {
  background: linear-gradient(180deg, rgba(8,14,28,0.95), rgba(4,8,18,0.95));
  border-color: rgba(40,80,180,0.25);
}
.ygo-card.legendary .ygo-desc-box {
  background: linear-gradient(180deg, rgba(20,14,0,0.95), rgba(10,8,0,0.95));
  border-color: rgba(160,120,20,0.3);
}

.ygo-ability-name {
  font-family: var(--font-title); font-size: 8px; font-weight: 700;
  letter-spacing: 0.5px; margin-bottom: 3px;
}
.ygo-card.common .ygo-ability-name   { color: #C8A850; }
.ygo-card.rare .ygo-ability-name     { color: #6EA3FF; }
.ygo-card.legendary .ygo-ability-name { color: var(--gold2); }

.ygo-ability-text {
  font-size: 7.5px; color: #BABABA; line-height: 1.45;
  font-family: serif;
}

/* === STATS BAR === */
.ygo-stats-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1; flex-shrink: 0;
}
.ygo-card.common .ygo-stats-bar   { background: rgba(30,20,8,0.8); }
.ygo-card.rare .ygo-stats-bar     { background: rgba(6,12,28,0.8); }
.ygo-card.legendary .ygo-stats-bar { background: rgba(18,12,0,0.8); }

.ygo-stat { display: flex; align-items: center; gap: 3px; }
.ygo-stat-icon { font-size: 11px; line-height: 1; }
.ygo-stat-num {
  font-family: var(--font-title); font-size: 12px; font-weight: 900; line-height: 1;
}
.ygo-card.common .ygo-stat-num   { color: #D4B870; text-shadow: 0 0 8px rgba(212,175,55,0.3); }
.ygo-card.rare .ygo-stat-num     { color: #88BBFF; text-shadow: 0 0 8px rgba(58,123,255,0.4); }
.ygo-card.legendary .ygo-stat-num { color: var(--gold2); text-shadow: 0 0 12px rgba(255,215,0,0.5); }
.ygo-stat-div { color: rgba(255,255,255,0.2); font-size: 10px; }

/* === FOOTER === */
.ygo-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 10px 5px;
  border-top: 1px solid rgba(255,255,255,0.04);
  position: relative; z-index: 1; flex-shrink: 0;
}
.ygo-card-id, .ygo-edition, .ygo-pa {
  font-family: var(--font-title); font-size: 7px; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.2);
}
.ygo-pa { color: rgba(212,175,55,0.5); }

/* === GRID & COLLECTION === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 22px;
}
.card-grid-wrapper { position: relative; }

/* === PICKER GRID (deck builder) === */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
}

.picker-card {
  position: relative; cursor: pointer; border-radius: 8px;
  transition: transform 0.15s, filter 0.15s;
  user-select: none; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.picker-card:hover { transform: translateY(-4px) scale(1.02); }
.picker-card.in-deck { outline: 3px solid rgba(212,175,55,0.6); outline-offset: 3px; border-radius: 10px; }
.picker-card[draggable="true"] { cursor: grab; }
.picker-card[draggable="true"]:active { cursor: grabbing; }

.in-deck-badge {
  position: absolute; top: -8px; right: -8px; z-index: 20;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #000;
  font-family: var(--font-title); font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px var(--gold-glow);
}
.picker-count {
  position: absolute; top: 6px; left: 6px; z-index: 20;
  background: rgba(0,0,0,0.75); color: var(--text-dim);
  font-family: var(--font-title); font-size: 8px;
  padding: 1px 5px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.1);
}

/* The picker card IS a ygo-card — just smaller/same size, works perfectly */
.picker-card .ygo-outer-frame { min-height: 260px; }

/* Empty state */
.empty-state { grid-column:1/-1; text-align:center; padding:80px 20px; color:var(--text-dim); }
.empty-state .big { font-size:56px; margin-bottom:14px; opacity:0.4; }
.empty-state p { font-family:var(--font-title); font-size:12px; letter-spacing:3px; margin-bottom:6px; }


/* ─── COLLECTION GRID ─── */
.filter-row { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-title); font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; padding: 7px 16px;
  border: 1px solid rgba(255,255,255,0.08); background: transparent;
  color: var(--text-dim); cursor: pointer; transition: all 0.2s; border-radius: 2px;
}
.filter-btn:hover, .filter-btn.active {
  color: var(--gold); border-color: rgba(212,175,55,0.4);
  background: rgba(212,175,55,0.07);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.card-grid-wrapper { position: relative; }
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 80px 20px;
  color: var(--text-dim);
}
.empty-state .big { font-size: 56px; margin-bottom: 14px; opacity: 0.4; }
.empty-state p { font-family: var(--font-title); font-size: 12px; letter-spacing: 3px; margin-bottom: 6px; }

/* ─── DECK BUILDER ─── */
.deck-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 900px) { .deck-layout { grid-template-columns: 1fr; } }

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

/* picker-card base styles now in Yu-Gi-Oh card section */

.picker-card-icon   { font-size: 48px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6)); }
.picker-card-name   {
  font-family: var(--font-title); font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.3; margin-bottom: 4px;
}
.picker-card-meta   { font-family: var(--font-title); font-size: 9px; color: var(--text-dim); margin-bottom: 4px; }
.picker-card-stats  { font-family: var(--font-title); font-size: 9px; color: var(--text-dim); }
.picker-count       {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,0.6); color: var(--text-dim);
  font-family: var(--font-title); font-size: 8px;
  padding: 1px 5px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.1);
}
.picker-locked { position: absolute; top: 4px; right: 4px; font-size: 10px; opacity: 0.4; }

.in-deck-badge {
  position: absolute; top: -7px; right: -7px;
  background: var(--gold); color: #000;
  font-family: var(--font-display); font-size: 10px; font-weight: 900;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* Deck panel */
.deck-panel {
  background: var(--bg2);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: var(--radius); padding: 20px;
  position: sticky; top: 0; max-height: 90vh; overflow-y: auto;
}
.deck-panel h3 {
  font-family: var(--font-title); font-size: 13px; letter-spacing: 2px;
  color: var(--gold); margin-bottom: 16px;
  text-shadow: 0 0 20px var(--gold-glow);
}

.deck-drop-zone {
  min-height: 220px;
  border: 2px dashed rgba(212,175,55,0.2);
  border-radius: var(--radius); padding: 6px;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 10px;
}
.deck-drop-zone.drag-over {
  border-color: var(--gold);
  background: rgba(212,175,55,0.05);
  box-shadow: inset 0 0 20px rgba(212,175,55,0.05);
}
.drop-hint {
  font-family: var(--font-title); font-size: 10px; letter-spacing: 2px;
  color: var(--text-dim); text-align: center; padding: 12px;
  opacity: 0.5; pointer-events: none;
}

.deck-slots { display: flex; flex-direction: column; gap: 3px; }
.deck-slot {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 2px;
  font-family: var(--font-title); font-size: 10px;
  transition: background 0.15s;
}
.deck-slot:hover { background: rgba(255,255,255,0.06); }
.slot-icon  { font-size: 14px; flex-shrink: 0; }
.slot-name  { flex: 1; color: var(--text); letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-lv    { color: var(--text-dim); font-size: 9px; flex-shrink: 0; }
.slot-count { color: var(--gold); font-size: 9px; flex-shrink: 0; }
.slot-rarity { font-size: 11px; flex-shrink: 0; }
.slot-rarity.common    { color: var(--common-c); }
.slot-rarity.rare      { color: var(--rare-c); }
.slot-rarity.epic      { color: var(--epic-c); }
.slot-rarity.legendary { color: var(--legend-c); }
.slot-remove {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 11px; padding: 3px 6px;
  border-radius: 2px; flex-shrink: 0; transition: all 0.15s; line-height: 1;
}
.slot-remove:hover { color: #fff; background: var(--red); }

/* Context menu */
#card-context-menu {
  animation: ctxIn 0.15s ease;
  font-family: var(--font-title);
}
@keyframes ctxIn { from{opacity:0;transform:translateY(-6px) scale(0.96);}to{opacity:1;transform:none;} }
.ctx-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid rgba(212,175,55,0.2); margin-bottom: 8px;
}
.ctx-icon  { font-size: 22px; }
.ctx-name  { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--gold); flex: 1; }
.ctx-lv    { font-size: 9px; color: var(--text-dim); }
.ctx-btn {
  display: block; width: 100%; padding: 9px 12px; margin-bottom: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 2px;
  color: var(--text); font-family: var(--font-title); font-size: 10px; letter-spacing: 1px;
  cursor: pointer; text-align: left; transition: all 0.15s;
}
.ctx-btn:hover      { background: rgba(212,175,55,0.1); color: var(--gold); border-color: rgba(212,175,55,0.3); }
.ctx-btn.ctx-sell   { color: #F0A030; border-color: rgba(240,160,48,0.3); }
.ctx-btn.ctx-sell:hover { background: rgba(240,160,48,0.12); }
.ctx-btn.ctx-cancel { color: var(--text-dim); font-size: 9px; margin-top: 6px; }
.ctx-no-sell { font-size: 9px; color: var(--text-dim); padding: 6px 12px; font-style: italic; }

/* ─── PvE ZONES ─── */
.zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.zone-card {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 22px 20px; cursor: pointer;
  transition: all 0.2s; position: relative; overflow: hidden;
  clip-path: polygon(12px 0%,100% 0%,calc(100% - 12px) 100%,0% 100%);
}
.zone-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.zone-card:hover::before { opacity: 1; }
.zone-card:hover { border-color: var(--gold3); transform: translateY(-3px); }
.zone-card.locked { opacity: 0.35; cursor: not-allowed; }
.zone-card.locked:hover { transform: none; }
.zone-icon { font-size: 38px; margin-bottom: 12px; }
.zone-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: 1px; }
.zone-subtitle { font-size: 11px; color: var(--text-dim); font-style: italic; margin-bottom: 10px; }
.zone-lore { font-size: 11px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; font-family: serif; }
.zone-progress-bar-wrap { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-bottom: 10px; }
.zone-progress-bar { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--gold3), var(--gold2)); transition: width 0.5s; }
.zone-meta { display: flex; justify-content: space-between; font-family: var(--font-title); font-size: 10px; letter-spacing: 1px; color: var(--text-dim); }
.zone-meta .reward { color: var(--gold3); }

/* ─── COMBAT ARENA ─── */

/* ══ SCREEN CONTAINER ══ */
#combat-screen {
  display: none; position: fixed; inset: 0; z-index: 50;
  flex-direction: column; overflow: hidden;
  font-family: var(--font-title);
}
#combat-screen.active { display: flex; }

/* ══ ARENA BACKGROUND ══ */
.arena-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
}

/* Sky layer - changes per zone via JS class */
.arena-sky {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      #1a2a1a 0%,       /* dark canopy top */
      #2a3820 25%,      /* deep forest mid */
      #3a4a28 50%,      /* talking island green */
      #283220 75%,      /* ground transition */
      #1a2010 100%);    /* dark earth */
  transition: background 0.8s;
}

/* Zone-specific backgrounds */
.arena-bg.zone-0 .arena-sky { background: linear-gradient(180deg, #1C2E3A 0%, #243A2A 40%, #2E4820 70%, #1A2A14 100%); } /* Talking Island - dawn forest */
.arena-bg.zone-1 .arena-sky { background: linear-gradient(180deg, #1A1410 0%, #2C1C10 40%, #3A2010 70%, #1C1008 100%); } /* Ruins - dark orange */
.arena-bg.zone-2 .arena-sky { background: linear-gradient(180deg, #101828 0%, #141E30 40%, #1A2838 70%, #0C1018 100%); } /* Plains - deep blue night */
.arena-bg.zone-3 .arena-sky { background: linear-gradient(180deg, #0A1A0C 0%, #0E2410 40%, #122814 70%, #081008 100%); } /* Sea of Spores - toxic green */
.arena-bg.zone-4 .arena-sky { background: linear-gradient(180deg, #18101E 0%, #22142A 40%, #2A1834 70%, #120C1A 100%); } /* Cruma Tower - arcane purple */
.arena-bg.zone-5 .arena-sky { background: linear-gradient(180deg, #2A1400 0%, #3A1C00 40%, #4A2400 70%, #1E0E00 100%); } /* Dragon Valley - volcanic */
.arena-bg.zone-6 .arena-sky { background: linear-gradient(180deg, #201800 0%, #2E2200 40%, #3A2A00 70%, #181000 100%); } /* Tower of Insolence - gold dark */
.arena-bg.zone-7 .arena-sky { background: linear-gradient(180deg, #2E0800 0%, #3E0C00 40%, #4E1000 70%, #200400 100%); } /* Fire Dragon - infernal */

/* Ground texture */
.arena-ground {
  position: absolute; bottom: 0; left: 0; right: 0; height: 45%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.5) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.01) 0px, transparent 1px, transparent 40px, rgba(255,255,255,0.01) 40px),
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.01) 0px, transparent 1px, transparent 30px, rgba(255,255,255,0.01) 30px);
}

/* Atmospheric fog */
.arena-fog {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 100% 30% at 50% 100%, rgba(0,0,0,0.6) 0%, transparent 70%),
    radial-gradient(ellipse 80% 20% at 50% 60%, rgba(0,0,0,0.2) 0%, transparent 60%);
}

/* Magic particles */
.arena-particles {
  position: absolute; inset: 0; pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(212,175,55,0.6);
  box-shadow: 0 0 6px rgba(212,175,55,0.8);
  animation: particleFloat var(--dur, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  left: var(--x, 50%); bottom: var(--y, 20%);
  opacity: 0;
}
.particle:nth-child(1)  { --x:10%; --y:15%; --dur:7s;  --delay:0s;   background:rgba(212,175,55,0.7); }
.particle:nth-child(2)  { --x:25%; --y:25%; --dur:9s;  --delay:1.5s; background:rgba(100,150,255,0.6); }
.particle:nth-child(3)  { --x:45%; --y:10%; --dur:6s;  --delay:3s;   background:rgba(212,175,55,0.5); }
.particle:nth-child(4)  { --x:65%; --y:30%; --dur:11s; --delay:0.5s; background:rgba(150,100,255,0.6); }
.particle:nth-child(5)  { --x:80%; --y:20%; --dur:8s;  --delay:2s;   background:rgba(212,175,55,0.7); }
.particle:nth-child(6)  { --x:35%; --y:40%; --dur:10s; --delay:4s;   background:rgba(100,200,100,0.5); }
.particle:nth-child(7)  { --x:55%; --y:15%; --dur:7s;  --delay:1s;   background:rgba(212,175,55,0.6); }
.particle:nth-child(8)  { --x:90%; --y:35%; --dur:9s;  --delay:3.5s; background:rgba(200,100,100,0.5); }
@keyframes particleFloat {
  0%   { opacity:0; transform: translateY(0) scale(0.5); }
  20%  { opacity:1; }
  80%  { opacity:0.6; }
  100% { opacity:0; transform: translateY(-120px) scale(1.2); }
}

/* ══ HUD SUPERIOR ══ */
.arena-hud-top {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 100%);
  border-bottom: 1px solid rgba(212,175,55,0.15);
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.arena-hud-left { display: flex; align-items: center; gap: 14px; }
.arena-hud-right { display: flex; align-items: center; }

.arena-btn-surrender {
  font-family: var(--font-title); font-size: 10px; letter-spacing: 2px;
  color: rgba(192,57,43,0.8); background: rgba(192,57,43,0.1);
  border: 1px solid rgba(192,57,43,0.3); padding: 6px 14px; cursor: pointer;
  border-radius: 2px; transition: all 0.2s;
}
.arena-btn-surrender:hover { color: #e74c3c; background: rgba(192,57,43,0.2); }

.arena-zone-name {
  font-family: var(--font-display); font-size: 13px; letter-spacing: 3px;
  color: var(--gold); text-shadow: 0 0 20px var(--gold-glow);
}

.arena-turn-badge {
  font-family: var(--font-title); font-size: 11px; letter-spacing: 3px;
  color: var(--text-dim);
  padding: 5px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
}

.arena-enemy-info {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-title); font-size: 10px; letter-spacing: 1px;
}
.arena-enemy-label { color: var(--text-dim); }
.arena-enemy-cards { color: var(--rare-c); }
.arena-enemy-dead  { color: var(--red); }

/* ══ ARENA MAIN ══ */
.arena-main {
  flex: 1; position: relative; z-index: 5;
  display: flex; flex-direction: column;
  padding: 0 20px;
  overflow: hidden;
}

/* ══ ENEMY SIDE ══ */
.arena-enemy-side {
  flex: 1; display: flex; align-items: flex-start;
  justify-content: center; gap: 30px;
  padding-top: 12px;
}

/* ══ NPC SPRITES ══ */
.arena-npc {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; flex-shrink: 0;
}
.npc-sprite {
  font-size: 44px; line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
  animation: npcBreathe 4s ease-in-out infinite;
}
@keyframes npcBreathe {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}
.npc-aura {
  position: absolute; width: 60px; height: 20px; border-radius: 50%;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  animation: auraBreath 4s ease-in-out infinite;
}
.enemy-aura { background: radial-gradient(ellipse, rgba(192,57,43,0.5), transparent 70%); }
.player-aura { background: radial-gradient(ellipse, rgba(212,175,55,0.5), transparent 70%); }
@keyframes auraBreath {
  0%,100% { opacity:0.5; transform:translateX(-50%) scale(1); }
  50%     { opacity:1;   transform:translateX(-50%) scale(1.2); }
}
.npc-name {
  font-family: var(--font-title); font-size: 9px; letter-spacing: 2px;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
}

/* ══ CARD ZONES ══ */
.arena-card-zone {
  flex: 1; max-width: 280px;
  display: flex; align-items: center; justify-content: center;
}

.zone-platform {
  width: 100%; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 20px;
  border-radius: 8px;
}

/* Enemy platform - dark red stone */
.enemy-platform {
  background:
    linear-gradient(180deg, rgba(80,20,20,0.3) 0%, rgba(40,10,10,0.5) 100%);
  border: 1px solid rgba(192,57,43,0.2);
  box-shadow:
    inset 0 1px 0 rgba(192,57,43,0.1),
    0 4px 20px rgba(0,0,0,0.4);
}
.enemy-platform::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 8px; pointer-events: none;
  border: 1px solid rgba(192,57,43,0.1);
}

/* Player platform - gold magic circle */
.player-platform {
  background:
    linear-gradient(180deg, rgba(80,60,10,0.3) 0%, rgba(40,30,0,0.5) 100%);
  border: 1px solid rgba(212,175,55,0.25);
  box-shadow:
    inset 0 1px 0 rgba(212,175,55,0.15),
    0 4px 20px rgba(0,0,0,0.4),
    0 0 30px rgba(212,175,55,0.05);
}
.player-platform::before {
  content: '';
  position: absolute; inset: -1px; border-radius: 8px; pointer-events: none;
  border: 1px solid rgba(212,175,55,0.1);
}

/* Rune in zone */
.zone-rune {
  position: absolute; inset: 8px; border-radius: 6px;
  border: 1px solid rgba(212,175,55,0.08);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(212,175,55,0.04) 0%, transparent 65%);
  pointer-events: none;
  animation: runeGlow 4s ease-in-out infinite;
}
.player-rune { animation-delay: 1s; }
@keyframes runeGlow {
  0%,100% { opacity:0.4; }
  50%     { opacity:1; }
}

.zone-slot-label {
  font-family: var(--font-title); font-size: 8px; letter-spacing: 3px;
  color: rgba(255,255,255,0.2); text-transform: uppercase;
}
.zone-card-slot {
  min-height: 160px; width: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* ══ CENTER LINE ══ */
.arena-center-line {
  flex-shrink: 0; height: 32px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.arena-divider-line {
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(212,175,55,0.15) 20%,
    rgba(212,175,55,0.4) 50%, rgba(212,175,55,0.15) 80%, transparent 100%);
}
.arena-vs-orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle, #1A1200, #0A0800);
  border: 2px solid rgba(212,175,55,0.4);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  box-shadow: 0 0 20px rgba(212,175,55,0.2), inset 0 0 10px rgba(0,0,0,0.5);
  animation: vsOrbPulse 3s ease-in-out infinite;
}
@keyframes vsOrbPulse {
  0%,100% { box-shadow: 0 0 20px rgba(212,175,55,0.2), inset 0 0 10px rgba(0,0,0,0.5); }
  50%     { box-shadow: 0 0 35px rgba(212,175,55,0.4), inset 0 0 10px rgba(0,0,0,0.5); }
}
.vs-glow {
  position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.15), transparent 70%);
  animation: vsOrbPulse 3s ease-in-out infinite reverse;
}
.vs-text {
  font-family: var(--font-display); font-size: 11px; color: var(--gold);
  letter-spacing: 1px; position: relative; z-index: 1;
}

/* ══ PLAYER SIDE ══ */
.arena-player-side {
  flex: 1; display: flex; align-items: flex-end;
  justify-content: center; gap: 30px;
  padding-bottom: 8px;
}

/* ══ ACTION PANEL ══ */
.arena-action-panel {
  position: relative; z-index: 10;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
  border-top: 1px solid rgba(212,175,55,0.2);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

/* Controls row */
.arena-controls {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* PA orbs */
.arena-pa-section {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.arena-pa-label {
  font-size: 9px; letter-spacing: 3px; color: var(--text-dim); text-transform: uppercase;
}
.arena-pa-orbs { display: flex; gap: 6px; }
.pa-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F0CC55, #A07800);
  border: 1px solid rgba(212,175,55,0.5);
  box-shadow: 0 0 10px rgba(212,175,55,0.6), 0 0 3px rgba(255,215,0,0.8);
  transition: all 0.2s;
}
.pa-orb.used {
  background: radial-gradient(circle at 35% 35%, #2A2A2A, #111);
  border-color: rgba(255,255,255,0.1);
  box-shadow: none;
}
.arena-pa-count { font-size: 10px; color: var(--gold); letter-spacing: 1px; min-width: 40px; }

/* Action buttons */
.arena-action-btns { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }

.arena-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-title);
}
.arena-action-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(212,175,55,0.3); }
.arena-action-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.arena-btn-icon  { font-size: 18px; line-height: 1; }
.arena-btn-label { font-size: 9px; letter-spacing: 2px; color: var(--text); text-transform: uppercase; }
.arena-btn-cost  { font-size: 8px; color: var(--text-dim); letter-spacing: 1px; }

/* ══ THE ATTACK BUTTON ══ */
.arena-attack-btn {
  position: relative; overflow: hidden;
  padding: 12px 32px;
  background: linear-gradient(135deg, #1A1000, #0E0A00);
  border: 2px solid rgba(212,175,55,0.5);
  border-radius: 4px; cursor: pointer;
  font-family: var(--font-display);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  transition: all 0.2s;
  animation: attackBtnPulse 3s ease-in-out infinite;
}
@keyframes attackBtnPulse {
  0%,100% { box-shadow: 0 0 20px rgba(212,175,55,0.2), 0 4px 20px rgba(0,0,0,0.5); }
  50%     { box-shadow: 0 0 40px rgba(212,175,55,0.4), 0 4px 20px rgba(0,0,0,0.5); }
}
.arena-attack-btn:hover {
  background: linear-gradient(135deg, #2A1C00, #1A1000);
  border-color: var(--gold);
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(212,175,55,0.5), 0 6px 24px rgba(0,0,0,0.6) !important;
  animation: none;
}
.arena-attack-btn:disabled { opacity: 0.3; cursor: not-allowed; animation: none; transform: none; }
.attack-btn-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(212,175,55,0.12), transparent 65%);
  animation: attackGlowPulse 3s ease-in-out infinite;
}
@keyframes attackGlowPulse {
  0%,100% { opacity:0.5; } 50% { opacity:1; }
}
.attack-btn-icon { font-size: 22px; display: block; position: relative; z-index: 1; line-height: 1; margin-bottom: 2px; }
.attack-btn-text {
  display: block; font-size: 13px; letter-spacing: 4px; color: var(--gold);
  text-shadow: 0 0 16px rgba(212,175,55,0.7); position: relative; z-index: 1;
}
.attack-btn-cost { display: block; font-size: 8px; color: var(--gold-dim); letter-spacing: 2px; position: relative; z-index: 1; font-family: var(--font-title); }

/* ══ HAND ══ */
.arena-hand-section {
  padding: 8px 14px 10px;
}
.arena-hand-label {
  font-size: 9px; letter-spacing: 3px; color: var(--text-dim); text-transform: uppercase;
  margin-bottom: 6px;
}
.arena-hand-cards {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
}

/* ══ LOG PANEL ══ */
.arena-log-panel {
  position: absolute; right: 0; top: 46px; bottom: 0;
  width: 200px; z-index: 8;
  background: rgba(6,6,8,0.85);
  border-left: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column;
  backdrop-filter: blur(6px);
}
.arena-log-title {
  font-family: var(--font-title); font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--text-dim);
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.arena-log-entries {
  flex: 1; overflow-y: auto; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
/* Reuse existing log-entry styles */
.arena-log-entries .log-entry { font-size: 10px; line-height: 1.45; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.03); font-family: serif; }

/* Field card in arena context */
.zone-card-slot .field-empty {
  width: 155px; height: 170px;
  border: 2px dashed rgba(212,175,55,0.15);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.2); font-size: 10px; letter-spacing: 1px;
  text-align: center; line-height: 1.5;
  animation: emptySlotBreath 3s ease-in-out infinite;
}
@keyframes emptySlotBreath {
  0%,100% { border-color: rgba(212,175,55,0.1); }
  50%     { border-color: rgba(212,175,55,0.25); }
}

/* ══ RESPONSIVE ══ */
@media (max-width: 768px) {
  .arena-log-panel { display: none; }
  .arena-npc { display: none; }
  .arena-main { padding: 0 10px; }
  .arena-attack-btn { padding: 10px 22px; }
}


/* ─── PACK OPENING OVERLAY ─── */

#pack-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6,6,8,0.96);
  backdrop-filter: blur(12px);
  display: none; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
#pack-overlay.active { display: flex; }
#pack-overlay::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(212,175,55,0.06), transparent 65%);
}
.pack-overlay-title {
  font-family: var(--font-display);
  font-size: clamp(18px,4vw,34px); color: var(--gold);
  text-align: center; margin-bottom: 6px;
  text-shadow: 0 0 40px var(--gold-glow);
  letter-spacing: 4px; position: relative; z-index: 1;
}
.pack-overlay-hint { font-size: 12px; color: var(--text-dim); text-align: center; margin-bottom: 28px; font-style: italic; position: relative; z-index: 1; }
.pack-cards-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 1100px; position: relative; z-index: 1; }

/* ── PACK CARD FLIP (completely separate from ygo-card) ── */
.pack-card-wrap {
  width: 148px; height: 240px;
  cursor: pointer; perspective: 900px;
  animation: packReveal 0.4s ease both;
  flex-shrink: 0;
}
@keyframes packReveal { from{opacity:0;transform:translateY(40px) scale(0.8);}to{opacity:1;transform:none;} }

.pack-card-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
.pack-card-wrap.flipped .pack-card-inner { transform: rotateY(180deg); }

.pack-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; border-radius: 8px;
  background: linear-gradient(145deg, #0E1825, #060C14);
  border: 2px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}
.pack-card-back::before {
  content: ''; position: absolute; inset: 5px;
  border: 1px solid rgba(212,175,55,0.1); border-radius: 5px;
}
.pack-back-symbol { font-size: 42px; opacity: 0.2; }
.pack-back-logo { font-family: var(--font-title); font-size: 10px; color: var(--gold-dim); letter-spacing: 3px; text-align: center; }

/* Front - physical card */
.pack-card-front {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  border-radius: 8px; border: 3px solid;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pack-card-front.common   {
  border-color: #5A4520;
  background: linear-gradient(160deg, #1A1408, #0C0A04);
  box-shadow: inset 0 1px 0 rgba(160,120,60,0.2);
}
.pack-card-front.rare     {
  border-color: #1A4A8A;
  background: linear-gradient(160deg, #0A1830, #060E1E);
  box-shadow: 0 0 20px rgba(58,123,255,0.15), inset 0 1px 0 rgba(58,123,255,0.3);
}
.pack-card-front.legendary {
  border-color: #8A6A00;
  background: linear-gradient(160deg, #201500, #150E00);
  box-shadow: 0 0 35px rgba(255,215,0,0.2), inset 0 1px 0 rgba(255,215,0,0.4);
  animation: legendFrameBreath 3s ease-in-out infinite;
}

/* Name bar */
.pc-name-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pc-name {
  font-family: var(--font-title); font-size: 8px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; flex: 1;
}
.pc-name.common   { color: #C8A850; text-shadow: 0 1px 2px rgba(0,0,0,0.9); }
.pc-name.rare     { color: #88BBFF; text-shadow: 0 0 10px rgba(58,123,255,0.5); }
.pc-name.legendary { color: var(--gold2); text-shadow: 0 0 14px rgba(255,215,0,0.6); }
.pc-stars { font-size: 7px; letter-spacing: 0.5px; flex-shrink: 0; }
.pc-stars.common   { color: #8A7A50; }
.pc-stars.rare     { color: var(--rare-c); }
.pc-stars.legendary { color: var(--legend-c); }

/* Art */
.pc-art {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin: 4px; border: 1px solid rgba(255,255,255,0.08); border-radius: 3px;
}
.pc-art-glow {
  position: absolute; inset: 0;
}
.pc-art-glow.common   { background: radial-gradient(ellipse at 50% 60%, rgba(160,120,60,0.2), transparent 65%); }
.pc-art-glow.rare     { background: radial-gradient(ellipse at 50% 60%, rgba(58,123,255,0.25), transparent 65%); }
.pc-art-glow.legendary { background: radial-gradient(ellipse at 50% 60%, rgba(255,215,0,0.3), transparent 65%); }
.pc-icon { font-size: 46px; position: relative; z-index: 2; line-height: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8)); }
.pc-el-badge {
  position: absolute; bottom: 4px; right: 5px; z-index: 3;
  background: rgba(0,0,0,0.75); border-radius: 3px; padding: 2px 4px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; line-height: 1;
}
.pc-el-label { font-family: var(--font-title); font-size: 6px; color: var(--text-dim); letter-spacing: 1px; }

/* Type line */
.pc-type-line {
  font-family: var(--font-title); font-size: 7px; letter-spacing: 1px;
  padding: 3px 8px; flex-shrink: 0;
}
.pc-type-line.common   { color: rgba(160,130,70,0.8); }
.pc-type-line.rare     { color: rgba(88,150,255,0.8); }
.pc-type-line.legendary { color: rgba(212,175,55,0.9); }

/* Desc */
.pc-desc {
  margin: 0 4px; padding: 4px 6px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06); border-radius: 2px; min-height: 28px;
}
.pc-desc.common   { background: rgba(20,14,6,0.9); }
.pc-desc.rare     { background: rgba(6,10,22,0.9); }
.pc-desc.legendary { background: rgba(16,10,0,0.9); }
.pc-ability-name { font-family: var(--font-title); font-size: 7px; font-weight: 700; }
.pc-ability-name.common   { color: #C8A850; }
.pc-ability-name.rare     { color: #6EA3FF; }
.pc-ability-name.legendary { color: var(--gold2); }

/* Stats */
.pc-stats-bar {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 4px 8px; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.pc-desc.common + .pc-type-line,
.pc-stats-bar.common { background: rgba(20,14,6,0.7); }
.pc-stats-bar.rare   { background: rgba(4,8,18,0.7); }
.pc-stats-bar.legendary { background: rgba(12,8,0,0.7); }
.pc-stat-icon { font-size: 9px; }
.pc-stat-num  { font-family: var(--font-title); font-size: 9px; font-weight: 900; }
.pc-stat-num.common   { color: #D4B870; }
.pc-stat-num.rare     { color: #88BBFF; }
.pc-stat-num.legendary { color: var(--gold2); }
.pc-stat-div  { color: rgba(255,255,255,0.2); font-size: 8px; }

/* Footer */
.pc-footer {
  display: flex; justify-content: space-between;
  padding: 3px 8px 4px; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.pc-id, .pc-lv { font-family: var(--font-title); font-size: 6px; color: rgba(255,255,255,0.2); letter-spacing: 0.5px; }

.overlay-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 26px; position: relative; z-index: 1; }


/* ─── GAME END OVERLAY ─── */
#game-end-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,6,8,0.97);
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 20px; text-align: center;
}
#game-end-overlay.active { display: flex; }
.game-end-icon  { font-size: 90px; animation: bounceIn 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes bounceIn { from{opacity:0;transform:scale(0.3);}to{opacity:1;transform:scale(1);} }
.game-end-title { font-family: var(--font-display); font-size: clamp(24px,5vw,44px); color: var(--gold); text-shadow: 0 0 40px var(--gold-glow); letter-spacing: 4px; }
.game-end-sub   { font-family: var(--font-title); font-size: 13px; letter-spacing: 3px; color: var(--text-dim); }
.game-end-reward {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.3);
  padding: 12px 28px; border-radius: var(--radius);
  font-family: var(--font-display); font-size: 13px; color: var(--gold); letter-spacing: 2px;
}

/* ─── LOGIN SCREEN ─── */
#login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px; padding: 24px;
}
#login-screen.hidden { display: none; }
#login-screen::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(212,175,55,0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(58,123,255,0.04), transparent 50%);
}
.login-logo { font-family: var(--font-display); font-size: clamp(26px,6vw,52px); color: var(--gold); text-shadow: 0 0 50px var(--gold-glow); letter-spacing: 5px; text-align: center; position: relative; z-index: 1; }
.login-sub { font-family: var(--font-title); font-size: 12px; letter-spacing: 5px; color: var(--text-dim); text-align: center; position: relative; z-index: 1; }
.login-welcome { font-size: 13px; color: rgba(200,212,224,0.6); text-align: center; line-height: 1.8; max-width: 380px; position: relative; z-index: 1; font-family: serif; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; position: relative; z-index: 1; }
.login-input {
  font-family: var(--font-title); font-size: 13px; letter-spacing: 3px;
  padding: 15px 20px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.2); color: var(--text);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
}
.login-input:focus { border-color: var(--gold3); box-shadow: 0 0 20px rgba(212,175,55,0.1); }
.login-input::placeholder { color: rgba(255,255,255,0.2); }
.login-starter-info {
  background: rgba(212,175,55,0.05);
  border: 1px solid rgba(212,175,55,0.15);
  padding: 16px 20px; border-radius: var(--radius);
  font-size: 11px; color: var(--text-dim); line-height: 1.7;
  max-width: 340px; text-align: center; position: relative; z-index: 1; font-family: serif;
}
.login-starter-info strong { color: var(--gold); }

/* ─── TOAST ─── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--bg2);
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--gold); font-family: var(--font-title);
  font-size: 12px; letter-spacing: 2px;
  padding: 13px 30px; z-index: 200;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  clip-path: polygon(8px 0%,100% 0%,calc(100% - 8px) 100%,0% 100%);
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(212,175,55,0.1);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ─── DC SYSTEM ─── */
.dc-shake { animation: dcShake 0.4s ease; }
@keyframes dcShake { 0%,100%{transform:none;} 25%{transform:translateX(-4px);} 75%{transform:translateX(4px);} }

/* ─── RULES SECTION ─── */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 16px; }
.rule-card {
  background: var(--bg2); border: 1px solid rgba(255,255,255,0.07);
  padding: 20px; border-radius: var(--radius);
  border-top: 2px solid rgba(212,175,55,0.2);
}
.rule-card-title { font-family: var(--font-display); font-size: 12px; letter-spacing: 2px; color: var(--gold3); margin-bottom: 12px; }
.rule-card p { font-size: 12px; color: var(--text-dim); line-height: 1.85; font-family: serif; }
.rule-card strong { color: var(--text); }

/* ─── RESPONSIVE ─── */
@media (max-width:768px) {
  .combat-log-panel { display: none; }
  .combat-battlefield { gap: 16px; }
  .field-card { width: 135px; }
  .card-grid { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); }
  .picker-grid { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 10px; }
  .deck-layout { grid-template-columns: 1fr; }
  .deck-panel { position: static; max-height: none; }
  .packs-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width:500px) {
  .packs-row { grid-template-columns: 1fr; }
  .zones-grid { grid-template-columns: 1fr; }
  .hand-card { min-width: 70px; max-width: 70px; }
}

/* ─── MINI HAND CARD (combat) — YGO style ─── */
.arena-hand-cards { display:flex; gap:8px; overflow-x:auto; padding:4px 2px 8px; align-items:flex-end; }

.hand-card-mini {
  flex-shrink: 0;
  width: 88px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, filter 0.15s;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.7));
}
.hand-card-mini:hover { transform: translateY(-12px) scale(1.06); }
.hand-card-mini[draggable="true"] { cursor: grab; }
.hand-card-mini[draggable="true"]:active { cursor: grabbing; transform: translateY(-8px) scale(1.04) rotate(3deg); }

/* The frame */
.hcm-frame {
  border-radius: 5px;
  border: 2px solid;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: #0a0a0c;
}
.hcm-frame.common   { border-color: #5A4520; background: linear-gradient(160deg,#18130a,#0d0a05); box-shadow: inset 0 1px 0 rgba(160,120,60,0.2); }
.hcm-frame.rare     { border-color: #1A4A8A; background: linear-gradient(160deg,#080e1c,#040810); box-shadow: 0 0 12px rgba(58,123,255,0.15), inset 0 1px 0 rgba(58,123,255,0.25); }
.hcm-frame.legendary { border-color: #7A5A00; background: linear-gradient(160deg,#181000,#0c0800); box-shadow: 0 0 18px rgba(255,215,0,0.2), inset 0 1px 0 rgba(255,215,0,0.35); animation: legendFrameBreath 3s ease-in-out infinite; }

/* Name bar */
.hcm-name-bar {
  padding: 4px 5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.5);
}
.hcm-name {
  font-family: var(--font-title);
  font-size: 8px; font-weight: 700; letter-spacing: 0.3px;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hcm-name.common   { color: #C8A850; text-shadow: 0 1px 2px rgba(0,0,0,0.9); }
.hcm-name.rare     { color: #88BBFF; text-shadow: 0 0 8px rgba(58,123,255,0.5); }
.hcm-name.legendary { color: var(--gold2); text-shadow: 0 0 10px rgba(255,215,0,0.6); }

/* Art area */
.hcm-art {
  height: 60px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hcm-art-glow {
  position: absolute; inset: 0;
}
.hcm-art-glow.common   { background: radial-gradient(ellipse at 50% 60%, rgba(160,120,60,0.2), transparent 65%); }
.hcm-art-glow.rare     { background: radial-gradient(ellipse at 50% 60%, rgba(58,123,255,0.25), transparent 65%); }
.hcm-art-glow.legendary { background: radial-gradient(ellipse at 50% 60%, rgba(255,215,0,0.3), transparent 65%); }

.hcm-icon { font-size: 32px; line-height: 1; position: relative; z-index: 2; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.8)); }
.hcm-el   { position: absolute; bottom: 3px; right: 4px; font-size: 12px; z-index: 3; }

/* Stats */
.hcm-stats {
  display: flex; justify-content: space-around;
  padding: 3px 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.4);
  font-family: var(--font-title); font-size: 7.5px; font-weight: 700;
}
.hcm-stats.common   { color: #D4B870; }
.hcm-stats.rare     { color: #88BBFF; }
.hcm-stats.legendary { color: var(--gold2); }

/* Level */
.hcm-lv {
  font-family: var(--font-title); font-size: 7px; letter-spacing: 1px;
  text-align: center; padding: 2px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.5);
}
.hcm-lv.common   { color: rgba(200,168,80,0.6); }
.hcm-lv.rare     { color: rgba(136,187,255,0.6); }
.hcm-lv.legendary { color: rgba(255,215,0,0.6); }

/* Field drop target */
.zone-card-slot.drop-active {
  background: rgba(212,175,55,0.1);
  border-radius: 6px;
  box-shadow: inset 0 0 30px rgba(212,175,55,0.15);
}
.zone-card-slot.drop-active .field-empty {
  border-color: rgba(212,175,55,0.5);
  color: rgba(212,175,55,0.6);
}

/* Old hand-card classes kept for compat */
.hand-card, .hand-card-el { display: none; }

/* ─── COMBAT HAND CARDS (mini physical cards) ─── */

.arena-hand-cards {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 6px 2px 8px; align-items: flex-end;
}
.arena-hand-cards::-webkit-scrollbar { height: 3px; }

.combat-hand-card {
  min-width: 100px; max-width: 100px;
  position: relative; flex-shrink: 0;
  border-radius: 6px; border: 2px solid;
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 6px 8px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34,1.2,0.64,1), box-shadow 0.18s, filter 0.18s;
  user-select: none;
  overflow: hidden;
}

/* Rarity frames */
.combat-hand-card.common {
  border-color: #5A4520;
  background: linear-gradient(170deg, #1A1408, #0C0A04);
  box-shadow: 0 3px 12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(160,120,60,0.15);
}
.combat-hand-card.rare {
  border-color: #1A4A8A;
  background: linear-gradient(170deg, #0A1830, #060E1E);
  box-shadow: 0 3px 14px rgba(0,0,0,0.6), 0 0 10px rgba(58,123,255,0.1), inset 0 1px 0 rgba(58,123,255,0.2);
}
.combat-hand-card.legendary {
  border-color: #8A6A00;
  background: linear-gradient(170deg, #201500, #150E00);
  box-shadow: 0 3px 16px rgba(0,0,0,0.6), 0 0 14px rgba(255,215,0,0.15), inset 0 1px 0 rgba(255,215,0,0.25);
  animation: legendFrameBreath 3s ease-in-out infinite;
}

/* Hover — lift */
.combat-hand-card.playable:hover {
  transform: translateY(-14px) scale(1.05);
  z-index: 10;
}
.combat-hand-card.common.playable:hover   { box-shadow: 0 12px 28px rgba(0,0,0,0.7), 0 0 16px rgba(160,120,60,0.3); }
.combat-hand-card.rare.playable:hover     { box-shadow: 0 12px 28px rgba(0,0,0,0.7), 0 0 20px rgba(58,123,255,0.4); }
.combat-hand-card.legendary.playable:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.7), 0 0 28px rgba(255,215,0,0.5); }

.combat-hand-card.locked { opacity: 0.4; cursor: not-allowed; }
.combat-hand-card[draggable="true"] { cursor: grab; }
.combat-hand-card[draggable="true"]:active { cursor: grabbing; transform: scale(0.95); }

/* Rarity top bar */
.chc-rarity-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.chc-rarity-bar.common   { background: linear-gradient(90deg, #5A4520, #A07030, #5A4520); }
.chc-rarity-bar.rare     { background: linear-gradient(90deg, #1A4A8A, #3A7BFF, #1A4A8A); }
.chc-rarity-bar.legendary { background: linear-gradient(90deg, #8A6A00, #FFD700, #8A6A00); animation: goldSweep 3s ease-in-out infinite; }

/* Card content */
.chc-icon {
  font-size: 30px; line-height: 1; margin: 4px 0 5px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8));
  transition: transform 0.15s;
}
.combat-hand-card.playable:hover .chc-icon { transform: scale(1.15); }

.chc-name {
  font-family: var(--font-title); font-size: 8px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; text-align: center;
  line-height: 1.2; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%;
}
.chc-name.common   { color: #C8A850; text-shadow: 0 1px 2px rgba(0,0,0,0.9); }
.chc-name.rare     { color: #6EA3FF; text-shadow: 0 0 8px rgba(58,123,255,0.4); }
.chc-name.legendary { color: var(--gold2); text-shadow: 0 0 12px rgba(255,215,0,0.5); }

.chc-level {
  font-family: var(--font-title); font-size: 7px; color: var(--text-dim);
  letter-spacing: 1px; margin-bottom: 4px;
}

.chc-stats {
  display: flex; gap: 4px; justify-content: center;
  font-family: var(--font-title); font-size: 7.5px; font-weight: 700;
  margin-bottom: 3px; flex-wrap: wrap;
}
.combat-hand-card.common .chc-stats   { color: #D4B870; }
.combat-hand-card.rare .chc-stats     { color: #88BBFF; }
.combat-hand-card.legendary .chc-stats { color: var(--gold2); }

.chc-ability {
  font-family: var(--font-title); font-size: 6.5px; color: var(--text-dim);
  text-align: center; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

.chc-action-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(212,175,55,0.15);
  font-family: var(--font-title); font-size: 7px; letter-spacing: 2px;
  color: var(--gold); text-align: center; padding: 2px 0;
  opacity: 0; transition: opacity 0.15s;
}
.combat-hand-card.playable:hover .chc-action-hint { opacity: 1; }

/* Field drop zone highlight */
.zone-card-slot.drop-active {
  outline: 3px solid rgba(212,175,55,0.6);
  outline-offset: 4px;
  background: rgba(212,175,55,0.05);
  border-radius: 6px;
}
