/* CSSリセットと基本設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  background-color: #fff9e6;
  /* 薄いイエロー系 */
  color: #333;
  line-height: 1.6;
}

/* 画面コンテナ (SPA用) */
.screen {
  display: none;
  min-height: 100vh;
  padding: 20px;
}

.screen.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* 共通コンテナ */
.container {
  width: 100%;
  max-width: 500px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  padding: 30px 20px;
  margin-top: 20px;
}

/* 見出し類 */
.main-title {
  text-align: center;
  font-size: 2.5rem;
  color: #ff7b00;
  /* ポップなオレンジ */
  margin-bottom: 40px;
  text-shadow: 2px 2px 0px #ffe1b3;
}

h2 {
  font-size: 1.5rem;
  color: #ff9d00;
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px dashed #ffe1b3;
  padding-bottom: 10px;
}

/* ボタン類 */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.btn {
  border: none;
  border-radius: 30px;
  padding: 15px 20px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  text-align: center;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background-color: #ff7b00;
  color: white;
  box-shadow: 0 4px 0 #cc6200;
}

.btn-secondary {
  background-color: #ffd000;
  color: #555;
  box-shadow: 0 4px 0 #ccaa00;
}

.btn-outline {
  background-color: transparent;
  color: #ff7b00;
  border: 2px solid #ff7b00;
}

.btn-small {
  padding: 10px 15px;
  font-size: 1rem;
  background-color: #ff7b00;
  color: white;
  border-radius: 10px;
}

.divider {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 10px 0;
}

/* フォーム関連 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
  color: #ff7b00;
}

input[type="text"],
input[type="number"],
.custom-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ffecb3;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
  background-color: #fff;
}

input[type="text"]:focus,
input[type="number"]:focus,
.custom-select:focus {
  outline: none;
  border-color: #ff7b00;
}

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

/* タグリスト */
.players-list-container {
  min-height: 50px;
  margin-bottom: 20px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.tag {
  background-color: #ffe1b3;
  color: #d16500;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: fadeIn 0.3s ease;
}

.tag .delete-btn {
  background: none;
  border: none;
  color: #ff7b00;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

/* モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 20px;
  position: relative;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

/* ルーレット関連 */
.roulette-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 30px;
}

#roulette-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  background-color: #fff;
}

.roulette-pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.5rem;
  color: #ff3b3b;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.hidden {
  display: none !important;
}

.roulette-result {
  margin: 20px 0;
  padding: 15px;
  background-color: #fff;
  border: 3px solid #ff7b00;
  border-radius: 15px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #d16500;
  text-align: center;
  box-shadow: 0 4px 0 #ffe1b3;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Step 4: 確認画面とリザルト画面関連 --- */
.confirmation-card {
  background-color: #fff9e6;
  border: 3px solid #ffd000;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  width: 100%;
}

.history-count {
  font-weight: 700;
  color: #ff7b00;
  margin-bottom: 10px;
  border-bottom: 1px dashed #ffd000;
  padding-bottom: 5px;
}

.food-details p {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.highlight-eater {
  font-size: 1.3rem !important;
  color: #d16500;
  background-color: #ffe1b3;
  padding: 5px 10px;
  border-radius: 10px;
  display: inline-block;
  margin-top: 10px;
}

.photo-upload {
  text-align: center;
}

.photo-btn {
  display: inline-block;
  cursor: pointer;
  margin-bottom: 15px;
}

#photo-preview-container {
  margin-top: 15px;
  max-width: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#photo-preview {
  width: 100%;
  height: auto;
  display: block;
}

/* リザルト画面 */
.result-container {
  max-width: 600px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 30px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  font-size: 1rem;
}

.result-table th,
.result-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ffe1b3;
}

.result-table th {
  background-color: #ff7b00;
  color: white;
  font-weight: 700;
  white-space: nowrap;
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.result-table tbody tr:nth-of-type(even) {
  background-color: #fff9e6;
}

.history-list {
  background-color: #fff;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  width: 100%;
}

.history-list h3 {
  color: #ff7b00;
  border-bottom: 2px dashed #ffe1b3;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

#history-ul {
  list-style: none;
  padding-left: 0;
}

#history-ul li {
  padding: 10px 0;
  border-bottom: 1px dotted #ccc;
}

#history-ul li:last-child {
  border-bottom: none;
}

.history-item-header {
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.history-item-details {
  font-size: 0.9rem;
  color: #666;
}

/* --- Step 5: レスポンシブ調整 --- */
@media (max-width: 480px) {
  .container {
    padding: 20px 15px;
    margin-top: 10px;
    border-radius: 15px;
  }

  .main-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  h2 {
    font-size: 1.3rem;
  }

  .btn {
    padding: 12px 15px;
    font-size: 1.1rem;
  }

  input[type="text"],
  input[type="number"],
  .custom-select {
    padding: 12px;
    font-size: 1rem;
  }

  .roulette-container {
    width: 260px;
    height: 260px;
  }

  .roulette-result {
    font-size: 1.3rem;
    padding: 10px;
  }

  .result-table th,
  .result-table td {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
}