/* Pixel Arena — playful 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;
  --coral:    #FF6F61;

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

  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 26px;

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

  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Background pattern: subtle dot grid */
body {
  background-image:
    radial-gradient(rgba(27,27,47,.07) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

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

/* ============ Top nav ============ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 26px;
  letter-spacing: -0.01em;
  transform: rotate(-2deg);
  transition: transform .15s;
}
.brand:hover { transform: rotate(0deg) scale(1.02); }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--yellow);
  border: var(--border);
  display: grid; place-items: center;
  font-weight: 900; color: var(--ink);
  box-shadow: var(--shadow-1);
  font-size: 18px;
  transform: rotate(4deg);
}

.brand-name { color: var(--ink); }
.brand-name span { color: var(--pink); }

.search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  background: white;
  border: var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow-1);
  transition: transform .08s, box-shadow .12s;
}
.search input::placeholder { color: rgba(27,27,47,.45); }
.search input:focus { transform: translate(-2px,-2px); box-shadow: var(--shadow-2); }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink); pointer-events: none;
}

.topnav-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }

.btn {
  height: 44px;
  padding: 0 20px;
  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;
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }

.btn-primary { background: var(--pink); color: white; }
.btn-primary:hover { background: var(--pink); }

.btn-yellow  { background: var(--yellow); color: var(--ink); }
.btn-teal    { background: var(--teal); color: white; }
.btn-orange  { background: var(--orange); color: white; }

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - 76px);
}

.sidebar {
  background: var(--cream);
  border-right: var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow-y: auto;
}
.sidebar-section + .sidebar-section { margin-top: 22px; padding-top: 18px; border-top: 2px dashed rgba(27,27,47,.25); }
.sidebar-title {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  padding: 0 12px 10px;
  letter-spacing: 0.01em;
}

.cat-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border: 2px solid transparent;
  background: transparent;
  width: 100%; text-align: left;
  font-family: inherit;
  transition: transform .08s, background .12s, border-color .12s, box-shadow .12s;
}
.cat-link:hover {
  background: white;
  border-color: var(--ink);
  transform: translate(-1px,-1px);
}
.cat-link.active {
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
  box-shadow: var(--shadow-1);
  transform: translate(-1px,-1px) rotate(-1deg);
}
.cat-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--ink);
}
.cat-link.active .cat-icon { color: var(--yellow); }

/* ============ Main ============ */
.main {
  padding: 28px 30px 80px;
  max-width: 1500px;
  width: 100%;
  position: relative;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: visible;
  height: 360px;
  margin-bottom: 50px;
  background: var(--yellow);
  border: var(--border-thick);
  box-shadow: var(--shadow-3);
  isolation: isolate;
  transition: background .35s;
}
.hero-shapes {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  z-index: 0;
}
.hero-shape {
  position: absolute;
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.hero-shape.s1 { width: 180px; height: 180px; top: -40px; right: 10%; background: var(--pink); transform: rotate(8deg); }
.hero-shape.s2 { width: 120px; height: 120px; bottom: -30px; right: 30%; background: var(--teal); }
.hero-shape.s3 { width: 90px; height: 90px; top: 30%; right: -30px; background: var(--lime); border-radius: 18px; transform: rotate(20deg); }
.hero-shape.s4 { width: 60px; height: 60px; bottom: 20%; right: 18%; background: var(--orange); border-radius: 12px; transform: rotate(-12deg); }

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 60%;
}
.hero-eyebrow {
  display: inline-block;
  align-self: flex-start;
  background: var(--ink);
  color: var(--yellow);
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  letter-spacing: 0.06em;
  transform: rotate(-2deg);
}
.hero-title {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 0.95;
  margin-bottom: 14px;
  color: var(--ink);
  text-shadow: 4px 4px 0 var(--cream);
}
.hero-tag {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 480px;
}
.hero-cta {
  align-self: flex-start;
  height: 52px;
  padding: 0 28px;
  font-size: 17px;
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
  box-shadow: var(--shadow-2);
}
.hero-cta:hover { background: var(--ink); color: var(--pink); }

.hero-dots {
  position: absolute;
  bottom: 16px; right: 22px;
  display: flex; gap: 8px;
  z-index: 3;
}
.hero-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background .12s, transform .12s;
}
.hero-dot.active { background: var(--ink); transform: scale(1.25); }

/* ============ Section header ============ */
.section { margin-bottom: 48px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 3px dashed rgba(27,27,47,.25);
}
.section-title {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 30px;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.section-title em {
  font-style: normal;
  display: inline-block;
  background: var(--lime);
  padding: 2px 12px;
  border: var(--border);
  border-radius: 999px;
  transform: rotate(-2deg);
  margin: 0 4px;
  box-shadow: 3px 3px 0 var(--ink);
}
.section-tag {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pink);
  color: white;
  border: 2px solid var(--ink);
  letter-spacing: 0.06em;
  transform: rotate(-3deg);
}
.section-count {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  margin-left: auto;
  background: white;
  padding: 4px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
}

/* ============ Game grid ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
}

/* ============ Tile (sticker card) ============ */
.tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  border: var(--border);
  box-shadow: var(--shadow-2);
  aspect-ratio: 1 / 1.15;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  transform: rotate(var(--tilt, 0deg));
}
.tile:hover {
  transform: rotate(0deg) translate(-3px,-3px);
  box-shadow: var(--shadow-3);
}
.tile-art {
  position: absolute;
  inset: 0 0 38% 0;
  background: linear-gradient(135deg, var(--c1, var(--pink)), var(--c2, var(--orange)));
  border-bottom: var(--border);
}
.tile-art::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.35), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,.18), transparent 45%);
}
/* Doodle squiggle in top-right of art */
.tile-art::after {
  content: "";
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  opacity: .85;
}
.tile-glyph {
  position: absolute;
  left: 0; right: 0;
  top: 0; bottom: 38%;
  display: grid;
  place-items: center;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 64px;
  color: white;
  letter-spacing: -0.02em;
  text-shadow: 3px 3px 0 rgba(27,27,47,.4);
  pointer-events: none;
}
.tile-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  padding: 12px 14px;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.tile-title {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.005em;
}
.tile-cat {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tile-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-family: "Bagel Fat One", system-ui, sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  color: var(--ink);
  letter-spacing: 0.06em;
  transform: rotate(-6deg);
  box-shadow: 2px 2px 0 var(--ink);
  z-index: 2;
}
.tile-badge.new      { background: var(--lime); }
.tile-badge.trending { background: var(--pink); color: white; }
.tile-badge.play     { background: var(--teal); color: white; }

