:root{
  --bg:#0a0f14;
  --card:rgba(18,22,28,0.7);
  --text:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.65);
  --accent:#ffe47a;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  /* In an iframe we don't need an extra page background; let the canvas dominate. */
  background: transparent;
  color:var(--text);
  display:block;
}

.wrap{
  width:100%;
  padding:0;
  display:flex;
  justify-content:center;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  background:var(--card);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px;
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
}
.dot{
  width:14px;height:14px;border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 18px rgba(255,228,122,0.45);
}
.title{ font-weight:800; letter-spacing:0.2px; }
.sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.stage{
  position:relative;
  margin-top:0;
  width:100%;
  max-width:1100px;
  margin-left:auto;
  margin-right:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.08);
  /* voorkom donkere zijbalken op brede schermen */
  background:#1f6fae;
  overflow:hidden;
}

#slotCanvas{
  width:100%;
  display:block;
}

/* Full-width bottom HUD bar (bet + spin gekoppeld, zoals screenshot) */
.hudBar{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:78px;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  pointer-events:none;
  background:linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0.50));
  border-top:1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hudBar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  pointer-events:auto;
}
.hudStat{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  white-space:nowrap;
}
.hudStat-label{
  font-size:12px;
  font-weight:800;
  letter-spacing:0.08em;
  color:rgba(255,255,255,0.80);
}
.hudStat-value{
  margin-top:4px;
  font-size:18px;
  font-weight:900;
  color:#fff;
}
.hudDivider{
  width:1px;
  height:44px;
  background:rgba(255,255,255,0.22);
  opacity:0.65;
}
.hudBar-right{
  display:flex;
  align-items:center;
  gap:0;
  pointer-events:auto;
}

/* Bet dock (rechthoek) */
.betDock{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px 10px 12px;
  border-radius:10px;
  background:rgba(0,0,0,0.62);
  border:1px solid rgba(255,255,255,0.14);
  box-shadow:0 10px 22px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.betDock-main{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  min-width:110px;
}
.betDock-label{
  font-size:12px;
  font-weight:900;
  letter-spacing:0.08em;
  color:rgba(255,255,255,0.80);
}
.betDock-value{
  margin-top:4px;
  font-size:18px;
  font-weight:900;
  color:#fff;
}
.betDock-arrows{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding-left:10px;
  border-left:1px solid rgba(255,255,255,0.14);
}
.betDock-arrow{
  width:34px;
  height:20px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.08);
  color:rgba(255,255,255,0.95);
  font-weight:900;
  cursor:pointer;
}
.betDock-arrow:active{ transform:translateY(1px); }

/* Spin knop: gekoppeld aan bet dock en steekt boven/onder de bar uit */
.spinBtnDock{
  pointer-events:auto;
  width:78px;
  height:78px;
  border-radius:999px;
  border:3px solid rgba(0,0,0,0.65);
  background: radial-gradient(circle at 30% 25%, rgba(70,74,82,0.95), rgba(22,24,28,0.95));
  cursor:pointer;
  box-shadow:0 16px 30px rgba(0,0,0,0.45);
  display:grid;
  place-items:center;
  margin-left:-12px;   /* 'vast' aan bet box */
  margin-top:-16px;    /* steekt uit boven bar */
  margin-bottom:-16px; /* steekt uit onder bar */
  position:relative;
}
.spinBtnDock::before{
  content:"";
  position:absolute;
  inset:6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.18);
  pointer-events:none;
}
.spinBtnDock::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10);
  pointer-events:none;
  opacity:0.55;
}
.spinBtnDock:hover{ filter:brightness(1.03); }
.spinBtnDock:active{ transform: translateY(1px); }

/* HUD onderin (zoals screenshot) */
.hudBottom{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  pointer-events:none;
}

.hudBottom-left,
.hudBottom-right{
  display:flex;
  align-items:center;
  gap:12px;
}

