:root {
  --bg: #FFF9F0;
  --bg-card: #FFFFFF;
  --primary: #FF8FA3;
  --primary-dark: #E76F8A;
  --accent: #FFD56B;
  --text: #3A3A3A;
  --text-muted: #7A7A7A;
  --ok: #4CAF50;
  --ng: #F06292;
  --border: #FFE0CC;
  --shadow: 0 4px 0 rgba(0,0,0,0.08);
  --radius: 18px;

  --finger-L1: #E74C3C;
  --finger-L2: #F39C12;
  --finger-L3: #F1C40F;
  --finger-L4: #2ECC71;
  --finger-R4: #1ABC9C;
  --finger-R3: #3498DB;
  --finger-R2: #9B59B6;
  --finger-R1: #E91E63;
  --finger-T:  #95A5A6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo UI", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  padding: 16px;
}

h1 {
  font-size: 32px;
  margin: 16px 0 8px;
  color: var(--primary-dark);
}

h2 {
  font-size: 24px;
  margin: 16px 0 8px;
}

a {
  color: var(--primary-dark);
}

ruby rt {
  font-size: 0.5em;
  color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px auto;
  max-width: 720px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
}

.btn {
  display: inline-block;
  min-height: 64px;
  min-width: 64px;
  padding: 14px 24px;
  font-size: 22px;
  font-weight: bold;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--primary-dark);
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:hover { filter: brightness(1.05); }
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--primary-dark);
}

.btn.secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 0 var(--border);
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.btn:disabled {
  background: #ccc;
  box-shadow: 0 4px 0 #999;
  cursor: not-allowed;
}

.input {
  width: 100%;
  font-size: 24px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin: 8px 0;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
}

.error {
  color: var(--ng);
  font-weight: bold;
  margin: 8px 0;
}

.muted {
  color: var(--text-muted);
}

.center { text-align: center; }

.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.grid {
  display: grid;
  gap: 16px;
}

.level-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.level-card {
  background: #fff;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.08s;
}
.level-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.level-card.current { border-color: var(--primary); background: #FFF3F6; }
.level-card.locked {
  background: #EEE;
  color: #999;
  cursor: not-allowed;
}
.level-card .level-num { font-size: 36px; font-weight: bold; color: var(--primary-dark); }
.level-card.locked .level-num { color: #aaa; }
.level-card .level-name { font-size: 18px; margin-top: 4px; }
.level-card .stars { font-size: 22px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
