/* Jaguar-skin theme for the games: tan fur, brown spots, red-and-white paws,
   chunky pixel borders like a Minecraft skin's outer layer. */
:root {
  --fur: #e2c46b;
  --fur-light: #f2dc8e;
  --fur-shade: #c9a64e;
  --spot: #6b4a22;
  --spot-light: #8a6430;
  --paw: #c8241e;
  --paw-dark: #8f1712;
  --claw: #f4f4f4;
  --outline: #2b1d0c;
  --px: 4px;
  --pixel-font: "Press Start 2P", ui-monospace, monospace;
}

/* Pixel jaguar-spot fur, tiled */
.skin-page { min-height: 100vh; background-color: var(--fur); background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' shape-rendering='crispEdges'><rect width='160' height='160' fill='%23e2c46b'/><rect x='24' y='24' width='16' height='16' fill='%236b4a22'/><rect x='40' y='32' width='8' height='8' fill='%238a6430'/><rect x='96' y='16' width='8' height='16' fill='%236b4a22'/><rect x='104' y='16' width='8' height='8' fill='%238a6430'/><rect x='120' y='72' width='16' height='16' fill='%236b4a22'/><rect x='64' y='88' width='8' height='8' fill='%236b4a22'/><rect x='16' y='112' width='16' height='8' fill='%238a6430'/><rect x='24' y='120' width='8' height='8' fill='%236b4a22'/><rect x='136' y='136' width='8' height='8' fill='%236b4a22'/><rect x='80' y='136' width='8' height='8' fill='%23c9a64e'/><rect x='8' y='64' width='8' height='8' fill='%23c9a64e'/><rect x='144' y='40' width='8' height='8' fill='%23c9a64e'/></svg>"); background-size: 160px 160px; }

.skin-page .nav { background: rgba(43, 29, 12, 0.92); }

.pixel-title {
  font-family: var(--pixel-font);
  color: var(--outline);
  text-shadow: var(--px) var(--px) 0 var(--fur-light);
  line-height: 1.4;
}

/* A panel with a stepped, pixel-art border */
.px-panel {
  background: var(--fur-light);
  color: var(--outline);
  border: var(--px) solid var(--outline);
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--fur-shade),
    inset var(--px) var(--px) 0 #fff3c4,
    var(--px) var(--px) 0 var(--outline);
  image-rendering: pixelated;
}

.px-btn {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.8rem 1rem;
  background: var(--paw);
  color: var(--claw);
  border: var(--px) solid var(--outline);
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--paw-dark),
    inset var(--px) var(--px) 0 #e8544d;
  cursor: pointer;
  text-transform: uppercase;
}
.px-btn:hover { filter: brightness(1.08); }
.px-btn:active { box-shadow: inset var(--px) var(--px) 0 var(--paw-dark); }
.px-btn.alt {
  background: var(--fur);
  color: var(--outline);
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 var(--fur-shade),
    inset var(--px) var(--px) 0 var(--fur-light);
}
.px-btn[aria-pressed="true"], .px-btn.active {
  background: var(--spot);
  color: var(--fur-light);
  box-shadow: inset var(--px) var(--px) 0 var(--outline);
}

