/* Oli.is — styles for the redesigned pages (index, jokes, programs).
   Older pages still use style.css. */

:root {
  --ink: #1d1a2b;
  --cream: #fffaf0;
  --pink: #ff6fb1;
  --yellow: #ffe14d;
  --page-ink: #1d1a2b;           /* text drawn straight on the background; site.js flips it on dark colours */
  --disp: 'Baloo 2', system-ui, sans-serif;
  --disp-weight: 700;
  --radius: 14px;
  --shadow: 4px 4px 0 rgba(29, 26, 43, .9);
}
html.font-pixel  { --disp: 'Pixelify Sans', monospace; --disp-weight: 700; }
html.font-chunky { --disp: 'Bungee', system-ui, sans-serif; --disp-weight: 400; }
html.font-comic  { --disp: 'Comic Neue', cursive; --disp-weight: 700; }
html.font-clean  { --disp: 'Nunito', system-ui, sans-serif; --disp-weight: 800; }

*, *::before, *::after { box-sizing: border-box; }
html { background: none; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--page-ink);
  transition: color .3s ease;
}
/* Page background: script.js writes the colour or image to --page-bg */
html::before {
  content: '';
  position: fixed; inset: 0; z-index: -10000; pointer-events: none;
  background: var(--page-bg, url('/images/1.jpg') center center / cover no-repeat);
  background-size: cover;
}
.three-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -500; pointer-events: none;
  background: transparent !important; border: 0 !important;
  transition: opacity .22s ease, visibility .18s ease;
}

a { color: inherit; }
img { max-width: 100%; }
.disp { font-family: var(--disp); font-weight: var(--disp-weight); letter-spacing: -.015em; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons, pills, stickers ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1.1;
  color: var(--ink); background: var(--cream);
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  padding: 10px 18px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible, .pill:focus-visible, .sw:focus-visible, .card:focus-visible, .mini-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn.small { font-size: 14px; padding: 6px 12px; min-height: 36px; }
.btn-pink { background: var(--pink); }
.btn-yellow { background: var(--yellow); }
.btn svg { flex: none; }

.pill {
  font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--cream);
  border: 2px solid var(--ink); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.sw { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); padding: 0; cursor: pointer; background-size: cover; }
.sw[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 3px; }
.sw-input { width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 12px; padding: 0; background: var(--cream); cursor: pointer; }

.stk { background: var(--cream); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 10px; color: var(--ink);
}
.c0 { background: #ffe14d; } .c1 { background: #9be7ff; } .c2 { background: #ffb3d1; } .c3 { background: #b8f28c; } .c4 { background: #d5c2ff; }
.badge {
  position: absolute; top: -14px; right: 22px; z-index: 2;
  padding: 4px 14px; background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; transform: rotate(4deg);
  font-size: 18px; line-height: 1.3;
}

/* ---------- Layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 24px 72px; display: flex; flex-direction: column; gap: 44px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.brand img { width: 96px; height: auto; transform: rotate(-6deg); transition: transform .3s ease; }
.brand:hover img { transform: rotate(6deg) translateY(-3px); }
.brand-name { display: block; font-size: 42px; line-height: 1; }
.brand-tag { display: block; font-size: 16px; font-weight: 700; }
.site-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.site-nav .btn[aria-current="page"] { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.hero h1 { margin: 0; font-size: clamp(48px, 7vw, 76px); line-height: 1; }
.hero p:empty { display: none; }
.hero p { margin: 8px 0 0; font-size: 21px; font-weight: 700; max-width: 640px; }
.section-title { margin: 0 0 22px; font-size: 44px; line-height: 1; }
.daily-games { display: flex; flex-direction: column; }
.daily-card { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1fr); overflow: hidden; max-width: 900px; }
.daily-card > img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; align-self: center; display: block; border-radius: 12px 0 0 12px; border-right: 2px solid var(--ink); background: #fff0d6; }
.daily-card-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 28px; }
.daily-card h3 { margin: 0; font-size: 40px; line-height: 1; }
.daily-card p { margin: 0; font-size: 17px; line-height: 1.45; }
.daily-card .btn { align-self: flex-start; }

/* ---------- Cards ---------- */
.feature {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.feature .feature-img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; border-radius: 12px 0 0 12px; background: var(--ink); }
.feature .feature-body { padding: 36px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.feature h2 { margin: 0; font-size: 52px; line-height: 1; }
.feature p { margin: 0; font-size: 19px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }
.card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.card:hover { --lift: -4px; box-shadow: 7px 9px 0 rgba(29, 26, 43, .9); transition: transform .08s linear, box-shadow .25s ease; }
.card .thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--ink); background: var(--ink); }
.card .card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.card .card-title { font-size: 28px; line-height: 1.05; }
.card .card-desc { font-size: 15px; line-height: 1.45; }

