/* Yaoki app: the page around the screens. The screens style themselves inline. */
html, body { margin: 0; height: 100%; }
html {
  color-scheme: light;
  background: #F4F5F9;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow: hidden;
  overscroll-behavior: none;
  background: #F4F5F9;
  color: #1B2440;
  font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* on its own page the app owns the whole screen, edge to edge, and never scrolls or bounces */
html.yk-own body { position: fixed; left: 0; top: 0; right: 0; bottom: 0; }

/* shown as a page inside Claude, the app keeps clear of the phone's system bars */
html.yk-hosted #yk-view { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); bottom: env(safe-area-inset-bottom, 0px); width: auto; height: auto; }

/* the area the app may use, and inside it the 390 by 844 design, which yk-app.js scales to fit */
#yk-view { position: relative; width: 100%; height: 100%; overflow: hidden; background: #F4F5F9; }
#yk-stage {
  position: absolute;
  left: 0; top: 0;
  width: 390px; height: 844px;
  overflow: hidden;
  transform-origin: 0 0;
  background: #F4F5F9;
  visibility: hidden;
}
html.yk-ready #yk-stage { visibility: visible; }
#yk-stage > .sc-host { width: 390px; height: 100%; }

/* in a wide window the app sits in the middle like a phone */
html.yk-boxed, html.yk-boxed body, html.yk-boxed #yk-view { background: #C9D0E3; }
html.yk-boxed #yk-stage { border-radius: 30px; box-shadow: 0 0 0 3px #1B2440, 0 20px 50px rgba(27, 36, 64, 0.28); }

/* the same starting point for buttons in every browser; each button's own inline style still wins */
button {
  margin: 0;
  padding: 1px 6px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
a { touch-action: manipulation; -webkit-user-drag: none; }

/* lists that scroll inside a screen keep their scroll to themselves and show no bar */
#yk-stage [style*="overflow-y: auto"] { overscroll-behavior: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#yk-stage [style*="overflow-y: auto"]::-webkit-scrollbar { display: none; }

.sc-logic-error { padding: 8px 12px; background: #C7361E; color: #FFFFFF; font: 700 12px/1.4 ui-monospace, monospace; }
noscript { display: block; padding: 40px 24px; font-weight: 700; }

/* a phone held sideways gets a note instead of a tiny upright app */
#yk-sideways { display: none; }
html.yk-sideways #yk-view { visibility: hidden; }
html.yk-sideways #yk-sideways {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #F4F5F9; color: #1B2440; font-size: 15px; font-weight: 700;
}
html.yk-sideways #yk-sideways [lang="ja"] { font-size: 20px; font-weight: 800; }
