/* ベーススタイル */
body {
  font-family: 'Zen Maru Gothic', sans-serif;
  background: linear-gradient(to bottom, #eaf6ff, #ffffff);
  text-align: center;
  padding: 20px;
  color: #444;
}

h1 {
  display: flex;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 10px;
  color: #336699;
}

/* レイアウト */
#layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  max-width: 1000px;
  margin: 0 auto 20px;
}

#left-panel,
#center-panel,
#right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#left-panel,
#right-panel {
  height: 470px;
}

/* バーと進捗 */
#bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar {
  width: 140px;
  text-align: left;
  font-size: 13px;
  color: #336699;
}

.progress {
  height: 10px;
  background-color: #d0e0ff;
  border-radius: 5px;
  margin-top: 5px;
  transition: width 0.3s ease;
}

/* 説明・虹アイコン */
#explain {
  margin-top: auto;
  padding-bottom: 20px;
}

#rainbow-container {
  margin-bottom: 10px;
}

#rainbow-icon {
  max-width: 140px;
  height: auto;
}

/* グリッド */
#grid {
  display: grid;
  grid-template-columns: repeat(7, 60px);
  grid-template-rows: repeat(7, 60px);
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}

.grid-cell {
  width: 60px;
  height: 60px;
  background-color: #f0f8ff;
  border-radius: 12px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.05);
  position: relative;
}

/* アイテム */
.item {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transition: transform 0.3s ease;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.item.selected {
  outline: 3px solid #ffcc80;
  transform: scale(1.05);
}

.item.glow {
  animation: glow 0.5s ease-in-out;
}

/* 雲と削除エリア */
#cloud {
  width: 100px;
  height: 100px;
  background-image: url('assets/images/cloud.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: float 3s infinite ease-in-out;
  cursor: pointer;
}

#delete-zone {
  width: 100px;
  height: 100px;
  background-image: url('assets/images/wind.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 12px;
}

/* ラベル */
.label {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
}

/* コントロールボタン */
#controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30%;
  margin-bottom: 30%;
}

#controls button {
  font-size: 14px;
  padding: 6px 12px;
  border: none;
  border-radius: 12px;
  background-color: #e0f0ff;
  color: #336699;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

#controls button:hover {
  background-color: #c0e0ff;
}

/* メッセージ */
#message {
  margin: 10px auto 20px;
  font-size: 14px;
  color: #666;
}

/* スマホ対応 */
@media screen and (max-width: 600px) {
  body {
    padding: 10px;
  }

  h1 {
    font-size: 20px;
  }

  #layout {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  #grid {
    grid-template-columns: repeat(7, 40px);
    grid-template-rows: repeat(7, 40px);
    gap: 4px;
  }

  .grid-cell {
    width: 40px;
    height: 40px;
  }

  .item {
    border-radius: 8px;
  }

  #rainbow-container {
    display: none;
  }

  #message {
    font-size: 13px;
    margin-top: 5px;
  }

  #controls {
    gap: 10px;
    margin-top: 10%;
    margin-bottom: 10%;
  }

  #controls button {
    font-size: 10px;
    padding: 6px 10px;
  }

  #left-panel,
  #center-panel,
  #right-panel {
    flex-direction: column;
    align-items: center;
  }

  #center-panel {
    padding: 10px;
    background-image: url('assets/images/rainbow.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  #left-panel {
    height: auto;
  }

  #right-panel {
    height: auto;
    flex-direction: row;
    font-size: 10px;
  }

  #bars {
    flex-direction: row;
    gap: 12px;
  }

  .bar {
    width: 100%;
    font-size: 12px;
  }

  .progress {
    height: 5px;
    margin-top: 5px;
  }

  #explain {
    font-size: 10px;
    margin-top: auto;
    padding: 0;
  }

  #cloudarea,
  #deletearea {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 80px;
  }

  .label {
    font-size: 10px;
    margin-top: 5px;
  }
}