*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #fff;
  color: #111;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px;
  width: 100%;
  max-width: 400px;
}

.title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.wheel-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pointer {
  font-size: 1.8rem;
  color: #111;
  margin-bottom: -6px;
  z-index: 2;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

canvas {
  border-radius: 50%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  display: block;
}

.result {
  font-size: 1.4rem;
  font-weight: 700;
  min-height: 2rem;
  text-align: center;
  letter-spacing: 0.05em;
  transition: opacity 0.3s;
}

.spin-btn {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, transform 0.1s;
  touch-action: manipulation;
}

.spin-btn:active { transform: scale(0.97); }
.spin-btn:disabled { background: #aaa; cursor: not-allowed; }

.edit-btn {
  background: transparent;
  color: #555;
  border: 1.5px solid #ccc;
  border-radius: 40px;
  padding: 10px 32px;
  font-size: 0.9rem;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
  touch-action: manipulation;
}

.edit-btn:hover { border-color: #888; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  transform: translateY(40px);
  transition: transform 0.25s;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.menu-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid #eee;
  border-radius: 10px;
  font-size: 0.95rem;
}

.menu-list li .del-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.2s;
}

.menu-list li .del-btn:hover { color: #e33; }

.add-row {
  display: flex;
  gap: 10px;
}

.add-row input {
  flex: 1;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: 'Noto Sans JP', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.add-row input:focus { border-color: #111; }

.add-row button {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}

.close-btn {
  background: transparent;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  touch-action: manipulation;
}