/* 기본 설정 */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f0f2f5;
  background-image: url('coffee-at-table-copy.jpeg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right bottom;
  padding-bottom: 220px;
  padding-right: 220px;
  box-sizing: border-box;
}

/* 컨테이너 */
.container {
  max-width: 800px;
  margin: auto;
  background: white;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

/* 제목과 본문 텍스트 */
h1, h2, h3 {
  text-align: center;
  color: #333;
}
p {
  text-align: center;
  color: #666;
  margin-bottom: 10px;
}

/* 입력 및 버튼 */
.input-section {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 10px;
}
input[type="text"] {
  padding: 10px;
  font-size: 16px;
  width: 180px;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-align: center;
  text-transform: uppercase;
}
button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  background-color: #4CAF50;
}
button:hover {
  background-color: #45a049;
}

/* ✅ 정확한 새 게임 버튼 색상 적용 (클래스명으로 구분) */
.btn-new3 {
  background-color: #FD7E14 !important;
}
.btn-new3:hover {
  background-color: #e96c0a !important;
}

.btn-new4 {
  background-color: #007BFF !important;
}
.btn-new4:hover {
  background-color: #0056b3 !important;
}

.btn-new5 {
  background-color: #6F42C1 !important;
}
.btn-new5:hover {
  background-color: #59359f !important;
}

/* 피드백 */
#feedback, #feedback4 {
  font-weight: bold;
  text-align: center;
  margin-top: 10px;
}
#meaning4 {
  text-align: center;
  color: gray;
}

/* 추리 로그 */
.guess-log {
  margin-top: 15px;
  padding: 10px;
  border: 1px dashed #ccc;
  border-radius: 5px;
  background: #fafafa;
  min-height: 80px;
}

/* 색깔 힌트 박스 */
.guess {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}
.guess span {
  display: inline-block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 4px;
  font-weight: bold;
}
.correct {
  background-color: #22c55e;
  color: white;
}
.present {
  background-color: #facc15;
  color: black;
}
.absent {
  background-color: #e5e7eb;
  color: black;
}

/* 게임 룰 박스 */
.game-rules {
  background: #f8f8f8;
  border: 1px solid #eee;
  padding: 15px;
  margin-top: 20px;
  border-radius: 8px;
}

/* 결과 테이블 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
th, td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: center;
}
th {
  background-color: #eef;
}
tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* 반응형 모바일 대응 */
@media (max-width: 768px) {
  body {
    padding: 10px;
    background-image: none;
  }
  .container {
    padding: 15px 20px;
  }
  .input-section {
    flex-direction: column;
    align-items: center;
  }
  input[type="text"] {
    width: 100%;
    margin-bottom: 10px;
  }
  button {
    width: 100%;
  }
}

/* 푸터 */
.footer {
  margin-top: 40px;
  font-size: 0.75em;
  color: #9ca3af;
  text-align: center;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
}

/* 다크 모드 대응 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
    background-image: none;
  }
  .container {
    background-color: #1e1e1e;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
  }
  h1, h2, h3 {
    color: #ffffff;
  }
  p {
    color: #cccccc;
  }
  input[type="text"] {
    background-color: #2c2c2c;
    border: 1px solid #555;
    color: #f0f0f0;
  }
  button {
    background-color: #2e7d32;
  }
  button:hover {
    background-color: #1b5e20;
  }
  .btn-new3 {
    background-color: #e96c0a;
  }
  .btn-new4 {
    background-color: #0056b3;
  }
  .btn-new5 {
    background-color: #59359f;
  }
  .game-rules {
    background: #2a2a2a;
    border-color: #444;
  }
  .guess-log {
    background-color: #1b1b1b;
    border-color: #333;
  }
  .correct {
    background-color: #22c55e;
    color: white;
  }
  .present {
    background-color: #facc15;
    color: black;
  }
  .absent {
    background-color: #555;
    color: white;
  }
  table {
    background-color: #1e1e1e;
  }
  th {
    background-color: #333;
    color: #f0f0f0;
  }
  td {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }
  tr:nth-child(even) {
    background-color: #242424;
  }
  .footer {
    color: #aaaaaa;
    border-top: 1px solid #333;
  }
}
