body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f7f4ee 0%, #ebe6dc 48%, #d9d1bf 100%);
  color: #2f322d;
  font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", sans-serif;
}

.home-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
}

.home-shell {
  width: min(420px, calc(100vw - 32px));
  text-align: center;
  padding: 32px 18px;
  background: rgba(248, 245, 239, 0.84);
  border: 1px solid rgba(124, 110, 81, 0.28);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(68, 57, 32, 0.12);
}

.home-shell h1 {
  margin: 0;
  font-size: 1.9rem;
  color: #3c433a;
}

.list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.btn {
  width: 100%;
  max-width: 280px;
  padding: 18px 24px;
  background: #f1eadf;
  color: #37413a;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  border: 1px solid #b5a38a;
  transition: 0.2s ease;
  box-shadow: 0 4px 12px rgba(58, 47, 26, 0.08);
}

.btn:hover {
  background: #3a4a3d;
  color: #f6f3ee;
  border-color: #3a4a3d;
}

.gear-wrap {
  position: absolute;
  top: 16px;
  right: 16px;
}

.gear-button,
.gear-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #3b4139;
  background: rgba(245, 240, 231, 0.9);
  border: 1px solid #b5a38a;
  border-radius: 999px;
  padding: 6px 12px;
}

.gear-button {
  width: 42px;
  height: 42px;
  font-size: 24px;
}

.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f6f2ea 0%, #e9e0cd 100%);
}

#judge-base-line {
  position: absolute;
  bottom: 120px;
  width: 340px;
  height: 2px;
  background: #7f7669;
  z-index: 5;
}

#shinobue-guide {
  position: absolute;
  bottom: 50px;
  display: flex;
  gap: 10px;
  z-index: 10;
  width: 340px;
  justify-content: center;
}

.hole {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #9c9588;
  text-align: center;
  line-height: 40px;
  font-size: 16px;
  transition: 0.1s;
  box-sizing: border-box;
  background: #f7f3ed;
  color: #4d4f4b;
}

.active {
  background: #d8c092 !important;
  color: #2c2b27;
  border-color: #7a6546 !important;
  box-shadow: 0 0 15px rgba(122, 101, 70, 0.45);
}

#canvas {
  width: 340px;
  height: 100%;
  position: absolute;
  top: 0;
  overflow: visible;
  pointer-events: none;
}

.note {
  fill: #ffcc00;
  rx: 10;
}

.start-bar {
  fill: none;
  stroke: #8b806f;
  stroke-width: 1px;
}

.nav {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 100;
  display: flex;
  gap: 8px;
}

.back {
  color: #3b4139;
  text-decoration: none;
  border: 1px solid #b5a38a;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 240, 231, 0.85);
}

.settings-page {
  padding: 24px;
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto 16px;
}

.settings-header h1 {
  margin: 0;
}

.settings-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.settings-panel {
  background: rgba(248, 245, 239, 0.92);
  border: 1px solid rgba(124, 110, 81, 0.32);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(68, 57, 32, 0.08);
}

.field-label {
  display: block;
  font-weight: bold;
  margin-bottom: 12px;
}

.field-input,
.cell-input {
  width: 100%;
  border: 1px solid #b8ad95;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbf8f2;
  color: #2f322d;
  box-sizing: border-box;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.save-status {
  color: #5c5a55;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.small-btn,
.delete-btn {
  border: 1px solid #b5a38a;
  background: #f1eadf;
  color: #37413a;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.small-btn:hover,
.delete-btn:hover {
  background: #3a4a3d;
  color: #f6f3ee;
}

.table-wrap {
  overflow-x: auto;
}

.note-table {
  width: 100%;
  border-collapse: collapse;
}

.note-table th,
.note-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(124, 110, 81, 0.28);
  text-align: left;
}

.preview-panel h2 {
  margin-top: 0;
}

.speed-value {
  margin-bottom: 12px;
  font-weight: bold;
}

.preview-frame {
  position: relative;
  height: 220px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9f5ef 0%, #ece3cf 100%);
  border: 1px solid rgba(124, 110, 81, 0.4);
  overflow: hidden;
}

.preview-guide {
  position: absolute;
  top: 24px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #7f7669;
}

.preview-bar {
  position: absolute;
  left: 12px;
  width: 100px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b69b62, #d6b26d);
  animation: flow 2.4s linear infinite;
}

.hint {
  margin-top: 12px;
  color: #5c5a55;
  font-size: 0.9rem;
}

@keyframes flow {
  from { transform: translateY(0px); }
  to { transform: translateY(170px); }
}

@media (max-width: 760px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }
}
