/* Square1 pages. Colors, radii and the lip come from the game's design tokens (tokens.json): cream only, no dark mode (Nipun). */
@font-face { font-family: Gabarito; font-weight: 700; font-display: swap; src: url(assets/Gabarito-700.ttf) format("truetype"); }
@font-face { font-family: Gabarito; font-weight: 800; font-display: swap; src: url(assets/Gabarito-800.ttf) format("truetype"); }
@font-face { font-family: Gabarito; font-weight: 900; font-display: swap; src: url(assets/Gabarito-900.ttf) format("truetype"); }

:root {
  color-scheme: light;
  --bg: #FBF3E7; --grid: #F3E8D9; --ink: #5A4038; --ink-muted: #8A6F64;
  --card: #FFFFFF; --card-lip: #E6D9C8; --accent: #EE5140; --accent-lip: #C73A2B; --on-accent: #FFFFFF;
  --note: #FFD15C; --note-ink: #5A4038;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--bg);
  /* the faint grid of tiles: 58 px pitch, 55 px tile, 9 px corners */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58' height='58'%3E%3Crect x='1.5' y='1.5' width='55' height='55' rx='9' fill='%23000' fill-opacity='.035'/%3E%3C/svg%3E");
  font: 700 17px/1.6 Gabarito, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }

