/* 경매 & 우편함 */

.auction-container,
.mail-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auction-container h2,
.mail-container h2 {
  color: white;
  text-align: center;
  margin-bottom: 8px;
}

.page-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.auction-gold {
  text-align: right;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.auction-gold .gold-amount {
  color: #ffd700;
  font-weight: 600;
}

.auction-gold .gold-held {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.auction-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.auction-tab {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}

.auction-tab:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.auction-tab {
  position: relative;
}

.auction-tab.active {
  background: linear-gradient(135deg, var(--pokemon-red), #ff5a36);
  color: white;
}

.auction-section {
  min-height: 200px;
}

.auction-section.hidden {
  display: none !important;
}

.auction-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.auction-filters select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
}

.btn-small {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

.auction-card {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auction-card-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
}

.auction-card-name {
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.auction-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auction-card-price {
  font-size: 13px;
  color: #b8e986;
  margin-bottom: 4px;
}

.auction-card-buynow {
  font-size: 12px;
  color: #ffd700;
  margin-bottom: 4px;
}

.auction-card-ends {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.auction-card-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.auction-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* 포켓몬 랭킹 카드: 좌상단 순위 배지, 1·2·3위 색상 및 오라 */
.pokemon-ranking-card,
.auction-card.ranking-aura-gold,
.auction-card.ranking-aura-silver,
.auction-card.ranking-aura-bronze {
  position: relative;
}

/* 1·2·3위 오라(글로우) 효과 */
.auction-card.ranking-aura-gold {
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.25);
  border-color: rgba(255, 215, 0, 0.6);
  animation: aura-glow-gold 2.5s ease-in-out infinite;
}

.auction-card.ranking-aura-silver {
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.5), 0 0 24px rgba(192, 192, 192, 0.25);
  border-color: rgba(192, 192, 192, 0.6);
  animation: aura-glow-silver 2.5s ease-in-out infinite;
}

.auction-card.ranking-aura-bronze {
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.5), 0 0 24px rgba(205, 127, 50, 0.25);
  border-color: rgba(205, 127, 50, 0.6);
  animation: aura-glow-bronze 2.5s ease-in-out infinite;
}

@keyframes aura-glow-gold {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.5), 0 0 24px rgba(255, 215, 0, 0.25); }
  50% { box-shadow: 0 0 18px rgba(255, 215, 0, 0.7), 0 0 32px rgba(255, 215, 0, 0.35); }
}

@keyframes aura-glow-silver {
  0%, 100% { box-shadow: 0 0 12px rgba(192, 192, 192, 0.5), 0 0 24px rgba(192, 192, 192, 0.25); }
  50% { box-shadow: 0 0 18px rgba(192, 192, 192, 0.7), 0 0 32px rgba(192, 192, 192, 0.35); }
}

@keyframes aura-glow-bronze {
  0%, 100% { box-shadow: 0 0 12px rgba(205, 127, 50, 0.5), 0 0 24px rgba(205, 127, 50, 0.25); }
  50% { box-shadow: 0 0 18px rgba(205, 127, 50, 0.7), 0 0 32px rgba(205, 127, 50, 0.35); }
}

.pokemon-ranking-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 1;
}

.pokemon-ranking-rank.rank-gold {
  color: var(--gold-primary, #ffd700);
  background: rgba(0, 0, 0, 0.7);
}

.pokemon-ranking-rank.rank-silver {
  color: #c0c0c0;
  background: rgba(0, 0, 0, 0.7);
}

.pokemon-ranking-rank.rank-bronze {
  color: #cd7f32;
  background: rgba(0, 0, 0, 0.7);
}

.pokemon-ranking-owner {
  margin-bottom: 8px;
}

.pokemon-ranking-owner-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(100, 120, 200, 0.9), rgba(80, 100, 180, 0.95));
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pokemon-ranking-container .page-desc {
  margin-bottom: 16px;
}

.auction-register-form h3 {
  color: white;
  margin: 20px 0 12px;
  font-size: 16px;
}

.auction-fee-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.auction-register-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.auction-register-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auction-register-filter-label {
  color: var(--text-secondary);
  font-size: 13px;
  min-width: 70px;
}

.auction-register-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
  min-width: 100px;
}

