/* 文字や余白は rem で指定。ui.js が舞台の幅に合わせて html の font-size を変える。 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #120c08;
  color: #fff;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

body { display: flex; align-items: center; justify-content: center; }

/* 縦長 480:800 の舞台。画面に収まる最大サイズで中央に置く */
#stage {
  position: relative;
  width: min(100vw, 60dvh);
  aspect-ratio: 480 / 800;
  max-height: 100dvh;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* スワイプでページがスクロールしないようにする */
  user-select: none;
}

#toolbar {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
#toolbar[hidden] { display: none; }
.mini {
  pointer-events: auto;
  font: inherit;
  font-size: 0.7rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem 1.2rem;
  background: rgba(24, 14, 8, 0.86);
  text-align: center;
  overflow-y: auto;
}
.screen[hidden] { display: none; }
.screen.overlay { background: rgba(24, 14, 8, 0.72); }

h1 { font-size: 3.2rem; margin: 0; letter-spacing: 0.3rem; color: #ffd34d; text-shadow: 0 0.2rem 0 #a8470b; }
h2 { font-size: 1.4rem; margin: 0; }
h3 { font-size: 0.9rem; margin: 0 0 0.3rem; }
.sub { margin: 0; font-size: 1rem; color: #e8d9a8; }
.how { font-size: 0.85rem; line-height: 1.7; margin: 0.4rem 0 0.8rem; color: #f3e8cc; }

button.big {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  width: 80%;
  max-width: 20rem;
  padding: 0.75rem 1rem;
  color: #3a1d05;
  background: linear-gradient(#ffd34d, #f0a020);
  border: none;
  border-radius: 0.8rem;
  box-shadow: 0 0.2rem 0 #a8470b;
}
button.big:active { transform: translateY(0.12rem); box-shadow: 0 0.08rem 0 #a8470b; }
button.big.alt { background: linear-gradient(#bfe0ff, #6aaef0); box-shadow: 0 0.2rem 0 #1f4f8a; color: #0b2a4a; }
button.big.ghost { background: transparent; color: #f3e8cc; border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: none; }
button.big:disabled { opacity: 0.4; }

.current { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: #e8d9a8; margin-top: 0.6rem; }
#current-card { width: 2.2rem; height: auto; border-radius: 0.3rem; }

.create-row { display: flex; gap: 1rem; align-items: center; justify-content: center; }
#preview-card { width: 5.6rem; height: auto; border-radius: 0.5rem; background: rgba(255, 255, 255, 0.08); }
.create-side { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; max-width: 12rem; text-align: left; }
.file-btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b2a4a;
  background: linear-gradient(#bfe0ff, #6aaef0);
  border-radius: 0.7rem;
  cursor: pointer;
}
.file-btn input { display: none; }
.note { margin: 0; font-size: 0.7rem; color: #e8d9a8; line-height: 1.5; }
.note.err { color: #ff9a8a; }

.terms {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.6;
}
.terms ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.agree { display: flex; gap: 0.5rem; align-items: center; font-weight: 800; font-size: 0.85rem; }
.agree input { width: 1.1rem; height: 1.1rem; }

#result-title { font-size: 2.4rem; color: #ffd34d; }
#result-score { font-size: 1.1rem; margin: 0 0 0.8rem; }
