/* CSS Reset and Variables */
:root {
  --bg-color: #0d0f13;
  --panel-bg: rgba(22, 28, 38, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-color: #ffd700; /* Gold */
  --neon-blue: #00e5ff;
  --neon-purple: #bd00ff;
  --neon-green: #39ff14;
  --neon-red: #ff3131;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --font-title: 'Outfit', 'Noto Sans KR', sans-serif;
  --font-body: 'Noto Sans KR', sans-serif;

  /* Tier Aura Colors */
  --tier-0-color: #9ca3af; /* Gray */
  --tier-1-color: #3b82f6; /* Blue */
  --tier-2-color: #8b5cf6; /* Purple */
  --tier-3-color: #ec4899; /* Pink */
  --tier-4-color: #f97316; /* Orange */
  --tier-5-color: #ef4444; /* Red */
  --tier-6-color: #eab308; /* Mythic Gold */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(26, 21, 44, 0.5) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(13, 27, 42, 0.5) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.game-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.neon-text {
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.gold-text {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.gold-box {
  color: var(--accent-color);
  box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.1);
}

.gold-icon {
  animation: pulse 2s infinite alternate;
}

.currency {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Layout Grid (2 Columns: Display, Control) */
.game-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  min-height: 480px;
}

.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Header Shop Button */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Header Inventory Quick-View Badges */
.header-inventory {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 30px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid;
  transition: all 0.2s;
}

.shield-badge {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.clover-badge {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.25);
  color: #4ade80;
}

.inv-badge i { font-size: 0.85rem; }

.btn-shop-open {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: var(--accent-color);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-shop-open:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-shop-open i {
  font-size: 1rem;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #f87171;
  padding: 7px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

/* Shop Modal Popup Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-backdrop.hidden {
  display: none !important;
  opacity: 0;
}

.modal-content {
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 28px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

/* Modal Inventory Status (inside shop header) */
.modal-inv-status {
  display: flex;
  gap: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.modal-inv-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.modal-inv-item strong {
  color: #fff;
  font-family: var(--font-title);
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.btn-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shop-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  border-left: 3px solid var(--accent-color);
  padding-left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-section h3 .text-blue { color: var(--neon-blue); }
.shop-section h3 .text-green { color: var(--neon-green); }
.shop-section h3 .text-gold { color: var(--accent-color); }

/* Item Grid in Modal */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.shop-grid.single-item {
  grid-template-columns: 1fr;
}

.shop-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.shop-item-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.shop-item-card.horizontal {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.card-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.card-desc h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.card-desc p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.item-qty {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.btn-buy-bundle {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.15);
  color: var(--accent-color);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-buy-bundle:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.shop-item-card.horizontal .btn-buy-bundle {
  width: auto;
  min-width: 100px;
  padding: 10px 20px;
}

/* Booster Requirements Cost label */
.booster-cost {
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-top: 2px;
  font-weight: 500;
}

.booster-slot.active .booster-cost {
  color: var(--neon-blue);
  opacity: 1;
}

/* Custom Scrollbar for Modal content */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Left Panel: Sword Display Stage */
.sword-display-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#particle-canvas {
  width: 100%;
  height: 100%;
}

.aura-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 1;
  transition: background 0.5s ease;
}

.sword-wrapper {
  z-index: 2;
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sword-container {
  width: 180px;
  height: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: float 4s ease-in-out infinite;
  transform-origin: center;
  transition: transform 0.1s ease;
}

.sword-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px var(--aura-color, rgba(255, 255, 255, 0.2)));
}

/* Animations for Sword */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.hammering {
  animation: shake 0.1s infinite alternate !important;
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  100% { transform: translate(-1px, -1px) rotate(1deg); }
}

.break-apart {
  animation: crack-out 0.8s forwards !important;
}

@keyframes crack-out {
  0% { transform: scale(1) rotate(0deg); filter: brightness(3); opacity: 1; }
  50% { transform: scale(1.1) rotate(5deg) translateY(-10px); filter: brightness(5); opacity: 0.8; }
  100% { transform: scale(0.3) rotate(45deg) translateY(100px); filter: grayscale(1); opacity: 0; }
}

.success-glow {
  animation: flash-success 1s forwards !important;
}

@keyframes flash-success {
  0% { filter: brightness(1) drop-shadow(0 0 20px var(--neon-green)); transform: scale(1); }
  50% { filter: brightness(4) drop-shadow(0 0 50px var(--neon-green)); transform: scale(1.15); }
  100% { filter: brightness(1) drop-shadow(0 0 15px var(--aura-color)); transform: scale(1); }
}

/* Sword Name & Level Badge */
.sword-floating-info {
  margin-top: 20px;
  text-align: center;
  z-index: 3;
}

.sword-floating-info h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s;
}

.sword-level-color {
  color: var(--aura-color, #fff);
  text-shadow: 0 0 10px var(--aura-color, rgba(255, 255, 255, 0.3));
}

.sword-level {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: var(--aura-color, #fff);
}

/* Enhancement Banner */
.result-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--border-color);
  padding: 16px 40px;
  border-radius: 40px;
  z-index: 10;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.result-banner.success {
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.result-banner.fail {
  border-color: var(--neon-red);
  box-shadow: 0 0 20px rgba(255, 49, 49, 0.3);
  color: var(--neon-red);
  text-shadow: 0 0 10px rgba(255, 49, 49, 0.5);
}

.result-banner.destroy {
  border-color: #ff0055;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.5);
  color: #ff0055;
  background: linear-gradient(135deg, #2b0010, #000);
  text-shadow: 0 0 15px #ff0055;
}

.result-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.result-text {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 4px;
}

.hidden {
  display: none !important;
}

/* Right Panel: Controls */
.control-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.info-value {
  font-weight: 700;
  font-size: 1.1rem;
}

.grade-tier {
  color: var(--aura-color, var(--text-primary));
  text-shadow: 0 0 8px var(--aura-color);
}

.success-rate {
  font-family: var(--font-title);
  color: var(--neon-green);
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
}

.cost-value {
  font-family: var(--font-title);
  color: var(--accent-color);
}

.warning-row {
  background: rgba(255, 49, 49, 0.1);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 49, 49, 0.2);
}

.warning-row .info-label {
  color: #ff7676;
}

.penalty-text {
  color: #ff4d4d;
}

/* Action Area */
.action-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.booster-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.booster-slot {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.booster-slot:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.booster-slot.active {
  border-color: var(--neon-blue);
  background: rgba(0, 229, 255, 0.05);
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
}

.booster-slot.active i {
  color: var(--neon-blue);
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.5));
}

.booster-slot .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #374151;
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--bg-color);
  transition: background-color 0.3s;
}

.booster-slot.active .badge {
  background: var(--neon-blue);
}

.booster-slot i {
  font-size: 1.5rem;
}

.booster-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.booster-effect {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.booster-slot.active .booster-effect {
  color: var(--neon-blue);
}

/* Action Buttons */
.btn-enhance {
  position: relative;
  width: 100%;
  padding: 16px;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: #000;
  background: linear-gradient(90deg, #ffc700, #ffea00);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-enhance:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 215, 0, 0.4);
}

.btn-enhance:active {
  transform: translateY(1px);
}

.btn-enhance:disabled {
  background: #374151;
  color: var(--text-secondary);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-sell {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-sell:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Tabs Navigation & Contents */
.game-tabs-section {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent-color);
  background: rgba(255, 215, 0, 0.05);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

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

/* Shop Grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.shop-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.shop-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.item-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
}

.clover-color { color: var(--neon-green); background: rgba(57, 255, 20, 0.05); }
.shield-color { color: var(--neon-blue); background: rgba(0, 229, 255, 0.05); }
.auto-color { color: var(--accent-color); background: rgba(255, 215, 0, 0.05); }

.item-info {
  flex: 1;
}

.item-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.item-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.btn-buy {
  padding: 10px 16px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.15);
  color: var(--accent-color);
  font-family: var(--font-title);
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-buy:hover {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

/* Collection Grid (Compact layout for 31 swords) */
.collection-status {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

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

.collection-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  filter: grayscale(1);
  transition: all 0.3s ease;
}

.collection-item.unlocked {
  opacity: 1;
  filter: none;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--tier-color, rgba(255, 255, 255, 0.1));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 0 10px rgba(255, 255, 255, 0.01);
}

.collection-item .sword-thumb {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.collection-item .sword-thumb svg {
  width: 100%;
  height: 100%;
}

.collection-item .sword-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Settings Switch styling */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 400px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-label {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-label i {
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #374151;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--neon-blue);
}

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

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 8px 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fff;
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.1); filter: brightness(1.2); }
}

/* Responsive Styles */
@media (max-width: 1000px) {
  .game-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .panel {
    padding: 20px;
  }
  
  .sword-display-panel {
    min-height: 340px;
  }

  .sword-container {
    width: 150px;
    height: 220px;
  }

  .header-inventory { display: none; }
}

/* ========================================
   AUTH OVERLAY (Login / Signup Screen)
   ======================================== */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #07090f 0%, #0d1220 50%, #07090f 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

#auth-overlay.hidden {
  display: none !important;
}

.auth-box {
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 0 40px rgba(255, 255, 255, 0.02);
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 6px;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden { display: none !important; }

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.auth-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.auth-input::placeholder { color: rgba(255, 255, 255, 0.2); }

.btn-auth-submit {
  margin-top: 6px;
  padding: 14px;
  background: linear-gradient(90deg, #ffc700, #ffea00);
  border: none;
  border-radius: 12px;
  color: #000;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.25);
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 215, 0, 0.4);
}

.auth-error {
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  min-height: 20px;
}

/* ========================================
   USER HUD (after login)
   ======================================== */
.user-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.user-hud:hover {
  background: rgba(255, 255, 255, 0.07);
}

.user-hud .user-nick {
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-admin {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ========================================
   ADMIN PANEL MODAL
   ======================================== */
#admin-modal .modal-content {
  max-width: 700px;
}

.admin-panel-title {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.user-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.user-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.user-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-role-admin {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 20px;
}

.badge-role-user {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.btn-kick {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-kick:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}
