/* -------------------------------------------------
   GLOBAL
------------------------------------------------- */

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

/* MTG sparkle cursor */
@keyframes cursor-sparkle {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

body, a, button, [role="button"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3Cfilter id='glow'%3E%3CfeGaussianBlur stdDeviation='1.5' result='blur'/%3E%3CfeMerge%3E%3CfeMergeNode in='blur'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23glow)'%3E%3C!-- big 4-point star --%3E%3Cpath d='M16 2 L17.2 14.8 L30 16 L17.2 17.2 L16 30 L14.8 17.2 L2 16 L14.8 14.8 Z' fill='%2393c5fd' opacity='0.95'/%3E%3C!-- small 4-point star offset --%3E%3Cpath d='M24 6 L24.7 10.3 L29 11 L24.7 11.7 L24 16 L23.3 11.7 L19 11 L23.3 10.3 Z' fill='%23bfdbfe' opacity='0.8'/%3E%3C!-- tiny dot --%3E%3Ccircle cx='9' cy='22' r='1.5' fill='%2360a5fa' opacity='0.7'/%3E%3C/g%3E%3C/svg%3E") 16 16, crosshair;
}

body {
  font-family: 'Archivo', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: #0e0c0a;
  color: #e8dcc8;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(139, 90, 43, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(60, 40, 100, 0.18) 0%, transparent 60%);
}

.events-root {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}


/* -------------------------------------------------
   HERO SECTION
------------------------------------------------- */

.page-hero {
  text-align: center;
  padding: clamp(1.5rem, 6vw, 3rem) 1.25rem clamp(1.2rem, 4vw, 2rem);
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.page-hero::before {
  content: '';
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(to right, #f9fafb, #3b82f6, #1a1a1a, #ef4444, #22c55e);
  position: absolute;
  top: 0;
  left: 0;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: #f0e6c8;
  text-shadow: 0 2px 18px rgba(200, 150, 60, 0.35);
}

.page-hero .tagline {
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  color: #9e8f78;
  margin: 0.5rem 0 1.2rem;
  line-height: 1.6;
}

.page-hero h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.8rem, 3vw, 1rem);
  font-weight: 700;
  color: #c9a84c;
  margin: 0;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-hero hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 1.2rem auto;
  max-width: 320px;
}


/* -------------------------------------------------
   MTG CARD
   Anatomy (outer → inner):
   1. Outer frame  — thick rounded border, coloured by type
   2. Frame inset  — 8px padding in frame colour
   3. Inner border — thin gold line
   4. Card face    — dark parchment bg
      a. Title bar
      b. Art box   — inset with its own border
      c. Type line
      d. Text box
------------------------------------------------- */

.mtg-card {
  width: 100%;
  border-radius: 20px;
  margin-bottom: 2.8rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  /* Layer 1: outermost shadow */
  box-shadow:
    0 20px 60px rgba(0,0,0,0.85),
    0 4px 12px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

.mtg-card:hover {
  transform: translateY(-8px) rotate(-0.5deg);
  box-shadow:
    0 32px 80px rgba(0,0,0,0.9),
    0 8px 24px rgba(0,0,0,0.7),
    0 0 60px rgba(201,168,76,0.1);
}

/* Layer 1: outer frame — type-coloured thick border */
.event-type-show {
  background: linear-gradient(145deg, #c9a84c 0%, #8a6e2a 30%, #5a4418 60%, #3a2c10 100%);
  padding: 10px;
}
.event-type-jam {
  background: linear-gradient(145deg, #4ade80 0%, #16a34a 30%, #14532d 60%, #0a2e18 100%);
  padding: 10px;
}
.event-type-workshop {
  background: linear-gradient(145deg, #60a5fa 0%, #1d4ed8 30%, #1e3a8a 60%, #0f2060 100%);
  padding: 10px;
}

/* Layer 2: inner gold border ring */
.mtg-card-inner {
  border-radius: 12px;
  overflow: hidden;
  /* Two borders: gold outer, then dark gap, then card face */
  outline: 2px solid rgba(201,168,76,0.6);
  outline-offset: -1px;
  box-shadow:
    inset 0 0 0 3px rgba(0,0,0,0.8),
    inset 0 0 0 4px rgba(201,168,76,0.15);
  background: #1c160e;
}


/* ----- Title bar ----- */
.mtg-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem 0.55rem;
  background: linear-gradient(to bottom, #2e2212, #221a0d);
  border-bottom: 2px solid rgba(201,168,76,0.35);
  position: relative;
}

/* subtle gold sheen line at very top of title bar */
.mtg-title-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,168,76,0.5), transparent);
}

.mtg-card-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f5e8c0;
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}


