:root {
  --correct-color: #6aaa64;
  --present-color: #c9b458;
  --absent-color: #787c7e;
  --keyboard-color: #d3d6da;
  --border-color: #d3d6da;
  --text-color: #1a1a1b;
  --background-color: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 580px;
  min-width: 320px;
  width: 100%;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  margin-bottom: 20px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
}

.menu {
  display: flex;
  gap: 10px;
}

button {
  background-color: var(--keyboard-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  padding: 8px 12px;
}

button:hover {
  opacity: 0.8;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 30px;
}

#game-board {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 2.5rem;
  width: 100%;
}

/* 오늘의 문제 정보 스타일 */
#today-info {
  text-align: center;
  margin-bottom: 15px;
  padding: 8px;
  font-weight: bold;
  color: #333;
  border-radius: 5px;
  background-color: #f0f0f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#today-date {
  margin: 0 5px;
  color: #e67e22;
}

/* 날짜 네비게이션 버튼 스타일 */
.date-nav-btn {
  display: inline-block;
  margin: 0 10px;
  padding: 5px 10px;
  color: #666;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s;
  user-select: none;
}

.date-nav-btn:hover {
  background-color: #e8e8e8;
  color: #333;
}

.date-nav-btn.disabled {
  color: #ccc;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
  background-color: transparent;
}

.row {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.tile {
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  width: 100%;
  max-width: 3.5rem;
  aspect-ratio: 1 / 1;
  text-transform: uppercase;
  user-select: none;
  position: relative;
}

.tile.filled {
  border-color: #878a8c;
}

.tile.correct {
  background-color: var(--correct-color);
  border-color: var(--correct-color);
  color: white;
}

.tile.present {
  background-color: var(--present-color);
  border-color: var(--present-color);
  color: white;
}

.tile.absent {
  background-color: var(--absent-color);
  border-color: var(--absent-color);
  color: white;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #09f;
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  right: -30px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.key {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--keyboard-color);
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  height: 58px;
  flex: 1;
  text-transform: uppercase;
  user-select: none;
}

/* 스페이서 스타일 추가 */
.spacer {
  height: 58px; /* .key와 동일한 높이 */
  flex: 1; /* .key와 동일한 flex 비율 */
  background: none; /* 배경 없음 */
  border: none; /* 테두리 없음 */
  pointer-events: none; /* 클릭 이벤트 무시 */
}

.key:hover {
  opacity: 0.8;
}

.key.wide {
  flex: 1.5;
}

.key.correct {
  background-color: var(--correct-color);
  color: white;
}

.key.present {
  background-color: var(--present-color);
  color: white;
}

.key.absent {
  background-color: var(--absent-color);
  color: white;
}

#message-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px 25px;
  border-radius: 4px;
  z-index: 9999;
  text-align: center;
  max-width: 90%;
}

.hidden {
  display: none !important;
}

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

.modal-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 480px;
  width: 90%;
  position: relative;
  line-height: 1.6;
}
.modal-content h2 {
  margin-bottom: 0.3em;
}
#answer-message {
  padding: 10px 0;
}
#shareBtn {
  margin-top: 1em;
  font-size: 1em;
}

/* 게임 방법 모달 스타일 */
.how-to-intro {
  margin-bottom: 20px;
  text-align: center;
  font-size: 15px;
  color: #444;
}

.example {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.example-tiles {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.example-tile {
  width: 40px;
  height: 40px;
  border: 2px solid #d3d6da;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin: 0 2px;
  background-color: white;
}

.example-tile.correct {
  background-color: var(--correct-color);
  border-color: var(--correct-color);
  color: white;
}

.example-tile.present {
  background-color: var(--present-color);
  border-color: var(--present-color);
  color: white;
}

.example-tile.absent {
  background-color: var(--absent-color);
  border-color: var(--absent-color);
  color: white;
}

.example-tile.small-text {
  font-size: 16px;
  color: #e74c3c;
}

.example-desc {
  font-size: 14px;
  color: #555;
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

.close {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 24px;
  cursor: pointer;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
  .tile {
    font-size: 1.4rem;
  }

  #keyboard {
    gap: 3px;
  }

  .keyboard-row {
    gap: 3px;
  }

  .key {
    height: 48px;
    font-size: 0.9rem;
  }
  .spacer {
    height: 48px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  button {
    padding: 6px 8px;
    font-size: 0.8rem;
  }
}

#login-status {
  margin-left: 15px;
  font-size: 0.9em;
  color: #e67e22; /* 주황색 계열 */
  font-weight: bold;
}

/* 로그인 필요 메시지 스타일 */
.login-required-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 20px auto;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  line-height: 1.6;
}

.login-required-message p {
  margin: 10px 0;
  font-size: 16px;
  color: #333;
}

.login-required-message p:first-child {
  font-weight: bold;
  color: #e74c3c;
}

/* 자유문제 버튼 강조 효과 */
.highlight {
  animation: pulse 2s infinite;
  box-shadow: 0 0 10px 5px rgba(52, 152, 219, 0.5);
  background-color: #3498db !important;
  color: white !important;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* 로그인 상태 메시지 제거 */
#login-status.hidden {
  display: none;
}

.example .example-tiles {
  display: flex;
  justify-content: center;
}

.spacer-small {
  width: 15px;
}

/* 에러 모달 스타일 */
#errorModal .modal-content {
  text-align: center;
}

#error-message {
  margin: 20px 0;
  color: #d32f2f;
  font-weight: bold;
  line-height: 1.5;
}

#refreshBtn {
  background-color: #1976d2;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 6px;
  margin-top: 10px;
}

#refreshBtn:hover {
  background-color: #1565c0;
}

/* 날짜 네비게이션 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
} 