/* Pixel Arena — game page styles (doodle redesign) */

@import url("https://fonts.googleapis.com/css2?family=Bagel+Fat+One&family=Fredoka:wght@400;500;600;700&display=swap");

:root {
  --cream:    #FFF6E5;
  --cream-2:  #FFEDC9;
  --ink:      #1B1B2F;
  --ink-soft: #2D2D44;
  --pink:     #FF4D8D;
  --yellow:   #FFD23F;
  --orange:   #FF7A45;
  --teal:     #00A896;
  --lime:     #C4E538;
  --plum:     #5B2A86;
  --sky:      #4FC3F7;
  --good:     #00A896;
  --warn:     #FF7A45;
  --danger:   #FF4D8D;

  --shadow-1: 4px 4px 0 var(--ink);
  --shadow-2: 6px 6px 0 var(--ink);
  --shadow-3: 8px 8px 0 var(--ink);

  --border:        3px solid var(--ink);
  --border-thick:  4px solid var(--ink);

  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 26px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  background-image: radial-gradient(rgba(27,27,47,.07) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.05;
  color: var(--ink);
}

/* ---- Top nav ---- */
.gtopnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--cream);
  border-bottom: var(--border);
}
.gtopnav .brand {
  display: flex; align-items: center; gap: 12px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 24px;
  transform: rotate(-2deg);
  transition: transform .15s;
}
.gtopnav .brand:hover { transform: rotate(0) scale(1.02); }
.gtopnav .brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--yellow);
  border: var(--border);
  display: grid; place-items: center;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  font-size: 16px;
  transform: rotate(4deg);
}
.gtopnav .brand-name span { color: var(--pink); }

.gback {
  margin-left: auto;
  height: 44px; padding: 0 18px;
  border-radius: 999px;
  background: white;
  border: var(--border);
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-1);
  transition: transform .08s, box-shadow .12s;
}
.gback:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-2); }

/* ---- Page ---- */
.gpage {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px 70px;
}
.gheader {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.gheader h1 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 42px;
  letter-spacing: 0.005em;
  text-shadow: 4px 4px 0 var(--cream-2);
}
.gheader .gsubtitle {
  color: var(--ink-soft);
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
}

.ghud {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.gstat {
  background: white;
  border: var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  min-width: 100px;
  box-shadow: var(--shadow-1);
}
.gstat:nth-child(2n) { transform: rotate(2deg); }
.gstat:nth-child(3n) { transform: rotate(-2deg); }
.gstat .label {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.gstat .value {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 28px;
  letter-spacing: 0.005em;
  margin-top: 2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.gstat .value.good { color: var(--teal); }
.gstat .value.warn { color: var(--orange); }

/* ---- Game frame ---- */
.gframe {
  background: white;
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: grid;
  place-items: center;
  position: relative;
  min-height: 460px;
  box-shadow: var(--shadow-3);
}
.gframe canvas {
  display: block;
  background: var(--ink);
  border-radius: var(--radius);
  border: var(--border);
  max-width: 100%;
  touch-action: none;
}

/* ---- Buttons (game page) ---- */
.gcontrols {
  display: flex; gap: 12px; flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}
.gbtn {
  height: 46px; padding: 0 22px;
  border-radius: 999px;
  border: var(--border);
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-1);
  transition: transform .08s, box-shadow .12s;
}
.gbtn:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-2); }
.gbtn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.gbtn.primary { background: var(--pink); color: white; }
.gbtn.primary:hover { background: var(--pink); }
.gbtn:disabled { opacity: .5; cursor: not-allowed; }

/* Native select restyled to match button */
select.gbtn {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) center,
    calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

/* ---- Hint card ---- */
.ghint {
  margin-top: 26px;
  background: var(--cream-2);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-1);
  transform: rotate(-0.5deg);
}
.ghint h3 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.ghint p { font-size: 15px; font-weight: 500; color: var(--ink); }
.ghint kbd {
  display: inline-block;
  padding: 3px 10px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ---- Overlay (game over / start screen) ---- */
.goverlay {
  position: absolute;
  inset: 22px;
  background: var(--cream);
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  display: grid; place-items: center;
  text-align: center;
  z-index: 10;
}
.goverlay-inner { padding: 28px; max-width: 90%; }
.goverlay h2 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 36px;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 var(--yellow);
}
.goverlay p {
  color: var(--ink-soft);
  margin-bottom: 22px;
  font-weight: 600;
  font-size: 16px;
}

/* ---- Footer ---- */
.gfoot {
  margin-top: 42px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.gfoot a {
  color: var(--pink);
  font-weight: 700;
}

@media (max-width: 700px) {
  .gheader h1 { font-size: 30px; }
  .gpage { padding: 18px 14px 50px; }
  .gframe { padding: 14px; }
}

/* ============ Game description (added below frame) ============ */
.game-desc {
  max-width: 760px;
  margin: 28px auto 0;
  background: white;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 4px 4px 0 var(--ink);
}
.game-desc h2 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--ink);
}
.game-desc p {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 12px;
  color: var(--ink);
}
.game-desc p:last-child { margin-bottom: 0; }

.game-desc .related-games {
  margin-top: 14px !important;
  padding-top: 14px;
  border-top: 2px dashed rgba(27,27,47,.18);
  font-size: 14px;
}
.game-desc .related-games strong {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-weight: 400;
  margin-right: 6px;
}
.game-desc a {
  color: var(--pink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.game-desc a:hover {
  color: var(--ink);
  background: var(--yellow);
}
