@font-face { font-family: Oxanium; src: url('./assets/fonts/oxanium.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: Manrope; src: url('./assets/fonts/manrope.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }
:root { color-scheme: dark; --bg: #111111; --fg: #fafafa; --surface: #191919; --muted: #b8b8b8; --line: #484848; --hover: #292929; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); font: 400 16px/1.6 Manrope, sans-serif; }
button { font: inherit; }
a { color: inherit; text-underline-offset: 4px; }
h1, h2, nav { font-family: Oxanium, sans-serif; }
h1, h2 { font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(20px, 2.5vw, 26px); }
h2 { font-size: clamp(28px, 4vw, 36px); }
button, a { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 16px; top: -100px; padding: 8px; background: var(--fg); color: var(--bg); z-index: 5; }
.skip:focus { top: 16px; }
/* Auto block margins share spare height; overflowing content scrolls naturally. */
.demo-page { --demo-width: clamp(360px, calc((100svh - 300px) * 670 / 660), 600px); width: min(100%, calc(var(--demo-width) + 64px)); margin: auto; padding: max(32px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 16px; flex: 0 0 auto; }
.demo-frame { position: relative; display: grid; aspect-ratio: 670 / 660; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.demo-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.demo-meta h1 { flex: 1 1 220px; }
nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action:disabled { opacity: .55; cursor: wait; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--fg); background: transparent; font-weight: 600; cursor: pointer; }
.action:hover { background: var(--hover); border-color: var(--fg); }
.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.primary:hover { background: var(--muted); color: var(--bg); }
.icon-link { width: 44px; height: 44px; padding: 8px; flex: 0 0 44px; }
.icon-link svg { width: 22px; height: 22px; }
.brand-link img { width: 28px; height: 28px; object-fit: contain; }
.brand-link, .brand-link img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.project-note { max-width: 65ch; color: var(--muted); }
.project-note p { margin: 0; }
.project-note p + p { margin-top: 8px; font-size: 14px; }
.launch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.launch p { margin: 0; color: var(--muted); }
.launch .primary { margin-top: 4px; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); width: 112px; aspect-ratio: 1; margin-bottom: 4px; flex-shrink: 0; }
.board span { display: grid; place-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 28px Manrope; }
.board span:nth-child(3n) { border-right: 0; }
.board span:nth-child(n+7) { border-bottom: 0; }
@media (max-width: 600px) {
  .demo-page { width: 100%; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 20px; }
  .demo-meta { flex-wrap: nowrap; align-items: flex-start; gap: 16px; }
  .demo-meta h1 { flex: 1; min-width: 0; font-size: clamp(22px, 6vw, 24px); text-wrap: balance; }
  .demo-meta nav { flex-shrink: 0; }
  #play { width: min(100%, 240px); }
  .launch { padding: 20px 16px; gap: 10px; }
  .board { width: 80px; }
  .board span { font-size: 24px; }
  .launch p { font-size: 14px; }
}

/* Keep Java's drawing surface and pointer coordinates at the native size. */
#display { position: absolute; top: 0; left: 0; width: 670px; height: 660px; transform-origin: top left; }
.demo-frame:has(.launch:not([hidden])) { aspect-ratio: auto; container-type: inline-size; }
.launch { min-width: 0; min-height: calc(100cqw * 660 / 670); }
.launch .launch-note { font-size: 13px; }
#play { min-width: 160px; padding: 8px 20px; }
.demo-frame[aria-busy="true"] .launch > p:not(.launch-note) { visibility: hidden; }
