/* The public site. Colours, type and the "sticker" button follow docs/tiki-style-guide.md,
   so the frame feels like the games inside it. */

:root {
  --sand: #FFF4E0;
  --deep: #0E2A35;
  --coral: #FF6B5E;
  --teal: #1FB89B;
  --sky: #87CEEB;
  --gold: #FFD447;
  --gold-hi: #FFE082;
  --gold-edge: #C99A17;
  --gold-lip: #A97F10;
  --cream: #FFF6DF;
  --wood: #6B4A2B;
  --wood-lip: #3A2816;
  --muted: rgba(14, 42, 53, .64);
  --lip: rgba(14, 42, 53, .16);
  --display: 'Luckiest Guy', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --body: 'Nunito', ui-rounded, 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* Hidden means hidden, even for a class like .btn that sets its own display. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.5;
  color: var(--deep);
  /* A sunny sky fading into sand. */
  background: linear-gradient(#BDE6F6 0, #E4F1E6 260px, var(--sand) 520px) no-repeat var(--sand);
}

a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 250, 240, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(14, 42, 53, .06);
}

.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; }

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  padding-top: 4px; /* the display face sits high on its line */
}
.wordmark-flower { font-size: 24px; margin-right: 8px; }
.wordmark-games { color: var(--coral); }

.site-nav { display: flex; align-items: center; gap: 18px; font-weight: 900; }
.site-nav a:not(.btn) { text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--coral); }

/* Sticker button: a hard lip underneath, and it presses down. */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  color: var(--deep);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  padding: 13px 30px 10px;
  border-radius: 14px;
  border: 3px solid var(--gold-edge);
  background: linear-gradient(var(--gold-hi), var(--gold));
  box-shadow: 0 5px 0 var(--gold-lip);
  transition: transform .07s, box-shadow .07s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-lip); }
.btn:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }
.btn[disabled] { cursor: default; filter: saturate(.55); opacity: .8; transform: none; }

.btn-small { font-size: 16px; padding: 9px 16px 6px; border-radius: 12px; border-width: 2px; box-shadow: 0 4px 0 var(--gold-lip); }
.btn-small:active { transform: translateY(3px); }

.btn-cream { background: #fff; border-color: #D9CDB2; box-shadow: 0 5px 0 #BDAF90; }
.btn-cream:active { box-shadow: 0 1px 0 #BDAF90; }
.btn-cream.btn-small { box-shadow: 0 4px 0 #BDAF90; }

/* Hero */

.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1;
  letter-spacing: .01em;
  max-width: 13em;
  margin: 0 auto;
}
.hero-accent { color: var(--coral); }
.hero p { max-width: 34em; margin: 18px auto 0; font-size: 18px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 28px; }

.collage { display: none; }

@media (min-width: 940px) {
  .hero-with-collage { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 36px; text-align: left; padding: 64px 0 44px; }
  .hero-with-collage h1 { margin: 0; }
  .hero-with-collage p { margin-left: 0; }
  .hero-with-collage .hero-actions { justify-content: flex-start; }

  .collage { display: block; position: relative; height: 340px; }
  .collage-shot {
    position: absolute;
    width: 62%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 5px solid #fff;
    border-radius: 18px;
    box-shadow: 0 8px 0 var(--lip), 0 18px 36px rgba(14, 42, 53, .18);
  }
  .collage-0 { left: 0; top: 6px; transform: rotate(-6deg); }
  .collage-1 { right: 0; top: 54px; transform: rotate(5deg); z-index: 1; }
  .collage-2 { left: 14%; bottom: 0; transform: rotate(-1.5deg); z-index: 2; }
}

/* Shelves of cards */

.shelf { padding: 26px 0 10px; }
.shelf-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 18px;
}
.price-tag {
  font-family: var(--body);
  font-weight: 900;
  font-size: 14px;
  color: var(--deep);
  background: var(--gold);
  border-radius: 999px;
  padding: 3px 12px;
  box-shadow: 0 3px 0 var(--gold-lip);
  transform: rotate(-3deg);
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.empty { color: var(--muted); }

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--lip);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--lip); }
.card:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--lip); }
.card:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }

