
:root {
  --ink: #33272a;
  --cream: #fff1c9;
  --accent: #f25c54;
  --blue: #4a6fa5;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--ink); color: var(--ink);
  font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#wrap {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: var(--cream);
  overflow: hidden;
  font-size: min(2vw, 3.555vh);   /* 폭 800 일 때 16px */
  touch-action: none;
}
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.7em; padding: 1.5em;
  background: rgba(255, 241, 201, 0.93);
  text-align: center;
}
.panel[hidden], .calbox[hidden] { display: none; }
h1 { margin: 0; font-size: 4em; letter-spacing: 0.05em; line-height: 1; }
h2 { margin: 0; font-size: 2.6em; line-height: 1.1; }
h3 { margin: 0; font-size: 1.05em; }
p { margin: 0; line-height: 1.5; }
.sub { opacity: 0.7; }
.small { font-size: 0.8em; opacity: 0.7; }
.how { list-style: none; margin: 0.4em 0; padding: 0; font-size: 1.1em; line-height: 2.2; text-align: left; }
.row { display: flex; gap: 0.6em; flex-wrap: wrap; justify-content: center; align-items: center; }
button {
  font: inherit; color: var(--ink);
  background: #fff; border: 0.16em solid var(--ink); border-radius: 0.7em;
  padding: 0.35em 0.9em; cursor: pointer;
  box-shadow: 0 0.2em 0 var(--ink);
}
button:active { transform: translateY(0.2em); box-shadow: none; }
button:disabled { opacity: 0.4; cursor: default; }
button.big { font-size: 1.5em; font-weight: 700; background: var(--accent); color: #fff; padding: 0.35em 1.6em; }
button.mini { font-size: 0.8em; padding: 0.1em 0.7em; }
kbd {
  font: inherit; font-size: 0.85em; background: #fff;
  border: 0.12em solid var(--ink); border-radius: 0.4em; padding: 0.05em 0.5em;
}
.cal { display: flex; gap: 1.2em; align-items: stretch; }
.calbox {
  width: 21em;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.5em;
  padding: 0.8em;
  background: rgba(255, 255, 255, 0.55);
  border: 0.12em solid var(--ink); border-radius: 0.9em;
}
#c-pad {
  width: 5em; height: 5em; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1em; font-weight: 700;
  background: #fff; border: 0.16em solid var(--ink); cursor: pointer;
}
#c-pad.on { background: #ffd166; }
#v-cv {
  width: 16.5em; height: 5.5em; display: block;   /* 안쪽 해상도와 같은 3:1 */
  background: #fff; border: 0.12em solid var(--ink); border-radius: 0.6em;
}
.score { font-size: 3.6em; font-weight: 800; line-height: 1; }
.score .unit { font-size: 0.4em; margin-left: 0.15em; }
.counts { display: flex; gap: 1.3em; font-size: 1.05em; line-height: 1.25; }
.counts b { display: block; font-size: 1.7em; }
/* 결과 화면: 왼쪽은 이번 판의 결과, 오른쪽은 순위표. 순위표는 Discord 에 연결한 판에서만 채운다 */
.res { display: flex; gap: 1.4em; align-items: center; justify-content: center; }
.res-main { display: flex; flex-direction: column; align-items: center; gap: 0.7em; max-width: 30em; }
#r-board {
  width: 15.5em; font-size: 0.88em; text-align: left;
  display: flex; flex-direction: column; gap: 0.22em;
  padding: 0.7em 0.8em;
  background: rgba(255, 255, 255, 0.55);
  border: 0.12em solid var(--ink); border-radius: 0.9em;
}
#r-board[hidden] { display: none; }
.lb-head { font-weight: 700; text-align: center; margin-bottom: 0.2em; }
.lb-note { font-size: 0.85em; opacity: 0.7; text-align: center; }
.lb-row { display: flex; align-items: center; gap: 0.45em; padding: 0.08em 0.4em; border-radius: 0.5em; line-height: 1.5; }
.lb-row.me { background: #ffd166; font-weight: 700; }
.lb-rank { width: 1.7em; text-align: right; font-variant-numeric: tabular-nums; }
.lb-av { width: 1.35em; height: 1.35em; border-radius: 50%; background: #ddd; flex: none; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-variant-numeric: tabular-nums; }
.lb-gap { text-align: center; line-height: 0.8; opacity: 0.6; }
