:root {
  --ink: #1b1d3a;
  --hot: #ff4d4d;
  --gold: #ffcc33;
  --paper: #fff8e8;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; margin: 0; overflow: hidden; background: #5ab6ff;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}
button { font: inherit; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* パネル */
#title, #result, #sharebox {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10, 12, 30, .45);
}
#title[hidden], #result[hidden], #sharebox[hidden], #rival[hidden], #rrival[hidden], button[hidden] { display: none; }
.panel {
  width: min(92vw, 400px); max-height: calc(100% - 20px); overflow-y: auto;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 16px; text-align: center;
}
.logo {
  font-weight: 900; font-size: min(44px, 11vw); line-height: 1.05; color: var(--hot);
  text-shadow: 3px 3px 0 var(--ink); letter-spacing: 1px;
}
.lead { margin-top: 8px; font-weight: 700; font-size: 14px; }
#rival {
  margin-top: 10px; padding: 8px; border-radius: 10px; background: #ffe7a8; border: 2px solid var(--ink);
  font-weight: 800; font-size: 15px;
}
#tbest { margin-top: 8px; font-size: 14px; font-weight: 700; opacity: .8; }
.howto { list-style: none; padding: 0; margin: 12px 0 14px; text-align: left; font-size: 13px; line-height: 1.7; }
.howto li { padding-left: 4px; }
.howto b { color: var(--hot); }
.howto b.k { display: inline-block; min-width: 108px; }
.howto b.blue { color: #1f7ae0; }
.howto b.gold { color: #d08a00; }
.howto b.gray { color: #6b7280; }

.main, .sub {
  border: 3px solid var(--ink); border-radius: 14px; padding: 10px 22px; font-weight: 800; font-size: 18px; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}
.main { background: var(--hot); color: #fff; }
button.sub { background: #fff; color: var(--ink); margin-top: 0; font-size: 16px; }
.main:active, button.sub:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.rtitle { font-weight: 900; font-size: 22px; }
.rnum { font-weight: 900; font-size: 64px; line-height: 1.1; color: var(--hot); font-variant-numeric: tabular-nums; text-shadow: 3px 3px 0 var(--ink); }
.rnum .unit { font-size: 28px; margin-left: 4px; }
.rsub { font-weight: 700; font-size: 14px; margin-top: 4px; }
.rbest { font-weight: 800; font-size: 15px; margin-top: 6px; min-height: 1.2em; }
.rbest.new { color: #d08a00; }
.rbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

#shareimg { width: 100%; border-radius: 10px; border: 2px solid var(--ink); }
.note { font-size: 12px; margin: 6px 0; }
#sharetext { width: 100%; height: 84px; font-size: 13px; border-radius: 8px; border: 2px solid var(--ink); padding: 6px; resize: none; }

.rrival { font-weight: 800; font-size: 15px; margin-top: 6px; padding: 6px; border-radius: 10px; background: #ffe7a8; border: 2px solid var(--ink); }