.card-shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* Seen only until a game has a screenshot. */
  background: linear-gradient(135deg, var(--gold), var(--coral));
}
.card-members .card-shot { background: linear-gradient(135deg, var(--teal), var(--deep)); }
.card-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .18)); }

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 12px;
  font-weight: 900;
  color: var(--deep);
  background: var(--gold);
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 0 3px 0 var(--gold-lip);
}

.card-body { padding: 14px 16px 16px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 18px; font-weight: 900; line-height: 1.25; }
.card-tagline { margin-top: 4px; font-size: 14px; color: var(--muted); }

.pill { flex: none; font-size: 12px; font-weight: 900; color: #fff; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill-free { background: var(--teal); }
.pill-members { background: var(--deep); }
/* A members game that is free for everyone for now. */
.pill-open { color: var(--deep); background: var(--gold); box-shadow: 0 2px 0 var(--gold-lip); }
.pill-age { color: var(--deep); background: var(--cream); box-shadow: inset 0 0 0 2px var(--lip); }
.pills { flex: none; display: flex; gap: 6px; }
.card-age { position: absolute; left: 10px; bottom: 10px; box-shadow: inset 0 0 0 2px var(--lip), 0 3px 0 var(--lip); }

/* Panel: dark teal framed like carved wood, as in the games' menus. */

.pitch { display: grid; place-items: center; padding: 56px 0 30px; }
.panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 34px 36px 36px;
  border-radius: 22px;
  color: var(--cream);
  background: var(--deep);
  border: 4px solid var(--wood);
  box-shadow: 0 10px 0 var(--wood-lip), 0 20px 50px rgba(0, 0, 0, .25);
}
.panel h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.panel p { margin: 14px 0 22px; }
.panel .panel-note { margin: 16px 0 0; font-size: 13px; opacity: .7; }

/* A panel holding a form: the sign-in pages. */

.panel-form { max-width: 440px; }
.panel-form h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  margin-bottom: 18px;
}
.panel-form form { display: grid; gap: 16px; text-align: left; }
.panel-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 900; letter-spacing: .02em; }
.panel-form input:not([type=hidden]) {
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--deep);
  background: var(--cream);
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
}
.panel-form input:focus-visible { outline: none; border-color: var(--gold); }
.panel-form .btn { justify-self: center; margin-top: 6px; }
.panel-form .form-hint { font-size: 13px; font-weight: 700; letter-spacing: 0; opacity: .75; }
.panel-form .form-lede { margin: 0 0 16px; }
.panel-form .form-terms { margin: 0; text-align: center; }
.panel-form .form-terms a { color: var(--cream); }
.panel-form .form-error, .panel-form .form-notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.panel-form .form-error { color: #3A0000; background: #FFB3AC; }
.panel-form .form-notice { color: var(--deep); background: #BDEFE2; }
.panel .panel-links { margin: 22px 0 0; font-size: 14px; line-height: 1.9; }
.panel .panel-links a, .text-button { color: var(--cream); }
.panel .panel-links a:hover, .text-button:hover { color: var(--gold); }
.panel-form form.panel-links { display: block; text-align: center; }
/* A button that reads as a link, for actions that must be posted. */
.text-button { font: inherit; font-size: 14px; padding: 0; border: 0; background: none; text-decoration: underline; cursor: pointer; }

/* The account page. */
.panel-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .35);
}
.panel .account-email { margin: 10px 0 18px; opacity: .8; overflow-wrap: anywhere; }
.panel > .form-notice, .panel > .form-error { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.panel > .form-error { color: #3A0000; background: #FFB3AC; }
.panel > .form-notice { color: var(--deep); background: #BDEFE2; }

/* A game's page */

.game { padding-top: 18px; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 12px; }
.game-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; min-width: 0; }
.game-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 5vw, 38px); line-height: 1.1; padding-top: 4px; }
.game-tagline { color: var(--muted); }
.game-age { margin: -4px 0 14px; font-size: 15px; color: var(--muted); }
.game-age strong { color: var(--deep); }
.game-tools { flex: none; display: flex; align-items: center; gap: 14px; }
.back { font-weight: 900; text-decoration: none; white-space: nowrap; }
.back:hover { color: var(--coral); }

