*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

:root{
  --felt:#0d4a2b;
  --felt-dark:#071d12;
  --gold:#c9a84c;
  --gold-light:#f0ca6f;
}

body{
  overflow:hidden;
  min-height:100vh;
  font-family:'Rajdhani',sans-serif;
  background:
    radial-gradient(circle at center,
    var(--felt),
    var(--felt-dark));

  color:white;
}

/* BACKGROUND */

.bg-particles{
  position:fixed;
  inset:0;

  background:
    radial-gradient(circle at 20% 20%,
    rgba(255,255,255,.04),
    transparent 20%),

    radial-gradient(circle at 80% 70%,
    rgba(255,255,255,.03),
    transparent 20%);
}

/* HEADER */

.header{
  height:80px;

  display:flex;
  justify-content:center;
  align-items:center;

  background:rgba(0,0,0,.25);

  border-bottom:1px solid rgba(255,255,255,.08);
}

.logo{
  font-size:2rem;
  font-weight:900;
  color:var(--gold);
  font-family:'Playfair Display',serif;
}

.logo span{
  color:white;
}

/* TABLE */

.table{
  position:relative;

  height:calc(100vh - 80px);

  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:center;

  padding:20px;
}

/* BALANCE */

.floating-balance{
  position:absolute;
  top:20px;
  left:25px;
  z-index:50;
}

.balance-chip{
  background:rgba(0,0,0,.45);

  border:2px solid rgba(201,168,76,.4);

  border-radius:18px;

  padding:14px 26px;

  display:flex;
  flex-direction:column;

  backdrop-filter:blur(8px);

  box-shadow:
    0 10px 30px rgba(0,0,0,.45);
}

.balance-title{
  letter-spacing:3px;
  font-size:.75rem;
  color:var(--gold);
}

.balance-money{
  font-size:2rem;
  color:var(--gold-light);
  font-weight:700;
}

/* DECK */

.deck-container{
  position:absolute;
  right:7%;
  top:50%;
  transform:translateY(-50%);
}

.deck-stack{
  width:78px;
  height:112px;

  border-radius:10px;

  background:
    repeating-linear-gradient(
      135deg,
      #16395d 0px 8px,
      #0f2440 8px 16px
    );

  border:2px solid #204d7a;
}

/* ZONES */

.zone{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}

.zone-label{
  display:flex;
  gap:10px;
}

.hand-score{
  padding:4px 14px;
  border-radius:20px;
  border:1px solid var(--gold);
  background:rgba(0,0,0,.4);
  color:var(--gold-light);
}

/* AVATAR */

.avatar{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;

  animation:floatAvatar 3s infinite ease-in-out;
}

@keyframes floatAvatar{

  0%{
    transform:translateY(0);
  }

  50%{
    transform:translateY(-5px);
  }

  100%{
    transform:translateY(0);
  }
}

