/* The community level gallery: the Maker's look (Mario Maker 2 spirit),
   on its own page. Fonts come from the Maker (/fonts/). */

@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url("/fonts/LuckiestGuy.woff2") format("woff2"); font-display: block; }

:root {
  --sun: #ffd21f; --sun-2: #ffc70a;
  --orange: #ff8a1f; --orange-deep: #e06a00; --orange-soft: #fff1d6;
  --white: #fff; --cloud: #f7f2e6; --line: #eadfc4;
  --ink: #3b2f22; --muted: #8a7760; --night: #262a3d;
  --shadow: rgba(122, 76, 0, 0.32);
  --ui: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh;
  /* A calm cream, the stripes barely there. */
  background: repeating-linear-gradient(135deg, #fff8e6 0 26px, #fff3d9 26px 52px) fixed;
  color: var(--ink);
  font: 500 15px/1.4 var(--ui);
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  background: var(--white); border: 0; border-radius: 14px;
  box-shadow: 0 4px 0 var(--shadow);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 90ms, box-shadow 90ms;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--shadow); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }
.btn.go { background: var(--orange); color: var(--white); box-shadow: 0 4px 0 var(--orange-deep); }

/* header */
.top {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
  max-width: 1180px; margin: 0 auto; padding: 24px 20px 12px;
}
.logo { width: 230px; image-rendering: pixelated; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.2)); }
.logo-link { display: block; min-width: 230px; min-height: 60px; }
.top h1 { margin: 0 0 4px; font: 700 clamp(24px, 3vw, 34px) var(--ui); }
.top p { margin: 0; max-width: 560px; }
.top-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

main { max-width: 1180px; margin: 0 auto; padding: 8px 20px 40px; }

/* search and sorting */
.tools {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 12px; margin-bottom: 12px;
  background: var(--white); border-radius: 18px; box-shadow: 0 5px 0 var(--shadow);
}
.tools input, .tools select {
  padding: 8px 12px;
  background: var(--cloud); border: 3px solid var(--line); border-radius: 12px; outline: none;
}
.tools input:focus, .tools select:focus { border-color: var(--orange); background: var(--white); }
#search { flex: 1; min-width: 180px; }
.code-form { display: flex; gap: 8px; }
#code { width: 230px; text-transform: uppercase; letter-spacing: 0.08em; }
.sorts { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tab {
  padding: 5px 14px;
  background: var(--white); box-shadow: 0 2px 0 var(--line); border: 0; border-radius: 999px;
  font-weight: 600; color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--orange); color: var(--white); box-shadow: 0 3px 0 var(--orange-deep); }

/* level cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column;
  background: var(--white); border-radius: 20px; overflow: hidden;
  box-shadow: 0 6px 0 var(--shadow);
}
.thumb { display: block; width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; background: var(--night); }
.info { padding: 12px 14px 14px; display: grid; gap: 4px; }
.info h2 { margin: 0; font: 700 19px/1.2 var(--ui); overflow-wrap: anywhere; }
.info p { margin: 0; }
.meta, .stats { color: var(--muted); font-size: 13px; }
.stars { color: var(--orange-deep); letter-spacing: 1px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn.code { letter-spacing: 0.06em; background: var(--cloud); box-shadow: 0 3px 0 var(--line); }

.card.big { display: grid; grid-template-columns: minmax(0, 512px) 1fr; }
.card.big .info { padding: 20px; align-content: start; }
.card.big h2 { font-size: 28px; }
.featured-title { margin: 0 0 10px; font: 700 20px var(--ui); }
#featured { margin-bottom: 26px; }

.empty { text-align: center; padding: 30px; font-size: 17px; background: rgba(255, 255, 255, 0.85); border-radius: 18px; }
.more { display: flex; margin: 22px auto 0; }

footer.bottom { max-width: 900px; margin: 0 auto; padding: 10px 20px 30px; text-align: center; font-size: 13px; }
footer.bottom p { margin: 0 0 6px; }
footer.bottom a { color: var(--orange-deep); font-weight: 700; text-decoration: none; }
footer.bottom a:hover { text-decoration: underline; }
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); max-width: calc(100vw - 40px); text-align: center;
  padding: 9px 20px; background: var(--white); border: 3px solid var(--orange); border-radius: 999px;
  box-shadow: 0 5px 0 var(--shadow); font-weight: 600;
}

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .top-links { justify-content: center; }
  .card.big { grid-template-columns: 1fr; }
}
