/* ことばカウンター（表示） */
html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  font-family: "Yu Gothic UI", "Meiryo", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 14px;
  background: rgba(20, 24, 33, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 10px;
  z-index: 10;
}
.hint a { color: #8fd3ff; }

.notice {
  position: fixed;
  left: 12px;
  top: 12px;
  padding: 10px 14px;
  background: rgba(160, 30, 40, 0.92);
  color: #fff;
  font-size: 14px;
  border-radius: 10px;
  z-index: 11;
}

.counter {
  --base: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--base) * 0.5);
  padding: calc(var(--base) * 1.3) calc(var(--base) * 0.5) calc(var(--base) * 0.5);
  align-items: flex-start;
}
.counter.size-S { --base: 20px; }
.counter.size-M { --base: 28px; }
.counter.size-L { --base: 40px; }
.counter.layout-column { flex-direction: column; flex-wrap: nowrap; }

.card {
  position: relative;
  min-width: calc(var(--base) * 4.2);
  padding: calc(var(--base) * 0.35) calc(var(--base) * 0.6) calc(var(--base) * 0.45);
  border-radius: calc(var(--base) * 0.6);
  text-align: center;
  box-sizing: border-box;
}
.label {
  font-size: calc(var(--base) * 0.62);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.num {
  font-size: calc(var(--base) * 1.5);
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.num.bump { animation: bump 0.45s ease-out; }
@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.plus {
  position: absolute;
  right: calc(var(--base) * 0.3);
  top: calc(var(--base) * 0.1);
  font-size: calc(var(--base) * 0.6);
  font-weight: 800;
  pointer-events: none;
  animation: plus 1.1s ease-out forwards;
}
@keyframes plus {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(calc(var(--base) * -1.2)); }
}
.goal {
  height: calc(var(--base) * 0.22);
  margin-top: calc(var(--base) * 0.2);
  border-radius: 999px;
  overflow: hidden;
}
.goal .fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.4s ease-out;
}
.goal-text {
  margin-top: calc(var(--base) * 0.12);
  font-size: calc(var(--base) * 0.42);
  font-weight: 700;
  opacity: 0.85;
}

/* ---- pop（明るい） ---- */
.theme-pop .card {
  background: rgba(255, 255, 255, 0.94);
  color: #2b2d42;
  box-shadow: 0 calc(var(--base) * 0.12) calc(var(--base) * 0.4) rgba(0, 0, 0, 0.25);
  border-bottom: calc(var(--base) * 0.16) solid var(--accent);
}
.theme-pop .card:nth-child(6n+1) { --accent: #ff6b8b; }
.theme-pop .card:nth-child(6n+2) { --accent: #ffb547; }
.theme-pop .card:nth-child(6n+3) { --accent: #4cc9a0; }
.theme-pop .card:nth-child(6n+4) { --accent: #4ea8ff; }
.theme-pop .card:nth-child(6n+5) { --accent: #a77bff; }
.theme-pop .card:nth-child(6n+6) { --accent: #ff7b54; }
.theme-pop .card.total { --accent: #2b2d42; }
.theme-pop .num { color: var(--accent); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.08); }
.theme-pop .plus { color: var(--accent); }
.theme-pop .goal { background: rgba(43, 45, 66, 0.12); }
.theme-pop .goal .fill { background: var(--accent); }
.theme-pop .card.reached { box-shadow: 0 0 0 calc(var(--base) * 0.12) var(--accent), 0 calc(var(--base) * 0.12) calc(var(--base) * 0.4) rgba(0, 0, 0, 0.25); }

/* ---- simple（暗い半透明） ---- */
.theme-simple .card {
  background: rgba(16, 18, 26, 0.72);
  color: #fff;
}
.theme-simple .label { opacity: 0.85; }
.theme-simple .plus { color: #ffe066; }
.theme-simple .goal { background: rgba(255, 255, 255, 0.18); }
.theme-simple .goal .fill { background: #ffe066; }
.theme-simple .card.reached { background: rgba(60, 50, 10, 0.8); }

/* ---- neon（光る） ---- */
.theme-neon .card {
  background: rgba(8, 6, 20, 0.78);
  color: #fff;
  border: 2px solid var(--neon);
  box-shadow: 0 0 calc(var(--base) * 0.35) var(--neon), inset 0 0 calc(var(--base) * 0.25) var(--neon);
}
.theme-neon .card:nth-child(4n+1) { --neon: #ff4fd8; }
.theme-neon .card:nth-child(4n+2) { --neon: #3ff0ff; }
.theme-neon .card:nth-child(4n+3) { --neon: #b6ff3f; }
.theme-neon .card:nth-child(4n+4) { --neon: #ffd23f; }
.theme-neon .card.total { --neon: #ffffff; }
.theme-neon .num { color: #fff; text-shadow: 0 0 calc(var(--base) * 0.2) var(--neon), 0 0 calc(var(--base) * 0.5) var(--neon); }
.theme-neon .label { color: var(--neon); }
.theme-neon .plus { color: var(--neon); text-shadow: 0 0 8px var(--neon); }
.theme-neon .goal { background: rgba(255, 255, 255, 0.12); }
.theme-neon .goal .fill { background: var(--neon); box-shadow: 0 0 10px var(--neon); }
.theme-neon .card.reached { animation: neon-pulse 1.6s ease-in-out infinite; }
@keyframes neon-pulse {
  0%, 100% { box-shadow: 0 0 calc(var(--base) * 0.35) var(--neon), inset 0 0 calc(var(--base) * 0.25) var(--neon); }
  50% { box-shadow: 0 0 calc(var(--base) * 0.8) var(--neon), inset 0 0 calc(var(--base) * 0.4) var(--neon); }
}
