/* The Games Room (W4b, 2026-11-17; was GR1 v2): a sunlit striped tent with three corners.
   Shared tokens, menu, gate and footer come from ../shared/world.css. */
:root { --night: #141c3a; --ember: #E9C46A; --paper2: #FBF3E3; --ink2: #2a2238; --ink3: #3a2416; }
html, body.groom { height: 100%; overflow: hidden; background: #c9a56a; }   /* the tent's base colour: shown at once */
body.groom { margin: 0; color: var(--paper2); }
.gr { position: fixed; inset: 0; overflow: hidden; background: #c9a56a; }
.gr__stage { position: absolute; transform-origin: 50% 50%; transition: transform 1.6s cubic-bezier(.25, .6, .2, 1); }
.walking .gr__stage { transform: scale(1.18); }
.inside .gr__stage, .nowalk .gr__stage { transform: none; }
.gr__stage img#roomImg, .gr__stage picture { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; }
.gr__glow { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(ellipse 22% 26% at 16% 18%, rgba(255, 200, 110, .35), transparent 70%), radial-gradient(ellipse 22% 26% at 70% 20%, rgba(255, 200, 110, .3), transparent 70%); animation: lamp 4s ease-in-out infinite; }
@keyframes lamp { 50% { opacity: .65; } }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body.groom .wnav { background: rgba(48, 24, 18, .76); }   /* the tent painting is bright: darker menu pill keeps its words readable */

/* room title: near the top, shown at once (above the tent door too) */
.gr-head { position: fixed; z-index: 72; left: 0; right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 64px); padding: 0 var(--gutter); text-align: center; pointer-events: none; }
.gr-head h1 { margin: 0; font-size: clamp(34px, 5.2vw, 54px); line-height: 1.05; text-shadow: 0 2px 4px rgba(70, 24, 10, .6), 0 0 22px rgba(70, 24, 10, .6); }

/* the three corners */
.corners { position: fixed; z-index: 20; left: 0; right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 124px); bottom: 78px; box-sizing: border-box; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, minmax(0, 340px)); justify-content: center; align-content: center; gap: 30px; }
.corner { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.corner__pic { display: block; width: 100%; aspect-ratio: 3 / 2; box-sizing: border-box; border: 6px solid #fff6e2; border-radius: 22px; overflow: hidden; background: #f6ecd6;
  box-shadow: 0 18px 30px -12px rgba(50, 20, 8, .75); transform: rotate(var(--tilt, 0deg)); transition: transform .35s cubic-bezier(.3, .7, .2, 1.2), box-shadow .35s; }
.corner__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.corner--story { --tilt: -1.5deg; } .corner--wonder { --tilt: 1.5deg; } .corner--play { --tilt: -1deg; }
/* the word under each picture: 20px or more, dark ink on cream (about 12:1) */
.corner__label { padding: 6px 18px 8px; border-radius: 999px; background: #fff8e8; color: var(--ink3); font: 400 clamp(20px, 2vw, 26px)/1 var(--hand); white-space: nowrap; box-shadow: 0 6px 14px -6px rgba(40, 16, 4, .6); }
.corner:hover .corner__pic { transform: rotate(0deg) translateY(-6px); box-shadow: 0 26px 34px -12px rgba(50, 20, 8, .8), 0 0 34px rgba(255, 220, 150, .6); }
.corner:focus-visible { outline: none; }
.corner:focus-visible .corner__pic { outline: 4px solid #FFE08A; outline-offset: 4px; }
.corner.lift .corner__pic { transform: scale(1.06) translateY(-6px); box-shadow: 0 30px 40px -12px rgba(30, 12, 4, .8), 0 0 50px rgba(255, 220, 150, .85); }

/* phones and tall screens: the big Story games corner on top, the other two side by side under it */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .corners { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; max-width: 560px; margin: 0 auto; }
  .corner--story { grid-column: 1 / -1; }
  .corner__label { font-size: 20px; padding: 6px 14px 8px; }
}
@media (max-width: 760px) and (max-height: 700px) { .corner--story { width: 80%; justify-self: center; } }

/* the Story games card */
.sheet { position: fixed; inset: 0; z-index: 74; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(40, 16, 8, .55); opacity: 0; transition: opacity .22s; }
.sheet[hidden] { display: none; }
.sheet.show { opacity: 1; }
.sheet__card { position: relative; box-sizing: border-box; width: min(100%, 980px); max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px clamp(16px, 3vw, 34px) 26px; border-radius: 28px;
  background: #fbf3e3; color: var(--ink3); box-shadow: 0 30px 60px -20px rgba(20, 8, 4, .8); transform: translateY(14px) scale(.98); transition: transform .3s cubic-bezier(.3, .7, .2, 1.2); }
.sheet.show .sheet__card { transform: none; }
.sheet__title { margin: 0 56px 18px; text-align: center; font: 400 clamp(28px, 3.4vw, 40px)/1.05 var(--hand); color: var(--ink3); }
.sheet__close { position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: #efe2c6; cursor: pointer; display: grid; place-items: center; }
.sheet__close span, .sheet__close span::after { display: block; width: 22px; height: 4px; border-radius: 2px; background: var(--ink3); transform: rotate(45deg); }
.sheet__close span::after { content: ""; transform: rotate(90deg); }
.sheet__close:hover { background: #e6d4ae; }
.sheet__close:focus-visible { outline: 4px solid #c4472f; outline-offset: 2px; }
.sheet__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 26px); margin: 0; padding: 0; list-style: none; }
@media (max-width: 760px) { .sheet__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; } .sheet__title { margin-bottom: 12px; } .sheet__card { padding-top: 16px; } }
.sg { position: relative; }
.sg__card { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
.sg__pic { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 6px 12px 12px 6px; overflow: hidden; background: #f3e6c8; box-shadow: inset 6px 0 0 rgba(40, 18, 6, .2), 0 14px 20px -10px rgba(30, 12, 4, .6); transition: transform .3s cubic-bezier(.3, .7, .2, 1.2); }
.sg__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sg--next .sg__pic { box-shadow: none; background: #fbf1dc; }
.sg--next .sg__pic img { object-fit: contain; }
.sg__title { text-align: center; font: 400 clamp(18px, 1.8vw, 22px)/1.1 var(--hand); color: var(--ink3); }
.sg__title small { display: block; font: 400 16px/1.1 var(--hand); color: #9a3b22; }
.sg__btn { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 46px; padding: 0 22px 2px; border-radius: 999px; background: #b33d26; color: #fff; font: 400 21px/1 var(--hand); box-shadow: 0 8px 14px -6px rgba(120, 30, 10, .6); }
a.sg__card:hover .sg__pic { transform: translateY(-5px); }
a.sg__card:focus-visible { outline: none; }
a.sg__card:focus-visible .sg__pic { outline: 4px solid #c4472f; outline-offset: 3px; }
a.sg__card.lift .sg__pic { transform: translateY(-6%) scale(1.05); }
.sg__mark { position: absolute; z-index: 2; top: -10px; right: -6px; padding: 5px 12px 7px; border-radius: 999px; font: 400 17px/1 var(--hand); font-style: normal; color: #fff; transform: rotate(6deg); box-shadow: 0 6px 12px -5px rgba(0, 0, 0, .5); pointer-events: none; }
.sg__mark--played { background: #2f6b3a; }
.sg__mark--new { background: #b33d26; }

/* footer: world.js fills it with the disclaimer and the Grown-ups link */
.gr__foot { position: fixed; z-index: 13; left: 0; right: 0; bottom: 0; padding: 26px var(--gutter) calc(8px + env(safe-area-inset-bottom)); font-size: 12px; color: rgba(255, 246, 230, .94); background: linear-gradient(transparent, rgba(54, 22, 12, .74) 45%); }
.gr__foot { text-align: center; }
.gr__foot p { margin: 2px auto; }
.gr__foot .wfoot__links { margin: 0; gap: 14px; }

body.groom::after { content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none; background: #fbf3e3; opacity: 0; transition: opacity .45s; }
body.groom.leaving::after { opacity: 1; }

/* the way in: tent flaps that wait for a tap (daytime tent painting: doorway x 38.4% to 62.2%, y 40.5% to 84.5%, seam at 49.57%) */
.entry { position: fixed; inset: 0; z-index: 70; overflow: hidden; cursor: pointer; background: #bcd6ee; }
.entry.gone { opacity: 0; transition: opacity .55s; pointer-events: none; }
.entry__stage { position: absolute; transition: transform 1.5s cubic-bezier(.55, 0, .3, 1), opacity 1.2s .3s; transform-origin: var(--ox, 50%) var(--oy, 62%); }
.entry.through .entry__stage { transform: scale(3.4); opacity: 0; }
.entry__frame { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.entry__inside { position: absolute; left: 38.4%; top: 40.5%; width: 23.8%; height: 44%; background: radial-gradient(ellipse 60% 70% at 50% 70%, rgba(255, 246, 214, .95) 0%, rgba(255, 227, 160, .75) 40%, rgba(243, 182, 95, .25) 100%), repeating-linear-gradient(90deg, #f4e6c4 0 14%, #e9a98a 14% 28%); }
.entry__flap { position: absolute; top: 40.5%; height: 44%; user-select: none; pointer-events: none; transition: transform 1.25s cubic-bezier(.45, 0, .25, 1); }
.entry__flap--l { left: calc(38.4% - 1px); width: calc(11.17% + 2px); transform-origin: 0 0; }
.entry__flap--r { left: calc(49.57% - 1px); width: calc(12.63% + 2px); transform-origin: 100% 0; }
.entry.open .entry__flap--l { transform: scaleX(.16) skewY(4deg); }
.entry.open .entry__flap--r { transform: scaleX(.16) skewY(-4deg); }
.entry__ring { position: absolute; left: 49.57%; top: 66%; width: 10.7%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); border: 3px solid rgba(255, 236, 190, .9); box-shadow: 0 0 18px 4px rgba(255, 220, 150, .55); opacity: 0; pointer-events: none; }
.entry.ready:not(.open) .entry__ring { animation: tapRing 2s ease-out 1s infinite; }
.entry.ready:not(.open) .entry__flap--l { animation: flapL 3.6s ease-in-out 2.2s infinite; }
.entry.ready:not(.open) .entry__flap--r { animation: flapR 3.6s ease-in-out 2.4s infinite; }
@keyframes tapRing { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.5); } 80%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } }
@keyframes flapL { 0%, 80%, 100% { transform: none; } 86% { transform: scaleX(.9) skewY(2deg); } 92% { transform: scaleX(.96); } }
@keyframes flapR { 0%, 80%, 100% { transform: none; } 86% { transform: scaleX(.9) skewY(-2deg); } 92% { transform: scaleX(.96); } }
.entry__hint { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); margin: 0; padding: 8px 22px 10px; font-size: 26px; color: #4A2A1E; background: rgba(255, 244, 222, .94); border-radius: 999px; box-shadow: 0 10px 26px -10px rgba(10, 10, 30, .7); white-space: nowrap; opacity: 0; transition: opacity .6s .6s; }
.entry.ready .entry__hint { opacity: 1; animation: hintBob 1.8s ease-in-out .9s infinite; }
.entry.open .entry__hint { opacity: 0; transition-delay: 0s; animation: none; }
@keyframes hintBob { 50% { transform: translateX(-50%) translateY(-6px); } }
.entry__veil { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, #fff8e6 0%, #f6f0e1 45%, #efe6cf 100%); transition: opacity .8s .1s; pointer-events: none; }
.entry.ready .entry__veil { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .gr__stage, .entry__stage, .entry__flap, .corner__pic, .sheet, .sheet__card, .sg__pic { transition: none; }
  .gr__glow, .entry__hint, .entry__ring, .entry__flap { animation: none !important; }
}

/* phones: the Story games card fits on one screen (pictures a little less tall; covers are cropped, never squashed) */
@media (max-width: 760px) { .sg__pic { aspect-ratio: 4 / 5; } }
@media (max-width: 760px) and (max-height: 700px) { .sg__pic { aspect-ratio: 1; } .sg__card { gap: 6px; } }
