* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--ff);
  font-weight: 700;
  font-size: var(--fs-s);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  justify-content: center;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
ul { list-style: none; }
.nw { white-space: nowrap; }

#app { position: relative; width: 100%; max-width: 430px; height: 100vh; height: 100dvh; overflow: hidden; }

.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  padding: calc(8px + var(--sa-top)) calc(16px + var(--sa-r)) calc(8px + var(--sa-bot)) calc(16px + var(--sa-l));
}
.screen.on { display: flex; }

.h-m { font-size: var(--fs-m); line-height: 1.2; }

/* ボタン */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 16px;
  font-size: var(--fs-s); line-height: 1.6; white-space: nowrap;
}
.btn.main { height: 56px; background: var(--ink); color: var(--white); }
.btn.main:active { transform: scale(0.98); }
.btn.main:disabled { opacity: 0.4; cursor: default; }
.btn.sub { height: 48px; background: var(--white); border: 2px solid var(--key-line); box-shadow: 0 4px 0 var(--key-line); }
.btn.sub:active { transform: translateY(4px); box-shadow: 0 0 0 var(--key-line); }

.icon-btn { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 16px; flex: none; }
.ico { width: 24px; height: 24px; fill: var(--ink); stroke: var(--ink); }
.ico-s { width: 20px; height: 20px; fill: var(--ink); stroke: var(--ink); flex: none; }
.ico-off { display: none; }
html[data-sound="off"] .ico-on { display: none; }
html[data-sound="off"] .ico-off { display: block; }

.top-bar { display: flex; align-items: center; height: 56px; flex: none; }
.top-bar-end { justify-content: flex-end; }
.meta { font-size: var(--fs-xs); line-height: 1.6; color: var(--ink-sub); }

/* 経験値バー */
.xp { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; flex: none; }
.xp-fill { height: 100%; width: 0%; background: var(--ink); border-radius: 4px; transition: width 0.4s ease-out; }

[hidden] { display: none !important; }
