* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #1a110c;
  overflow: hidden;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

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

#stage {
  --s: 1;
  position: relative;
  width: 360px;
  height: 640px;
  font-size: calc(14px * var(--s));
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 0.6em;
  padding: 1.2em;
  background: rgba(26, 17, 12, 0.88);
  text-align: center;
  overflow-y: auto;
  touch-action: manipulation;
}

.hidden { display: none !important; }

h1 {
  margin: 0 0 0.2em;
  font-size: 2.4em;
  line-height: 1.15;
  color: #ffd84a;
  text-shadow: 0 0.12em 0 #8a5a32;
}

h2 {
  margin: 0 0 0.3em;
  font-size: 1.4em;
  line-height: 1.35;
}

.sub { margin: 0 0 0.6em; font-size: 0.95em; color: #f3e2cf; }

.btn {
  min-width: 70%;
  padding: 0.7em 1em;
  border: 2px solid #f3c58a;
  border-radius: 0.6em;
  background: #5c3a1e;
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: #7a4d27; outline: none; }
.btn.primary { background: #e0533d; border-color: #ffb199; }
.btn.primary:hover, .btn.primary:focus-visible { background: #f06a52; }
.btn.small { min-width: 50%; padding: 0.45em 0.8em; font-size: 0.9em; }

.records {
  display: flex;
  gap: 1.2em;
  font-size: 0.9em;
  color: #f3e2cf;
}
.records strong { color: #ffd84a; font-size: 1.15em; }

.howto {
  margin: 0.2em 0;
  padding-left: 1.4em;
  text-align: left;
  font-size: 0.82em;
  line-height: 1.5;
  color: #e6d6c4;
}

.card-list {
  display: flex;
  gap: 0.5em;
  width: 100%;
  justify-content: center;
}

.card {
  flex: 1 1 0;
  max-width: 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  padding: 0.8em 0.4em;
  border: 2px solid #f3c58a;
  border-radius: 0.6em;
  background: #fff7ea;
  color: #3a2a1e;
  font: inherit;
  cursor: pointer;
}
.card .icon { font-size: 2em; line-height: 1; }
.card .name { font-weight: bold; font-size: 0.9em; }
.card .desc { font-size: 0.75em; line-height: 1.35; }
.card .key { font-size: 0.7em; color: #8a5a32; }
.card.selected, .card:hover { border-color: #e0533d; box-shadow: 0 0 0 3px #ffd84a; }

.hint { margin: 0.3em 0; font-size: 0.78em; color: #d9c6b2; }

.mode { margin: 0; color: #9fe3ff; font-weight: bold; }

.stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.35em 1em;
  margin: 0.3em 0;
  font-size: 1em;
}
.stats dt { text-align: right; color: #d9c6b2; }
.stats dd { margin: 0; text-align: left; font-weight: bold; }

.new {
  color: #ff5a3c;
  font-weight: bold;
  animation: blink 0.8s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.emoji {
  margin: 0.2em 0;
  max-width: 100%;
  word-break: break-all;
  font-size: 1.1em;
  line-height: 1.3;
}

#daily-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#copy-fallback {
  width: 100%;
  font: inherit;
  font-size: 0.8em;
  color: #000;
  -webkit-user-select: text;
  user-select: text;
}
