/* Space Cactus Studios: one street with two doors. Grandma's house is MAY I?, the bar is MAY I? POKER.
   Big plain bold words (Nunito 800-900), pixel letters only for names, every button made of its place. */
@font-face { font-family: "Press Start 2P"; src: url("/fonts/PressStart2P.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  --night: #15101f; --ink: #1b1428; --cream: #fffaf0; --enamel: #fff3d6; --mustard: #e8a531;
  --red: #e8434d; --gold: #ffcc33; --cobalt: #1f4fa0; --pink: #ff4fa3; --stucco: #f1d3a8;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--night) url("/img/stars.png"); color: #fffdf6;
  font: 800 22px/1.35 Nunito, system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img.px { image-rendering: pixelated; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }

/* ---- The top bar: the studio, then three tabs. ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 40px; background: rgba(13, 9, 20, .86); border-bottom: 4px solid #000;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 64px; height: 64px; }
.brand span { font: 15px/1.6 "Press Start 2P"; color: var(--gold); text-shadow: 3px 3px 0 var(--red); }
.tabs { display: flex; gap: 14px; }
.tab {
  min-width: 150px; min-height: 64px; padding: 10px 22px; display: grid; place-items: center; text-align: center;
  font: 900 24px/1.05 Nunito; border-radius: 10px; position: relative;
}
.tab.home { background: var(--cream); color: var(--ink); outline: 3px dashed var(--red); outline-offset: -9px; }
.tab.mayi { background: var(--enamel); color: var(--cobalt); border: 6px solid transparent;
  border-image: url("/img/talavera.png") 12 round; border-radius: 0; }
.tab.poker { background: #170c14; color: #ffe6f3; border: 4px solid var(--pink);
  box-shadow: 0 0 12px var(--pink), inset 0 0 10px rgba(255, 79, 163, .55); text-shadow: 0 0 8px var(--pink); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 6px;
  background: var(--gold); box-shadow: 0 0 0 2px var(--ink); }

.foot { text-align: center; padding: 30px 20px 40px; color: #e9e2f5; font: 800 20px Nunito; }

/* ---- Home: the sky with the studio, then the street. ---- */
.sky { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 34px 20px 30px; }
.sky img { width: 132px; height: 132px; }
.sky h1 { font: 34px/1.35 "Press Start 2P"; color: var(--gold); text-shadow: 5px 5px 0 var(--red); margin: 0 0 12px; }
.sky p { margin: 0; font: 900 28px Nunito; }

.street { display: grid; grid-template-columns: 1fr 1fr; max-width: 1400px; margin: 0 auto; padding: 0 30px; align-items: stretch; }
.place { display: flex; flex-direction: column; align-items: center; padding: 0 26px; }
.place .say { font: 900 24px Nunito; margin: 16px 0 18px; text-align: center; }
.window { width: 100%; position: relative; display: block; }
.window img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.door { display: grid; place-items: center; width: min(100%, 470px); min-height: 96px; font: 900 32px Nunito;
  border-radius: 12px; margin-bottom: 28px; padding: 6px 36px; text-align: center; transition: transform .08s; }
.door:hover { transform: translateY(-2px); }
.door:active { transform: translateY(4px); }
.sidewalk { height: 40px; max-width: 1400px; width: 100%; margin: 0 auto;
  background: repeating-linear-gradient(90deg, #6d6672 0 120px, #57505c 120px 124px); border-top: 6px solid #8b8492; }
.road { height: 26px; max-width: 1400px; width: 100%; margin: 0 auto; background: #2a2530; }

/* Grandma's house: tile roof, stucco, a talavera band, gingham curtains, an enamel sign. */
.house { background: var(--stucco); border-radius: 8px 8px 0 0; color: var(--ink); box-shadow: inset 0 0 0 6px #e4bd86; }
.house .roof { align-self: stretch; height: 46px; margin: 0 -26px; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, #c4572f 0 26px, #a9452a 26px 30px); box-shadow: inset 0 -8px 0 #8a3520; }
.house .band { align-self: stretch; height: 34px; margin: 0 -26px 22px; background: url("/img/talavera.png") 0 0 / 34px; }
.house .sign { font: 34px/1 "Press Start 2P"; color: var(--gold);
  text-shadow: 4px 4px 0 var(--red), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  background: var(--cream); padding: 16px 22px; border: 5px solid var(--ink); border-radius: 8px; margin: 0 0 18px; }
.house .window { border: 14px solid #7a4a26; border-radius: 6px; box-shadow: 0 0 0 4px var(--ink); }
.house .window.curtains::before, .house .window.curtains::after { content: ""; position: absolute; top: -2px; bottom: -2px; width: 13%; z-index: 1;
  background: repeating-linear-gradient(90deg, rgba(232,67,77,.85) 0 10px, transparent 10px 20px),
              repeating-linear-gradient(0deg, rgba(232,67,77,.55) 0 10px, #fff 10px 20px); pointer-events: none; }
.house .window.curtains::before { left: -2px; clip-path: polygon(0 0, 100% 0, 40% 100%, 0 100%); }
.house .window.curtains::after { right: -2px; clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%); }
.enamel { background: var(--enamel); color: var(--ink); border: 7px solid var(--mustard);
  outline: 3px dashed var(--mustard); outline-offset: -17px; box-shadow: 0 7px 0 #a8701a; }

/* The bar: brick, a striped awning, a neon sign, a brass plate on the door. */
.bar { color: #fffdf6; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(0deg, #2a1712 0 4px, transparent 4px 34px),
              repeating-linear-gradient(90deg, #2a1712 0 4px, transparent 4px 64px), #6e2f22; }
.bar .awning { align-self: stretch; height: 46px; margin: 0 -26px; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, #1d1d24 0 40px, #3a1220 40px 80px); box-shadow: inset 0 -8px 0 #0e0e12; }
.neon { font: 34px/1 "Press Start 2P"; color: #fff0f7; padding: 16px 22px; border: 5px solid var(--pink); border-radius: 12px;
  background: rgba(20, 8, 16, .78); text-shadow: 0 0 6px var(--pink), 0 0 16px var(--pink), 0 0 30px var(--pink);
  box-shadow: 0 0 18px var(--pink), inset 0 0 14px rgba(255,79,163,.6); }
.bar .neon { margin: 34px 0 30px; }
.bar .window { border: 14px solid #15121a; border-radius: 6px; box-shadow: 0 0 0 4px #c9a24a, 0 0 30px rgba(57,224,255,.35); }
.bar .say { text-shadow: 0 2px 0 #000; }
.brass { color: var(--ink); border: 4px solid #7a5a1c; box-shadow: 0 7px 0 #5c4214, inset 0 2px 0 #fff2c4;
  background:   /* a screw in each corner */
    radial-gradient(circle at 16px 16px, #7a5a1c 5px, transparent 6px),
    radial-gradient(circle at calc(100% - 16px) 16px, #7a5a1c 5px, transparent 6px),
    radial-gradient(circle at 16px calc(100% - 16px), #7a5a1c 5px, transparent 6px),
    radial-gradient(circle at calc(100% - 16px) calc(100% - 16px), #7a5a1c 5px, transparent 6px),
    linear-gradient(#f1d27c, #c99b3e); }

/* ---- A game's page: its own wall, the game in the window, a big Play over the picture. ---- */
.stage { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 30px 10px; }
.stage .place { padding-bottom: 26px; border-radius: 0 0 8px 8px; }
.stage .title-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; margin: 0 0 20px; }
.stage .title-row .say { margin: 0; }
.stage .sign, .stage .bar .neon { margin: 0; }
.game { width: min(100%, calc((100vh - 330px) * 16 / 9)); min-width: min(100%, 640px); aspect-ratio: 16 / 9; position: relative; background: #000; }
.game img.poster { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(.82); }
.game .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(70%, 420px);
  min-height: 104px; margin: 0; font-size: 38px; z-index: 2; }
.game .play:hover { transform: translate(-50%, calc(-50% - 2px)); }
.game .play:active { transform: translate(-50%, calc(-50% + 4px)); }
.game iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.game .busy { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; z-index: 3;
  background: rgba(13, 9, 20, .9); color: #fffdf6; font: 900 26px/1.35 Nunito; }
.game .busy[hidden] { display: none; }
.game .busy button { margin-top: 18px; min-height: 76px; padding: 0 30px; font: 900 26px Nunito; border-radius: 12px; }
.controls { display: flex; gap: 16px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.controls button { min-height: 72px; padding: 0 28px; border-radius: 10px; font: 900 24px Nunito; }
.controls[hidden] { display: none; }
.cloth { background: var(--cream); color: var(--ink); border: 0; outline: 3px dashed var(--red); outline-offset: -9px; }
.notes { margin: 22px auto 0; max-width: 900px; text-align: center; font: 800 22px/1.45 Nunito; }
.notes p { margin: 6px 0; }

/* Playing on a phone: the game takes the whole screen; Back leaves it. */
body.playing-full { overflow: hidden; }
body.playing-full .game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; min-width: 0;
  aspect-ratio: auto; z-index: 50; border: 0; box-shadow: none; border-radius: 0; }
.hint { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; background: var(--cream); color: var(--ink);
  padding: 12px 20px; border-radius: 10px; font: 900 20px Nunito; outline: 3px dashed var(--red); outline-offset: -7px;
  transition: opacity .6s; pointer-events: none; }
.hint.gone { opacity: 0; }

.lost { text-align: center; padding: 60px 20px; }
.lost h1 { font: 30px/1.4 "Press Start 2P"; color: var(--gold); text-shadow: 4px 4px 0 var(--red); }
.lost .door { margin: 30px auto 0; }

@media (max-width: 760px) {
  body { font-size: 20px; }
  .top { flex-direction: column; align-items: stretch; padding: 12px 14px 18px; gap: 12px; }
  .brand { justify-content: center; }
  .brand img { width: 52px; height: 52px; }
  .brand span { font-size: 13px; }
  .tabs { gap: 8px; }
  .tab { min-width: 0; flex: 1; font-size: 19px; padding: 8px 6px; min-height: 60px; }
  .sky { flex-direction: column; text-align: center; gap: 12px; padding: 22px 14px 18px; }
  .sky img { width: 104px; height: 104px; }
  .sky h1 { font-size: 20px; text-shadow: 4px 4px 0 var(--red); }
  .sky p { font-size: 22px; }
  .street { grid-template-columns: 1fr; padding: 0 12px; }
  .place { padding: 0 14px; }
  .house .roof, .house .band, .bar .awning { margin-left: -14px; margin-right: -14px; }
  .house .sign { font-size: 25px; }
  .neon { font-size: 20px; padding: 14px 14px; }
  .house .window, .bar .window { border-width: 10px; }
  .place .say { font-size: 20px; }
  .door { min-height: 84px; font-size: 25px; }
  .stage { padding: 0 12px 10px; }
  .stage .title-row { gap: 12px; margin-bottom: 14px; }
  .game { min-width: 0; width: 100%; }
  .game .play { min-height: 76px; font-size: 28px; width: 76%; }
  .notes { font-size: 20px; }
}

/* ---- The Terms and the Privacy Policy: a recipe card of plain words. ---- */
.doc { max-width: 900px; margin: 30px auto; padding: 0 16px; width: 100%; }
.doc article { background: var(--cream); color: var(--ink); border-radius: 14px; border-top: 10px solid var(--red); padding: 28px 34px 34px; }
.doc h1 { font: 900 40px/1.2 Nunito; margin: 6px 0 4px; }
.doc h2 { font: 900 28px/1.25 Nunito; margin: 28px 0 8px; color: #a8202a; }
.doc p, .doc li { font: 700 21px/1.55 Nunito; margin: 0 0 10px; }
.doc ul { padding-left: 24px; margin: 0; }
.doc a { color: var(--cobalt); text-decoration: underline; }
.doc .when { color: #4a3f5c; font-size: 18px; }
.doc .lang { float: right; margin: 0; }
.foot a { color: #fffdf6; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { .doc article { padding: 20px 18px 24px; } .doc h1 { font-size: 30px; } .doc h2 { font-size: 23px; } }
