html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  color:#ffffff;
}
.title {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-x: hidden;
  font-family: sans-serif;
}

#global-user-bar {
    position: fixed;  
    bottom: 60px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 0px 0;
    z-index: 999;
}

#global-user-bar.hidden {
  display: none !important;
}

.global-user-field {
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 8px;
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.global-user-field img {
  width: 24px;
  height: 24px;
}

.screen-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
  overflow: hidden;
}

.screen {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 80px;
  display: none; /* 기본적으로 숨김 */
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  box-sizing: border-box;
}

.screen.active {
  display: flex; /* 활성화된 화면만 보임 */
}

.screen {
  background-color: #222222;
}

.nav-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 60px;
  background-color: #222;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-bar div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  border: 1px;
  background: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-bar img {
  height: 100%;
  margin-right: 20px;
}

.postcard-simulator {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.user-status {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
}

.currency-field {
  position: relative;
  width: 200px;
  height: 48px;
  flex-shrink: 0;
}

.currency-field img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.currency-value {
  position: absolute;
  top: 45%;
  left: 90%;
  transform: translate(-100%, -50%);
  color: white;
  font-size: 20px;
  font-weight: bold;
  text-align: right;
}

/* 게임 완료 모달 스타일 */
    .game-completion-modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 10000;
    }
    
    .game-completion-modal .modal-content {
      background: white;
      border-radius: 15px;
      padding: 30px;
      max-width: 500px;
      width: 90%;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .game-completion-modal .modal-header {
      text-align: center;
      margin-bottom: 25px;
    }
    
    .game-completion-modal .modal-header h2 {
      color: #ff6b35;
      margin: 0 0 10px 0;
      font-size: 24px;
    }
    
    .game-completion-modal .modal-header p {
      color: #666;
      margin: 0;
    }
    
    .game-completion-modal .stats-grid {
      display: grid;
      gap: 15px;
      margin-bottom: 25px;
    }
    
    .game-completion-modal .stat-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px;
      background-color: #f8f9fa;
      border-radius: 8px;
    }
    
    .game-completion-modal .stat-item label {
      font-weight: bold;
      color: #333;
    }
    
    .game-completion-modal .stat-item span {
      color: #007bff;
      font-weight: bold;
    }
    
    .game-completion-modal .nickname-input {
      margin-bottom: 25px;
    }
    
    .game-completion-modal .nickname-input label {
      display: block;
      margin-bottom: 8px;
      font-weight: bold;
      color: #333;
    }
    
    .game-completion-modal .nickname-input input {
      width: 100%;
      padding: 12px;
      border: 2px solid #ddd;
      border-radius: 8px;
      font-size: 16px;
      box-sizing: border-box;
    }
    
    .game-completion-modal .nickname-input input:focus {
      outline: none;
      border-color: #007bff;
    }
    
    .game-completion-modal .modal-footer {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
    }
    
    .game-completion-modal .submit-btn {
      background-color: #28a745;
      color: white;
      border: none;
      padding: 12px 24px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 16px;
      font-weight: bold;
    }
    
    .game-completion-modal .submit-btn:hover {
      background-color: #218838;
    }
    
    .game-completion-modal .close-btn {
      background-color: #6c757d;
      color: white;
      border: none;
      padding: 12px 24px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 16px;
    }
    
    .game-completion-modal .close-btn:hover {
      background-color: #5a6268;
    }
/* 컬렉션 달성 모달 스타일 */
.collection-achieve-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-achieve-modal .modal-content {
  background: #fff;
  color: black;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 32px 24px;
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
}

.collection-achieve-modal .modal-header h2 {
  margin-bottom: 12px;
}

.collection-achieve-modal .close-btn {
  margin-top: 24px;
  padding: 8px 24px;
  font-size: 1.1em;
  border-radius: 8px;
  border: none;
  background: #0078d4;
  color: #fff;
  cursor: pointer;
}

#reset-user-state {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #eb3e5b;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

@media (max-width: 600px) {
  #global-user-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 0 0;
    z-index: 999;
  }

  .global-user-fields {
    flex-direction: column;
    gap: 0 !important;
  }

  .global-user-field {
  padding: 0;
  }


  .global-user-field img {
    padding-left: 10px;
  }

  .nav-bar img {
  height: 100%;
  margin-right: 10px;
}

  .nav-bar div {
    font-size: 16px;
  }
}

.global-user-field-toggle {
  position: absolute;
  left: 24px;
  bottom: 8px;
  z-index: 1001;
  pointer-events: auto;
}

#global-bar-toggle-btn {
  background: #333;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(255,204,68,0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s;
  outline: none;
}
#global-bar-toggle-btn:hover {
  background: #333;
  border-color: #fff;
}
.toggle-arrow {
  display: inline-block;
  transition: transform 0.3s;
  font-size: 18px;
}
#global-user-bar.folded .toggle-arrow {
  transform: rotate(180deg);
}

.global-user-fields {
  display: flex;
  gap: 24px;
  align-items: center;
  transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.3s;
  max-height: 100px;
  overflow: hidden;
  pointer-events: auto;
}

#global-user-bar.folded .global-user-fields {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  padding: 0;
}

/* 접힌 상태에서 글로벌바 전체가 터치/클릭을 막지 않게 */
#global-user-bar.folded {
  pointer-events: none;
}
#global-user-bar.folded .global-user-field-toggle {
  pointer-events: auto;
}