/* ===================================
   PINK NOIR GOLD v7 (MOBILE FIX)
   - Desktop OK
   - Mobile FIX: 1 colonna + altezza fissa + font/padding ridotti
   - Bottone sempre visibile anche su mobile
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Cinzel:wght@600;700&family=Manrope:wght@700;800;900&display=swap');

:root{
  --radius:22px;

  --p1:#ff2fc8;
  --p2:#ff78df;
  --p3:#ffd6f3;

  --gold1:#b38b2a;
  --gold2:#ffd56a;

  --free1:#20e3b2; --free2:#00b894;
  --busy1:#ff1f4b; --busy2:#b00020;
  --stand1:#6a00f4; --stand2:#00d4ff;
  --off1:#64748b; --off2:#111827;

  --shadow:0 20px 45px rgba(0,0,0,.25);
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:Manrope, sans-serif;
  background:linear-gradient(180deg,#ffffff,#ffe6f7);
}

/* clearfix per i float */
body::after{
  content:"";
  display:block;
  clear:both;
}

/* =========================
   CARD
   ========================= */
div.cartomante{
  position:relative;
  width:calc(33.333% - 18px);
  aspect-ratio:1/1;                 /* desktop */
  float:left;

  margin:14px 9px;
  padding:18px;

  border-radius:var(--radius);

  background:
    radial-gradient(260px 180px at 18% 18%, rgba(255,255,255,.65), transparent 62%),
    radial-gradient(300px 220px at 88% 30%, rgba(255,255,255,.30), transparent 66%),
    linear-gradient(135deg,var(--p1),var(--p2),var(--p3));

  border:3px solid #0b0b0f;
  box-shadow:
    0 0 0 2px rgba(179,139,42,.60),
    var(--shadow);

  overflow:hidden;                   /* ok, ma su mobile gestiamo misure */
}

/* cornice oro interna */
div.cartomante::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius:calc(var(--radius) - 10px);
  border:2px solid rgba(255,213,106,.90);
  pointer-events:none;
}

/* =========================
   NOME
   ========================= */
.labelnome{
  font-family:"Cormorant Garamond", serif;
  font-size:26px;
  font-weight:700;
  text-align:center;
  margin:20px auto 10px;

  color:#fff;
  padding:10px 16px;
  border-radius:16px;

  background:rgba(0,0,0,.75);
  border:2px solid var(--gold2);

  width:fit-content;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* =========================
   CODICE
   ========================= */
.cartcodice{
  text-align:center;
  margin-bottom:80px;  /* spazio bottone */
  color:#fff;
  font-weight:900;
  letter-spacing:1px;
}

.cartcodice::before{
  content:"CODICE";
  display:block;
  font-size:12px;
  letter-spacing:2px;
  margin-bottom:8px;
  opacity:.95;
}

.cartcod{
  font-family:"Cinzel", serif;
  font-size:18px;
  letter-spacing:2px;

  padding:10px 18px;
  border-radius:999px;

  background:linear-gradient(90deg,var(--gold1),var(--gold2));
  color:#1a1200;
  border:2px solid #000;

  box-shadow:0 10px 25px rgba(0,0,0,.30);

  display:inline-block;
}

/* =========================
   BOTTONE STATO
   ========================= */
a.pluslink, a.pluslink:visited, a.pluslink:hover, a.pluslink:active{
  text-decoration:none;
  color:inherit;
}

div.cartomante a.pluslink > div.btncart{
  position:absolute;
  left:20px;
  right:20px;
  bottom:20px;

  height:60px;
  border-radius:18px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:15px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:1px;
  color:#fff;

  z-index:5; /* sotto modal bootstrap */

  border:2px solid #000;
  box-shadow:
    0 18px 35px rgba(0,0,0,.35),
    inset 0 2px 0 rgba(255,255,255,.30),
    inset 0 -4px 0 rgba(0,0,0,.25);

  overflow:hidden;
  transition:transform .2s ease;
}

/* sweep animation */
div.cartomante a.pluslink > div.btncart::before{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width:55%;
  height:180%;
  transform:rotate(25deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.80),transparent);
  animation:sweep 2s linear infinite;
  opacity:.9;
}

@keyframes sweep{
  0%{left:-70%;}
  100%{left:140%;}
}

div.cartomante:hover a.pluslink > div.btncart{
  transform:translateY(-2px);
}

/* colori stati */
.btn-free{ background:linear-gradient(135deg,var(--free1),var(--free2)); }
.btn-busy{ background:linear-gradient(135deg,var(--busy1),var(--busy2)); }
.btn-pause{ background:linear-gradient(135deg,var(--busy1),var(--busy2)); } /* pausa = occupato */
.btn-standby{ background:linear-gradient(135deg,var(--stand1),var(--stand2)); }
.btn-offline{ background:linear-gradient(135deg,var(--off1),var(--off2)); opacity:.92; }

/* =========================
   RESPONSIVE
   ========================= */

/* tablet: 2 colonne */
@media (max-width:900px){
  div.cartomante{
    width:calc(50% - 18px);
  }
}

/* mobile: 1 colonna + altezza fissa (NO aspect-ratio) */
@media (max-width:600px){
  div.cartomante{
    width:calc(100% - 18px);
    float:left;

    /* 🔥 qui risolviamo: niente quadrato forzato */
    aspect-ratio:auto;
    height:230px;

    padding:14px;
    border-radius:20px;
  }

  div.cartomante::before{
    inset:8px;
    border-radius:14px;
  }

  .labelnome{
    font-size:22px;
    margin:14px auto 8px;
    padding:9px 14px;
    border-radius:14px;
  }

  .cartcodice{
    margin-bottom:72px; /* spazio bottone */
    font-size:13px;
  }

  .cartcod{
    font-size:16px;
    padding:9px 16px;
  }

  div.cartomante a.pluslink > div.btncart{
    left:14px;
    right:14px;
    bottom:14px;
    height:56px;
    font-size:14px;
    border-radius:16px;
  }
}

/* ultra small (sotto 360) */
@media (max-width:360px){
  div.cartomante{
    height:240px;
  }

  .labelnome{
    font-size:20px;
  }

  div.cartomante a.pluslink > div.btncart{
    height:54px;
    font-size:13px;
  }
}