.game-open { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--gold-hi); border: 2px solid var(--gold-edge); }
.game-open a { color: inherit; font-weight: 900; }
.notice { margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--gold-hi); border: 2px solid var(--gold-edge); }

.player {
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  border: 4px solid var(--wood);
  box-shadow: 0 10px 0 var(--wood-lip);
}
/* As tall as the window allows: the header, the title row and the frame take about 11rem. */
.player iframe { display: block; width: 100%; height: calc(100dvh - 11rem); min-height: 520px; border: 0; }

/* Where the game can't go full screen (iPhones), it fills the window, under a wooden bar
   that holds the button to put it back. The bar sits outside the game so it hides none of
   the game's own buttons. */
.player-bar { display: none; }
.game-filled { overflow: hidden; }
.player.player-filled {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.player-filled .player-bar { display: flex; flex: none; align-items: flex-start; padding: 6px 8px 10px; background: var(--wood); }
.player.player-filled iframe { flex: 1; width: auto; height: auto; min-width: 0; min-height: 0; }
.player-exit { font-size: 18px; padding: 7px 12px 4px; }
/* A phone on its side is short, so there the bar runs down the left instead. */
@media (orientation: landscape) and (max-height: 500px) {
  .player.player-filled { flex-direction: row; }
  .player-filled .player-bar { padding: 8px 10px 8px 6px; }
}

.locked {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 40px 16px 50px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--deep);
}
.locked-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(5px) brightness(.6); transform: scale(1.06); }
.locked-icon { display: block; font-size: 44px; margin-bottom: 8px; }

/* How to play: the keyboard-and-mouse list, or the touch one on a touch screen. */
.howto { max-width: 46em; margin-top: 26px; font-size: 17px; }
.howto-title { margin-bottom: 10px; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.howto-list { padding-left: 1.3em; }
.howto-list li + li { margin-top: 6px; }
.howto-touch { display: none; }
@media (pointer: coarse) {
  .howto-touch { display: block; }
  .howto-keys { display: none; }
}

.about { max-width: 46em; margin-top: 26px; font-size: 17px; }
.about p + p { margin-top: 12px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shot { display: block; overflow: hidden; border-radius: 16px; border: 4px solid #fff; box-shadow: 0 5px 0 var(--lip); transition: transform .12s; }
.shot:hover { transform: translateY(-3px); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }

.lightbox { max-width: min(96vw, 1280px); padding: 0; border: 4px solid var(--wood); border-radius: 18px; background: var(--deep); box-shadow: 0 10px 0 var(--wood-lip); }
.lightbox::backdrop { background: rgba(10, 40, 60, .85); }
.lightbox img { display: block; max-width: 100%; max-height: 82vh; }
.lightbox form { display: flex; justify-content: center; padding: 12px 12px 16px; }

/* The pop-up a game's SAVE button opens for a player who isn't signed in: the sign-in pages,
   bare, in a frame over the game. */

/* On a short screen the frame scrolls, not the dialog, so the ✕ stays put. */
.savebox { width: min(460px, 94vw); max-height: none; padding: 0; border: 0; background: transparent; overflow: visible; }
.savebox::backdrop { background: rgba(10, 40, 60, .7); }
.savebox iframe { display: block; width: 100%; height: 520px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border: 0; background: transparent; color-scheme: light; }
.savebox-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--wood);
  font: 900 16px var(--body); color: var(--deep); background: var(--cream); cursor: pointer;
}
.savebox-close:hover { background: var(--gold); }
html.bare, html.bare body { min-height: 0; background: transparent; }
html.bare .pitch { padding: 4px 4px 16px; }

/* Long-form pages: the terms. */

.prose { max-width: 44em; padding: 36px 0 10px; font-size: 17px; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 6vw, 44px); line-height: 1; }
.prose h2 { font-size: 21px; font-weight: 900; margin: 30px 0 8px; }
.prose p { margin: 10px 0; }
.prose .prose-lede { margin-top: 14px; font-size: 19px; color: var(--muted); }
.prose ul { margin: 8px 0; padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose a { color: inherit; }

/* What's New */

.news { max-width: 920px; padding: 36px 0 10px; }
.news-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 6vw, 44px); line-height: 1; }
.news-lede { max-width: 34em; margin-top: 14px; font-size: 19px; color: var(--muted); }
.news-month { padding-top: 34px; }

