/* Jogo Leve — Percas. A wooden board look, four pens, a track, and a die. */

.jl-percas {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #241a10 0%, #120d08 70%);
  color: #f0e7d8;
  overflow: hidden;
}

.jl-pc-col {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 6px 6px 8px;
}

.jl-pc-hud { display: flex; gap: 14px; padding: 2px 2px 6px; }
.jl-pc-stat { display: flex; align-items: baseline; gap: 6px; }
.jl-pc-lab { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #9b8767; }
.jl-pc-val { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: #ffd54f; }

/* ---- the board: a square 15x15 grid, sized by the smaller axis ---- */
.jl-pc-board {
  position: relative;
  flex: 0 1 auto;
  width: min(100%, 52vh, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  background: #1d150d;
  border: 1px solid #3a2b1a;
  border-radius: 10px;
  overflow: hidden;
}

/* The pens are four quadrants drawn behind the track. */
.jl-pc-pens {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.jl-pc-pen {
  margin: 5%;
  border-radius: 10px;
  border: 2px solid var(--pen);
  background: color-mix(in srgb, var(--pen) 14%, transparent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  padding: 12%;
  gap: 8%;
}
.jl-pc-pentok {
  width: 100%;
  aspect-ratio: 1;
  max-width: 22px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .4);
}
.jl-pc-pentok.jl-pc-out { background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12); }
.jl-pc-pentok.jl-pc-turn { outline: 2px solid #ffd54f; outline-offset: 1px; }

/* The track is a 15x15 grid layered over the pens, with nodes only where the cross runs. */
.jl-pc-track {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
}

.jl-pc-cell {
  position: relative;
  border: 1px solid #3a2b1a;
  background: #2a1f13;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jl-pc-cell.jl-pc-safe { background: #332617; }

/* A token: a circle that fills most of its cell. */
.jl-pc-tok {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .5);
  border: 1.5px solid rgba(255, 255, 255, .35);
}
.jl-pc-tok.jl-pc-turn { box-shadow: 0 0 0 2px #ffd54f, inset 0 -2px 4px rgba(0, 0, 0, .45); }

/* A cell the player may tap to move a token. */
.jl-pc-cell.jl-pc-pickable {
  background: rgba(255, 213, 79, .22);
  box-shadow: inset 0 0 0 2px #ffd54f;
  cursor: pointer;
  animation: jl-pc-pulse 1.1s ease-in-out infinite;
}
@keyframes jl-pc-pulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 213, 79, .55); }
  50% { box-shadow: inset 0 0 0 2.5px rgba(255, 213, 79, 1); }
}

/* ---- the foot: turn line, die, roll button ---- */
.jl-pc-foot { flex: 0 0 auto; padding-top: 8px; }
.jl-pc-turnline {
  margin: 0 0 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  min-height: 18px;
}
.jl-pc-dierow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.jl-pc-die {
  width: 44px; height: 44px;
  border-radius: 9px;
  background: #f4efe4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 5px;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}
.jl-pc-pip { background: #1a1208; border-radius: 50%; }
.jl-pc-nopip { background: transparent; }

.jl-pc-roll {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #d8a72b;
  color: #1a1208;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.jl-pc-roll:active:not(:disabled) { background: #bd901f; }
.jl-pc-roll:disabled { opacity: .45; cursor: default; }
.jl-pc-roll:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- the veil ---- */
.jl-pc-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 7, 4, .96);
  z-index: 5;
}
.jl-pc-veil[hidden] { display: none; }
.jl-pc-box { width: 100%; max-width: 320px; text-align: center; }
.jl-pc-box h2 { margin: 0 0 8px; font-size: 21px; }
.jl-pc-sub { margin: 0 0 16px; font-size: 13px; color: #b6a184; line-height: 1.5; }
.jl-pc-go {
  width: 100%; min-height: 48px;
  border: 0; border-radius: 11px;
  background: #ffd54f; color: #1a1208;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.jl-pc-go:active { background: #e8bf3d; }
.jl-pc-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .jl-pc-cell.jl-pc-pickable { animation: none; }
}

@media (max-height: 460px) {
  .jl-pc-board { width: min(100%, 54vh, 340px); }
  .jl-pc-foot { padding-top: 4px; }
  .jl-pc-turnline { margin-bottom: 4px; }
}
