/* Ho-Ho Santa-ish theme variables (easy to tweak) */
:root{
  --hh-red: #b10f1a;
  --hh-red-dark: #7f0a12;
  --hh-green: #0b6b3a;
  --hh-gold: #d4a21a;
  --hh-ink: #1b1b1b;
  --hh-bg: #fff8f3;
  --hh-card: #ffffff;
  --hh-border: rgba(0,0,0,.10);

  /* Dice sizing (overridden by breakpoints below) */
  --die-size: 56px;
  --die-gap: 10px;
}

/* Page background */
body{
  background:
    radial-gradient(900px 400px at 10% 0%, rgba(177,15,26,.12), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(11,107,58,.12), transparent 60%),
    linear-gradient(180deg, var(--hh-bg), #ffffff 40%);
  color: var(--hh-ink);
}

/* Header */
.hh-header{
  background: linear-gradient(90deg, var(--hh-red-dark), var(--hh-red));
  color: #fff;
  border-bottom: 3px solid rgba(212,162,26,.45);
}

.hh-title{
  font-weight: 800;
  letter-spacing: .4px;
}

.hh-subtitle{
  opacity: .9;
  font-size: .95rem;
}

/* Cards */
.hh-card{
  border: 1px solid var(--hh-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--hh-card);
}

.hh-label{
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .75;
}

.hh-value{
  font-weight: 700;
  font-size: 1.05rem;
}

.hh-total{
  font-weight: 900;
  font-size: 1.8rem;
}

.hh-muted{
  opacity: .75;
}

/* Buttons */
.btn-hh{
  background: var(--hh-green);
  color: #fff;
  border: 1px solid rgba(0,0,0,.08);
}

.btn-hh:hover{
  background: #095a31;
  color: #fff;
}

.btn-hh:disabled{
  opacity: .55;
  cursor: not-allowed;
}

.btn-hh-outline{
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.6);
}

.btn-hh-outline:hover{
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* Mini cards */
.hh-mini-card{
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.6));
}

/* =========================================================
   DICE (fixed-size row, centered, 130px on desktop)
   ========================================================= */

/* Mobile-first sizing */
.dice-grid{
  display: grid;
  grid-template-columns: repeat(5, var(--die-size));
  gap: 10px;
  justify-content: start; /* keeps them from stretching */
}

/* Dice tile */
.die{
  width: var(--die-size);
  height: var(--die-size);
  border: 2px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: #fff;
  padding: 0; /* keep size consistent */
  text-align: center;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .06s ease, border-color .2s ease, box-shadow .2s ease;


  /* IMPORTANT: keep container/card uncolored; color only on dice */
  background: #fff;

  padding: 0;
  text-align: center;
  cursor: pointer;
  user-select: none;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: transform .06s ease, border-color .2s ease, box-shadow .2s ease;
}

.die:active{
  transform: scale(.98);
}

.die .pip{
  font-size: var(--pip-size);
  line-height: 1;
}

.die .hold-badge{
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(177,15,26,.12);
  border: 1px solid rgba(177,15,26,.25);
  color: var(--hh-red-dark);
  display: none;
}

.die.held{
  border-color: rgba(177,15,26,.55);
  box-shadow: 0 0 0 4px rgba(177,15,26,.10);
  background: #fff; /* keep held dice neutral unless you want otherwise */
}

.die.held .hold-badge{
  display: inline-block;
}

.die.empty{
  opacity: .55;
  cursor: default;
}

/* ------- Dice-only color (NOT the container/card) ------- */
/* Only apply to real dice that are not held (so held styling stays clear) */
.die:not(.empty):not(.held){
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.80));
}

/* Slightly different accent per die, still dice-only */
.die:not(.empty):not(.held):nth-child(5n + 1){
  background: linear-gradient(180deg, rgba(212,162,26,.32), rgba(255,255,255,.86));
}
.die:not(.empty):not(.held):nth-child(5n + 2){
  background: linear-gradient(180deg, rgba(11,107,58,.28), rgba(255,255,255,.86));
}
.die:not(.empty):not(.held):nth-child(5n + 3){
  background: linear-gradient(180deg, rgba(177,15,26,.24), rgba(255,255,255,.86));
}
.die:not(.empty):not(.held):nth-child(5n + 4){
  background: linear-gradient(180deg, rgba(90,120,255,.22), rgba(255,255,255,.86));
}
.die:not(.empty):not(.held):nth-child(5n + 5){
  background: linear-gradient(180deg, rgba(180,80,255,.20), rgba(255,255,255,.86));
}

/* Hover pop (desktop-friendly, harmless on mobile) */
.die:not(.empty):hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
  border-color: rgba(0,0,0,.20);
}

/* Mobile tweaks */
@media (max-width: 480px){
  :root{
    --die-size: 56px;
    --die-gap: 8px;
  }
}

/* Desktop dice size request: 130px */
@media (min-width: 992px){
  :root{
    --die-size: 80px;/*130*/
    --die-gap: 10px;/*16*/
  }

  /* Prevent the last die from getting clipped inside the left card */
  main .row.g-4 > .col-12.col-lg-5 .hh-card{
    overflow: visible;
  }
}

/* =========================================================
   SCORE TABLE / PILLS
   ========================================================= */

.hh-table thead th{
  white-space: nowrap;
}

.score-row{
  cursor: pointer;
}

.score-row.locked{
  cursor: default;
  opacity: .9;
}

.score-row .pill{
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--hh-border);
  font-size: .85rem;
}

.pill-scored{
  background: rgba(11,107,58,.10);
  border-color: rgba(11,107,58,.25);
}

.pill-empty{
  background: rgba(0,0,0,.04);
}