.news-item {
  display: grid;
  margin-bottom: 22px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 0 var(--lip);
  scroll-margin-top: 92px;
}
/* The entry the home page pointed to. */
.news-item:target { outline: 4px solid var(--gold); outline-offset: 3px; }

.news-pic {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold), var(--coral));
}
.news-update .news-pic { background: linear-gradient(135deg, var(--sky), var(--teal)); }
.news-members .news-pic { background: linear-gradient(135deg, var(--teal), var(--deep)); }
.news-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.news-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .18)); }

.news-text { padding: 18px 20px 22px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--muted); }
.news-kind { font-size: 12px; font-weight: 900; color: #fff; background: var(--teal); border-radius: 999px; padding: 3px 10px; }
.news-game .news-kind { background: var(--coral); }
.news-launch .news-kind { color: var(--deep); background: var(--gold); box-shadow: 0 2px 0 var(--gold-lip); }
.news-title { margin-top: 10px; font-size: 22px; font-weight: 900; line-height: 1.2; }
.news-body p { margin-top: 8px; }
.news-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }

@media (min-width: 700px) {
  /* The picture beside the words, filling the entry's height. */
  .news-item { grid-template-columns: minmax(0, 300px) 1fr; }
  .news-pic { aspect-ratio: auto; min-height: 170px; }
  .news-text { padding: 20px 24px 24px; }
}

/* On the home page: the newest entry, while it is new. */
.news-flash {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-bottom: 22px;
  padding: 6px 16px 6px 6px;
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 4px 0 var(--lip);
  transition: transform .12s, box-shadow .12s;
}
.news-flash:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--lip); }
.news-flash:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }
.news-flash-tag { flex: none; font-size: 12px; font-weight: 900; color: #fff; background: var(--coral); border-radius: 999px; padding: 3px 10px; }
.news-flash-text { min-width: 0; }
.news-flash-arrow { flex: none; color: var(--coral); }

/* Footer */

.site-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 36px; padding-bottom: 36px; font-size: 14px; color: var(--muted); }
.site-footer a { color: inherit; }

@media (max-width: 720px) {
  /* The home page's pointer and the footer lead there instead. */
  .site-nav .nav-news { display: none; }
}

@media (max-width: 560px) {
  /* The header holds the wordmark, Sign in or Account, and the button, on one line. */
  .site-header-inner { height: 60px; gap: 8px; }
  .wordmark { font-size: 19px; }
  .wordmark-flower { display: none; }
  .site-nav { gap: 10px; font-size: 14px; white-space: nowrap; }
  .site-nav .nav-games { display: none; }
  .site-nav .btn-small { font-size: 13px; padding: 8px 9px 5px; }
  .hero { padding-top: 36px; }
  .game-head { flex-direction: column; align-items: flex-start; }
  .game-tools { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 10px 14px; }
  .player { border-radius: 16px; }
  .player iframe { height: calc(100dvh - 14.5rem); }
}

@media (max-width: 350px) {
  .wrap { padding: 0 12px; }
  .wordmark { font-size: 16px; }
  .site-nav { gap: 8px; font-size: 13px; }
  .site-nav .btn-small { font-size: 12px; padding: 7px 7px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .shot, .news-flash { transition: none; }
}