/* ============ Footer ============ */
.footer {
  border-top: var(--border);
  padding: 30px 30px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  background: var(--cream-2);
  font-weight: 500;
  color: var(--ink);
}
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-weight: 700; }
.footer-links a:hover { color: var(--pink); }

/* ============ Mobile ============ */
.mobile-toggle { display: none; }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 76px;
    width: 270px;
    height: calc(100vh - 76px);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s;
    background: var(--cream);
    border-right: var(--border);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle {
    display: inline-flex;
    width: 44px; height: 44px;
    border-radius: 12px;
    border: var(--border);
    background: white;
    color: var(--ink);
    align-items: center; justify-content: center;
    box-shadow: var(--shadow-1);
  }
  .hero { height: 280px; margin-bottom: 36px; }
  .hero-content { padding: 28px; max-width: 100%; }
  .main { padding: 18px 16px 50px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .topnav { padding: 12px 14px; gap: 10px; }
  .brand-name { display: none; }
  .section-title { font-size: 24px; }
}

/* ============ Empty state ============ */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
  background: white;
  border: 3px dashed rgba(27,27,47,.3);
  border-radius: var(--radius);
}
.empty h3 {
  font-family: "Bagel Fat One", system-ui, sans-serif;
  color: var(--ink);
  font-size: 26px;
  margin-bottom: 8px;
}
