/* PicTiles website — same look as the game: soft grey-blue ground, cobalt tiles, coral accent, rounded type.
   Fonts are hosted here (SIL Open Font License), nothing is loaded from other servers. */
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-800-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 800; font-display: swap; src: url(fonts/baloo-2-latin-ext-800-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url(fonts/nunito-latin-900-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url(fonts/nunito-latin-ext-900-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f2f5f8; --glow: #d3e2fa; --surface: #ffffff; --band: #e9eef5; --line: #dfe5ee;
  --ink: #19212f; --muted: #5d6779; --tile: #1c4f8a; --tile-hi: #2a64a8; --tile-lo: #123a68;
  --coral: #ff6a4d; --coral-deep: #d94a2f; --sun: #ffc233; --mint: #19c49a; --grape: #8b5cf6;
  --shadow: 0 10px 30px rgba(20, 40, 80, .10); --phone: #19212f;
  --display: "Baloo 2", "Hiragino Maru Gothic ProN", "Nunito", ui-rounded, system-ui, sans-serif;
  --text: "Nunito", "Hiragino Maru Gothic ProN", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --glow: #15284a; --surface: #182130; --band: #1e293a; --line: #2a3546;
    --ink: #eef3fa; --muted: #a3afc2; --tile: #8fb6ff; --tile-hi: #a9c8ff; --tile-lo: #5f86cf;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --phone: #000000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --glow: #15284a; --surface: #182130; --band: #1e293a; --line: #2a3546;
  --ink: #eef3fa; --muted: #a3afc2; --tile: #8fb6ff; --tile-hi: #a9c8ff; --tile-lo: #5f86cf;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35); --phone: #000000; color-scheme: dark;
}
:lang(ja) { --display: "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", "Hiragino Sans", "Noto Sans JP", sans-serif; --text: var(--display); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 700 17px/1.55 var(--text); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 100% at 50% 0%, var(--glow), transparent 75%); }
/* hidden for a moment while the language is applied; shown anyway after a second if the script never runs */
html.pending body { visibility: hidden; animation: reveal 0s 1s forwards; }
@keyframes reveal { to { visibility: visible; } }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 3px 0 var(--coral-deep)); }
.wordmark { font: 800 28px/1 "Baloo 2", var(--display); letter-spacing: -.01em; }
.wordmark b { color: var(--coral); font-weight: 800; }
.lang { position: relative; }
.lang select { appearance: none; -webkit-appearance: none; font: 800 14px/1 var(--text); color: var(--ink); background: var(--surface); border: 0; border-radius: 14px;
  padding: 11px 34px 11px 14px; box-shadow: var(--shadow); cursor: pointer; }
.lang::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; padding: 28px 0 56px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 900 13px/1 var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--coral); }
:lang(ja) .eyebrow { letter-spacing: .02em; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) p, :lang(ja) summary { word-break: auto-phrase; line-break: strict; }
h1 { font: 800 clamp(38px, 6vw, 62px)/1.02 var(--display); margin: 14px 0 18px; letter-spacing: -.015em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--tile); }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 26px; max-width: 34em; }
.store { display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: 18px; background: var(--ink); color: var(--bg);
  text-decoration: none; box-shadow: 0 5px 0 rgba(0, 0, 0, .25); }
.store svg { width: 30px; height: 30px; flex: none; }
.store small { display: block; font: 800 12px/1.2 var(--text); opacity: .75; }
.store strong { display: block; font: 800 20px/1.1 var(--display); }
.note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }

