  @font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/fonts/baloo2-latin.woff2) format('woff2'); }

  /* Layout: blank screen until a key is typed; then the giant letter or number, its example picture + words, and Next. Single bright look on purpose. */
  :root {
    --bg: #fff8ec;
    --ink: #2a2140;
    --faint: rgba(42, 33, 64, .28);
    --muted-ink: #6d6680;
    --chip: #ffffff;
    --shadow: rgba(42, 33, 64, .18);
    --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  }
  html, body { height: 100%; }
  [hidden] { display: none !important; }
  body {
    background: var(--bg); color: var(--ink);
    font-family: var(--display);
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
  }
  .blank {
    height: 100%; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 16px;
    cursor: pointer;
  }
  .hint { color: var(--faint); font: 600 clamp(1.2rem, 3vw, 1.8rem) var(--display); text-align: center; }
  /* two views: Type (blank screen + keyboard) and Tap (on-screen buttons) */
  .views {
    position: fixed; z-index: 7;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    display: flex; gap: 4px; padding: 4px; border-radius: 999px;
    background: var(--chip); box-shadow: 0 2px 8px var(--shadow);
  }
  .views a {
    font: 600 1rem var(--display); color: var(--ink); text-decoration: none;
    padding: 4px 16px; border-radius: 999px;
  }
  .views a[aria-current="page"] { background: var(--ink); color: var(--bg); }
  /* home link back to avdcltd.com, same pill style as the views switch */
  .home {
    position: fixed; z-index: 7;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: max(16px, env(safe-area-inset-left, 0px));
    font: 600 1rem var(--display); color: var(--ink); text-decoration: none;
    padding: 8px 16px; border-radius: 999px;
    background: var(--chip); box-shadow: 0 2px 8px var(--shadow);
  }
  .home:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
  .views a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
  .tapview {
    position: fixed; inset: 0; overflow-y: auto; box-sizing: border-box;
    padding: calc(64px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .tapview h2 { font: 800 clamp(1.3rem, 3vw, 1.8rem) var(--display); margin: 8px 0 10px; color: var(--muted-ink); letter-spacing: .02em; }
  .tiles {
    display: grid; gap: clamp(6px, 1.2vw, 12px); margin-bottom: 20px;
    grid-template-columns: repeat(auto-fill, minmax(clamp(58px, 10vw, 110px), 1fr));
  }
  .tiles.wide { grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 18vw, 200px), 1fr)); }
  .tile {
    aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 22%;
    background: var(--c); color: #fff; cursor: pointer;
    font: 800 clamp(1.8rem, 5vw, 3.6rem)/1 var(--display);
    box-shadow: 0 4px 0 var(--d);
  }
  .tiles.wide .tile { aspect-ratio: 2 / 1; border-radius: 18px; font-size: clamp(1.3rem, 3vw, 2.2rem); }
  .tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--d); }
  .tile:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
  .mode {
    position: fixed; z-index: 6;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    display: flex; background: var(--chip); border-radius: 999px; padding: 4px;
    box-shadow: 0 2px 8px var(--shadow); opacity: .6;
  }
  .mode:hover, .mode:focus-within { opacity: 1; }
  .mode select {
    font: 600 .9rem var(--display); border: 0; background: transparent; color: var(--ink);
    padding: 4px 8px; max-width: 60vw; cursor: pointer;
  }
  .pic.tens { display: grid; grid-template-columns: repeat(10, auto); justify-content: center; }
  .pic.mountain { flex-direction: column; align-items: center; flex-wrap: nowrap; }
  .pic.mountain .tier { display: flex; justify-content: center; margin-top: -0.18em; }
  .example.on .pic.mountain .tier { animation: tumble .5s ease-out backwards; }
  @keyframes tumble { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .mode button {
    font: 600 .95rem var(--display); border: 0; background: transparent; color: var(--ink);
    padding: 4px 14px; border-radius: 999px; cursor: pointer;
  }
  .mode button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  button:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }

  .show {
    position: fixed; inset: 0; z-index: 5;
    background: var(--c);
    display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 1.5vh;
    overflow: hidden;
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
  }
  .big {
    color: #fff; cursor: pointer;
    font: 800 min(52vh, 80vw)/0.85 var(--display);
    text-shadow: 0 1vh 0 var(--d);
    animation: pop .6s ease-out;
  }
  .big .lower { font-size: .55em; opacity: .9; margin-left: .05em; }
  .example {
    display: flex; flex-direction: column; align-items: center; gap: .5vh;
    color: #fff; text-align: center;
    visibility: hidden;
  }
  .example.on { visibility: visible; animation: rise .4s ease-out; }
  .pic { font-size: min(14vh, 22vw); line-height: 1; display: flex; flex-wrap: wrap; justify-content: center; max-width: 90vw; }
  .pic.many { font-size: min(9vh, 14vw); }
  .words { font: 800 clamp(1.6rem, 6vh, 3.4rem)/1.1 var(--display); text-shadow: 0 3px 0 var(--d); }
  @keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
  .next {
    font: 800 clamp(1.4rem, 4.5vh, 2.4rem) var(--display);
    color: var(--d); background: #fff; border: 0; border-radius: 999px;
    padding: .15em 1.4em; box-shadow: 0 6px 0 rgba(0,0,0,.2); cursor: pointer;
  }
  @media (prefers-reduced-motion: reduce) { .big, .example.on { animation: none; } }
  body { margin: 0; }
  .views a[aria-current="page"] { background: var(--ink); color: var(--bg); }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