.hudPill{
  pointer-events:auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(0,0,0,0.46);
  border:1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hudPill-label{
  font-size:12px;
  font-weight:900;
  letter-spacing:0.06em;
  color:rgba(255,255,255,0.85);
  margin-right:6px;
}

.hudPill-value{
  font-size:18px;
  font-weight:900;
  color:#fff;
}


.menuBtn{
  pointer-events:auto;
  width:42px;
  height:42px;
  border-radius:10px;
  background:rgba(0,0,0,0.0);
  border:0;
  cursor:pointer;
  display:grid;
  place-items:center;
}

.menuIcon{
  width:18px;
  height:12px;
  position:relative;
  display:block;
}
.menuIcon::before,
.menuIcon::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:2px;
  background:rgba(255,255,255,0.92);
  border-radius:2px;
}
.menuIcon::before{ top:0; }
.menuIcon::after{ bottom:0; }
.menuIcon{ background:linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)); background-size:100% 2px; background-repeat:no-repeat; background-position:center; }

.betPill{ padding-right:8px; }
.betArrows{ display:flex; flex-direction:column; gap:8px; }
.betArrow{
  width:34px;
  height:20px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.10);
  color:rgba(255,255,255,0.95);
  font-weight:900;
  cursor:pointer;
}

.spinBtn{
  pointer-events:auto;
  width:66px;
  height:66px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(0,0,0,0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor:pointer;
  box-shadow:0 12px 28px rgba(0,0,0,0.35);
  display:grid;
  place-items:center;
}

.spinIcon{ position:relative; z-index:1; color:#fff; display:grid; place-items:center; }
.spinSvg{ display:block; }

.winHidden{ display:none !important; }

.bet-hidden{ display:none !important; }

.msg{
  position:absolute;
  left:18px;
  top:16px;
  min-height:24px;
  padding:8px 12px;
  border-radius:12px;
  background:rgba(0,0,0,0.28);
  border:1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight:900;
  color:var(--accent);
  pointer-events:none;
}
code{
  color:rgba(255,255,255,0.85);
}


/* --- Modern animations / overlays --- */
.winBanner{
  position:absolute;
  left:50%;
  top:45%;
  transform:translate(-50%,-50%) scale(0.9);
  opacity:0;
  pointer-events:none;
  padding:14px 22px;
  border-radius:16px;
  background:rgba(10,12,16,0.55);
  border:1px solid rgba(255,255,255,0.18);
  box-shadow:0 18px 45px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align:center;
  color:#fff;
  min-width: 220px;
}
.winBanner-title{
  font-size:12px;
  letter-spacing:0.18em;
  text-transform:uppercase;
  opacity:0.85;
  margin-bottom:6px;
}
.winBanner-amount{
  font-size:34px;
  font-weight:900;
  letter-spacing:0.02em;
}
.winBanner.show{
  animation: winPop 1500ms ease forwards;
}
@keyframes winPop{
  0%{opacity:0;transform:translate(-50%,-50%) scale(0.88);}
  16%{opacity:1;transform:translate(-50%,-50%) scale(1.06);}
  28%{transform:translate(-50%,-50%) scale(1);}
  82%{opacity:1;transform:translate(-50%,-50%) scale(1.01);}
  100%{opacity:0;transform:translate(-50%,-50%) scale(0.98);}
}

body.isSpinning .spinBtnDock .spinIcon,
body.isSpinning .spinBtn .spinIcon{
  animation: spinRotate 700ms linear infinite;
}
@keyframes spinRotate{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}


/* Paytable modal */
.modal{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:auto;
}
.modal.hidden{ display:none; }
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-panel{
  position:relative;
  width:min(960px, calc(100% - 48px));
  max-height: calc(100% - 120px);
  display:flex;
  flex-direction:column;
  background: rgba(12,14,18,0.88);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:16px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.60);
  overflow:hidden;
}
.modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  background: rgba(255,255,255,0.06);
  border-bottom:1px solid rgba(255,255,255,0.10);
}
.modal-title{ font-weight:900; letter-spacing:0.02em; }
.modal-close{
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color:#fff;
  font-size:22px;
  cursor:pointer;
}
.modal-body{
  padding:16px 16px 18px;
  overflow:auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.payGrid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:14px;
}
.payItem{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:14px;
  background: rgba(0,0,0,0.30);
  border:1px solid rgba(255,255,255,0.10);
}
.payItem img{
  width:62px;
  height:62px;
  object-fit:contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}
