:root{
  --bg1:#0b1020;
  --bg2:#101a36;
  --glass: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.16);
}

.bg-app{
  background: radial-gradient(1200px 900px at 20% 10%, #2b3cff33, transparent 60%),
              radial-gradient(900px 800px at 85% 30%, #ff2bb433, transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  color: #fff;
}

/* Default = mobile-first: no scroll, game first */
.no-scroll{
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.glass{
  background: linear-gradient(180deg, var(--glass), rgba(255,255,255,.04));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}

.app-title{
  font-weight: 800;
  letter-spacing: .6px;
  font-size: 1.35rem;
}
.app-subtitle{
  color: rgba(255,255,255,.65);
  font-size: .9rem;
}

/* ----------------
   MOBILE LAYOUT
   ---------------- */
.game-shell{
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

.board-wrap{
  position: absolute;
  inset: 0;
  padding: 10px;
  padding-bottom: 170px; /* space for HUD overlay (mobile) */
  box-sizing: border-box;
}

.board-canvas{
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
}

/* 🔥 Canvas HD real */
.board-canvas canvas{
  width: 100%;
  height: 100%;

  image-rendering: auto;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

/* HUD OVERLAY (mobile) */
.hud-overlay{
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 12px;
  z-index: 20;
}

.hud-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-code{ font-weight: 700; }

.hud-players{
  font-size: .9rem;
  color: rgba(255,255,255,.75);
}
.hud-players .sep{
  margin: 0 .35rem;
  color: rgba(255,255,255,.35);
}

.hud-right{
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-menu{
  border-radius: 12px;
}

.actionbar{
  margin-top: 10px;
}

/* Inputs */
input.form-control, .input-group-text{
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.14) !important;
  color: #fff !important;
}
input.form-control::placeholder{ color: rgba(255,255,255,.45); }

.btn-primary{
  background: linear-gradient(135deg, #5b7cff, #b45bff);
  border: 0;
}
.btn-primary:hover{ filter: brightness(1.06); }

/* ----------------
   DESKTOP LAYOUT
   - "como antes": tablero grande + panel a la derecha
   - sin overlay abajo
   ---------------- */
@media (min-width: 992px){
  /* Convertimos el shell en grid (tablero + panel) */
  .game-shell{
    position: static;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    padding: 18px;
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
  }

  /* Board se vuelve “normal” dentro del grid */
  .board-wrap{
    position: relative;
    inset: auto;
    padding: 0;
    padding-bottom: 0;
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
  }

  .board-canvas{
    height: 100%;
  }

  /* HUD deja de ser overlay y pasa a panel lateral */
  .hud-overlay{
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    overflow: auto; /* si el panel crece, scrollea el panel, no la página */
    padding: 14px;
  }

  /* En desktop no queremos “look mobile”: más aire, tipografías */
  .hud-players{ font-size: 1rem; }
  .actionbar{ margin-top: 14px; }

  /* El offcanvas sigue existiendo, pero lo vas a usar menos en desktop */
}