header.site { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
header.site img { width: 48px; height: 48px; border-radius: 11px; display: block; }
header.site a.name { font-weight: 900; font-size: 26px; letter-spacing: -0.5px; color: var(--ink); text-decoration: none; }
header.site nav { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
header.site nav a { color: var(--ink-muted); text-decoration: none; font-weight: 900; font-size: 14px; }
header.site nav a[aria-current] { color: var(--ink); }

.card { background: var(--card); border-radius: 16px; box-shadow: 0 7px 0 var(--card-lip); padding: 28px 24px; }
h1 { font-weight: 900; font-size: 38px; line-height: 46px; letter-spacing: -0.5px; margin: 0 0 4px; }
h2 { font-weight: 900; font-size: 24px; line-height: 28px; margin: 36px 0 8px; }
h3 { font-weight: 900; font-size: 18px; margin: 20px 0 4px; }
p, ul, table { margin: 0 0 14px; }
ul { padding-left: 22px; }
li { margin-bottom: 6px; }
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1px; font-weight: 900; font-size: 14px; color: var(--ink-muted); margin: 0 0 20px; }
.lead { font-size: 19px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 2px solid var(--grid); }
th { font-weight: 900; color: var(--ink-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.scroll { overflow-x: auto; }

.button {
  display: inline-block; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 20px;
  padding: 12px 24px; border-radius: 16px; box-shadow: 0 7px 0 var(--accent-lip); text-decoration: none; margin: 4px 12px 14px 0;
}
.button:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--accent-lip); }
.button.quiet { background: var(--card); color: var(--ink); box-shadow: 0 7px 0 var(--card-lip), 0 0 0 2px var(--grid) inset; }

/* Something the owner still has to fill in before this page goes live. Loud on purpose. */
.todo { background: var(--note); color: var(--note-ink); border-radius: 6px; padding: 0 6px; }

footer.site { margin-top: 32px; color: var(--ink-muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
footer.site a { color: var(--ink-muted); }

/* ---------- Home page ---------- */
:root {
  --pink: #FF9DB5; --pink-lip: #E0708D; --blue: #8CCBF2; --blue-lip: #5FA5D4;
  --yellow: #FFD15C; --yellow-lip: #E0A92E; --green: #8FDDB8; --green-lip: #5FB98E;
  --square: #FF6B5A; --square-lip: #D94A3B; --flag: #3DBE6E; --flag-lip: #2E9A57;
}
.wrap.wide { max-width: 1120px; }
.home h1.title { font-size: clamp(44px, 7vw, 76px); line-height: 0.98; letter-spacing: -1.5px; margin: 0 0 18px; }
.home h1.title .hl { color: var(--square); display: inline-block; animation: hop 2.4s cubic-bezier(.3,.7,.4,1) infinite; }
@keyframes hop { 0%, 60%, 100% { transform: none; } 70% { transform: translateY(-14px) rotate(-6deg); } 80% { transform: translateY(0) rotate(0); } 86% { transform: translateY(-4px); } }

.hero { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; margin: 12px 0 72px; }
.hero .lead { max-width: 30em; color: var(--ink); }
.stores { margin-top: 26px; }

.play { position: relative; margin: 0; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.play canvas { display: block; width: 100%; aspect-ratio: 16 / 10; cursor: crosshair; touch-action: manipulation; }
.play-hud { position: absolute; top: 6px; right: 10px; font-weight: 900; font-size: 22px; color: var(--ink); pointer-events: none; }
.play-hud .tap-word { font-size: 14px; color: var(--ink-muted); }
.play-win { position: absolute; inset: 0; display: grid; place-content: start center; padding-top: 4%; justify-items: center; gap: 6px; pointer-events: none; }
.play-win[hidden] { display: none; }
.play-win b { font-weight: 900; font-size: 40px; color: var(--ink); background: var(--yellow); padding: 4px 22px; border-radius: 14px; box-shadow: 0 6px 0 var(--yellow-lip); animation: pop .35s cubic-bezier(.3,1.6,.5,1); }
.play-win .stars { font-size: 30px; letter-spacing: 4px; color: var(--yellow); text-shadow: 0 3px 0 var(--yellow-lip); }
.play-win .stars i { font-style: normal; color: var(--star-empty, #E6D9C8); text-shadow: none; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.play figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; color: var(--ink-muted); font-weight: 800; font-size: 15px; }
.play figcaption .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--square); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { transform: scale(1.6); opacity: .35; } }

.shots { margin: 0 -16px 80px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shot-row { display: flex; gap: 28px; justify-content: center; padding: 18px 16px 30px; min-width: min-content; }
.phone { margin: 0; flex: 0 0 auto; width: 230px; border-radius: 34px; padding: 7px; background: var(--card); box-shadow: 0 9px 0 var(--card-lip), 0 0 0 2px var(--grid) inset; scroll-snap-align: center; transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.phone img { display: block; width: 100%; height: auto; border-radius: 28px; }
.phone.tilt-l { transform: rotate(-3deg); }
.phone.tilt-r { transform: rotate(3deg) translateY(18px); }
.phone:hover { transform: rotate(0) translateY(-6px) scale(1.03); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 80px; }
.tile { border-radius: 18px; padding: 22px 22px 18px; color: #4A3530; }
.tile.pink { background: var(--pink); box-shadow: 0 8px 0 var(--pink-lip); }
.tile.blue { background: var(--blue); box-shadow: 0 8px 0 var(--blue-lip); }
.tile.yellow { background: var(--yellow); box-shadow: 0 8px 0 var(--yellow-lip); }
.tile h2 { margin: 14px 0 4px; font-size: 24px; }
.tile p { margin: 0; font-size: 16px; line-height: 1.45; }
.tile-face { height: 64px; display: flex; align-items: center; }
.mini { display: block; position: relative; }
.mini.eyes-tall { width: 60px; height: 60px; border-radius: 14px; background: var(--square); box-shadow: 0 6px 0 var(--square-lip); }
.mini.eyes-tall::before, .mini.eyes-tall::after { content: ""; position: absolute; top: 18px; width: 9px; height: 20px; border-radius: 5px; background: #fff; animation: look 4s ease-in-out infinite; }
.mini.eyes-tall::before { left: 16px; } .mini.eyes-tall::after { right: 16px; }
@keyframes look { 0%, 40%, 100% { transform: none; } 45%, 47% { transform: scaleY(.1); } 50%, 80% { transform: translateX(5px); } }
.mini.stars3 { display: flex; gap: 6px; }
.mini.stars3 b { width: 40px; height: 40px; background: #fff; clip-path: polygon(50% 0, 63% 35%, 100% 38%, 71% 61%, 81% 100%, 50% 78%, 19% 100%, 29% 61%, 0 38%, 37% 35%); }
.mini.stars3 b:nth-child(1) { background: var(--yellow); }
.mini.stars3 b:nth-child(2) { background: var(--yellow); transform: translateY(-8px) scale(1.15); }
.mini.flame { width: 44px; height: 56px; background: #FF8A3D; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; clip-path: path("M22 0 C30 14 44 24 44 38 C44 50 34 56 22 56 C10 56 0 50 0 38 C0 24 14 14 22 0 Z"); animation: flick 1.2s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.mini.flame::after { content: ""; position: absolute; left: 13px; bottom: 6px; width: 18px; height: 22px; background: #FFD15C; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
@keyframes flick { to { transform: scale(1.06, .94) rotate(2deg); } }

.outro { text-align: center; margin-bottom: 40px; }
.outro p:first-child { font-weight: 900; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; max-width: 20em; margin: 0 auto 10px; }
.outro .small { color: var(--ink-muted); font-size: 15px; }
.home footer.site { justify-content: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 20px; margin-bottom: 48px; }
  .play canvas { aspect-ratio: 10 / 8.5; }
  .shot-row { justify-content: flex-start; }
  .phone { width: 200px; }
  .tiles { grid-template-columns: 1fr; gap: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