.bottom-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 36px; align-items: start; }
.joke-note {
  background: #fff27a; color: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  padding: 30px; display: flex; flex-direction: column; gap: 16px; min-height: 280px;
  transform: rotate(-1.5deg);
}
.joke-note .label, .panel .label { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
.joke-text { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.35; white-space: pre-line; flex-grow: 1; }
.shelf { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.shelf h2 { margin: 0; font-size: 36px; }
.shelf p { margin: 4px 0 0; font-size: 16px; }
.shelf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mini-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; font-size: 13px; font-weight: 800; text-align: center; border-radius: 14px; }
.mini-link img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 2px solid var(--ink); border-radius: 14px; display: block; background: var(--ink); transition: transform .15s ease; }
.mini-link:hover img { transform: translateY(-3px) scale(1.04); }

/* Text pages (jokes, programs) */
.text-panel { padding: 32px; max-width: 820px; }
.text-panel ul { margin: 0; padding-left: 22px; line-height: 1.9; font-size: 17px; font-weight: 700; }
.text-panel ul ul { font-weight: 600; }
.jokes-more { display: flex; justify-content: flex-start; max-width: 720px; }
.all-jokes { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.all-jokes .joke-item { white-space: pre-line; font-size: 17px; line-height: 1.45; padding-bottom: 14px; border-bottom: 2px dashed rgba(29, 26, 43, .25); }

/* ---------- Customise panel ---------- */
.panel {
  position: fixed; top: 96px; right: 24px; z-index: 100;
  width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 22px; display: flex; flex-direction: column; gap: 18px;
}
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: flex-end; margin: -8px -8px -14px 0; }
.group { border: 2px dashed rgba(29, 26, 43, .3); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.sub { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; opacity: .7; margin: 0 0 6px; }
/* segmented control: joined buttons for "how many" / "how fast" */
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--cream); }
.seg button { font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); background: transparent; border: 0; border-left: 2px solid var(--ink); padding: 8px 16px; min-height: 40px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.seg button:focus-visible { outline: 3px solid var(--ink); outline-offset: -5px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row + .row { margin-top: 10px; }
.panel .label { margin-bottom: 10px; }
.panel-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.hint { font-size: 13px; font-weight: 600; opacity: .75; margin: 6px 0 0; }

/* ---------- In-page player (script.js) ---------- */
body.is-playing .hero { display: none; }
body { overflow-x: clip; }
/* while playing, the player breaks out of the page column and uses (almost) the whole window width */
body.is-playing .player-area { width: calc(100vw - 24px); margin-left: calc(50% - 50vw + 12px); }
.player-area {
  display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 10px;
  background: var(--ink); color: var(--cream); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  scroll-margin-top: 10px;
}
.player-header { display: flex; align-items: center; gap: 12px; padding: 2px 4px 0; min-height: 36px; }
.player-info { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.player-title { color: var(--cream); font-family: var(--disp); font-weight: var(--disp-weight); font-size: 1.4rem; margin: 0; line-height: 1.2; }
.player-subtitle { color: rgba(255, 250, 240, .9); font-weight: 600; font-size: .9rem; }
.player-subtitle:empty, .player-desc:empty { display: none; }
.player-desc { flex-basis: 100%; color: rgba(255, 250, 240, .75); font-size: .85rem; line-height: 1.35; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-actions { display: flex; gap: 6px; flex-shrink: 0; }
.player-actions .ico { font-size: 1rem; line-height: 1; }
.player-controls { list-style: none; margin: 0; padding: 0 4px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: rgba(255, 250, 240, .85); }
.player-controls[hidden] { display: none; }
.player-controls li { display: flex; align-items: center; gap: 6px; }
.player-controls kbd { font: inherit; font-weight: 800; font-size: .78rem; color: var(--ink); background: var(--cream); border-radius: 6px; padding: 1px 7px; box-shadow: 0 2px 0 rgba(255, 250, 240, .35); white-space: nowrap; }
@media (hover: none) and (pointer: coarse) { .player-controls, #toggleControls { display: none !important; } }
.player-stage { display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; }
.player-aspect-box { position: relative; flex: none; width: 100%; height: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.player-aspect-box iframe, .player-area iframe#playerFrameMain { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: #000; transform-origin: 0 0; }
.player-area.fullscreen {
  position: fixed; inset: 0; z-index: 9999; width: 100%; height: 100%; height: 100dvh; margin: 0; border-radius: 0; gap: 4px;
  padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
}
.player-area.fullscreen .player-stage { flex: 1; }
.player-area.fullscreen .player-aspect-box { border-radius: 0; }
.player-area.fullscreen .player-desc, .player-area.fullscreen .player-subtitle { display: none; }
.player-area.fullscreen .player-controls { font-size: .75rem; }
body:has(.player-area.fullscreen) { overflow: hidden; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 50; background: rgba(0, 0, 0, .6); }
.modal[aria-hidden="false"] { display: flex; }
.modal-inner { width: 90%; max-width: 1000px; height: 80vh; background: #111; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; }
.modal-close { align-self: flex-end; background: transparent; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.modal iframe { flex: 1; border-radius: 8px; border: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .feature-img { min-height: 200px; max-height: 280px; border-radius: 12px 12px 0 0; border-bottom: 2px solid var(--ink); }
  .feature .feature-body { padding: 22px; }
  .feature h2 { font-size: 40px; }
}
@media (max-width: 520px) {
  .daily-card { grid-template-columns: minmax(0, 1fr); }
  .daily-card > img { width: 100%; min-height: 0; max-height: 240px; border-right: 0; border-bottom: 2px solid var(--ink); border-radius: 12px 12px 0 0; }
}
@media (max-width: 720px), (max-height: 520px) {
  body.is-playing { overflow: hidden; }
  body.is-playing .player-area {
    position: fixed; inset: 0; z-index: 9999; width: 100%; height: 100%; height: 100dvh; margin: 0; border-radius: 0; gap: 4px;
    padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
  }
  body.is-playing .player-stage { flex: 1; }
  body.is-playing .player-aspect-box { border-radius: 4px; }
  .player-header { min-height: 32px; gap: 8px; }
  .player-title { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .player-subtitle, .player-desc, .player-controls { display: none !important; }
  .player-actions .lbl { display: none; }
  .player-actions .btn { padding: 6px 10px; min-width: 36px; }
}
@media (max-width: 600px) {
  .wrap { padding: 16px 16px 56px; gap: 30px; }
  .site-header { flex-wrap: nowrap; gap: 8px; }
  .brand { gap: 8px; min-width: 0; }
  .brand img { width: 48px; }
  .brand-name { font-size: 26px; }
  .brand-tag { display: none; }
  .site-nav { gap: 6px; flex-wrap: nowrap; }
  .site-nav .btn { padding: 8px 12px; font-size: 14px; }
  .site-nav .btn .btn-label { display: none; }
  .section-title { font-size: 34px; }
  .grid { gap: 22px; }
  .bottom-row { grid-template-columns: minmax(0, 1fr); }
  .shelf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .joke-note { padding: 22px; min-height: 0; }
  .joke-text { font-size: 20px; }
  /* the customise panel becomes a bottom sheet */
  .panel {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none; max-height: 78vh;
    border-radius: 22px 22px 0 0; border-width: 2px 0 0; box-shadow: 0 -8px 24px rgba(29, 26, 43, .25);
    padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card:hover { transform: none; transition: box-shadow .2s ease; }
  .btn, .brand img, .mini-link img { transition: none; }
}

/* Keep the selected game header visible while the playfield takes the remaining height. */
.player-header, .player-controls { flex-shrink: 0; }

/* ---------- Player header: one clean row, icon buttons, controls as a drop-down card ---------- */
.player-area { position: relative; }
.player-header { gap: 14px; padding: 0 2px 0 6px; min-height: 40px; }
.player-info { flex-wrap: nowrap; align-items: baseline; gap: 12px; overflow: hidden; }
.player-title { font-size: 1.2rem; white-space: nowrap; letter-spacing: -.01em; }
.player-subtitle { font-weight: 500; font-size: .85rem; color: rgba(255, 250, 240, .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.player-desc { display: none; }
.player-actions { gap: 4px; align-items: center; }
.player-actions .btn.small {
  background: rgba(255, 250, 240, .08); color: var(--cream); border: 0; box-shadow: none; border-radius: 10px;
  min-height: 34px; min-width: 34px; padding: 6px 9px; font-size: 13px; font-weight: 700; transition: background .15s ease;
}
.player-actions .btn.small:hover, .player-actions .btn.small:focus-visible { background: rgba(255, 250, 240, .18); transform: none; box-shadow: none; }
.player-actions .btn.small:active { transform: scale(.96); box-shadow: none; }
.player-actions .btn.small .lbl { display: none; }
.player-actions .ico { font-size: 1.05rem; line-height: 1; }
.player-actions #toggleControls[aria-expanded="true"] { background: rgba(255, 250, 240, .22); }
.music-wrap { position: relative; display: inline-flex; }
.player-actions #toggleMusic[aria-expanded="true"] { background: rgba(255, 250, 240, .22); }
.player-actions #toggleMusic.off .ico { opacity: .4; }
.music-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 7; width: max-content; min-width: 200px;
  display: flex; flex-direction: column; gap: 6px; padding: 12px; text-align: left;
  background: #2b2840; border: 1px solid rgba(255, 250, 240, .14); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.music-menu .mm-song { display: flex; flex-direction: column; gap: 1px; padding: 0 2px 4px; }
.music-menu .mm-song small { font-size: .72rem; color: rgba(255, 250, 240, .55); font-weight: 600; }
.music-menu .mm-song b { font-size: .95rem; color: var(--cream); }
.music-menu .btn.small { justify-content: center; width: 100%; }
.music-menu .btn.small .lbl { display: inline; }
.player-actions .music-menu .mm-studio { background: var(--yellow); color: var(--ink); }
.player-actions .music-menu .mm-studio:hover { background: #ffec85; }
.player-actions #closePlayer:hover { background: #ff5a4f; color: #fff; }
.player-actions .btn.small.pip-btn { background: var(--yellow); color: var(--ink); padding: 6px 12px; margin-right: 4px; }
.player-actions .btn.small.pip-btn .lbl { display: inline; }
.player-actions .btn.small.pip-btn:hover { background: #ffec85; }
.player-actions .pip-btn .pip-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; display: none; }
.player-actions .pip-btn.has-news .pip-dot { display: inline-block; }
.player-controls {
  position: absolute; top: 58px; right: 12px; z-index: 6; width: max-content; max-width: min(380px, calc(100% - 24px));
  background: #2b2840; border: 1px solid rgba(255, 250, 240, .14); border-radius: 12px; padding: 12px 14px;
  display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; align-items: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45); font-size: .85rem; color: rgba(255, 250, 240, .85);
}
.player-controls li { display: contents; }
.player-controls kbd { justify-self: start; background: rgba(255, 250, 240, .12); color: var(--cream); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3); padding: 2px 8px; border-radius: 6px; font-size: .75rem; }
.player-area.fullscreen .player-controls { top: 50px; }
@media (max-width: 720px), (max-height: 520px) {
  .player-actions .btn.small.pip-btn .lbl { display: none; }
  .player-actions .btn.small.pip-btn { padding: 6px 9px; }
}
/* the Controls button keeps its label so people know what it does */
.player-actions .btn.small.controls-btn { padding: 6px 12px; gap: 6px; }
.player-actions .btn.small.controls-btn .lbl { display: inline; }
.player-actions .btn.small.controls-btn[aria-expanded="true"] { background: var(--cream); color: var(--ink); }
.player-actions .controls-btn.nudge { animation: controls-nudge 1.6s ease 2; }
@keyframes controls-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 225, 77, 0) } 50% { box-shadow: 0 0 0 4px rgba(255, 225, 77, .55) } }
@media (max-width: 720px), (max-height: 520px) { .player-actions .btn.small.controls-btn .lbl { display: none; } }

/* Snake plays in a smaller window at the top of the page, with the website around it */
body.snake-small.is-playing .player-area { width: min(540px, calc(100vw - 24px)); margin: 18px auto 24px; height: auto !important; }
body.snake-small.is-playing .player-stage { height: min(440px, 58vh, calc(100vw - 48px)); flex: none !important; }
@media (max-width: 720px), (max-height: 520px) {
  body.snake-small.is-playing { overflow: auto; }
  body.snake-small.is-playing .player-area { position: relative; inset: auto; z-index: auto; border-radius: var(--radius); margin: 10px auto 18px; }
}

/* Python adventures use their terminal's natural size, with one outer toolbar. */
body.terminal-player.is-playing .player-area:not(.fullscreen) {
  width: min(844px, calc(100vw - 24px)); height: auto !important;
  margin: 18px auto 24px; position: relative; inset: auto;
}
body.terminal-player.is-playing .player-area:not(.fullscreen) .player-stage {
  height: min(580px, calc(100dvh - 110px)); flex: none !important;
}
body.terminal-player.is-playing:has(.player-area:not(.fullscreen)) { overflow: auto; }

/* ---------- Phone header: Games / Jokes / Daily become one compact segmented control ---------- */
@media (max-width: 600px) {
  .site-header { gap: 10px; }
  .brand img { width: 42px; }
  .brand-name { font-size: 24px; }
  .site-nav { gap: 0; flex: none; }
  .site-nav a.btn {
    min-height: 34px; padding: 6px 11px; font-size: 13.5px;
    border-radius: 0; box-shadow: none; transform: none;
  }
  .site-nav a.btn + a.btn { margin-left: -2px; }
  .site-nav a.btn:first-of-type { border-radius: 999px 0 0 999px; padding-left: 13px; }
  .site-nav a.btn:nth-of-type(3) { border-radius: 0 999px 999px 0; padding-right: 13px; }
  /* Pip's room (appears once found) sits apart from the tabs as a small glowing round button */
  .site-nav a.btn.pip-room-link, .site-nav a.btn + a.btn.pip-room-link { margin-left: 8px; width: 34px; padding: 0; font-size: 0; border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); }
  .site-nav a.btn.pip-room-link::before { margin: 0; width: 10px; height: 10px; }
  .site-nav a.btn[aria-current="page"] { background: var(--ink); color: var(--cream); transform: none; box-shadow: none; }
  .site-nav a.btn:hover, .site-nav a.btn:active { transform: none; box-shadow: none; }
  .site-nav #customiseBtn { margin-left: 8px; min-height: 34px; width: 34px; padding: 0; box-shadow: 2px 2px 0 var(--ink); }
  .site-nav #customiseBtn svg { width: 18px; height: 18px; }
}
@media (max-width: 400px) {
  .brand-name { display: none; }
}
@media (max-width: 360px) {
  .site-nav a.btn { padding: 6px 8px; font-size: 12.5px; }
  .site-nav a.btn:first-of-type { padding-left: 10px; }
  .site-nav a.btn:nth-of-type(3) { padding-right: 10px; }
  .site-nav #customiseBtn, .site-nav a.btn.pip-room-link { margin-left: 6px; }
}
@media (max-width: 460px) {
  .site-header:has(.pip-room-link) .brand-name { display: none; }
}

/* ---------- Home: banner linking to the daily games (the whole card is the link) ---------- */
.daily-banner { display: flex; align-items: center; gap: 28px; padding: 18px 24px; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.daily-banner:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.daily-banner:hover .daily-banner-btn { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.daily-banner-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: none; width: min(340px, 40%); }
.daily-banner-title { font-size: 36px; line-height: 1; }
.daily-banner-text { font-size: 16px; line-height: 1.4; }
.daily-banner-btn { margin-top: 6px; }
.daily-banner-art { flex: 1; min-width: 0; max-width: 560px; margin-left: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.daily-banner-art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.daily-banner-art img:nth-child(1) { transform: rotate(-2deg); }
.daily-banner-art img:nth-child(3) { transform: rotate(2deg); }
@media (max-width: 860px) {
  .daily-banner { flex-direction: column; align-items: stretch; gap: 16px; padding: 16px; }
  .daily-banner-body { width: auto; }
  .daily-banner-art { gap: 10px; }
  .daily-banner-art img { border-radius: 8px; }
  .daily-banner-title { font-size: 28px; }
  .daily-banner-text { font-size: 14.5px; }
}

/* ---------- Daily page: every daily game in one compact grid; Slice gets the big spot ---------- */
.daily-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.dg-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .12s ease, box-shadow .12s ease; }
.dg-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.dg-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.dg-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--ink); background: #fff4d6; }
.dg-body { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 14px 20px; }
.dg-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dg-title { font-size: 26px; line-height: 1; }
.dg-big .dg-title { font-size: 34px; }
.dg-line { font-size: 14.5px; line-height: 1.35; opacity: .8; }
.dg-play { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); padding-left: 3px; }
.dg-big .dg-play { width: 54px; height: 54px; }
@media (max-width: 980px) { .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .daily-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .dg-big img { aspect-ratio: 16 / 10; }
  .dg-title, .dg-big .dg-title { font-size: 24px; }
}

/* the featured game card plays when you click anywhere on it, like the other cards */
#feature { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
#feature:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
#feature:hover .play-link { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

/* featured card: thinner, so more of the page shows on first load */
#feature .feature-img { min-height: 0; height: 100%; max-height: 250px; aspect-ratio: auto; }
#feature .feature-body { padding: 22px 30px; gap: 10px; }
#feature h2 { font-size: 40px; }
#feature p { font-size: 17px; line-height: 1.4; }
#feature .play-link { font-size: 17px !important; padding: 9px 20px !important; min-height: 0; }
@media (max-width: 860px) {
  #feature .feature-img { max-height: 190px; }
  #feature .feature-body { padding: 16px 18px; }
  #feature h2 { font-size: 30px; }
  #feature p { font-size: 15px; }
}

/* ---------- the logo's eyes (added by site.js on top of the logo image) ---------- */
.brand-eyes { position: absolute; pointer-events: none; overflow: visible; z-index: 1; }
.brand-eyes ellipse { fill: #1d1a2b; }
.brand-eyes .be-shine { fill: #fff; transition: opacity .08s; }
.brand-eyes .be-blink { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.brand-eyes.blink .be-blink { transform: scaleY(.12); }
.brand-eyes.blink .be-shine { opacity: 0; }
.brand-eyes.pip ellipse { fill: #b58cff; }
.brand-eyes.pip .be-shine { display: none; }
