/* 공통 변수 */
:root {
  --primary-color: #FFD700;
  --secondary-color: #FFA500;
  --text-color: #fff;
  --background-color: #000;
  --modal-background: rgba(0, 0, 0, 0.8);
  --border-color: rgba(255, 255, 255, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
  --glass-background: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.3);
  --overlay-dark: rgba(0, 0, 0, 0.6);
  --gold-color: #FFD700;
  --gold-bg: rgba(255, 215, 0, 0.8);
  --gold-border: rgba(255, 215, 0, 0.9);
  --white-bg: rgba(255, 255, 255, 0.2);
  --white-border: rgba(255, 255, 255, 0.5);
}

/* 공통 애니메이션 */
@keyframes pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.1); opacity: 0.8; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes glow {
  from { text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
  to { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes backgroundMove {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 키워드/이미지 등장 애니메이션 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96);}
  to   { opacity: 1; transform: translateY(0) scale(1);}
}
@keyframes fadeOutDown {
  from { opacity: 1; transform: translateY(0) scale(1);}
  to   { opacity: 0; transform: translateY(30px) scale(0.96);}
}
@keyframes popScore {
  0% { transform: scale(1);}
  40% { transform: scale(1.25);}
  100% { transform: scale(1);}
}
@keyframes buttonPress {
  0% { transform: scale(1);}
  50% { transform: scale(0.93);}
  100% { transform: scale(1);}
}

/* 기본 스타일 */
html {
  overflow: hidden;
  max-height: 100vh;
  width: 100%;
}

body {
  background: #f9f9fb;
  color: #222;
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 100vh;
  width: 100%;
}

/* 프리로더 화면 */
.preloader-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.preloader-screen.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 20, 40, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 247, 255, 0.2);
}

.animated-gradient {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d, #1a2a6c);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

.preloader-content {
  width: 90%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 15px 35px var(--shadow-color);
  text-align: center;
  color: var(--text-color);
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-color);
}