.games-wrap { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.games-head { padding: 1.5rem; margin-bottom: 1.5rem; text-align: center; }
.games-head h1 { font-size: clamp(1.1rem, 3.5vw, 1.8rem); margin-bottom: 0.75rem; }
.games-head p { font-size: 0.95rem; }

.game-tabs { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-bottom: 1.5rem; }

.game-area { padding: 1.25rem; display: grid; gap: 1rem; justify-items: center; }
.game-area[hidden] { display: none !important; }
.game-bar {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; justify-content: center;
  font-family: var(--pixel-font); font-size: 0.7rem;
}
.game-bar .stat b { color: var(--paw); }
.game-help { font-size: 0.9rem; text-align: center; max-width: 520px; }

.game-canvas {
  display: block;
  image-rendering: pixelated;
  border: var(--px) solid var(--outline);
  box-shadow: var(--px) var(--px) 0 var(--outline);
  background: var(--fur-light);
  max-width: 100%;
  height: auto;
  touch-action: none;
}

.game-stage { position: relative; }
.game-overlay {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 1rem;
  background: rgba(43, 29, 12, 0.72);
  color: var(--fur-light);
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
}
.game-overlay[hidden] { display: none; }
.game-overlay .big { font-size: 1.1rem; color: var(--claw); }

.touch-pad { display: none; gap: 0.4rem; grid-template-columns: repeat(3, 56px); }
.touch-pad .px-btn { padding: 0; height: 56px; font-size: 1rem; }
.touch-pad .blank { visibility: hidden; }
@media (hover: none), (max-width: 700px) { .touch-pad { display: grid; } }

.side-by-side { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.next-box { padding: 0.75rem; display: grid; gap: 0.5rem; justify-items: center; font-family: var(--pixel-font); font-size: 0.6rem; }

/* Minesweeper grid uses buttons for accessibility */
.mines-grid {
  display: grid;
  border: var(--px) solid var(--outline);
  box-shadow: var(--px) var(--px) 0 var(--outline);
  background: var(--outline);
  gap: 1px;
  user-select: none;
  touch-action: manipulation;
}
.mine-cell {
  width: var(--cell, 32px); height: var(--cell, 32px);
  border: 0; padding: 0; margin: 0;
  font-family: var(--pixel-font); font-size: calc(var(--cell, 32px) * 0.42);
  display: grid; place-items: center;
  cursor: pointer;
  background: var(--fur);
  --bev: clamp(1px, calc(var(--cell, 32px) * 0.09), 3px);
  box-shadow: inset calc(var(--bev) * -1) calc(var(--bev) * -1) 0 rgba(0, 0, 0, 0.22), inset var(--bev) var(--bev) 0 rgba(255, 255, 255, 0.22);
  color: var(--outline);
}
.mine-cell.spotted { background: var(--fur) radial-gradient(circle at 30% 35%, var(--spot) 0 18%, transparent 19%); }
.mine-cell:hover:not(.open) { filter: brightness(1.06); }
.mine-cell.open { background: var(--fur-light); box-shadow: none; cursor: default; }
.mine-cell.mine { background: var(--paw); color: var(--claw); }
.mine-cell.flag { color: #fff; text-shadow: 0 0 3px #000, 1px 1px 0 #000, -1px -1px 0 #000; }
.n1 { color: #1d5fa8 !important; } .n2 { color: #2c7a2c !important; } .n3 { color: var(--paw) !important; }
.n4 { color: #2b2a85 !important; } .n5 { color: #7a1c1c !important; } .n6 { color: #1c7070 !important; }
.n7 { color: #111 !important; } .n8 { color: #666 !important; }

.px-select {
  font-family: var(--pixel-font); font-size: 0.6rem;
  background: var(--fur); color: var(--outline);
  border: var(--px) solid var(--outline); padding: 0.5rem;
}

/* Global leaderboards */
.leaderboard { width: min(420px, 100%); padding: 1rem 1.1rem; display: grid; gap: 0.6rem; }
.lb-title { font-family: var(--pixel-font); font-size: 0.65rem; text-align: center; color: var(--paw); }
.lb-list { list-style: none; display: grid; gap: 0.3rem; margin: 0; padding: 0; }
.lb-row {
  display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; background: var(--fur);
  box-shadow: inset -2px -2px 0 var(--fur-shade), inset 2px 2px 0 #fff3c4;
  font-size: 0.9rem;
}
.lb-row:nth-child(1) .lb-rank { color: #b8860b; }
.lb-me { outline: 3px solid var(--paw); }
.lb-rank { font-family: var(--pixel-font); font-size: 0.6rem; }
.lb-name { display: flex; align-items: center; gap: 0.4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.lb-avatar { image-rendering: auto; border: 2px solid var(--outline); }
.lb-score { font-family: var(--pixel-font); font-size: 0.65rem; color: var(--spot); }
.lb-empty { text-align: center; font-size: 0.85rem; padding: 0.5rem; }
.lb-foot { font-size: 0.8rem; text-align: center; }
.lb-foot a { color: var(--paw); text-decoration: underline; font-weight: 700; }

/* Big boards scroll sideways on small screens instead of squashing */
.game-stage:has(.mines-grid) { max-width: 100%; overflow-x: auto; }

a.lb-name { color: inherit; text-decoration: none; }
a.lb-name:hover { text-decoration: underline; }
