/* Play page: a game running inside the studio, with the studio's bar around it. */
:root {
  --bg: #0f0d0b;
  --bg-raise: #18140f;
  --ink: #efe6d6;
  --ink-2: #b9ae9c;
  --ink-3: #82786a;
  --line: rgba(239, 230, 214, 0.12);
  --line-strong: rgba(239, 230, 214, 0.24);
  --accent: var(--ink);
  --bar: 56px;
  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.label {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 650;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mark { width: 26px; height: 26px; flex: none; }

/* ---------- before the script runs, or when the game opens on its own site ---------- */
.launch {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--ink-2);
}
.launch a { color: var(--ink); font-weight: 600; }
.is-ready .launch { display: none; }

/* ---------- the play screen: bar + game ---------- */
.play {
  display: none;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
}
.is-ready .play { display: flex; }

.bar {
  position: relative;
  flex: none;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.bar::before { /* the game's color, along the top edge */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--accent);
}
.home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 820;
  font-stretch: 84%;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.home:hover { background: rgba(239, 230, 214, 0.06); }
.home__back { width: 14px; height: 14px; color: var(--ink-3); }

.now {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.now__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 860;
  font-stretch: 76%;
  font-size: 1.15rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.now__kicker { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.actions { margin-left: auto; display: flex; gap: 8px; }
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(239, 230, 214, 0.04);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn:hover { border-color: var(--line-strong); background: rgba(239, 230, 214, 0.08); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--icon { width: 38px; padding: 0; justify-content: center; }
.btn--more { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn--more:hover { background: #fff; }

@media (max-width: 719px) {
  .home__name, .now__kicker { display: none; }
  .now { padding-left: 12px; }
  .btn--more span { display: none; }
  .btn--more { width: 38px; padding: 0; justify-content: center; }
}

/* ---------- the game ---------- */
.frame {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}
.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  overflow: hidden;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  filter: blur(6px) saturate(0.8);
  transform: scale(1.06);
}
.cover > :not(img) { position: relative; }
.cover__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 860;
  font-stretch: 76%;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
  text-transform: uppercase;
}
.cover__note { margin: 0; color: var(--ink-2); }
.spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(239, 230, 214, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.frame.is-loaded .cover { opacity: 0; visibility: hidden; }

/* the way back to the studio when the bar is out of the way (phones held sideways, full screen) */
.handle {
  appearance: none;
  position: absolute;
  z-index: 2;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  display: none;
  place-items: center;
  width: 30px;
  height: 64px;
  padding: 0 0 0 env(safe-area-inset-left);
  box-sizing: content-box;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: rgba(15, 13, 11, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.handle:hover, .handle:focus-visible { opacity: 1; }
.handle svg { width: 18px; height: 18px; }
.frame:fullscreen .handle { display: grid; }
.frame:-webkit-full-screen .handle { display: grid; }

@media (orientation: landscape) and (max-height: 500px) {
  .bar { display: none; }
  .handle { display: grid; }
}

/* ---------- below the game ---------- */
.more {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 48px) calc(48px + env(safe-area-inset-bottom));
}
.more__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}
.more__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 860;
  font-stretch: 74%;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1;
  text-transform: uppercase;
}
.more__all { color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.more__all:hover { color: var(--ink); }
.more__list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
@media (orientation: landscape) and (max-height: 500px) { .more { display: none; } }

/* a game, as a card (below the game and in the drawer) */
.gc {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(239, 230, 214, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.gc:hover, .gc:focus-within {
  border-color: color-mix(in srgb, var(--gc) 60%, transparent);
  background: color-mix(in srgb, var(--gc) 8%, transparent);
}
.gc img { width: 112px; height: 70px; border-radius: 10px; object-fit: cover; }
.gc__kicker { margin: 0 0 3px; color: var(--gc); }
.gc__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 820;
  font-stretch: 78%;
  font-size: 1.2rem;
  line-height: 1.05;
  text-transform: uppercase;
}
.gc__name a { text-decoration: none; }
.gc__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.gc__name a:focus-visible { outline: none; }
.gc:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.gc__hook { margin: 4px 0 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.35; }

/* ---------- the drawer ---------- */
.drawer {
  margin: 0 0 0 auto;
  width: min(400px, 100vw);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--ink);
  overflow: auto;
}
.drawer::backdrop { background: rgba(5, 4, 3, 0.6); }
.drawer[open] { animation: slide-in 0.35s var(--ease-out); }
.drawer[open]::backdrop { animation: fade 0.35s ease; }
@keyframes slide-in { from { translate: 100% 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer__in {
  display: grid;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) 18px;
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.drawer__title { margin: 0; color: var(--ink-2); }
.drawer__all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  padding: 13px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
}
.drawer__all:hover { color: var(--ink); border-color: var(--ink-3); }
.drawer__all svg { width: 16px; height: 16px; }
/* fills the drawer, so only a click on the dimmed page behind it closes it */
.drawer__in { min-height: 100%; align-content: start; }
.drawer__list { display: grid; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