.preloader-logo {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preloader-icon-logo {
    font-size: 48px;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: pulse 2s infinite alternate;
}

.preloader-logo-text {
    font-size: 36px;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    line-height: 1.2;
}

.preloader-animation-container {
    margin: 30px 0;
}

.preloader-spinner {
    font-size: 40px;
    color: #FFD700;
    margin-bottom: 20px;
    animation: spin 1.5s linear infinite;
}

.preloader-title {
    font-size: 24px;
    font-weight: 700;
    margin: 15px 0;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.preloader-progress-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 30px 0 15px;
    overflow: hidden;
    position: relative;
}

.preloader-progress {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.preloader-status {
    font-size: 18px;
    font-weight: 700;
    margin: 10px 0 30px;
    color: white;
}

.preloader-tip-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tip-icon {
    font-size: 24px;
    color: #FFD700;
    margin-right: 15px;
    animation: glow 2s infinite alternate;
}

.preloader-tip {
    font-size: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    line-height: 1.5;
}

@keyframes pulse {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.1); opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glow {
    from { text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.main-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: url('https://images.unsplash.com/photo-1519125323398-675f0ddb6308?auto=format&fit=crop&w=1500&q=80') no-repeat center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

.main-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-dark);
    z-index: 1;
}

.title-container {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 50px;
}

.main-title {
    color: white;
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.main-title span.more {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

.main-title span.less {
    color: #FF69B4;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.8);
}

.subtitle {
    color: white;
    font-size: 1.5rem;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.main-buttons {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.main-button {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    margin: 0 10px;
}

.main-button.start {
    background-color: #4CAF50;
    color: #fff;
    border: 2px solid #45a049;
}

.main-button.rankings-btn {
    background-color: var(--gold-bg);
    color: #000;
    border: 2px solid var(--gold-border);
}

.main-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* === 게임 화면 심플 스타일 === */
.game-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f9f9fb;
  overflow-x: hidden;
}

.game-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

.game-screen.show {
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 0 0;
  background: none;
  border: none;
  box-shadow: none;
}

.score-container {
  background: rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  padding: 3px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin: 0;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 99999;
}

.score-label {
  display: block;
  color: var(--gold-color);
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.score-value {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
  min-width: 45px;
  text-align: center;
}

.score-value.score-animate {
  animation: popScore 0.5s cubic-bezier(.4,1.4,.6,1);
  color: var(--gold-color);
}

.main-container {
  width: 100% !important;
  max-width: 1400px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 25px;
  margin: 0 auto;
  background: none;
  border: none;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

.keyword-left, .keyword-right {
  width: 42% !important;
  height: 85vh !important;
  max-height: 85vh !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 12px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  overflow: visible;
  min-width: 0;
  flex-shrink: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  top: 0;
  left: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.keyword-left:hover, .keyword-right:hover {
    /* background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2); */
}

/* 오른쪽 카드에 버튼을 위한 하단 패딩 추가 */
.keyword-right {
  /* padding: 12px 12px 90px 12px; */
}

/* 오른쪽 이미지 컨테이너 패딩 조정 */
.keyword-right .keyword-image-container {
  margin: 0 0 8px 0;
}

.keyword-image-container {
  width: 100% !important;
  height: 72% !important;
  max-height: 72% !important;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 0 8px 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.4);
  position: relative;
  min-height: 200px;
  flex-shrink: 0;
  align-self: stretch;
}

.keyword-image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.4);
}

.keyword-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background-position: center;
  max-width: 100%;
  max-height: 100%;
  position: relative;
  transform: none;
  transition: transform 0.3s ease;
  display: block;
  border-radius: 12px;
}

.keyword-text {
    width: calc(100% - 24px);
    font-size: clamp(1.1rem, 1.5vw, 1.7rem);
    font-weight: 800;
    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 16px;
    margin: 0;
    border-radius: 14px;
    text-align: center;
    word-break: keep-all;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    box-sizing: border-box;
    min-height: 50px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: absolute;
    bottom: 65px;
    left: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.keyword-text:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.search-count-wrapper {
    margin-top: 0;
    padding: 0;
    width: calc(100% - 24px);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 15px;
    left: 12px;
}

.search-count {
    font-size: 0.9rem;
    color: #fff;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 22px;
    padding: 8px 16px;
    display: inline-block;
    margin: 0 auto;
    font-weight: 600;
    border: 1px solid rgba(255, 215, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-align: center;
    max-height: 35px;
    position: relative;
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.search-count:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.vs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 20px;
  min-width: 85px;
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 193, 7, 0.95));
  border-radius: 50%;
  width: 85px;
  height: 85px;
  backdrop-filter: blur(15px);
  border: 3px solid rgba(255, 255, 255, 0.4);
  align-self: center;
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.vs-text {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.button-container {
  display: flex;
  gap: 12px;
  /* margin-top: 16px; */
  justify-content: center;
  flex-direction: row;
  flex-wrap: nowrap;
  position: absolute;
  bottom: 6px;
  left: 12px;
  width: calc(100% - 24px);
  z-index: 100;
}

/* 오른쪽 카드에만 버튼 표시 */
.keyword-right .button-container {
  display: flex;
}

.keyword-left .button-container {
  display: none;
}

.choice-button {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.98);
  color: #2196F3;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  animation: fadeInUp 0.5s cubic-bezier(.4,1.4,.6,1) both;
  backdrop-filter: blur(12px);
  min-width: 60px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.choice-button:hover:not(:disabled) {
  background: #2196F3;
  color: #fff;
  border: 2px solid #2196F3;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}
.choice-button:disabled {
  background: #f1f3f6;
  color: #bbb;
  border: 1px solid #e0e0e0;
  cursor: not-allowed;
}

.choice-button:active {
  animation: buttonPress 0.18s cubic-bezier(.4,1.4,.6,1);
}

/* PC 대형 화면 최적화 */
@media (min-width: 1920px) {
  .main-container {
    max-width: 1600px !important;
    padding: 40px !important;
    gap: 40px;
  }
  
  .keyword-left, .keyword-right {
    width: 42% !important;
    height: 80vh !important;
  }
  
  .keyword-image-container {
    height: 55% !important;
    min-height: 350px;
  }
  
  .keyword-text {
    font-size: 2rem;
    padding: 15px 20px;
  }
  
  .vs-container {
    width: 80px;
    height: 80px;
  }
  
  .vs-text {
    font-size: 24px;
  }
}

@media (max-width: 1440px) {
  .main-container {
    max-width: 1200px !important;
    padding: 20px !important;
    gap: 25px;
  }
  
  .keyword-left, .keyword-right {
    width: 42% !important;
    height: 80vh !important;
    max-height: 80vh !important;
  }
  
  .keyword-image-container {
    height: 70% !important;
    min-height: 190px;
  }
  
  .keyword-text {
    font-size: clamp(1rem, 1.3vw, 1.4rem);
    padding: 10px 14px;
    bottom: 60px;
  }
  
  .search-count-wrapper {
    bottom: 25px;
  }
  
  .keyword-right {
    padding: 12px 12px 90px 12px;
  }
}

@media (max-width: 1366px) {
  .main-container {
    max-width: 1000px !important;
    padding: 18px !important;
    gap: 20px;
  }
  
  .keyword-left, .keyword-right {
    width: 42% !important;
    height: 75vh !important;
    max-height: 75vh !important;
  }
  
  .keyword-image-container {
    height: 65% !important;
    min-height: 170px;
  }
  
  .keyword-text {
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
    padding: 8px 12px;
    bottom: 55px;
  }
  
  .search-count-wrapper {
    bottom: 22px;
  }
  
  .keyword-right {
    padding: 12px 12px 90px 12px;
  }
}

@media (max-width: 900px) {
  .main-container {
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh !important;
    padding: 10px !important;
    gap: 15px;
  }
  
  .keyword-left, .keyword-right {
    width: 100% !important;
    height: 50vh !important;
    min-height: 400px;
  }
  
  .keyword-image-container {
    height: 40vh !important;
    min-height: 250px;
  }
  
  .keyword-text {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    padding: 8px 16px;
  }
  
  .vs-container {
    margin: 15px 0;
  }
  
  .vs-text {
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  .main-container {
    padding: 5px !important;
    gap: 10px;
  }
  
  .keyword-left, .keyword-right {
    height: 45vh !important;
    min-height: 350px;
  }
  
  .keyword-image-container {
    height: 35vh !important;
    min-height: 200px;
  }
  
  .keyword-text {
    font-size: clamp(1rem, 5vw, 1.5rem);
    padding: 6px 12px;
  }
  
  .vs-container {
    margin: 10px 0;
  }
  
  .vs-text {
    font-size: 18px;
  }
  
  .button-container {
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
  }
  
  .choice-button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 3px !important;
    gap: 8px;
  }
  
  .keyword-left, .keyword-right {
    height: 42vh !important;
    min-height: 300px;
  }
  
  .keyword-image-container {
    height: 32vh !important;
    min-height: 180px;
  }
  
  .keyword-text {
    font-size: clamp(0.9rem, 6vw, 1.3rem);
    padding: 5px 10px;
  }
  
  .vs-text {
    font-size: 16px;
  }
  
  .choice-button {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .score-container {
    padding: 10px 20px;
    margin: 10px 0;
  }
  
  .score-value {
    font-size: 2rem;
  }
  
  .score-label {
    font-size: 1rem;
  }
}

/* 게임 화면 전체 레이아웃 안정성 */
.game-screen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 카드 간격 조정 */
@media (max-width: 1200px) {
  .vs-container {
    margin: 0 16px;
    min-width: 50px;
  }
}

@media (max-width: 768px) {
  .vs-container {
    margin: 0 12px;
    min-width: 40px;
  }
  
  .game-screen {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .vs-container {
    margin: 0 8px;
    min-width: 30px;
  }
  
  .game-screen {
    padding: 10px;
  }
}

/* 게임 오버 모달 스타일 */
#gameOverModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    pointer-events: auto !important;
}

#gameOverModal.fade-in {
    opacity: 1;
}

#gameOverModal.hidden {
    display: none;
}

#gameOverModal .modal-content {
    background: linear-gradient(135deg, #2d0b4e 60%, #1e005a 100%);
    color: #FFD700;
    border-radius: 24px;
    padding: 40px 32px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    border: 3px solid #FFD700;
    box-shadow: 0 8px 32px rgba(44,0,100,0.25);
    font-family: 'Noto Sans KR', sans-serif;
}

#gameOverModal .modal-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: #FFD700;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px #000;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 12px;
    background: none;
}

.final-score-container {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 24px 0 16px 0;
    border: 2px solid #FFD700;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(44,0,100,0.10);
}

.final-score-label {
    color: #FFD700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.final-score {
    color: #fff;
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 0 2px 10px #FFD700, 0 0 8px #000;
    margin-top: 8px;
}

.last-round-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    background: rgba(0, 20, 40, 0.8);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(0, 247, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.1);
}

.last-keyword-container {
    flex: 1;
    text-align: center;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.last-keyword {
    font-size: 20px;
    font-weight: 600;
    margin: 5px 0;
    color: #00f7ff;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
    font-family: 'Orbitron', sans-serif;
}

.last-count {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    font-family: 'Orbitron', sans-serif;
}

.result-container {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.result-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.result-icon.higher {
    color: #2ecc71;
}

.result-icon.lower {
    color: #e74c3c;
}

.result-text span.higher {
    color: #2ecc71;
    font-weight: bold;
}

.result-text span.lower {
    color: #e74c3c;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.modal-button.save {
    background: linear-gradient(45deg, #FFD700, #ffa751);
    color: #222;
    border: 2px solid #FFD700;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px 40px;
    box-shadow: 0 2px 8px rgba(44,0,100,0.10);
    transition: all 0.2s;
    width: auto;
    min-width: 180px;
    display: block;
    margin: 0 auto;
    text-align: center;
    letter-spacing: 1px;
}

.modal-button.save:hover {
    background: linear-gradient(45deg, #ffe259, #FFD700);
    color: #b21f1f;
    transform: translateY(-2px);
}

.modal-button.main {
    background: linear-gradient(45deg, #2d0b4e, #1e005a);
    color: #FFD700;
    border: 2px solid #FFD700;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1em;
    padding: 12px 32px;
    box-shadow: 0 2px 8px rgba(44,0,100,0.10);
    transition: all 0.2s;
    margin: 0;
}
.modal-button.main:hover {
    background: linear-gradient(45deg, #1e005a, #2d0b4e);
    color: #ffe259;
    transform: translateY(-2px);
}

.play-again-button {
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.2), rgba(0, 150, 255, 0.2));
    border-color: rgba(0, 247, 255, 0.5);
}

.main-menu-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.3);
}

.search-count {
    display: none;
}

.vs-container {
    
}

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

.vs-text {
    font-size: 24px;
    font-weight: bold;
    color: #888;
    margin: 5px 0;
}

.vs-text.correct {
    color: #4CAF50;
}

.vs-text.correct::after {
    content: '정답입니다!';
    display: block;
    font-size: 14px;
    margin-top: 3px;
    white-space: nowrap;
}

.vs-text.wrong {
    color: #f44336;
}

.vs-text.wrong::after {
    content: '틀렸습니다!';
    display: block;
    font-size: 14px;
    margin-top: 3px;
    white-space: nowrap;
}

.vs-text.correct {
    color: #4CAF50;
}

.vs-text.correct::after {
    content: '정답입니다!';
    display: block;
    font-size: 16px;
    margin-top: 5px;
}

.vs-text.wrong {
    color: #f44336;
}

.vs-text.wrong::after {
    content: '틀렸습니다!';
    display: block;
    font-size: 16px;
    margin-top: 5px;
}

.vs-subtext {
    font-size: 14px;
    opacity: 0.8;
}

.rankings-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
    padding: 20px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(5px);
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #2d0b4e;
}

.ranking-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
}

.ranking-card:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.rank-number {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    min-width: 40px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.ranking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ranking-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.ranking-score {
    font-size: 14px;
    color: #fdbb2d;
    font-weight: 500;
}

.ranking-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.ranking-card:nth-child(1) {
    background: linear-gradient(45deg, rgba(253, 187, 45, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(253, 187, 45, 0.3);
}

.ranking-card:nth-child(2) {
    background: linear-gradient(45deg, rgba(178, 31, 31, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(178, 31, 31, 0.3);
}

.ranking-card:nth-child(3) {
    background: linear-gradient(45deg, rgba(26, 42, 108, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(26, 42, 108, 0.3);
}

#rankingsModal .modal-button.main {
    background: linear-gradient(45deg, #fdbb2d, #b21f1f);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#rankingsModal .modal-button.main:hover {
    background: linear-gradient(45deg, #b21f1f, #fdbb2d);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
    .rankings-container {
        padding: 15px;
        gap: 8px;
    }
    
    .ranking-card {
        padding: 12px;
        gap: 10px;
    }
    
    .rank-number {
        font-size: 20px;
        min-width: 35px;
    }
    
    .ranking-name {
        font-size: 14px;
    }
    
    .ranking-score {
        font-size: 13px;
    }
    
    .ranking-date {
        font-size: 11px;
    }
}

/* 랭킹 모달 닫기 버튼 */
.modal-button.main {
    display: block;
    margin: 30px auto 0 auto !important;
    padding: 15px 40px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.modal-button.main:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3));
    border-color: rgba(255, 255, 255, 0.5);
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    margin-left: 0;
    text-align: left;
    gap: 2px;
}

.player-name {
    flex: 1;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 1px 2px #000;
    margin-left: 8px;
    text-align: left;
    background: none !important;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
}

.player-underline {
    display: block;
    text-align: center;
    color: #ffd700;
    font-size: 1.1em;
    letter-spacing: 2px;
    margin: 0 0 2px 0;
    line-height: 1.1;
    font-family: 'Consolas', 'monospace', 'Noto Sans KR', sans-serif;
    user-select: none;
}

.player-email {
    font-size: 1em;
    color: #fff;
    opacity: 1;
    margin-top: 4px;
    word-break: break-all;
    text-shadow: 0 1px 4px #FFD700, 0 0 2px #000;
    background: linear-gradient(90deg, #ffe259 0%, #ffa751 100%);
    border-radius: 12px;
    padding: 4px 12px;
    display: inline-block;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(44,0,100,0.10);
    transition: background 0.2s, color 0.2s;
    text-align: center;
}

/* 모달 타이틀 스타일 개선 */
.modal-title {
    color: var(--gold-color);
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 15px;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-color), transparent);
}

/* 게임 스타일 랭킹 모달 */
#rankingsModal, .modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  justify-content: center !important;
  align-items: center !important;
  display: flex !important;
  z-index: 2000 !important;
  background: transparent !important;
}

#rankingsModal {
  display: flex !important;
  background: rgba(0,0,0,0.7) !important;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#rankingsModal .modal-content {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d) !important;
  color: #fff !important;
  border-radius: 12px;
  padding: 30px;
  min-width: 320px;
  min-height: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

#rankingsModal .modal-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 28px;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.rankings-container::-webkit-scrollbar,
.leaderboard-list::-webkit-scrollbar {
  width: 10px;
  border-radius: 8px;
  background: #2d0b4e;
}

.rankings-container::-webkit-scrollbar-thumb,
.leaderboard-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #FFD700 40%, #b21f1f 100%);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(44,0,100,0.15);
  border: 2px solid #2d0b4e;
}

.rankings-container::-webkit-scrollbar-thumb:hover,
.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
}

/* 모든 모달의 표시/숨김을 보장하는 기본 스타일 */
.modal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 이미지 모달 스타일 */
#imageModal, .image-modal {
  display: none; /* JS에서 display: flex로 변경 */
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  justify-content: center;
  align-items: center;
  background: rgba(30, 30, 40, 0.85);
  z-index: 3000;
  backdrop-filter: blur(4px);
}
#imageModal.show, .image-modal.show {
  display: flex !important;
}
.image-modal-content {
  max-width: 98vw;
  max-height: 98vh;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.image-modal-img {
  max-width: 98vw;
  max-height: 98vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: #f5f5f7;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.image-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 22px;
  color: #888;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
}
.image-modal-close:hover {
  background: #f1f3f6;
  color: #2196F3;
}

/* 적용 클래스 */
.keyword-image, .keyword-text {
  animation: fadeInUp 0.5s cubic-bezier(.4,1.4,.6,1) both;
}
.keyword-image.fade-out, .keyword-text.fade-out {
  animation: fadeOutDown 0.4s cubic-bezier(.4,1.4,.6,1) both;
}

.current-score, .score-value.score-animate {
  animation: popScore 0.5s cubic-bezier(.4,1.4,.6,1);
}

.choice-button:active {
  animation: buttonPress 0.18s cubic-bezier(.4,1.4,.6,1);
}

/* 전체 라운드 전환 */
.main-container.round-transition {
  animation: fadeInUp 0.5s cubic-bezier(.4,1.4,.6,1);
}

.rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
    color: #fff;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 15px;
}

.rankings-table th {
    background: linear-gradient(45deg, rgba(253, 187, 45, 0.2), rgba(178, 31, 31, 0.2));
    color: #fff;
    font-weight: 600;
    padding: 15px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.rankings-table th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.rankings-table th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.rankings-table td {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: none;
    transition: all 0.3s ease;
}

.rankings-table td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-weight: 600;
    color: #fdbb2d;
}

.rankings-table td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.rankings-table tr:hover td {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.rankings-table tr:nth-child(1) td {
    background: linear-gradient(45deg, rgba(253, 187, 45, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(253, 187, 45, 0.3);
}

.rankings-table tr:nth-child(2) td {
    background: linear-gradient(45deg, rgba(178, 31, 31, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(178, 31, 31, 0.3);
}

.rankings-table tr:nth-child(3) td {
    background: linear-gradient(45deg, rgba(26, 42, 108, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(26, 42, 108, 0.3);
}

.rankings-table tr:nth-child(1) td:first-child::before {
    content: '👑';
    margin-right: 8px;
}

.rankings-table tr:nth-child(2) td:first-child::before {
    content: '🥈';
    margin-right: 8px;
}

.rankings-table tr:nth-child(3) td:first-child::before {
    content: '🥉';
    margin-right: 8px;
}

.rankings-table td:nth-child(2) {
    color: #fff;
    font-weight: 500;
}

.rankings-table td:nth-child(3) {
    color: #fdbb2d;
    font-weight: 600;
}

.rankings-table td:nth-child(4) {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .rankings-table {
        font-size: 14px;
    }
    
    .rankings-table th,
    .rankings-table td {
        padding: 12px 8px;
    }
    
    .rankings-table td:nth-child(4) {
        font-size: 0.8em;
    }
}

.leaderboard-box {
  background: linear-gradient(135deg, #2d0b4e 60%, #1e005a 100%);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(44,0,100,0.25);
  padding: 32px 24px;
  width: 350px;
  margin: 0 auto;
}

.leaderboard-title {
  font-size: 2rem;
  font-weight: 900;
  color: #FFD700;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px #000;
  border: 3px solid #FFD700;
  border-radius: 12px;
  background: #222;
  padding: 8px 0;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #00c6ff 0%, #0072ff 100%);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  height: 56px;
  padding: 0 18px;
  position: relative;
}

.leaderboard-row.first { background: linear-gradient(90deg, #ffe259 0%, #ffa751 100%); }
.leaderboard-row.second { background: linear-gradient(90deg, #e0eafc 0%, #cfdef3 100%); }
.leaderboard-row.third { background: linear-gradient(90deg, #f7971e 0%, #ffd200 100%); }

.rank-badge {
  width: 48px;
  text-align: center;
  font-size: 1.3em;
  font-weight: 900;
  border-radius: 50%;
  background: #fff;
  color: #333;
  margin-right: 8px;
  position: relative;
}
.rank-badge.gold { background: #FFD700; color: #fff; }
.rank-badge.silver { background: #C0C0C0; color: #fff; }
.rank-badge.bronze { background: #CD7F32; color: #fff; }

.player-icon {
  width: 32px; height: 32px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  background-image: url('https://cdn-icons-png.flaticon.com/512/149/149071.png');
  background-size: cover;
}

.player-name {
  flex: 1;
  font-weight: 700;
  color: #fff !important;
  text-shadow: 0 1px 2px #000;
  margin-left: 8px;
  text-align: left;
  background: none !important;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background-clip: initial;
}

.score {
  font-size: 1.3em;
  color: #FFD700;
  font-weight: 900;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 4px;
}
.coin {
  display: inline-block;
  width: 20px; height: 20px;
  background: url('https://cdn-icons-png.flaticon.com/512/138/138292.png') no-repeat center/contain;
  vertical-align: middle;
  margin-left: 4px;
}

@media (max-width: 500px) {
  .leaderboard-box { width: 98vw; padding: 12px 2vw; }
  .leaderboard-title { font-size: 1.2rem; }
  .leaderboard-row { font-size: 0.95rem; height: 44px; padding: 0 8px; }
  .rank-badge { width: 32px; font-size: 1em; }
  .player-icon { width: 22px; height: 22px; }
  .score { font-size: 1em; }
}
