* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  text-align: center;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* PC에서 모바일 뷰 컨테이너 */
.mobile-container {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 932px;
  margin: 0 auto;
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

@media (min-width: 431px) {
  body {
    background: #0a0a0a;
  }

  .mobile-container {
    border-radius: 20px;
    border: 3px solid rgba(136, 74, 224, 0.3);
  }
}

/* ゲームヘッダー */
.game-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(136, 74, 224, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
}

.user-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.user-avatar-wrapper:hover {
  background: rgba(136, 74, 224, 0.2);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #D9BB62;
  box-shadow: 0 2px 8px rgba(217, 187, 98, 0.4);
  transition: all 0.3s ease;
}

.user-avatar-wrapper:hover .user-avatar {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(217, 187, 98, 0.6);
}

.user-name {
  font-size: 16px;
  font-weight: bold;
  color: #D9BB62;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 15px;
  background: rgba(136, 74, 224, 0.2);
  border: 2px solid rgba(136, 74, 224, 0.4);
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.header-btn:hover {
  background: rgba(136, 74, 224, 0.5);
  border-color: #884ae0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(136, 74, 224, 0.4);
}

.header-btn:active {
  transform: translateY(0);
}

.logout-btn {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
}

.logout-btn:hover {
  background: rgba(255, 107, 107, 0.5);
  border-color: #ff6b6b;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
}

.header-icon {
  font-size: 18px;
  line-height: 1;
}

.header-label {
  font-size: 13px;
}

/* ヘッダーがある場合のページコンテンツ調整 */
.map-container {
  padding-top: 70px;
}

@media (max-width: 600px) {
  .game-header {
    padding: 10px 15px;
  }

  .user-greeting {
    font-size: 14px;
  }

  .header-btn {
    padding: 6px 12px;
    font-size: 12px;
    gap: 3px;
  }

  .header-icon {
    font-size: 16px;
  }

  .header-label {
    display: none;
  }
}

@media (max-width: 400px) {
  .header-btn {
    padding: 6px 10px;
  }

  .user-avatar {
    width: 35px;
    height: 35px;
  }

  .user-name {
    font-size: 12px;
  }
}

/* 設定モーダル */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-modal.active {
  opacity: 1;
  pointer-events: all;
}

.settings-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(136, 74, 224, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.settings-modal.active .settings-content {
  transform: scale(1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid rgba(136, 74, 224, 0.3);
  background: rgba(136, 74, 224, 0.1);
}

.settings-header h2 {
  margin: 0;
  font-size: 24px;
  color: #D9BB62;
  text-shadow: 0 2px 10px rgba(217, 187, 98, 0.5);
}

.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 107, 107, 0.3);
  transform: rotate(90deg);
}

.settings-body {
  padding: 20px;
}

.settings-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(136, 74, 224, 0.2);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(136, 74, 224, 0.1);
  border-radius: 15px;
  border: 2px solid rgba(136, 74, 224, 0.3);
}

.settings-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #D9BB62;
  box-shadow: 0 4px 15px rgba(217, 187, 98, 0.4);
}

.user-details h3 {
  margin: 0 0 5px 0;
  font-size: 20px;
  color: #D9BB62;
}

.user-id {
  margin: 0;
  font-size: 14px;
  color: #bbb;
}

.section-title {
  font-size: 18px;
  color: #D9BB62;
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: #fff;
}

.setting-item label {
  font-size: 16px;
  font-weight: bold;
}

.setting-item input[type="range"] {
  width: 150px;
  margin: 0 10px;
  accent-color: #884ae0;
}

#volumeValue {
  min-width: 45px;
  text-align: right;
  color: #D9BB62;
  font-weight: bold;
}