.payLines{
  font-size:13px;
  color:rgba(255,255,255,0.92);
  line-height:1.35;
}
.payLines .k{
  display:inline-block;
  min-width:36px;
  color:rgba(255,255,255,0.75);
  font-weight:900;
}
.payLines .v{ font-weight:900; }

.paySection{ margin-bottom: 18px; }
.paySectionTitle{
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 6px 0 12px;
  color: rgba(255,255,255,0.92);
}

.payInfo .payLines{ font-size: 12.5px; }

/* Paylines (winlijnen) mini-grid */
.plWrap{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.plItem{
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px 10px 12px;
}
.plNum{
  font-weight: 900;
  opacity: 0.85;
  margin-bottom: 8px;
}
.plGrid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
}
.plCell{
  height: 14px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
}
.plCell.on{
  background: rgba(255, 74, 74, 0.85);
  border-color: rgba(255,255,255,0.35);
}

/* --- Mobile HUD (small screens) --- */
@media (max-width: 768px){
  /* Transform the desktop bar into a compact 2-row mobile HUD (like screenshot 2). */
  .hudBar{
    left:12px;
    right:12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    height:auto;
    padding:0;
    gap:10px;
    background:none;
    border-top:0;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
    display:grid;
    grid-template-columns: 44px 1fr 1fr 1fr 44px;
    grid-template-rows: auto auto;
    grid-template-areas:
      "menu minus spin plus ."
      ". balance bet win .";
    align-items:center;
    justify-items:center;
    pointer-events:none;
  }

  /* Flatten wrapper nodes so their children participate in the grid */
  .hudBar-left,
  .hudBar-right,
  .betDock,
  .betDock-arrows{
    display: contents;
  }

  /* Remove desktop-only bits */
  .hudDivider{ display:none; }

  /* Grid placement */
  #menuBtn{ grid-area: menu; justify-self:start; pointer-events:auto; }
  .hudStat[aria-label="Balance"]{ grid-area: balance; pointer-events:auto; }
  .hudStat[aria-label="Totale winst"]{ grid-area: win; pointer-events:auto; }
  .betDock-main{ grid-area: bet; pointer-events:auto; min-width:0; }

  #betDown{ grid-area: minus; }
  #spinBtn{ grid-area: spin; }
  #betUp{ grid-area: plus; }

  /* Mobile buttons */
  .menuBtn{
    width:44px;
    height:44px;
    border-radius:999px;
    background: rgba(0,0,0,0.28);
    border:1px solid rgba(255,255,255,0.14);
    box-shadow:0 12px 28px rgba(0,0,0,0.25);
  }

  .betDock-arrow{
    pointer-events:auto;
    width:56px;
    height:56px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.38);
    box-shadow:0 12px 28px rgba(0,0,0,0.30);
    display:grid;
    place-items:center;
    font-size:26px;
    line-height:1;
    color:rgba(255,255,255,0.95);
    font-weight:900;
  }
  .betDock-arrow:active{ transform:translateY(1px); }

  .spinBtnDock{
    pointer-events:auto;
    position:static;
    transform:none;
    margin:0;
    width:74px;
    height:74px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.38);
    box-shadow:0 18px 40px rgba(0,0,0,0.35);
  }
  .spinBtnDock::before,
  .spinBtnDock::after{ display:none; }

  /* Stats row styling */
  .hudStat{
    align-items:center;
    text-align:center;
  }

  .hudStat-label,
  .betDock-label{
    font-size:11px;
    font-weight:800;
    letter-spacing:0.10em;
    color:rgba(255,255,255,0.80);
  }
  .hudStat-value,
  .betDock-value{
    margin-top:4px;
    font-size:15px;
    font-weight:900;
    color:#fff;
  }

  /* Bet main should behave like a stat on mobile */
  .betDock{
    padding:0;
    border:0;
    background:none;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
  .betDock-main{
    display:flex;
    flex-direction:column;
    align-items:center;
    line-height:1.05;
  }

  /* Don't force side clusters; grid handles it */
  .hudBar-left, .hudBar-right{ min-width:0; }
}

@media (max-width: 420px){
  .betDock-arrow{ width:52px; height:52px; border-radius:15px; font-size:24px; }
  .spinBtnDock{ width:70px; height:70px; }
  .hudStat-value, .betDock-value{ font-size:14px; }
}