.head{
  width:72px;
  height:72px;
  border-radius:50%;
  position:relative;
  background:linear-gradient(145deg,#f5d6b4,#d9a066);
}

.hat{
  width:90px;
  height:20px;
  background:#111;
  position:absolute;
  top:-5px;
  border-radius:10px;
}

.hat::before{
  content:'';

  position:absolute;

  width:60px;
  height:35px;

  background:#1a1a1a;

  left:50%;
  transform:translateX(-50%);

  top:-22px;

  border-radius:10px;
}

.glasses{
  position:absolute;

  width:46px;
  height:18px;

  background:#050505;

  border-radius:10px;

  left:50%;
  top:28px;

  transform:translateX(-50%);

  box-shadow:
    -22px 0 0 #050505,
    22px 0 0 #050505;
}

.avatar-name{
  letter-spacing:4px;
  color:var(--gold-light);
  font-size:.8rem;
}

/* CARDS */

.cards-row{
  display:flex;
  gap:12px;
  justify-content:center;
  align-items:center;
  min-height:120px;
}

/* CARD SIMPLE (PAS ABSOLUTE) */
.card{
  width:72px;
  height:104px;
  border-radius:8px;
  background:#fff;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:6px;

  box-shadow:0 10px 20px rgba(0,0,0,.35);

  animation:deal .35s ease-out;
  flex-shrink:0;
}

@keyframes deal{
  from{
    transform:translateY(-40px) scale(.8);
    opacity:0;
  }
  to{
    transform:translateY(0) scale(1);
    opacity:1;
  }
}

/* hidden card */
.card.hidden{
  background: repeating-linear-gradient(
    45deg,
    #123 0px,
    #123 8px,
    #0a1a2a 8px,
    #0a1a2a 16px
  );
  color:transparent;
}

.card{

  position:absolute;

  top:0;

  width:78px;
  height:112px;

  background:white;

  border-radius:10px;

  padding:6px;

  display:flex;
  flex-direction:column;
  justify-content:space-between;

  box-shadow:
    0 12px 25px rgba(0,0,0,.45);

  animation:
    dealCard .65s cubic-bezier(.22,.68,0,1.2);
}

@keyframes dealCard{

  from{

    opacity:0;

    transform:
      translate(500px,-250px)
      rotate(-30deg)
      scale(.3);
  }

  to{

    opacity:1;

    transform:
      translate(0,0)
      rotate(0)
      scale(1);
  }
}
.card:hover{
  transform:
    translateY(-6px)
    scale(1.03);
}

@keyframes dealCard{

  from{
    opacity:0;

    transform:
      translate(450px,-250px)
      rotate(-35deg)
      scale(.3);
  }

  to{
    opacity:1;

    transform:
      translate(0,0)
      rotate(0)
      scale(1);
  }
}

.card.red{
  color:#c0392b;
}

.card.black{
  color:#111;
}

.card.hidden{
  background:
    repeating-linear-gradient(
      135deg,
      #16395d 0px 8px,
      #0f2440 8px 16px
    );

  color:transparent;
}

.card-corner{
  display:flex;
  flex-direction:column;
  align-items:center;
}

.card-corner.bottom{
  transform:rotate(180deg);
}

.card-center{
  flex:1;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:2rem;
}

/* MESSAGE */

.message-banner{
  min-height:60px;

  display:flex;
  justify-content:center;
  align-items:center;
}

.message-banner.show{
  padding:12px 28px;

  background:rgba(0,0,0,.45);

  border:1px solid var(--gold);

  border-radius:40px;
}

#message-text{
  font-size:1.6rem;
  font-family:'Playfair Display',serif;
}

/* TOAST */

.action-toast{
  position:fixed;

  top:100px;
  left:50%;

  transform:
    translateX(-50%)
    translateY(-30px);

  opacity:0;

  transition:.4s;

  background:rgba(20,20,20,.95);

  padding:14px 22px;

  border-radius:14px;

  border:1px solid rgba(255,80,80,.5);

  display:flex;
  gap:10px;

  z-index:999;
}

.action-toast.show{
  opacity:1;

  transform:
    translateX(-50%)
    translateY(0);
}

/* CONTROLS */

.controls-wrapper{
  min-height:180px;

  display:flex;
  justify-content:center;
  align-items:center;
}

.bet-panel,
.action-panel,
.result-panel{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:20px;
}

.hidden{
  display:none !important;
}

/* CHIPS */

.chips{
  display:flex;
  gap:14px;
}

.chip{
  width:65px;
  height:65px;

  border:none;

  border-radius:50%;

  cursor:pointer;

  color:white;
  font-size:1rem;
  font-weight:700;

  transition:.2s;
}

.chip:hover{
  transform:
    translateY(-5px)
    scale(1.08);
}

.chip-5{
  background:#e74c3c;
}

.chip-10{
  background:#3498db;
}

.chip-25{
  background:#27ae60;
}

.chip-50{
  background:#8e44ad;
}

.chip-100{
  background:#c9a84c;
}

.chip-500{
  background:#111;
}

/* BUTTONS */

.btn{
  border:none;

  padding:14px 26px;

  border-radius:8px;

  cursor:pointer;

  font-weight:700;

  transition:.2s;
}

.btn:hover{
  transform:translateY(-3px);
}

.btn-primary{
  background:
    linear-gradient(135deg,
    #c9a84c,
    #f0ca6f);
}

.btn-ghost{
  background:transparent;
  border:1px solid rgba(255,255,255,.3);
  color:white;
}

.action-panel{
  flex-direction:row;
}

.btn-hit{
  background:#27ae60;
  color:white;
}

.btn-stand{
  background:#c0392b;
  color:white;
}

.btn-double{
  background:#2980b9;
  color:white;
}

/* HISTORY */

.history-panel{
  position:fixed;

  right:0;
  top:80px;

  width:180px;
  height:calc(100vh - 80px);

  background:rgba(0,0,0,.35);

  padding:20px;

  overflow:auto;
}

#history-list{
  list-style:none;

  display:flex;
  flex-direction:column;

  gap:8px;
}

#history-list li{
  background:rgba(255,255,255,.05);

  padding:8px;

  border-radius:6px;

  display:flex;
  justify-content:space-between;
}