/* ============================================================
   StarStyle Showdown — Styles
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0618;
  --bg2:      #140d2a;
  --bg3:      #1e1040;
  --purple:   #c084fc;
  --pink:     #f472b6;
  --cyan:     #22d3ee;
  --gold:     #fbbf24;
  --green:    #4ade80;
  --red:      #f43f5e;
  --text:     #f0e6ff;
  --text-dim: #9980cc;
  --card-bg:  rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.1);
  --radius:   14px;
  --radius-sm:8px;
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
}

html, body {
  height: 100%;
  font-family: 'Nunito', 'Fredoka One', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#starfield {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) var(--delay, 0s) infinite alternate ease-in-out;
}
@keyframes twinkle {
  0%   { opacity: 0.15; transform: scale(0.8); }
  100% { opacity: 0.9;  transform: scale(1.2); }
}

#game {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Screen transitions ───────────────────────────────────── */
.screen-fade-out { animation: fadeOut 0.18s ease forwards; }
.screen-fade-in  { animation: fadeIn  0.22s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.98); } }
@keyframes fadeIn  { from { opacity: 0; transform: scale(0.98); } }

/* ── Typography ───────────────────────────────────────────── */
.screen-title {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 800;
  text-shadow: 0 0 20px var(--purple);
  white-space: nowrap;
}