/* phones */
/* the tilted phones may poke out a little: clip them to the column so the page never scrolls sideways */
.phones { position: relative; height: 560px; overflow: clip; overflow-clip-margin: 24px; }
.phone { position: absolute; width: 250px; border-radius: 38px; padding: 9px; background: var(--phone); box-shadow: 0 30px 60px rgba(20, 40, 80, .28); }
.phone img { width: 100%; height: auto; aspect-ratio: 640 / 1385; object-fit: cover; border-radius: 30px; background: #f2f5f8; }
.phones .phone:nth-child(1) { left: 2%; top: 46px; transform: rotate(-7deg); }
.phones .phone:nth-child(2) { right: 4%; top: 0; transform: rotate(5deg); z-index: 2; }

/* features */
section { padding: 40px 0; }
h2 { font: 800 clamp(30px, 4.4vw, 42px)/1.08 var(--display); margin: 0 0 24px; text-wrap: balance; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); }
.feature .ic { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; }
.feature .ic svg { width: 26px; height: 26px; }
.feature h3 { font: 800 21px/1.2 var(--display); margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }
.ic.c1 { background: linear-gradient(145deg, var(--tile-hi), var(--tile)); box-shadow: 0 4px 0 var(--tile-lo); }
.ic.c2 { background: linear-gradient(145deg, #b596ff, var(--grape)); box-shadow: 0 4px 0 #6a45dd; }
.ic.c3 { background: linear-gradient(145deg, #ffd66b, var(--sun)); box-shadow: 0 4px 0 #d6960a; color: #5a3d00; }
.ic.c4 { background: linear-gradient(145deg, #ff8a70, var(--coral)); box-shadow: 0 4px 0 var(--coral-deep); }
.ic.c5 { background: linear-gradient(145deg, #5ef3cc, var(--mint)); box-shadow: 0 4px 0 #0f936f; }
.ic.c6 { background: linear-gradient(145deg, #6aa8ff, #2f7de1); box-shadow: 0 4px 0 #1e5bb0; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.shot { text-align: center; }
.shot .phone { position: relative; width: 100%; max-width: 280px; margin: 0 auto 14px; }
.shot p { margin: 0; font: 800 18px/1.3 var(--display); }

/* faq */
.faq { display: grid; gap: 12px; max-width: 760px; }
.faq details { background: var(--surface); border-radius: 20px; padding: 18px 22px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font: 800 19px/1.3 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 800 24px/1 var(--display); color: var(--coral); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* footer */
footer { margin-top: 40px; padding: 30px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; }
footer b { color: var(--ink); }
footer a { color: var(--ink); text-underline-offset: 3px; }
footer nav { display: flex; flex-direction: column; gap: 6px; }

/* legal page */
.legal { max-width: 760px; padding: 10px 0 20px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); }
.legal h2 { font-size: 24px; margin: 34px 0 8px; }
.legal p, .legal li { color: var(--ink); font-weight: 700; }
.legal p { margin: 0 0 12px; }
.legal ul { padding-left: 22px; margin: 0 0 12px; }
.legal .meta { color: var(--muted); }
.legal article[hidden] { display: none; }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; text-decoration: none; color: var(--tile); margin: 6px 0 4px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 12px; gap: 8px; }
  .phones { height: 470px; max-width: 420px; width: 100%; margin: 10px auto 0; }
  .phone { width: 205px; border-radius: 32px; padding: 8px; }
  .phone img { border-radius: 25px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shots { grid-template-columns: minmax(0, 1fr); max-width: 320px; margin: 0 auto; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .phones { height: 400px; }
  .phone { width: 172px; }
  .wordmark { font-size: 24px; }
  .brand svg { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: no-preference) {
  .phones .phone { transition: transform .4s cubic-bezier(.2, 1.3, .4, 1); }
  .phones:hover .phone:nth-child(1) { transform: rotate(-9deg) translateY(-6px); }
  .phones:hover .phone:nth-child(2) { transform: rotate(7deg) translateY(-6px); }
}

/* friend's puzzle page (/p/#p<code>) */
.gift { max-width: 560px; margin: 0 auto; padding: 28px 0 10px; text-align: center; }
.gift .lead { margin: 0 auto 26px; }
.gift h1 { font-size: clamp(34px, 8vw, 52px); }
.gift-tiles { display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; justify-content: center; margin: 6px auto 22px; }
.gift-tiles i { height: 34px; border-radius: 9px; background: var(--band); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06); }
.gift-tiles i:nth-child(1), .gift-tiles i:nth-child(3), .gift-tiles i:nth-child(5), .gift-tiles i:nth-child(8) {
  background: linear-gradient(var(--tile-hi), var(--tile)); box-shadow: inset 0 -3px 0 var(--tile-lo); }
.gift-tiles i:nth-child(5) { background: linear-gradient(#ff8a70, var(--coral)); box-shadow: inset 0 -3px 0 var(--coral-deep); }
.open-app { margin: 0 auto 18px; text-decoration: none; }
.open-app[hidden], #hasCode[hidden], #noCode[hidden] { display: none; }
.code-card { background: var(--surface); border-radius: 26px; padding: 20px; box-shadow: var(--shadow); text-align: left; display: grid; gap: 12px; }
.code-card label { font: 900 13px/1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
:lang(ja) .code-card label { letter-spacing: .02em; }
.code-card textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg); color: var(--ink);
  font: 700 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.code-card .copy { justify-self: start; border: 0; border-radius: 14px; padding: 12px 20px; cursor: pointer; background: var(--coral); color: #fff;
  font: 800 16px/1 var(--display); box-shadow: 0 4px 0 var(--coral-deep); }
.code-card .copy:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--coral-deep); }
.code-card .copy.done { background: var(--mint); box-shadow: 0 4px 0 #11916f; }
.code-card .note { margin: 0; }
.get { margin: 34px 0 0; display: grid; justify-items: center; gap: 12px; }