/* トグルスイッチ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  border-radius: 34px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #884ae0;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* 進捗情報 */
.progress-info {
  background: rgba(136, 74, 224, 0.1);
  border-radius: 10px;
  padding: 15px;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-item:last-child {
  border-bottom: none;
}

.progress-label {
  font-size: 15px;
}

.progress-value {
  font-weight: bold;
  color: #D9BB62;
  font-size: 16px;
}

/* ログアウトボタン */
.logout-button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.logout-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.logout-button:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .settings-content {
    width: 95%;
    max-height: 85vh;
  }

  .settings-header h2 {
    font-size: 20px;
  }

  .user-details h3 {
    font-size: 18px;
  }

  .setting-item input[type="range"] {
    width: 100px;
  }
}

/* ログイン画面 */
#login {
  width: 90%;
  max-width: 400px;
  margin: 15vh auto;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 2px solid rgba(136, 74, 224, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: #FFF;
}

#login h2 {
  font-size: 2em;
  margin-bottom: 30px;
  color: #D9BB62;
  text-shadow: 0 2px 10px rgba(217, 187, 98, 0.5);
}

#login input[type="text"],
#login input[type="password"] {
  width: 100%;
  padding: 15px;
  margin: 10px 0 20px 0;
  font-size: 16px;
  border: 2px solid rgba(136, 74, 224, 0.5);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.3s ease;
}

#login input[type="text"]:focus,
#login input[type="password"]:focus {
  outline: none;
  border-color: #884ae0;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(136, 74, 224, 0.4);
}

#login input[type="submit"] {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, #884ae0 0%, #b987ff 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(136, 74, 224, 0.4);
}

#login input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(136, 74, 224, 0.6);
}

#login input[type="submit"]:active {
  transform: translateY(0);
}

#login a {
  display: block;
  margin-top: 20px;
  color: #66ccff;
  text-decoration: none;
  transition: color 0.3s ease;
}

#login a:hover {
  color: #D9BB62;
}

#login p {
  margin-top: 15px;
  color: #ff6b6b;
  font-weight: bold;
}

/* メイン画面 (mypage.php) */
.main-screen {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.main-background {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 상단 상태바 */
.status-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(180deg, rgba(139, 90, 43, 0.95) 0%, rgba(101, 67, 33, 0.9) 100%);
  border-bottom: 3px solid #8B5A2B;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.status-left {
  display: flex;
  align-items: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  background: linear-gradient(135deg, rgba(139, 90, 43, 0.9) 0%, rgba(101, 67, 33, 0.8) 100%);
  border-radius: 25px;
  border: 3px solid #D9BB62;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid #FFE4B5;
  background: #FFF;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-name {
  font-size: 15px;
  font-weight: bold;
  color: #FFE4B5;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.profile-level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-text {
  font-size: 13px;
  font-weight: bold;
  color: #FFE4B5;
  min-width: 45px;
}

.level-bar {
  width: 100px;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #8B5A2B;
}

.level-fill {
  height: 100%;
  background: linear-gradient(90deg, #4FC3F7 0%, #29B6F6 100%);
  transition: width 0.3s ease;
}

.status-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(255, 228, 181, 0.95) 0%, rgba(255, 218, 151, 0.9) 100%);
  border-radius: 20px;
  border: 3px solid #D9BB62;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.status-icon {
  font-size: 20px;
  line-height: 1;
}

.status-value {
  font-size: 16px;
  font-weight: bold;
  color: #5D4037;
  min-width: 40px;
  text-align: center;
}

.plus-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
  border: 2px solid #2E7D32;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.plus-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

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

.energy-timer {
  position: relative;
  z-index: 10;
  text-align: right;
  padding: 5px 15px;
  background: rgba(139, 90, 43, 0.8);
  color: #FFE4B5;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

@media (max-width: 600px) {
  .status-bar {
    padding: 10px 15px;
  }

  .status-nickname {
    font-size: 14px;
  }

  .status-avatar {
    width: 30px;
    height: 30px;
  }

  .status-item {
    padding: 4px 8px;
    gap: 3px;
  }

  .status-icon {
    font-size: 16px;
  }

  .status-value {
    font-size: 12px;
    min-width: 25px;
  }

  .hp-bar-mini {
    width: 40px;
  }

  .hp-bar-container {
    min-width: 100px;
  }
}

@media (max-width: 400px) {
  .status-bar {
    padding: 8px 10px;
  }

  .status-nickname {
    display: none;
  }

  .status-item {
    padding: 3px 6px;
  }

  .status-value {
    font-size: 11px;
  }
}

.main-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  z-index: 0;
}