/* ── Shared layout pieces ─────────────────────────────────── */
.event-header, .wardrobe-header, .shop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10,6,24,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.currency-bar {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.currency {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  font-weight: 700;
}
.currency.coins { border-color: #fbbf2466; }
.currency.stars  { border-color: #c084fc66; }
.cur-icon { font-size: 1rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-back {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-back:hover { background: rgba(255,255,255,0.18); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(192,132,252,0.4);
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn-primary:active { transform: scale(0.97); }

.btn-enter {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 20px;
  border: none;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
  margin-top: 8px;
}
.btn-enter:hover { filter: brightness(1.15); transform: scale(1.03); }
.btn-enter:active { transform: scale(0.96); }

.btn-buy {
  display: block;
  width: 100%;
  padding: 8px 0;
  margin-top: 8px;
  border-radius: 20px;
  border: 2px solid #4ade80;
  background: linear-gradient(160deg,#22c55e,#16a34a);
  color: white;
  font-weight: 900;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 0 4px 0 #14532d, 0 0 14px rgba(74,222,128,0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  letter-spacing: 0.02em;
}
.btn-buy:hover:not(.disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #14532d, 0 0 20px rgba(74,222,128,0.5);
  filter: brightness(1.08);
}
.btn-buy:active:not(.disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #14532d;
}
.btn-buy.disabled { background: #1e1e2e; border-color: #334; color: #556; cursor: not-allowed; box-shadow: none; }

.btn-submit-event {
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  border: none;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 10px;
  transition: filter 0.15s, transform 0.1s;
}
.btn-submit-event:hover { filter: brightness(1.1); transform: scale(1.02); }

.btn-continue {
  display: block;
  padding: 14px 40px;
  border-radius: 28px;
  border: none;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  margin: 16px auto 0;
  transition: filter 0.15s, transform 0.1s;
}
.btn-continue:hover { filter: brightness(1.1); transform: scale(1.03); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 14px;
  flex-shrink: 0;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab:hover { background: rgba(255,255,255,0.13); color: var(--text); }
.tab.active {
  background: linear-gradient(135deg,#7c3aed,#c084fc);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 12px rgba(192,132,252,0.4);
}

/* ── Items grid ───────────────────────────────────────────── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
}

.item-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.item-card::before {
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:linear-gradient(135deg,var(--rarity-color,transparent) 0%,transparent 60%);
  opacity:0.06;
  pointer-events:none;
}
.item-card:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.item-card.equipped {
  border-color: var(--rarity-color, var(--purple));
  box-shadow: 0 0 14px var(--rarity-glow, rgba(192,132,252,0.3));
  background: rgba(192,132,252,0.1);
}
.item-card.theme-match {
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(251,191,36,0.3);
}
.item-card.locked { opacity: 0.5; cursor: default; }
.item-card.locked:hover { transform: none; box-shadow: none; }

.item-preview-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
}
.item-preview-svg {
  width: 56px;
  height: 56px;
  display: block;
}
.equipped-badge, .match-badge, .owned-badge, .locked-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}
.equipped-badge { background: var(--purple); color: white; }
.match-badge    { background: var(--gold); color: #1a0a3d; }
.owned-badge    { background: var(--green); color: #052e16; }
.locked-badge   { background: #333; color: #999; }

.item-info { text-align: center; }
.item-name  { font-size: 0.72rem; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.item-tags  { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; margin-bottom: 3px; }
.item-rarity{ font-size: 0.64rem; font-weight: 700; }
.item-price { text-align: center; font-weight: 800; font-size: 0.8rem; margin-top: 4px; }
.item-price.free { color: var(--green); }

.tag {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.tag-match { outline: 1.5px solid white; }

/* ── Character SVG ────────────────────────────────────────── */
.char-svg { width: 100%; height: 100%; overflow: visible; }

@keyframes idle-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}
@keyframes win-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%       { transform: translateY(-14px) rotate(2deg); }
  75%       { transform: translateY(-8px) rotate(-2deg); }
}
@keyframes lose-droop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(4px) rotate(-3deg); }
}
.char-pose-idle { animation: idle-float 3s ease-in-out infinite; }
.char-pose-win  { animation: win-bounce 0.8s ease-in-out 2; }
.char-pose-lose { animation: lose-droop 1.5s ease-in-out infinite; }

.sparkle { animation: sparkle-pulse 2s ease-in-out infinite; }
.s1 { animation-delay: 0s; }
.s2 { animation-delay: 0.6s; }
.s3 { animation-delay: 1.1s; }
.s4 { animation-delay: 1.7s; }
@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50%       { opacity: 0.9; transform: scale(1.3); }
}

/* ── Squishy ──────────────────────────────────────────────── */
.squishy-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--sq-color, var(--purple));
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: 0 0 16px var(--sq-glow, rgba(192,132,252,0.2));
  animation: idle-float 2.8s ease-in-out infinite;
}
.sz-large .squishy-face { font-size: 2.5rem; }
.sz-small .squishy-face { font-size: 1.8rem; }
.squishy-name  { font-size: 0.8rem; font-weight: 800; color: var(--sq-color); }
.squishy-bonus { font-size: 0.7rem; color: var(--text-dim); text-align: center; }
.squishy-empty { font-size: 0.75rem; color: var(--text-dim); text-align: center; padding: 8px; }

/* ── Body style picker ────────────────────────────────────── */
.body-picker {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
}
.body-btn {
  flex: 1;
  padding: 9px 8px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.body-btn.sel {
  background: linear-gradient(135deg, #7c3aed, #c084fc);
  border-color: #c084fc;
  color: white;
  box-shadow: 0 0 14px rgba(192,132,252,0.5);
}
.body-btn:hover:not(.sel) { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.12); }

/* ── Hub ──────────────────────────────────────────────────── */
.hub-home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.14);
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.hub-home-btn:hover { background: rgba(255,255,255,0.18); transform: scale(1.1); }

/* ── Hub ──────────────────────────────────────────────────── */
.hub-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background:
    radial-gradient(ellipse at 15% 0%,   rgba(200,50,255,0.75) 0%, transparent 40%),
    radial-gradient(ellipse at 85% 0%,   rgba(255,200,20,0.45) 0%, transparent 38%),
    radial-gradient(ellipse at 75% 55%,  rgba(0,180,220,0.55)  0%, transparent 42%),
    radial-gradient(ellipse at 20% 75%,  rgba(255,80,160,0.4)  0%, transparent 40%),
    radial-gradient(ellipse at 55% 35%,  rgba(120,40,240,0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(80,20,180,0.5)   0%, transparent 50%),
    linear-gradient(180deg, #080118 0%, #0a0620 50%, #060314 100%);
}
.hub-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  flex-shrink: 0;
}
.hub-title-block {
  text-align: center;
  flex-shrink: 0;
  padding: 2px 0 4px;
  line-height: 1;
}
.hub-title-line1 {
  font-size: clamp(1.5rem, 7.5vw, 2.6rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff7c0, #fbbf24, #fde68a, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(251,191,36,1)) drop-shadow(0 0 10px rgba(251,191,36,0.7)) drop-shadow(0 2px 0 rgba(0,0,0,0.5));
  letter-spacing: 0.06em;
}
.hub-title-line2 {
  font-size: clamp(2rem, 11vw, 3.8rem);
  font-weight: 900;
  background: linear-gradient(135deg, #f9a8d4, #e879f9, #d946ef, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(232,121,249,1)) drop-shadow(0 0 12px rgba(192,38,211,0.8)) drop-shadow(0 3px 0 rgba(0,0,0,0.5));
  letter-spacing: 0.14em;
  margin-top: -6px;
}
.hub-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.hub-center-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 4px 8px;
  min-width: 0;
  position: relative;
}
.hub-char-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hub-char-wrap .char-svg { max-height: 280px; max-width: 160px; }
.hub-char-ring {
  width: 100px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(192,132,252,0) 30%, rgba(192,132,252,0.9) 55%, rgba(34,211,238,0.5) 70%, transparent 80%);
  box-shadow: 0 0 28px rgba(192,132,252,0.8);
  margin-top: -8px;
  flex-shrink: 0;
  animation: ring-pulse 2s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%,100% { box-shadow: 0 0 20px rgba(192,132,252,0.7), 0 0 44px rgba(192,132,252,0.35); opacity: 0.85; }
  50%      { box-shadow: 0 0 36px rgba(192,132,252,1),   0 0 72px rgba(34,211,238,0.5);  opacity: 1; }
}
.hub-char-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #e879f9;
  text-shadow: 0 0 14px rgba(232,121,249,0.8);
  margin-top: 4px;
}
.hub-edit-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.hub-edit-btn:hover { opacity: 1; transform: scale(1.2); }
.hub-sq-mini { margin-top: 6px; }

.hub-left-col {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px 10px 8px;
  justify-content: center;
}
.hub-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
  text-align: center;
  border: 2px solid;
  position: relative;
  overflow: hidden;
}
.hub-zone::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: rgba(255,255,255,0.15);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}
.hub-zone:hover  { transform: scale(1.07); filter: brightness(1.2); }
.hub-zone:active { transform: scale(0.95); }
.zone-icon { font-size: 1.5rem; line-height: 1; }
.zone-name {
  font-size: 0.55rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1.2;
  letter-spacing: 0.03em;
}
.battle-zone  { background: linear-gradient(160deg,#f43f5e,#9f1239); border-color: #fb7185; box-shadow: 0 0 14px rgba(244,63,94,0.5), 0 3px 0 #881337; }
.squishy-zone { background: linear-gradient(160deg,#a855f7,#6d28d9); border-color: #c084fc; box-shadow: 0 0 14px rgba(168,85,247,0.5), 0 3px 0 #4c1d95; }
.hatch-zone   { background: linear-gradient(160deg,#6366f1,#4338ca); border-color: #818cf8; box-shadow: 0 0 14px rgba(99,102,241,0.5), 0 3px 0 #312e81; }

.hub-right-col {
  width: 130px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 10px 10px 6px;
  justify-content: center;
}
.nav-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 22px;
  padding: 8px 12px;
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
  letter-spacing: 0.02em;
}
.nav-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.2);
  border-radius: 22px 22px 0 0;
  pointer-events: none;
}
.nav-btn:hover  { transform: translateY(-3px) scale(1.05); filter: brightness(1.15); }
.nav-btn:active { transform: scale(0.95); filter: brightness(0.9); }
.nav-icon { font-size: 1.2rem; flex-shrink: 0; }
.wardrobe-btn   { background: linear-gradient(160deg,#f472b6,#be185d); box-shadow: 0 4px 0 #881337, 0 0 18px rgba(244,114,182,0.55); }
.shop-btn       { background: linear-gradient(160deg,#4ade80,#16a34a); box-shadow: 0 4px 0 #14532d, 0 0 18px rgba(74,222,128,0.55); }
.contest-btn    { background: linear-gradient(160deg,#fbbf24,#d97706); box-shadow: 0 4px 0 #92400e, 0 0 18px rgba(251,191,36,0.55); }
.showdown-btn   { background: linear-gradient(160deg,#f97316,#c2410c); box-shadow: 0 4px 0 #7c2d12, 0 0 18px rgba(249,115,22,0.55); }
.eggs-btn       { background: linear-gradient(160deg,#818cf8,#4f46e5); box-shadow: 0 4px 0 #3730a3, 0 0 18px rgba(129,140,248,0.55); }
.collection-btn { background: linear-gradient(160deg,#22d3ee,#0891b2); box-shadow: 0 4px 0 #0e7490, 0 0 18px rgba(34,211,238,0.55); }
.nav-btn:active.wardrobe-btn   { box-shadow: 0 1px 0 #881337; }
.nav-btn:active.shop-btn       { box-shadow: 0 1px 0 #14532d; }
.nav-btn:active.contest-btn    { box-shadow: 0 1px 0 #92400e; }
.nav-btn:active.showdown-btn   { box-shadow: 0 1px 0 #7c2d12; }
.nav-btn:active.eggs-btn       { box-shadow: 0 1px 0 #3730a3; }
.nav-btn:active.collection-btn { box-shadow: 0 1px 0 #0e7490; }

.egg-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 900;
  vertical-align: middle;
}

/* ── Wardrobe ─────────────────────────────────────────────── */
.wardrobe-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.wardrobe-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.wardrobe-char-panel {
  width: 170px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  border-right: 1px solid var(--card-border);
  background: rgba(0,0,0,0.2);
  overflow: hidden;
}
.wardrobe-char { flex: 1; width: 100%; min-height: 0; display:flex; align-items:center; }
.wardrobe-char .char-svg { max-height: 280px; }
.wardrobe-sq { margin-top: 6px; width: 100%; }
.wardrobe-items-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* Squishy cards */
.squishy-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--sq-color,var(--purple));
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  position: relative;
}
.squishy-card:hover { transform: scale(1.03); background: rgba(255,255,255,0.1); }
.squishy-card.sq-active { box-shadow: 0 0 16px var(--sq-color,var(--purple)); background: rgba(255,255,255,0.1); }
.squishy-card.locked { opacity: 0.5; cursor: default; }
.sq-card-emoji  { font-size: 2rem; }
.sq-card-name   { font-size: 0.78rem; font-weight: 800; margin: 4px 0 2px; }
.sq-card-rarity { font-size: 0.68rem; font-weight: 700; }
.sq-card-bonus  { font-size: 0.65rem; color: var(--text-dim); margin-top: 3px; }
.active-badge   { margin-top: 6px; background: var(--purple); color:white; font-size:0.65rem; font-weight:800; padding:2px 8px; border-radius:10px; display:inline-block; }

/* ── Shop ─────────────────────────────────────────────────── */
.shop-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background:
    radial-gradient(ellipse at 15% 0%,   rgba(160,40,255,0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 0%,   rgba(200,130,20,0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0,180,120,0.2)   0%, transparent 55%),
    linear-gradient(180deg, #17062c 0%, #0d0520 60%, #080415 100%);
}

/* ── String lights ───────────────────────────────────────── */
.shop-lights {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 6px 4px;
  flex-shrink: 0;
  position: relative;
  background: transparent;
}
.shop-lights::before {
  content: '';
  position: absolute;
  top: 8px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8855bb 10%, #8855bb 90%, transparent);
  opacity: 0.5;
}
.shop-light {
  width: 11px;
  height: 15px;
  border-radius: 50% 50% 45% 45%;
  background: var(--lc, #c084fc);
  box-shadow: 0 0 8px var(--lc, #c084fc), 0 0 18px var(--lc, #c084fc);
  animation: light-glow 1.8s ease-in-out infinite alternate;
  animation-delay: var(--ld, 0s);
  position: relative;
  flex-shrink: 0;
}
.shop-light::before {
  content: '';
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 8px;
  background: #8855bb;
  border-radius: 2px;
}
@keyframes light-glow {
  0%   { opacity: 0.55; filter: brightness(0.7); }
  100% { opacity: 1;    filter: brightness(1.4); }
}

/* ── Shop section sign ───────────────────────────────────── */
.shop-section-sign {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2a0e50, #4a1878, #2a0e50);
  border: 2px solid #c084fc;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 900;
  color: #f0e6ff;
  text-shadow: 0 0 12px rgba(192,132,252,0.8);
  box-shadow: 0 0 20px rgba(192,132,252,0.35), 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
  margin-bottom: 2px;
  letter-spacing: 0.04em;
}
.shop-section-sign::before, .shop-section-sign::after {
  content: '✦';
  color: #fbbf24;
  font-size: 0.8rem;
  text-shadow: 0 0 8px rgba(251,191,36,0.9);
  animation: sign-sparkle 2s ease-in-out infinite alternate;
}
@keyframes sign-sparkle {
  0%   { opacity: 0.6; }
  100% { opacity: 1; filter: drop-shadow(0 0 4px #fbbf24); }
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
}
.shop-item { cursor: pointer; }

/* Shop item cards float */
@keyframes shop-item-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}
.shop-item .item-preview-svg,
.shop-item .item-preview-wrap {
  animation: shop-item-float 2.8s ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}
.shop-item:hover .item-preview-wrap { animation-play-state: paused; }

/* Shimmer on epic/legendary shop items */
@keyframes rarity-shimmer {
  0%   { box-shadow: 0 0 10px var(--rarity-glow); }
  50%  { box-shadow: 0 0 24px var(--rarity-glow), 0 0 4px white; }
  100% { box-shadow: 0 0 10px var(--rarity-glow); }
}
.rarity-epic.shop-item, .rarity-legendary.shop-item {
  animation: rarity-shimmer 2.2s ease-in-out infinite;
}

/* Shop egg cards */
@keyframes egg-pulse {
  0%, 100% { box-shadow: 0 0 16px var(--egg-color, #c084fc), inset 0 0 12px rgba(255,255,255,0.04); }
  50%       { box-shadow: 0 0 36px var(--egg-color, #c084fc), inset 0 0 20px rgba(255,255,255,0.08); }
}
@keyframes egg-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-7px) rotate(2deg); }
}
.shop-egg-card {
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--egg-color, var(--purple));
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: egg-pulse 2.8s ease-in-out infinite;
  animation-delay: var(--ed, 0s);
  transition: transform 0.15s;
}
.shop-egg-card:hover { transform: scale(1.04); }
.shop-egg-visual {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--egg-color, #c084fc);
}
.shop-egg-visual .egg-icon-lg { animation: egg-bob 2.4s ease-in-out infinite; display: block; }
.egg-icon-lg { font-size: 2.6rem; }
.shop-egg-name { font-size: 0.85rem; font-weight: 800; text-align: center; }
.egg-rarity { font-size: 0.72rem; font-weight: 700; }

/* Shop squishy cards */
@keyframes sq-shop-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-6px) scale(1.04); }
}
.shop-sq-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--sq-color,var(--purple));
  box-shadow: 0 0 14px var(--sq-color, rgba(192,132,252,0.3));
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  transition: transform 0.15s;
}
.shop-sq-card:hover { transform: scale(1.04); }
.shop-sq-emoji {
  font-size: 2.6rem;
  display: block;
  animation: sq-shop-bounce 2s ease-in-out infinite;
  animation-delay: var(--sd, 0s);
}

.empty-msg { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 30px; grid-column: 1/-1; }

/* ── Contest & Showdown Select ────────────────────────────── */
.event-select-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.theme-card {
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.theme-icon { font-size: 2rem; }
.theme-name { font-size: 1.1rem; font-weight: 900; }
.theme-world { font-size: 0.72rem; opacity: 0.7; }
.theme-desc { font-size: 0.8rem; opacity: 0.85; }
.theme-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.opponent-power { font-size: 0.72rem; opacity: 0.7; }

/* ── Contest Build ────────────────────────────────────────── */
.contest-build-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.contest-build-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.contest-theme-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-icon-sm { font-size: 1.2rem; }
.theme-name-sm { font-size: 0.9rem; font-weight: 800; }
.theme-tag-hints { display: flex; gap: 4px; flex-wrap: wrap; }
.live-score {
  font-size: 0.9rem;
  font-weight: 900;
  background: rgba(0,0,0,0.3);
  padding: 4px 12px;
  border-radius: 16px;
  white-space: nowrap;
}

/* ── Result Screen ────────────────────────────────────────── */
.result-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  overflow-y: auto;
  padding-bottom: 20px;
}
.result-top { padding: 14px 20px 0; }
.result-theme-name { font-size: 1rem; font-weight: 900; text-align: center; }
.result-stage {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  min-height: 0;
  width: 100%;
  max-height: 280px;
}
.result-char {
  width: 140px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.result-char .char-svg { max-height: 260px; }
.result-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.result-score-area {
  text-align: center;
  padding: 12px 20px 0;
}
.result-score-label { font-size: 0.7rem; letter-spacing: 0.2em; font-weight: 700; opacity: 0.7; }
.result-score-num {
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg,#fbbf24,#c084fc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.result-rank {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 28px;
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 900;
  margin-top: 10px;
}
.rank-pop { animation: rankPop 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes rankPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.result-rewards {
  padding: 12px 20px 0;
  text-align: center;
}
.reward-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.reward-item {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
}

.hidden { display: none !important; }

/* ── Showdown Result ──────────────────────────────────────── */
.showdown-result-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.showdown-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0,0,0,0.3);
}
.event-title { font-size: 0.95rem; font-weight: 800; }
.battle-stage {
  display: flex;
  flex: 1;
  align-items: flex-end;
  padding: 10px 8px;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}
.battle-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.battle-char {
  width: 100%;
  max-height: 240px;
  display: flex;
  justify-content: center;
}
.battle-char .char-svg { max-height: 240px; max-width: 140px; }
.battle-label { font-size: 0.78rem; font-weight: 800; text-align: center; }
.power-bar-wrap { width: 100%; text-align: center; }
.power-bar {
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3px;
}
.power-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px currentColor;
}
.power-num { font-size: 0.9rem; font-weight: 900; }
.vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 0 4px;
}
.vs-text {
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 0 20px var(--purple);
  animation: vs-pulse 1s ease-in-out infinite;
}
@keyframes vs-pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.verdict-badge {
  padding: 8px 14px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 0.85rem;
  text-align: center;
  animation: rankPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.showdown-rewards { padding: 10px 20px 0; text-align: center; }

/* ── Eggs Screen ──────────────────────────────────────────── */
.eggs-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.eggs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.egg-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s;
}
.egg-card:hover { transform: translateY(-3px); }
.egg-visual {
  width: 90px; height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.egg-emoji-lg { font-size: 3rem; }
.egg-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,transparent 30%,rgba(255,255,255,0.25) 50%,transparent 70%);
  animation: shimmer 2.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(200%) rotate(45deg); }
}
.egg-name   { font-size: 0.85rem; font-weight: 800; text-align: center; }
.egg-rarity { font-size: 0.72rem; font-weight: 700; }
.btn-hatch {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn-hatch:hover { filter: brightness(1.15); transform: scale(1.04); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  text-align: center;
  color: var(--text-dim);
}
.empty-icon { font-size: 4rem; }

/* ── Egg Hatch ────────────────────────────────────────────── */
.hatch-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  cursor: pointer;
}
.hatch-title { font-size: 1.3rem; font-weight: 900; text-shadow: 0 0 20px rgba(192,132,252,0.6); }
.hatch-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 180px;
}
.hatch-egg-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hatch-egg-visual {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(255,255,255,0.2);
}
.egg-shaking { animation: egg-shake 0.3s ease-in-out infinite; }
@keyframes egg-shake {
  0%,100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-8deg) scale(1.05); }
  75% { transform: rotate(8deg) scale(1.05); }
}
.egg-explode { animation: egg-pop 0.4s ease-out forwards; }
@keyframes egg-pop {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}
.egg-cracks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.crack {
  position: absolute;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}
.crack.c1 { width: 2px; height: 30px; top: 20%; left: 48%; transform: rotate(20deg); }
.crack.c2 { width: 2px; height: 22px; top: 35%; left: 38%; transform: rotate(-15deg); }
.crack.c3 { width: 2px; height: 26px; top: 25%; left: 55%; transform: rotate(-30deg); }

.hatch-reward { text-align: center; }
.hatch-reward-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hatch-sq-emoji { font-size: 4rem; }
.hatch-reward-name { font-size: 1rem; font-weight: 900; }
.hatch-reward-rarity { font-size: 0.8rem; font-weight: 700; }
.hatch-reward-type { font-size: 0.72rem; color: var(--text-dim); }
.hatch-currency { gap: 8px; }
.hatch-cur-icon { font-size: 3.5rem; }
.hatch-cur-amount { font-size: 2rem; font-weight: 900; color: var(--gold); }
.hatch-cur-label { font-size: 0.85rem; font-weight: 700; color: var(--text-dim); }

.reward-reveal { animation: reward-appear 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes reward-appear {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.hatch-hint { font-size: 0.85rem; color: var(--text-dim); animation: pulse-opacity 1.5s ease-in-out infinite; }
@keyframes pulse-opacity { 0%,100%{opacity:0.5;} 50%{opacity:1;} }

/* ── Collection ───────────────────────────────────────────── */
.collection-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.collection-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}
.col-category { margin-bottom: 16px; }
.col-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.col-items-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.col-item {
  background: var(--card-bg);
  border: 1.5px solid var(--rarity-color,var(--card-border));
  border-radius: var(--radius-sm);
  padding: 6px;
  text-align: center;
  width: 70px;
}
.col-item.locked { border-color: #333; opacity: 0.5; }
.col-item svg { width: 40px; height: 40px; display: block; margin: 0 auto; }
.col-item-name { font-size: 0.6rem; font-weight: 700; margin-top: 3px; line-height: 1.2; }

/* Squishies collection */
.col-sq-progress { display:flex; align-items:center; gap:10px; margin-bottom:12px; font-size:0.8rem; font-weight:700; }
.progress-bar { flex:1; height:8px; background:rgba(255,255,255,0.1); border-radius:4px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#c084fc); border-radius:4px; }
.col-squishy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.col-sq-card {
  background: var(--card-bg);
  border: 1.5px solid var(--sq-color,var(--card-border));
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
}
.col-sq-card.locked { border-color: #333; opacity: 0.5; }
.col-sq-emoji  { font-size: 2rem; }
.col-sq-name   { font-size: 0.75rem; font-weight: 800; margin: 4px 0 2px; }
.col-sq-rarity { font-size: 0.65rem; font-weight: 700; }
.col-sq-bonus  { font-size: 0.62rem; color: var(--text-dim); }

/* Eggs collection */
.col-eggs-info { text-align: center; }
.col-stat-big  { font-size: 4rem; font-weight: 900; color: var(--purple); }
.col-stat-label { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 20px; }
.col-eggs-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.col-egg-type {
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  background: var(--card-bg);
}
.col-egg-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 6px;
}
.col-egg-name   { font-size: 0.8rem; font-weight: 800; }
.col-egg-rarity { font-size: 0.68rem; font-weight: 700; }

/* Achievements */
.col-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.col-ach {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  transition: all 0.15s;
}
.col-ach.unlocked { border-color: var(--gold); background: rgba(251,191,36,0.08); }
.col-ach.locked-ach { opacity: 0.5; }
.ach-icon { font-size: 2rem; margin-bottom: 4px; }
.ach-name { font-size: 0.78rem; font-weight: 800; margin-bottom: 3px; }
.ach-desc { font-size: 0.66rem; color: var(--text-dim); line-height: 1.3; }
.ach-done { margin-top: 6px; font-size: 0.7rem; font-weight: 800; color: var(--gold); }

/* Stats */
.col-stats { display: flex; flex-direction: column; gap: 2px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.stat-row:nth-child(odd) { background: rgba(255,255,255,0.04); }
.stat-row span:last-child { font-weight: 800; color: var(--purple); }

/* ── Character Creator ────────────────────────────────────── */
.creator-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%,#2e0a6e55,transparent 60%),var(--bg);
}
.creator-title {
  font-size: clamp(1.1rem,4vw,1.6rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg,#fbbf24,#f472b6,#c084fc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.creator-body {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 700px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}
.creator-char {
  width: 180px;
  height: 280px;
  flex-shrink: 0;
}
.creator-options {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.creator-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.creator-name-input {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  width: 100%;
}
.creator-name-input:focus { border-color: var(--purple); }

.tone-picker, .hair-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tone-option, .hair-option {
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.15s;
}
.tone-option:hover, .hair-option:hover { transform: scale(1.15); }
.tone-option.sel, .hair-option.sel { border-color: white; box-shadow: 0 0 0 2px rgba(255,255,255,0.4); transform: scale(1.15); }

.creator-start { margin-top: 8px; width: 100%; font-size: 1rem; }

/* ── Particles & Toasts ───────────────────────────────────── */
.particle-container { position:fixed; inset:0; pointer-events:none; z-index:100; }
.particle {
  position: absolute;
  animation: particle-fly 0.9s ease-out forwards;
}
@keyframes particle-fly {
  0%   { transform:translateY(0) rotate(0deg) scale(1); opacity:1; }
  100% { transform:translateY(-80px) translateX(var(--dx,30px)) rotate(540deg) scale(0); opacity:0; }
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 22px;
  border-radius: 24px;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: none;
}
.toast-show { transform: translateX(-50%) translateY(0); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
  .wardrobe-char-panel { width: 120px; }
  .wardrobe-char .char-svg { max-height: 200px; }
  .hub-char-wrap .char-svg { max-height: 240px; }
  .battle-char .char-svg { max-height: 180px; max-width: 110px; }
  .theme-grid { grid-template-columns: 1fr; }
  .shop-grid  { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
@media (max-width: 380px) {
  .wardrobe-char-panel { width: 100px; }
  .hub-right-col { width: 110px; }
  .nav-btn { font-size: 0.72rem; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .hub-title-line1 { font-size: 1.1rem; }
  .hub-title-line2 { font-size: 1.4rem; }
}
@media (min-width: 900px) {
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .result-char { width: 180px; }
  .result-char .char-svg { max-height: 320px; }
}

/* ── Land cards (shop) ───────────────────────────────────────────────────── */
@keyframes land-pulse {
  0%,100% { box-shadow: 0 0 16px var(--land-color,#c084fc); }
  50%      { box-shadow: 0 0 36px var(--land-color,#c084fc); }
}
.land-card {
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: land-pulse 3s ease-in-out infinite;
  animation-delay: var(--ld,0s);
  transition: transform 0.15s;
  grid-column: span 2;
}
.land-card:hover { transform: scale(1.02); }
.land-emoji { font-size: 2.2rem; }
.land-name  { font-size: 1rem; font-weight: 900; }
.land-rarity{ font-size: 0.7rem; font-weight: 700; }
.land-desc  { font-size: 0.75rem; opacity: 0.85; line-height: 1.4; }
.land-tags  { display: flex; gap: 4px; flex-wrap: wrap; }
.land-owned-badge {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 900;
  color: white;
  text-align: center;
}
.land-owned { opacity: 0.7; }

/* ── Adventure screen ────────────────────────────────────────────────────── */
.adventure-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}
.adventure-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.adv-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  text-align: center;
  color: var(--text-dim);
}
.adv-empty-icon { font-size: 4rem; }
.adv-land-card {
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adv-land-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.adv-land-emoji { font-size: 2.4rem; flex-shrink: 0; }
.adv-land-name  { font-size: 1rem; font-weight: 900; margin-bottom: 4px; }
.adv-land-desc  { font-size: 0.78rem; opacity: 0.85; line-height: 1.4; }
.adv-land-btns  { display: flex; gap: 8px; }
.adv-land-btns .btn-enter { flex: 1; text-align: center; }

/* ── Adventure nav button ─────────────────────────────────────────────────── */
.adventure-btn { background: linear-gradient(160deg,#f59e0b,#d97706); box-shadow: 0 4px 0 #92400e, 0 0 18px rgba(245,158,11,0.55); }
.nav-btn:active.adventure-btn { box-shadow: 0 1px 0 #92400e; }

/* ── Rare Cosmic Shop ─────────────────────────────────────── */
.rare-shop-btn {
  background: linear-gradient(160deg,#a78bfa,#7c3aed);
  box-shadow: 0 4px 0 #4c1d95, 0 0 18px rgba(167,139,250,0.7);
  border: 1px solid rgba(251,191,36,0.5);
  animation: rc-btn-pulse 2s ease-in-out infinite;
}
@keyframes rc-btn-pulse {
  0%,100% { box-shadow: 0 4px 0 #4c1d95, 0 0 18px rgba(167,139,250,0.7); }
  50%      { box-shadow: 0 4px 0 #4c1d95, 0 0 32px rgba(251,191,36,0.8); }
}
.nav-btn:active.rare-shop-btn { box-shadow: 0 1px 0 #4c1d95; }

.rare-shop-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: radial-gradient(ellipse at top, #1e0a4e 0%, #0a0618 60%);
}
.rc-shop-title {
  font-size: 1rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 16px #fbbf24, 0 0 30px #a78bfa;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rc-sparkle { animation: rc-twinkle 1.5s ease-in-out infinite alternate; }
.rc-sparkle:last-child { animation-delay: 0.75s; }
@keyframes rc-twinkle {
  from { transform: scale(1) rotate(-5deg); filter: brightness(1); }
  to   { transform: scale(1.35) rotate(5deg); filter: brightness(1.8); }
}
.rc-shop-banner {
  background: linear-gradient(90deg,transparent,rgba(167,139,250,0.25),rgba(251,191,36,0.15),rgba(167,139,250,0.25),transparent);
  border-top: 1px solid rgba(167,139,250,0.4);
  border-bottom: 1px solid rgba(167,139,250,0.4);
  padding: 7px 16px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px #fbbf24;
}
.rc-items-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.rc-item-card {
  border: 1px solid rgba(167,139,250,0.6) !important;
  animation: rc-card-glow 3s ease-in-out infinite;
  animation-delay: var(--rc-d, var(--fd, 0s));
}
@keyframes rc-card-glow {
  0%,100% { box-shadow: 0 0 10px rgba(167,139,250,0.3); }
  50%      { box-shadow: 0 0 24px rgba(167,139,250,0.7), 0 0 8px rgba(251,191,36,0.4); }
}
.btn-stars {
  background: linear-gradient(135deg,#1e1b4b,#312e81);
  border: 1px solid #818cf8;
  color: #fbbf24;
  font-weight: 900;
}
.btn-stars:hover:not(.disabled) {
  background: linear-gradient(135deg,#312e81,#4338ca);
  filter: brightness(1.15);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(192,132,252,0.3); border-radius: 4px; }

/* ── Gender Select Screen ─────────────────────────────────── */
.gender-select-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(160,40,255,0.55) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 75%, rgba(8,145,178,0.4)   0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(244,114,182,0.15) 0%, transparent 60%),
    linear-gradient(180deg, #0d0525 0%, #0a0618 100%);
  gap: 28px;
  padding: 24px 20px;
}
.gender-select-title { text-align: center; }
.gender-logo {
  font-size: clamp(1.5rem, 7vw, 2.4rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fbbf24 0%, #f472b6 40%, #c084fc 70%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(251,191,36,0.55));
  line-height: 1.15;
}
.gender-subtitle {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  color: #c084fc;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(192,132,252,0.9);
  margin-top: 8px;
}
.gender-cards {
  display: flex;
  gap: 18px;
  width: 100%;
  max-width: 500px;
}
.gender-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(20px, 5vw, 36px) 16px;
  border-radius: 24px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.gender-card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.18;
  background: radial-gradient(ellipse at 50% 30%, white 0%, transparent 70%);
  pointer-events: none;
}
.girl-card {
  background: linear-gradient(155deg, #3c0d52, #7c3aed, #be185d);
  border: 3px solid #f472b6;
  box-shadow: 0 0 32px rgba(244,114,182,0.5), 0 8px 36px rgba(0,0,0,0.55);
}
.boy-card {
  background: linear-gradient(155deg, #0c1e6e, #1d4ed8, #0c7a8c);
  border: 3px solid #22d3ee;
  box-shadow: 0 0 32px rgba(34,211,238,0.5), 0 8px 36px rgba(0,0,0,0.55);
}
.gender-card:hover { transform: translateY(-7px) scale(1.04); }
.girl-card:hover   { box-shadow: 0 0 55px rgba(244,114,182,0.75), 0 14px 44px rgba(0,0,0,0.5); }
.boy-card:hover    { box-shadow: 0 0 55px rgba(34,211,238,0.75),  0 14px 44px rgba(0,0,0,0.5); }
.gender-card:active { transform: scale(0.97); }
.gender-card-emoji {
  font-size: clamp(3rem, 10vw, 5rem);
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
  line-height: 1;
}
.gender-card-label {
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 900;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  letter-spacing: 0.1em;
}
.gender-card-sub {
  font-size: clamp(0.65rem, 2vw, 0.8rem);
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  text-align: center;
}

/* ── Shop Image Banner ────────────────────────────────────── */
.shop-image-banner {
  grid-column: 1 / -1;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(192,132,252,0.4);
  box-shadow: 0 0 28px rgba(192,132,252,0.35);
  margin-bottom: 2px;
  cursor: pointer;
}
.shop-banner-img {
  width: 100%;
  height: auto;
  display: block;
}
.shop-image-banner:hover .shop-banner-img { transform: scale(1.02); }