/* ----- Art box ----- */
.mtg-art-box {
  /* Inset border to frame the art like a real card */
  margin: 8px 8px 0;
  border: 3px solid rgba(201,168,76,0.4);
  box-shadow:
    inset 0 0 12px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0,0,0,0.8);
  overflow: hidden;
  line-height: 0;
  background: #0a0806;
  position: relative;
}

.mtg-art-box img {
  width: 100%;
  height: clamp(160px, 50vw, 220px);
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.mtg-card:hover .mtg-art-box img {
  transform: scale(1.04);
}

.mtg-art-placeholder {
  width: 100%;
  height: clamp(160px, 50vw, 220px);
  background:
    radial-gradient(ellipse at center, #2a1e0e 0%, #0e0c0a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mtg-art-placeholder::after {
  content: '✦';
  font-size: 2.5rem;
  color: rgba(201,168,76,0.15);
}


/* ----- Type line ----- */
.mtg-type-line {
  margin: 6px 8px 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: #d4b86a;
  background: linear-gradient(to right, #2a2010, #1e1a0c);
  border: 1px solid rgba(201,168,76,0.25);
  border-top: 2px solid rgba(201,168,76,0.4);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}


/* ----- Text box ----- */
.mtg-text-box {
  margin: 6px 8px 8px;
  padding: 0.75rem 0.8rem 0.8rem;
  background: #171208;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 0 0 4px 4px;
  /* parchment texture via subtle gradient */
  background-image: linear-gradient(160deg, #1c1509 0%, #130f06 100%);
}

.mtg-flavour-text {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #8a7a62;
  margin: 0 0 0.75rem;
  font-style: italic;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.mtg-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
}


/* -------------------------------------------------
   BUTTONS
------------------------------------------------- */

.btn {
  padding: 0.45rem 0.9rem;
  border-radius: 2px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.btn:active { transform: scale(0.97) !important; }

.btn-primary {
  background: linear-gradient(to bottom, #e0be66, #b8922e);
  color: #0e0c0a;
  border: 1px solid #a07820;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
  background: linear-gradient(to bottom, #f0ce76, #c9a84c);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-ghost {
  border: none;
  color: #6b5f50;
  background: transparent;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: none;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.btn-ghost:hover { color: #9e8f78; }


/* -------------------------------------------------
   SOCIAL CARDS
   Desktop (hover: hover): fan layout with hover pop
   Touch (hover: none):    vertical stack, always visible
------------------------------------------------- */

/* --- Shared base styles --- */
.social-card {
  text-decoration: none;
  display: block;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8);
  will-change: transform;
}

.social-card-reroll {
  background: linear-gradient(145deg, #f59e0b 0%, #b45309 30%, #78350f 60%, #3c1a04 100%);
}
.social-card-instagram {
  background: linear-gradient(145deg, #e4405f 0%, #8a1a2e 30%, #3a0d18 60%, #200a0e 100%);
}
.social-card-underline {
  background: linear-gradient(145deg, #a78bfa 0%, #6d28d9 30%, #3b1a8a 60%, #1e0f50 100%);
}
.social-card-whatsapp {
  background: linear-gradient(145deg, #25d366 0%, #128c3e 30%, #075c28 60%, #032e14 100%);
}

/*
  All cards share center-bottom as pivot.
  Fan goes one way: 0deg (upright), -12deg, -24deg —
  so the hand leans left like cards fanned in one direction.
  On hover a card pops straight up to center.
*/
.social-cards-row {
  position: relative;
  height: 280px;
  margin: 0 -1rem 1rem;
  overflow: visible;
}

.social-card {
  position: absolute;
  width: min(190px, 50vw);
  bottom: 0;
  left: 50%;
  margin-left: calc(min(190px, 50vw) / -2);
  transform-origin: center bottom;
}

.social-card.is-flipping {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.social-card-reroll     { transform: rotate(-21deg); z-index: 1; }
.social-card-instagram  { transform: rotate(-7deg);  z-index: 2; }
.social-card-underline  { transform: rotate(7deg);   z-index: 2; }
.social-card-whatsapp   { transform: rotate(21deg);  z-index: 1; }


.social-card-reroll .mtg-title-bar {
  background: linear-gradient(to bottom, #2a1a04, #1a1002);
  border-bottom-color: rgba(245,158,11,0.5);
}

.social-card-instagram .mtg-title-bar {
  background: linear-gradient(to bottom, #2a0e18, #1a0810);
  border-bottom-color: rgba(228,64,95,0.4);
}

.social-card-underline .mtg-title-bar {
  background: linear-gradient(to bottom, #1a1030, #100a20);
  border-bottom-color: rgba(139,92,246,0.5);
}

.social-card-whatsapp .mtg-title-bar {
  background: linear-gradient(to bottom, #0a2010, #061408);
  border-bottom-color: rgba(37,211,102,0.4);
}

.social-card-icon {
  width: 20px;
  height: 20px;
  opacity: 0.95;
  flex-shrink: 0;
}

.social-card .mtg-art-box { display: none; }
.social-card .mtg-type-line { display: none; }

.social-card-underline.is-focused .social-card-art {
  display: block;
}

.social-card-underline.is-focused .social-card-art img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  object-position: center;
  background: #0a0806;
}

.social-card .mtg-text-box {
  background-image: linear-gradient(160deg, #100c06 0%, #0a0804 100%);
}

.social-card .mtg-flavour-text {
  font-style: normal;
  color: #5a5048;
  font-size: clamp(0.72rem, 2.5vw, 0.78rem);
}

.social-card .btn-primary { font-size: 0.68rem; }


/* -------------------------------------------------
   SOCIAL CARD FOCUS — card pops to viewport center
------------------------------------------------- */

#card-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 99;
}

#card-overlay.is-visible {
  display: block;
}

.social-card.is-focused {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(320px, 88vw);
  margin-left: calc(min(320px, 88vw) / -2);
  margin-top: 0;
  translate: 0 -50%;
  z-index: 100;
  box-shadow: 0 40px 100px rgba(0,0,0,0.95);
}


/* -------------------------------------------------
   EMPTY STATE
------------------------------------------------- */

.empty-state {
  text-align: center;
  color: #7a6a5a;
  font-size: 1rem;
  margin: 3rem 0;
  padding: 2rem;
  background: #1a1612;
  border: 1px dashed rgba(201,168,76,0.15);
  border-radius: 12px;
}

.empty-state h2 {
  font-family: 'Cinzel', serif;
  color: #e8dcc8;
  margin-bottom: 0.5rem;
}

.warning {
  font-size: 0.82rem;
  color: #5a5050;
  margin-top: 0.8rem;
}


/* -------------------------------------------------
   FOOTER
------------------------------------------------- */

.footer {
  text-align: center;
  font-size: 0.78rem;
  color: #3d3530;
  padding: 2rem 0 1.2rem;
  letter-spacing: 0.04em;
}

.footer a {
  color: #5a4e42;
  text-decoration: none;
}

.footer a:hover { color: #c9a84c; }


/* -------------------------------------------------
   MOBILE OVERRIDES  ≤ 480px
------------------------------------------------- */

@media (max-width: 480px) {
  /* Tighten event card spacing */
  .mtg-card { margin-bottom: 2rem; }

  /* Slightly smaller card name so long titles don't overflow */
  .mtg-card-name { font-size: 0.9rem; }

  /* Slightly reduce type-line on very small screens but keep it legible */
  .mtg-type-line { font-size: 0.78rem; }

  /* Buttons stack comfortably on narrow screens */
  .mtg-buttons { gap: 0.5rem; }
  .btn { padding: 0.5rem 0.85rem; font-size: 0.68rem; }

  /* Reduce bottom padding on events-root */
  .events-root { padding-bottom: 2rem; }
}
