/* Page-wide styles, plus the parts every overlay shares: the full-screen
   layer, the toolbar along its bottom, the scrolling page used by the
   languages and the shelf, and the card that opens when you pick something. */

:root{
  --bg:#14121c; --fg:#e8e3f0; --dim:#9a92ad; --line:#332c42; --accent:#ffc98a;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--fg);
  font:400 14px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  min-height:100dvh; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:18px; padding:24px 16px 32px;
  transition:background-color 1.2s linear;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

/* ---- name, tagline and links ---- */
header{text-align:center; max-width:520px}
h1{
  margin:0; font-size:clamp(20px,4.4vw,30px); font-weight:600;
  letter-spacing:.14em; text-transform:uppercase;
}
header p{margin:6px 0 0; color:var(--dim); font-size:12.5px; letter-spacing:.05em}

nav{display:flex; gap:14px; align-items:center; flex-wrap:wrap; justify-content:center}
nav a{
  color:var(--dim); text-decoration:none; font-size:12px; letter-spacing:.12em;
  text-transform:uppercase; border-bottom:1px solid transparent; padding-bottom:2px;
  transition:color .15s, border-color .15s;
}
nav a:hover,nav a:focus-visible{color:var(--fg); border-color:var(--accent)}
nav span{color:var(--line)}

/* ---- overlays: hidden until opened, then they cover the whole window ---- */
.overlay{position:fixed; inset:0; display:none; flex-direction:column}
.overlay:not([hidden]){display:flex}

/* a canvas game (cat, plant), scaled to fit the space above its toolbar */
.game-stage{position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; padding:10px}
.game-canvas{
  image-rendering:auto;           /* backing store is drawn at screen size, see sharpen() */
  width:100%; height:100%; object-fit:contain; touch-action:none; cursor:none;
}

/* a page that scrolls (languages, shelf) */
.overlay-scroll{flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:20px 16px 12px}
.overlay-content{max-width:880px; margin:0 auto}
.overlay-title{margin:0; font-size:11px; letter-spacing:.24em; text-transform:uppercase; color:#8f88a6}
.overlay-content h3{margin:0; font-weight:400; font-size:11px; line-height:1; letter-spacing:.2em;
  text-transform:uppercase; color:#a39cb5}

/* the card that opens under whatever you picked */
.detail-card{margin-top:16px; padding:12px 14px 13px; background:#15121e;
  border-left:2px solid var(--accent); border-radius:0 3px 3px 0}
.detail-card h4{margin:0; font-size:14px; font-weight:600; letter-spacing:.02em; color:var(--fg)}
.detail-card .meta{margin:5px 0 0; font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--dim)}
.detail-card .note{margin:9px 0 0; max-width:62ch; font-size:12.5px; line-height:1.65; color:#c6bed6}

/* ---- the toolbar along the bottom of every overlay ---- */
.bar{
  display:flex; gap:6px; align-items:center; flex-wrap:wrap;
  padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:#0d0c14; border-top:1px solid #23202e;
}
.bar button{
  font:inherit; font-size:11px; letter-spacing:.09em; text-transform:uppercase;
  background:#191622; color:#b9b1c9; border:1px solid #2e2a3c; border-radius:3px;
  padding:6px 9px; cursor:pointer; transition:.12s;
}
.bar button:hover{color:#fff; border-color:#4a4360}
.bar button[aria-pressed="true"]{background:#2c2440; color:#fff; border-color:var(--accent)}
.bar .sep{flex:1}
.bar label{font-size:11px; letter-spacing:.09em; text-transform:uppercase; color:var(--dim); display:flex; gap:7px; align-items:center}
.bar input[type=range]{width:88px; accent-color:#ffc98a}
.bar-hint{font-size:11px; letter-spacing:.09em; text-transform:uppercase; color:var(--dim)}

@media (max-width:520px){
  body{gap:14px; padding:16px 10px 24px}
  .bar button{padding:7px 8px}
  .bar label{display:none}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important}
}