.auction-register-rarity-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auction-register-rarity-btns .auction-filter-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.auction-register-rarity-btns .auction-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auction-register-rarity-btns .auction-filter-btn.active {
  background: linear-gradient(135deg, var(--pokemon-red), #ff5a36);
  border-color: transparent;
  color: white;
}

.auction-register-search {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
}

.auction-register-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* 경매 등록: 포켓몬 그리드 스크롤 영역 (경매 조건이 바로 보이도록) */
.auction-register-form .auction-pokemon-grid-wrap {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.auction-pokemon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.auction-register-form .auction-pokemon-grid-wrap .auction-pokemon-grid {
  margin-bottom: 0;
  padding: 12px;
}

.auction-register-poke {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
}

.auction-register-poke:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.auction-register-poke.selected {
  border-color: var(--pokemon-red);
  background: rgba(255, 90, 54, 0.2);
}

.auction-register-poke img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.auction-register-poke span {
  font-size: 12px;
  color: white;
}

.auction-register-poke .auction-register-name {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.auction-register-poke .auction-register-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  margin-top: 4px;
}

.auction-register-poke .auction-register-iv,
.auction-register-poke .auction-register-stars {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

.auction-register-poke .grade-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.auction-register-poke .grade-badge.grade-S {
  background: linear-gradient(135deg, #ff4081, #f50057);
}

.auction-register-poke .grade-badge.grade-A {
  background: linear-gradient(135deg, #7c4dff, #651fff);
}

.auction-register-poke .grade-badge.grade-B {
  background: linear-gradient(135deg, #2196f3, #2979ff);
}

.auction-register-poke .grade-badge.grade-C {
  background: linear-gradient(135deg, #4caf50, #388e3c);
}

/* 경매 등록 포켓몬 그리드: 성격 배지 글자색(span color:white 덮어씀) */
.auction-register-poke .nature-badge {
  color: #2c3e50 !important;
  background: #e9ecef !important;
  border: 1px solid #dee2e6;
}

.auction-selected {
  margin-bottom: 16px;
  color: #b8e986;
}

.auction-form-row {
  margin-bottom: 14px;
}

.auction-form-row label {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 6px;
}

.auction-form-row input,
.auction-form-row select {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
}

.auction-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auction-modal.hidden {
  display: none !important;
}

.auction-modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auction-modal-content h3 {
  color: white;
  margin-bottom: 12px;
}

.auction-modal-content p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
}

.auction-modal-content input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
  box-sizing: border-box;
}

.auction-bid-proxy-label {
  margin-top: 12px !important;
}

.auction-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.auction-list-bids {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auction-bid-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.auction-bid-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.auction-bid-status {
  font-size: 12px;
  color: #ffd700;
  margin-left: 8px;
}

.auction-bid-date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 우편함 */
.mail-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.mail-filter-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.mail-filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mail-filter-btn.active {
  background: linear-gradient(135deg, var(--pokemon-red), #ff5a36);
  color: white;
}

.mail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mail-item {
  padding: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border-left: 4px solid rgba(255, 255, 255, 0.2);
}

.mail-item.unread {
  border-left-color: var(--pokemon-red);
}

.mail-type {
  font-size: 12px;
  color: #b8e986;
  margin-right: 8px;
}

.mail-title {
  font-weight: 600;
  color: white;
}

.mail-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 4px;
  line-height: 1.4;
}

.mail-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.mail-read-btn {
  margin-top: 8px;
}

.mail-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* 구매 등록 */
.auction-buy-orders-form {
  margin-bottom: 24px;
}

.auction-buy-orders-form h3 {
  color: white;
  margin-bottom: 12px;
}

.auction-buy-order-pokemon-wrap {
  margin-bottom: 12px;
}

.auction-buy-order-pokemon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
}

.auction-buy-order-poke {
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
}

.auction-buy-order-poke:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.auction-buy-order-poke.selected {
  border-color: var(--pokemon-red);
  background: rgba(255, 90, 54, 0.2);
}

.auction-buy-order-poke img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}

.auction-buy-order-poke span {
  font-size: 11px;
  color: white;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auction-grade-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auction-grade-btns .auction-filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.25);
  color: white;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.auction-grade-btns .auction-filter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.auction-grade-btns .auction-filter-btn.active {
  border-color: var(--pokemon-red);
  background: rgba(255, 90, 54, 0.25);
}

.auction-buy-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.auction-buy-order-card {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auction-buy-order-card .auction-card-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

.auction-buy-order-card .auction-card-name {
  font-size: 14px;
  color: white;
  margin-bottom: 4px;
}

.auction-buy-order-card .auction-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auction-buy-order-card .auction-buy-order-cancel-btn {
  margin-top: 8px;
}

/* 팝니다 모달: 포켓몬 선택 */
.auction-sell-modal-pokemon-list {
  max-height: 280px;
  overflow-y: auto;
  margin: 12px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.auction-sell-modal-poke {
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
}

.auction-sell-modal-poke:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.auction-sell-modal-poke img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.auction-sell-modal-poke span {
  font-size: 12px;
  color: white;
}

.auction-sell-modal-poke .auction-sell-modal-name {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.auction-sell-modal-poke .auction-sell-modal-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

.auction-sell-modal-poke .grade-badge {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.auction-sell-modal-poke .grade-badge.grade-S { background: linear-gradient(135deg, #ff4081, #f50057); }
.auction-sell-modal-poke .grade-badge.grade-A { background: linear-gradient(135deg, #7c4dff, #651fff); }
.auction-sell-modal-poke .grade-badge.grade-B { background: linear-gradient(135deg, #2196f3, #2979ff); }
.auction-sell-modal-poke .grade-badge.grade-C { background: linear-gradient(135deg, #4caf50, #388e3c); }

/* 이 가격에 판매 모달: 성격 배지 글자색(span color:white 덮어씀) */
.auction-sell-modal-poke .nature-badge {
  color: #2c3e50 !important;
  background: #e9ecef !important;
  border: 1px solid #dee2e6;
}