/* 左上プロフィールウィジェット */
.profile-widget {
  position: absolute;
  top: 15px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(136, 74, 224, 0.95) 0%, rgba(102, 51, 153, 0.95) 100%);
  padding: 12px 16px;
  border-radius: 50px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.profile-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(136, 74, 224, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

.profile-avatar-container {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.profile-name {
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.profile-level-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #663399;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  flex-shrink: 0;
}

.exp-bar-container {
  flex: 1;
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
  position: relative;
  overflow: hidden;
}

.exp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.exp-text {
  font-size: 11px;
  color: #ffeb99;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* モバイル対応 */
@media (max-width: 600px) {
  .profile-widget {
    top: 65px;
    left: 15px;
    padding: 10px 12px;
    gap: 10px;
  }

  .profile-avatar-container {
    width: 45px;
    height: 45px;
  }

  .profile-info-container {
    min-width: 130px;
  }

  .profile-name {
    font-size: 14px;
  }

  .level-badge {
    font-size: 12px;
    padding: 2px 8px;
  }

  .exp-bar-container {
    height: 10px;
  }

  .exp-text {
    font-size: 10px;
  }
}

.main-content {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 8% 5%;
  box-sizing: border-box;
}

/* 메뉴 그리드 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 500px;
  padding: 8px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 18px;
  border: 3px solid;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.menu-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.menu-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.btn-icon {
  font-size: 28px;
  line-height: 1;
}

.btn-text {
  font-size: 17px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 버튼 색상 */
.blue-btn {
  background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%);
  border-color: #1976D2;
  color: white;
}

.orange-btn {
  background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
  border-color: #F57C00;
  color: white;
}

.yellow-btn {
  background: linear-gradient(135deg, #FFD54F 0%, #FFCA28 100%);
  border-color: #F9A825;
  color: #5D4037;
}

.green-btn {
  background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%);
  border-color: #388E3C;
  color: white;
}

.purple-btn {
  background: linear-gradient(135deg, #BA68C8 0%, #AB47BC 100%);
  border-color: #7B1FA2;
  color: white;
}

.gray-btn {
  background: linear-gradient(135deg, #BDBDBD 0%, #9E9E9E 100%);
  border-color: #616161;
  color: white;
}

@media (max-width: 600px) {
  .menu-grid {
    gap: 10px;
    padding: 5px;
  }

  .menu-btn {
    padding: 15px 18px;
    gap: 12px;
  }

  .btn-icon {
    font-size: 28px;
  }

  .btn-text {
    font-size: 17px;
  }
}

@media (max-width: 400px) {
  .menu-btn {
    padding: 12px 14px;
    gap: 8px;
  }

  .btn-icon {
    font-size: 22px;
  }

  .btn-text {
    font-size: 14px;
  }

  .menu-grid {
    gap: 8px;
    max-width: 450px;
  }
}

.main-adventure-btn:active {
  transform: scale(0.98);
}

.sub-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.sub-btn {
  padding: 15px 30px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sub-btn:hover {
  background: rgba(136, 74, 224, 0.8);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 20px rgba(136, 74, 224, 0.6);
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 冒険マップ画面 (index.php) */
.adventure-map-screen {
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.adventure-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.adventure-map-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  max-height: 100vh;
}

.region-buttons {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.region-btn {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 3px solid #D9BB62;
  border-radius: 20px;
  text-decoration: none;
  color: #1a1a2e;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  min-width: 80px;
}

.region-btn:hover:not(.locked) {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 25px rgba(217, 187, 98, 0.6);
  border-color: #f0d48a;
}

.region-btn.locked {
  background: rgba(100, 100, 100, 0.8);
  border-color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

.region-number {
  font-size: 0.9em;
  color: #884ae0;
  margin-bottom: 3px;
}

.region-name {
  font-size: 1.3em;
  color: #1a1a2e;
}

.lock-icon {
  font-size: 1.5em;
  position: absolute;
  top: -10px;
  right: -10px;
}

/* 地域別の配置 (adventure_map.pngに合わせて調整してください) */
.region-kyushu {
  bottom: 15%;
  left: 20%;
}

.region-chugoku {
  bottom: 30%;
  left: 30%;
}

.region-kinki {
  bottom: 35%;
  left: 45%;
}

.region-chubu {
  bottom: 45%;
  left: 55%;
}

.region-kanto {
  bottom: 50%;
  left: 70%;
}

.region-tohoku {
  top: 20%;
  left: 65%;
}

.region-final {
  top: 50%;
  right: 15%;
  background: linear-gradient(135deg, #8E44AD 0%, #2C3E50 100%);
  color: white;
  border-color: #ff6b6b;
}

.region-final .region-number,
.region-final .region-name {
  color: white;
}

/* 学年選択・レッスン選択画面 */
.map-container {
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
  color: #FFF;
}

.map-container h1 {
  font-size: 2.5em;
  margin-bottom: 40px;
  color: #D9BB62;
  text-shadow: 0 2px 10px rgba(217, 187, 98, 0.5);
  animation: titleFloat 2s ease-in-out infinite;
}

.map-container h2 {
  font-size: 2em;
  margin-bottom: 30px;
  color: #D9BB62;
  text-shadow: 0 2px 10px rgba(217, 187, 98, 0.5);
}

@keyframes titleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.stage-map {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 0 auto;
}

.stage-map a, .stage-map .stage {
  width: 100%;
  display: block;
  padding: 20px;
  margin-bottom: 0;
  font-size: 1.5em;
  font-weight: bold;
  background: linear-gradient(135deg, #D9BB62 0%, #f0d48a 100%);
  color: #1a1a2e;
  text-decoration: none;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(217, 187, 98, 0.3);
  transition: all 0.3s ease;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.stage-map a:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(217, 187, 98, 0.5);
  background: linear-gradient(135deg, #f0d48a 0%, #D9BB62 100%);
}

.stage-map a:active {
  transform: translateY(-2px) scale(1);
}

/* 地域ヘッダー */
.region-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  border: 2px solid rgba(217, 187, 98, 0.3);
}

.region-story {
  font-size: 1.1em;
  color: #ffeb99;
  margin: 15px 0;
  line-height: 1.6;
}

.progress-indicator {
  margin-top: 15px;
  padding: 10px 20px;
  background: rgba(217, 187, 98, 0.2);
  border-radius: 10px;
  display: inline-block;
}

.progress-label {
  font-weight: bold;
  color: #D9BB62;
  margin-right: 10px;
}

.progress-value {
  color: #ffeb99;
  font-size: 1.1em;
}

/* ステージボタンの改善 */
.stage {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 25px !important;
  position: relative;
}

.stage-number {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 8px;
}

.stage-status {
  font-size: 0.9em;
  opacity: 0.9;
  margin-bottom: 5px;
}

.stage-reward {
  font-size: 0.85em;
  color: #ffeb99;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px 12px;
  border-radius: 15px;
  margin-top: 8px;
  display: inline-block;
}

.stage.completed {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-color: #86efac;
}

.stage.completed:hover {
  background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.4);
}

.stage.locked {
  background: linear-gradient(135deg, #555 0%, #777 100%);
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.stage.locked .stage-reward {
  color: #999;
}

.back-button {
  display: inline-block;
  margin-top: 30px;
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.1);
  color: #66ccff;
  text-decoration: none;
  border-radius: 10px;
  border: 2px solid rgba(102, 204, 255, 0.3);
  transition: all 0.3s ease;
  font-size: 16px;
}

.back-button:hover {
  background: rgba(102, 204, 255, 0.2);
  border-color: #66ccff;
  transform: translateY(-2px);
}

/* クイズ画面 */
.quiz-game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 100px;
}

.quiz-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.8);
}

.quiz-ui {
  color: #FFF;
  position: relative;
  z-index: 1;
  max-width: 600px;
  width: 95%;
  padding: 20px;
  box-sizing: border-box;
}

/* クイズストーリーセクション */
.quiz-story-section {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(136, 74, 224, 0.9) 0%, rgba(102, 51, 153, 0.9) 100%);
  padding: 15px 20px;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.quiz-location {
  font-size: 1.1em;
  color: #ffeb99;
  margin-bottom: 8px;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.quiz-mission {
  font-size: 1em;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.mission-item {
  color: #ffd700;
  font-weight: bold;
  text-decoration: underline;
  text-decoration-style: wavy;
}

.quiz-question {
  font-size: 1.8em;
  color: white;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.quiz-characters {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 55px 0;
  gap: 10px;
}

.miko-wrapper, .ghost-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character {
  width: 100%;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.hp-container {
  width: 100%;
  margin-bottom: 10px;
  position: absolute;
  top:-30px;
}

#miko-hp-text, .hp-text {
  color: #FFF;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
  margin-bottom: 5px;
}

.hp-bar {
  width: 100%;
  max-width: 150px;
  height: 12px;
  background-color: #333;
  border: 2px solid #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

.hp-inner {
  height: 100%;
  background: linear-gradient(90deg, #ff0000 0%, #ff6b6b 100%);
  width: 100%;
  transition: width 0.3s ease-in-out;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  justify-content: center;
  max-width: 500px;
  margin: 30px auto 0;
}

.choice {
  padding: 18px 12px;
  font-size: 1.5em;
  font-weight: bold;
  background: linear-gradient(135deg, #884ae0 0%, #b987ff 100%);
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(136, 74, 224, 0.4);
  transition: all 0.2s ease;
  animation: fadeIn 0.5s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.choice:hover {
  background: linear-gradient(135deg, #b987ff 0%, #d4a5ff 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(136, 74, 224, 0.6);
  border-color: rgba(255, 255, 255, 0.5);
}

.choice:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 10px rgba(136, 74, 224, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-box {
  margin-top: 25px;
  font-size: 1.5em;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 10px;
}

.next-button {
  display: inline-block;
  margin-top: 25px;
  padding: 15px 35px;
  background: linear-gradient(135deg, #66ccff 0%, #4db8ff 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1.2em;
  box-shadow: 0 4px 15px rgba(102, 204, 255, 0.4);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.next-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 204, 255, 0.6);
}

/* アイテム獲得画面 */
.item-get-screen {
  text-align: center;
  padding: 30px 20px;
}

.item-get-screen h2 {
  font-size: 2.2em;
  color: #ffd700;
  margin-bottom: 30px;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
  animation: titlePulse 1.5s ease-in-out infinite;
}

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

.item-get-animation {
  position: relative;
  margin: 30px auto;
  max-width: 400px;
}

.item-shine {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  animation: shineRotate 3s linear infinite;
}

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

.item-display {
  position: relative;
  background: linear-gradient(135deg, rgba(136, 74, 224, 0.9) 0%, rgba(102, 51, 153, 0.9) 100%);
  border: 3px solid #ffd700;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
  animation: itemFloat 2s ease-in-out infinite;
}

@keyframes itemFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.item-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.item-info {
  color: white;
}

.item-name {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.item-description {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #ffeb99;
  line-height: 1.6;
}

.item-rarity {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1em;
  margin-top: 10px;
}

.rarity-common {
  background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%);
  border: 2px solid #D1D5DB;
}

.rarity-rare {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  border: 2px solid #93C5FD;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.rarity-epic {
  background: linear-gradient(135deg, #A855F7 0%, #9333EA 100%);
  border: 2px solid #D8B4FE;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.5);
  animation: epicGlow 2s ease-in-out infinite;
}

@keyframes epicGlow {
  0%, 100% { box-shadow: 0 4px 15px rgba(168, 85, 247, 0.5); }
  50% { box-shadow: 0 6px 25px rgba(168, 85, 247, 0.8); }
}

.completion-message {
  font-size: 1.4em;
  color: #ffd700;
  margin: 25px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  animation: messageGlow 1.5s ease-in-out infinite;
}

@keyframes messageGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.back-arrow {
  position: fixed;
  top: 20px;
  left: 20px;
  font-size: 32px;
  color: white;
  text-decoration: none;
  z-index: 100;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-arrow:hover {
  background: rgba(136, 74, 224, 0.8);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* BGMボタン */
#bgmBtn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#bgmBtn:hover {
  background: rgba(136, 74, 224, 0.8);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}

/* アニメーション */
@keyframes flyToGhost {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(300px);
    opacity: 0;
  }
}

@keyframes flyToMiko {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-300px);
    opacity: 0;
  }
}

@keyframes ghostShake {
  0%, 100% {
    transform: translateX(0);
  }
  25%, 75% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translate(0px, 0px);
  }
  25%, 75% {
    transform: translate(5px, 0px);
  }
  50% {
    transform: translate(-5px, 0px);
  }
}

@keyframes fadeOutGhost {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

.fade-out {
  animation: fadeOutGhost 0.8s forwards;
}

.ghost {
  display: inline-block;
}

.shake {
  animation: shake 0.3s ease-in-out;
}

.ghost-damage {
  animation: ghostShake 0.3s ease-in-out 3;
}

.fly-text {
  position: absolute;
  font-size: 120px;
  font-weight: bold;
  color: #fff;
  text-shadow:
    0 0 15px rgba(136, 74, 224, 0.9),
    0 0 30px rgba(136, 74, 224, 0.7),
    0 4px 10px rgba(0, 0, 0, 0.9);
  z-index: 20;
  pointer-events: none;
  animation: flyToGhost 0.6s forwards ease-in;
}

.attack-effect,
.ghost_attack-effect {
  position: absolute;
  width: 60px;
  height: auto;
  z-index: 12;
  pointer-events: none;
}

#ghost_attack-effect {
  display: none;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  .quiz-question {
    font-size: 1.4em;
    padding: 12px;
  }

  .choice {
    font-size: 1.2em;
    padding: 15px 10px;
  }

  .character {
    max-width: 150px;
  }

  .fly-text {
    font-size: 80px;
  }

  .map-container h1 {
    font-size: 2em;
  }

  .stage-map a, .stage-map .stage {
    font-size: 1.3em;
    padding: 15px;
  }
}

@media (max-width: 400px) {
  .quiz-question {
    font-size: 1.2em;
  }

  .choice {
    font-size: 1em;
    padding: 12px 8px;
  }

  #login {
    padding: 30px 20px;
  }
}

/* 図鑑ページ */
.collection-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  color: #FFF;
}

.collection-header {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px;
}

.collection-header h1 {
  font-size: 1.8em;
  color: #ffd700;
  margin-bottom: 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.collection-stats {
  margin-top: 20px;
}

.stat-item {
  margin: 10px auto;
  max-width: 100%;
  padding: 0 10px;
}

.stat-label {
  display: block;
  font-size: 1.1em;
  color: #ffeb99;
  margin-bottom: 10px;
  font-weight: bold;
}

.stat-progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
}

.stat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  transition: width 0.5s ease;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.6);
}

.stat-value {
  font-size: 1em;
  color: #4ade80;
  font-weight: bold;
}

/* カテゴリタブ (名物/妖怪) */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.category-btn {
  flex: 1;
  max-width: 120px;
  padding: 12px 15px;
  border: 2px solid rgba(217, 187, 98, 0.4);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffeb99;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn:hover {
  background: rgba(136, 74, 224, 0.4);
  border-color: rgba(217, 187, 98, 0.6);
}

.category-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #ffd700;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* カテゴリコンテンツ */
.category-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.category-content.active {
  display: block;
}

/* タブナビゲーション */
.collection-tabs {
  display: flex;
  gap: 6px;
  padding: 5px 10px;
  margin-bottom: 15px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.collection-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 2px solid rgba(217, 187, 98, 0.4);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.3);
  color: #ffeb99;
  font-size: 0.9em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-btn:hover {
  background: rgba(136, 74, 224, 0.4);
  border-color: rgba(217, 187, 98, 0.6);
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #ffd700;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-complete {
  background: #4ade80;
  color: #1a5d2e;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  border: 2px solid rgba(217, 187, 98, 0.3);
  flex-wrap: wrap;
  gap: 10px;
}

.tab-region-header h2 {
  font-size: 1.6em;
  color: #D9BB62;
  margin: 0;
}

.tab-progress {
  font-size: 1.1em;
  color: #ffeb99;
}

.tab-rate {
  color: #4ade80;
  font-weight: bold;
}

/* 学年セクション (既存 - 後方互換用) */
.collection-grade {
  margin-bottom: 50px;
  background: rgba(0, 0, 0, 0.3);
  padding: 25px;
  border-radius: 20px;
  border: 2px solid rgba(217, 187, 98, 0.3);
}

.grade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(217, 187, 98, 0.3);
  flex-wrap: wrap;
  gap: 10px;
}

.grade-header h2 {
  font-size: 1.8em;
  color: #D9BB62;
  margin: 0;
}

.grade-number {
  font-size: 0.8em;
  color: #ffeb99;
  opacity: 0.8;
}

.grade-progress {
  font-size: 1.1em;
  color: #ffeb99;
}

.grade-rate {
  color: #4ade80;
  font-weight: bold;
}

/* コレクショングリッド */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.collection-item {
  transition: transform 0.3s ease;
}

.collection-item.acquired:hover {
  transform: translateY(-5px);
}

.item-card {
  background: linear-gradient(135deg, rgba(136, 74, 224, 0.8) 0%, rgba(102, 51, 153, 0.8) 100%);
  border: 3px solid #ffd700;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.locked-card {
  background: linear-gradient(135deg, rgba(60, 60, 60, 0.8) 0%, rgba(40, 40, 40, 0.8) 100%);
  border-color: #666;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  opacity: 0.6;
}

.item-card-icon {
  font-size: 60px;
  margin-bottom: 15px;
}

.item-card-name {
  font-size: 1.5em;
  color: #ffd700;
  margin-bottom: 10px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.locked-card .item-card-name {
  color: #999;
}

.item-card-description {
  font-size: 0.95em;
  color: #ffeb99;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

.locked-card .item-card-description {
  color: #888;
}

.item-card-rarity {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 0.9em;
  margin-top: auto;
}

/* 妖怪図鑑スタイル */
.yokai-intro {
  text-align: center;
  padding: 15px;
  margin-bottom: 20px;
  background: rgba(139, 0, 255, 0.2);
  border-radius: 10px;
  border: 1px solid rgba(139, 0, 255, 0.4);
}

.yokai-intro p {
  color: #e0b0ff;
  font-size: 1em;
  margin: 0;
}

.yokai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.item-card.yokai-card {
  background: linear-gradient(135deg, rgba(74, 0, 128, 0.8) 0%, rgba(139, 0, 255, 0.6) 100%);
  border-color: #9b59b6;
  min-height: 220px;
}

.yokai-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yokai-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

.yokai-defeat-count {
  font-size: 0.9em;
  color: #4ade80;
  font-weight: bold;
  margin: 10px 0;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  display: inline-block;
}

.stat-progress-fill.yokai-fill {
  background: linear-gradient(90deg, #9b59b6 0%, #8e44ad 100%);
}

/* 空のコレクション */
.empty-collection {
  text-align: center;
  padding: 60px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.empty-collection p {
  font-size: 1.3em;
  color: #ffeb99;
  margin: 15px 0;
}

.start-button {
  display: inline-block;
  margin-top: 30px;
  padding: 15px 40px;
  background: linear-gradient(135deg, #D9BB62 0%, #C9AB52 100%);
  color: white;
  text-decoration: none;
  border-radius: 15px;
  font-weight: bold;
  font-size: 1.2em;
  box-shadow: 0 4px 15px rgba(217, 187, 98, 0.4);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.start-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(217, 187, 98, 0.6);
  background: linear-gradient(135deg, #E9CB72 0%, #D9BB62 100%);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .collection-container {
    padding: 70px 15px 30px;
  }

  .collection-header h1 {
    font-size: 2em;
  }

  .grade-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

  .item-card {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .collection-grid {
    grid-template-columns: 1fr;
  }
}

/* 設定モーダル - 重複定義削除済み (199行目で定義) */

.settings-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 3px solid rgba(136, 74, 224, 0.5);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 2px solid rgba(136, 74, 224, 0.3);
  background: linear-gradient(135deg, rgba(136, 74, 224, 0.2) 0%, rgba(102, 51, 153, 0.2) 100%);
}

.settings-header h2 {
  margin: 0;
  font-size: 1.8em;
  color: #D9BB62;
  text-shadow: 0 2px 10px rgba(217, 187, 98, 0.5);
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.close-btn:hover {
  background: rgba(255, 100, 100, 0.3);
  border-color: #ff6464;
  transform: rotate(90deg);
}

.settings-body {
  padding: 25px;
}

.settings-section {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 1.3em;
  color: #D9BB62;
  margin-bottom: 15px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* プロフィール表示 */
.profile-display {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  background: rgba(136, 74, 224, 0.1);
  border-radius: 15px;
  border: 2px solid rgba(136, 74, 224, 0.3);
}

.settings-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #D9BB62;
  box-shadow: 0 4px 15px rgba(217, 187, 98, 0.4);
}

.profile-stats {
  flex: 1;
}

.stat-row {
  margin: 8px 0;
  font-size: 1em;
  color: #fff;
}

.stat-row .stat-label {
  color: #ffeb99;
  font-weight: bold;
  margin-right: 8px;
}

.stat-row .stat-value {
  color: #4ade80;
  font-weight: bold;
}

/* ゲーム設定 */
.setting-item {
  margin: 15px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item label {
  display: block;
  color: #ffeb99;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1em;
}

.volume-slider {
  width: 80%;
  height: 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
  margin-right: 15px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D9BB62 0%, #C9AB52 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217, 187, 98, 0.5);
  transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(217, 187, 98, 0.7);
}

.volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D9BB62 0%, #C9AB52 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(217, 187, 98, 0.5);
  transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(217, 187, 98, 0.7);
}

.setting-item span {
  color: #4ade80;
  font-weight: bold;
  font-size: 1em;
}

/* ログアウトボタン */
.logout-btn {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1.1em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  transition: all 0.3s ease;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
}

/* プロフィールウィジェットにクリック可能なカーソル */
.profile-widget {
  cursor: pointer;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .settings-content {
    width: 95%;
    max-height: 90vh;
  }

  .settings-header {
    padding: 15px 20px;
  }

  .settings-header h2 {
    font-size: 1.5em;
  }

  .settings-body {
    padding: 20px;
  }

  .profile-display {
    flex-direction: column;
    text-align: center;
  }

  .setting-item {
    padding: 12px;
  }

  .volume-slider {
    width: 70%;
  }
}
