:root{
  --bg:#f7f4ea;
  --text:#222;
  --accent:#ff6f3d;
  --accent-dark:#e45724;
  --muted:#777;
  --card:#ffffff;
  --border:#e6e2d6;
}

*{box-sizing:border-box}
html,body{margin:0; padding:0; background:var(--bg); color:var(--text); font-family:system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif}
/* Fondo de la página */
body{
  background-image:url('./fondo.png');
  background-repeat:repeat;
  background-size:auto;
}

.topbar{
  position:sticky; top:0; z-index:10;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  padding:32px 12px;
  /* Fondo del encabezado */
  background-image:url('./fondo.png');
  background-repeat:repeat;
  background-size:auto;
}

.title{
  margin:0 0 16px 0;
  text-align:center;
  font-size:28px;
  letter-spacing:1px;
}

.mode-nav{
  display:flex; gap:8px; justify-content:center; align-items:center;
}

.mode-btn{
  appearance:none; border:1px solid #000; background:#000; color:#fff;
  padding:10px 16px; border-radius:999px; font-weight:600; cursor:pointer;
}

.mode-btn:hover{ border-color:#000}
.mode-btn.active{ background:#000; color:#fff; border-color:#000}

#app{ padding:16px; max-width:900px; margin:0 auto}

.home{
  display:flex; flex-direction:column; align-items:center; gap:16px; text-align:center;
}

.subtitle{ color:var(--muted); font-size:16px}

.dice-area{
  display:flex; gap:24px; justify-content:center; align-items:center; flex-wrap:wrap; margin:8px 0 4px;
  perspective:800px;
}

.die{
  width:150px; height:150px; max-width:40vw; max-height:40vw;
  background:#000;
  border:2px solid var(--border);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:700; text-align:center; padding:12px;
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
  user-select:none; cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
  transform-style:preserve-3d;
  color:#fff;
  background-image:url('./logo crema.png');
  background-size:60%;
  background-repeat:no-repeat;
  background-position:center;
}

/* Golden color for initial mode labels on dice */
.die .die-text.initial-mode{
  color:#d4af37;
}

.die.no-logo{
  background-image:none;
}

.die.static{ cursor:default}
.die:hover{ box-shadow:0 10px 20px rgba(0,0,0,0.1)}
.die.spin{ animation:roll 1.2s cubic-bezier(.3,.7,.2,1) 0s 1 both }

.die.post-shot{
  background:#000;
  color:#fff;
  background-image:url('./logo crema.png');
  background-size:60%;
  background-repeat:no-repeat;
  background-position:center;
}

@keyframes roll{
  0%{ transform:rotateX(0deg) rotateY(0deg) scale(1) }
  50%{ transform:rotateX(540deg) rotateY(360deg) scale(0.98) }
  100%{ transform:rotateX(900deg) rotateY(720deg) scale(1) }
}

.tip{ color:var(--muted); text-align:center }

.footer{
  padding:20px 20px 100px 20px; display:flex; justify-content:center; border-top:1px solid var(--border); margin-top:24px;
  background-image:url('./fondo.png');
  background-repeat:repeat;
  background-size:auto;
}

.club-btn{
  display:inline-block; background:#000; color:#fff; text-decoration:none; padding:12px 18px;
  border-radius:999px; font-weight:700;
  margin-bottom:241.92px;
}

.mode-header{
  display:flex; align-items:center; justify-content:center; gap:12px; margin:8px 0 12px;
  flex-wrap:wrap;
}

.mode-chip{
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0;
  font-weight:700;
}

.game-select{
  appearance:none; border:1px solid var(--border); background:var(--card); padding:8px 12px; border-radius:10px; font-weight:600;
}

.lock{
  position:absolute; bottom:10px; right:10px; font-size:11px; color:var(--muted);
}

/* Modal */
.modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; }
.modal.hidden{ display:none }
.modal:not(.hidden){ display:flex }
.modal-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.35)}
.modal-card{
  position:relative; z-index:1; background:#000; border:1px solid var(--border);
  border-radius:16px; padding:16px; max-width:90vw; width:520px; box-shadow:0 10px 24px rgba(0,0,0,0.18);
  color:#fff;
}

.modal-content{ font-size:18px; text-align:center; margin-bottom:12px}
.modal-title{ margin:0 0 8px 0; font-size:20px; color:#d4af37; font-weight:800; }
.modal-phrase{ margin:0; color:#fff; }

.close-modal{
  appearance:none; border:none; background:#d4af37; color:#000; padding:10px 16px; border-radius:10px; font-weight:700; cursor:pointer;
  display:block;
  margin:0 auto;
}

/* Responsive tweaks */
@media (min-width:700px){
  .title{ font-size:32px}
  .die{ width:180px; height:180px; font-size:22px}
}