.pill-warn{
  background: rgba(212,162,26,.12);
  border-color: rgba(212,162,26,.28);
}

/* =========================================================
   ACTIVE PLAYER HIGHLIGHT (stronger)
   ========================================================= */

.hh-active-player{
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(212,162,26,.18);
  border: 1px solid rgba(212,162,26,.35);
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(212,162,26,.16);
}

.hh-scoreboard{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.hh-scoreline{
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.65));
  position: relative;
}

.hh-scoreline .name{
  font-weight: 800;
}

.hh-scoreline .meta{
  display: flex;
  gap: 10px;
  align-items: center;
}

.hh-scoreline .tag{
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--hh-border);
  background: rgba(0,0,0,.04);
  opacity: .9;
}

.hh-scoreline.active{
  border-color: rgba(11,107,58,.55);
  background: linear-gradient(90deg, rgba(11,107,58,.16), rgba(255,255,255,.85));
  box-shadow: 0 0 0 4px rgba(11,107,58,.10), 0 10px 18px rgba(0,0,0,.10);
}

.hh-scoreline.active::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hh-gold), var(--hh-green));
}

/* =========================================================
   Fullscreen privacy overlay
   ========================================================= */

.hh-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}

.hh-overlay-card{
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
}

.hh-overlay-title{
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}

.hh-overlay-name{
  font-weight: 950;
  font-size: 2.0rem;
  margin: 6px 0 10px;
  color: var(--hh-red-dark);
}

/* High scores list */
.hh-highscores{
  display: grid;
  gap: 8px;
}

.hh-highscore-item{
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, rgba(255,255,255,.65));
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.hh-highscore-item .left{
  display: grid;
  gap: 2px;
}

.hh-highscore-item .winner{
  font-weight: 900;
}

.hh-highscore-item .meta{
  font-size: .85rem;
  opacity: .75;
}

.hh-highscore-item .score{
  font-weight: 950;
  font-size: 1.05rem;
  white-space: nowrap;
}
/* =========================================================
   FIX: 130px dice but DO NOT overflow the left column
   - switch dice layout to flex-wrap on desktop
   ========================================================= */

@media (min-width: 992px){
  :root{
    --die-size: 70px; /* 130px*/
    --die-gap: 10px;/*16*/
  }

  /* Let the dice wrap instead of overflowing off the card */
  .dice-grid{
    display: flex;              /* override grid */
    flex-wrap: wrap;            /* key: allows 3+2 layout */
    justify-content: center;    /* center each row */
    align-items: center;
    gap: var(--die-gap);
    width: 100%;
    margin: 0 auto;
  }

  /* Dice are fixed size and won't shrink */
  .die{
    width: var(--die-size);
    height: var(--die-size);
    flex: 0 0 var(--die-size);  /* fixed tile width */
  }

  /* If your card was clipping effects, keep this */
  main .row.g-4 > .col-12.col-lg-5 .hh-card{
    overflow: visible;
  }
}

.die-svg { width: 82%; height: 82%; }
.die .pip { display:flex; align-items:center; justify-content:center; width:100%; height:100%; }
/* Light blue tint ONLY for dice + scoreboard cards */
:root{
  --hh-soft-blue: rgba(235, 245, 255, 0.85);   /* very light */
  --hh-soft-blue-2: rgba(255, 255, 255, 0.75); /* gentle blend */
}

/* Dice card: #diceGrid lives inside it */
#diceGrid{
  /* apply tint to the card that contains the dice grid */
}
#diceGrid.closest-card-fix{} /* (noop for old browsers) */

/* Most reliable: target the card by its content */
#diceGrid,
#scoreboard{
  /* nothing here yet; used below with :has */
}

/* Modern browsers (Chrome/Edge/Safari): tint the parent card */
.hh-card:has(#diceGrid),
.hh-card:has(#scoreboard){
  background: linear-gradient(180deg, var(--hh-soft-blue), var(--hh-soft-blue-2));
}

/* Make sure inner mini cards don’t get washed out */
.hh-card:has(#diceGrid) .hh-mini-card,
.hh-card:has(#scoreboard) .hh-mini-card{
  background: rgba(255,255,255,.72);
}
/* =====================================================
   Soft blue background for Dice, Scoreboard, ScoreCard
   ===================================================== */

:root{
  --hh-soft-blue: rgba(232, 242, 255, 0.88);   /* very subtle blue */
  --hh-soft-white: rgba(255,255,255,0.75);     /* blend so it’s not harsh */
}

/* Tint ONLY the cards that contain these sections */
.hh-card:has(#diceGrid),
.hh-card:has(#scoreboard),
.hh-card:has(#scoreTableBody){
  background: linear-gradient(180deg, var(--hh-soft-blue), var(--hh-soft-white));
}

/* Keep mini-cards readable on the tint */
.hh-card:has(#diceGrid) .hh-mini-card,
.hh-card:has(#scoreboard) .hh-mini-card,
.hh-card:has(#scoreTableBody) .hh-mini-card{
  background: rgba(255,255,255,.78);
}
@media (max-width: 480px){
  :root{
    --die-size: 56px;/*56*/
    --pip-size: 1.75rem;/*1.75rem*/
  }
}
.hh-standings-row{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--hh-border);
  border-radius: 12px;
  background: rgba(0,0,0,.03);
  margin-top: 8px;
}
.hh-standings-row .left{
  display:flex;
  gap: 10px;
  align-items: baseline;
}
.hh-standings-row .rank{
  font-weight: 950;
  color: var(--hh-red-dark);
}
.hh-standings-row .name{
  font-weight: 900;
}
.hh-standings-row .score{
  font-weight: 950;
}


