/* ========================================
   BUTTONS & INTERACTIVE ELEMENTS
   ======================================== */

/* Base Button */
.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  outline: none !important;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.btn:focus,
.btn:focus-visible,
.btn:focus-within {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.btn::-moz-focus-inner {
  border: 0 !important;
  outline: none !important;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.btn:hover::before {
  left: 100%;
}

/* Storage & Exchange Buttons */
.btn-storage,
.btn-exchange {
  background: linear-gradient(135deg, #4c6fa6 0%, #374a6b 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 111, 166, 0.3);
}

.btn-storage:hover,
.btn-exchange:hover {
  box-shadow: 0 6px 16px rgba(76, 111, 166, 0.5);
  transform: translateY(-2px);
}

.btn-storage:active,
.btn-exchange:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(76, 111, 166, 0.3);
}

/* Quests Button */
.btn-quests {
  background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
  color: #fff;
  flex: 1;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-quests:hover {
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
  transform: translateY(-2px);
}

.btn-quests:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* Treasury Button */
.btn-treasury {
  background: linear-gradient(135deg, #9c27b0 0%, #6a1b9a 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.btn-treasury:hover {
  box-shadow: 0 6px 16px rgba(156, 39, 176, 0.5);
  transform: translateY(-2px);
}

.btn-treasury:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(156, 39, 176, 0.3);
}

/* Market Button */
.btn-market {
  background: linear-gradient(135deg, #00796b 0%, #004d40 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 121, 107, 0.3);
}

.btn-market:hover {
  box-shadow: 0 6px 16px rgba(0, 121, 107, 0.5);
  transform: translateY(-2px);
}

.btn-market:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 121, 107, 0.3);
}

.btn-withdraw {
  background: linear-gradient(135deg, #00a78e 0%, #0a6f73 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 167, 142, 0.28);
}

.btn-withdraw:hover {
  box-shadow: 0 6px 16px rgba(0, 167, 142, 0.42);
  transform: translateY(-2px);
}

.btn-withdraw:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 167, 142, 0.26);
}

/* Attack Button */
.btn-attack {
  background: linear-gradient(135deg, #d32f2f 0%, #8b0000 100%);
  color: #fff;
  flex: 1;
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.btn-attack:hover {
  box-shadow: 0 6px 16px rgba(211, 47, 47, 0.5);
  transform: translateY(-2px);
}

.btn-attack:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

/* Primary & Secondary Buttons */
.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.btn-primary:focus,
.btn-primary:focus-visible,
.btn-secondary:focus,
.btn-secondary:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #d4af37 0%, #a8860e 100%);
  color: #000;
}

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

.btn-primary:disabled,
.btn-primary.disabled {
  background: linear-gradient(135deg, #999 0%, #666 100%);
  color: #ccc;
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-reward {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  background: linear-gradient(135deg, #33b864 0%, #1e8a47 100%);
  color: #fff;
}

.btn-reward:focus,
.btn-reward:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

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

.btn-speedup {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  background: linear-gradient(135deg, #f4b93c 0%, #d88414 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(216, 132, 20, 0.28);
}

.btn-speedup:focus,
.btn-speedup:focus-visible {
  outline: none !important;
  box-shadow: 0 6px 16px rgba(216, 132, 20, 0.28) !important;
}

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

.btn-speedup:disabled,
.btn-speedup.disabled {
  background: linear-gradient(135deg, rgba(138, 110, 70, 0.7) 0%, rgba(102, 78, 46, 0.7) 100%);
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  cursor: not-allowed;
}

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

.main-action-card:hover,
.main-banner-action:hover {
  transform: translateY(-1px);
}

.main-action-card:active,
.main-banner-action:active {
  transform: scale(0.98);
}

/* Building Buttons */
.building-btn {
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.building-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.building-btn:hover::before {
  left: 100%;
}

.building-btn:focus,
.building-btn:focus-visible {
  outline: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.collect-btn {
  background: linear-gradient(135deg, #616161 0%, #424242 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(97, 97, 97, 0.3);
  transition: all 0.3s ease;
  cursor: not-allowed;
  opacity: 0.8;
}

.collect-btn.collecting {
  background: linear-gradient(135deg, #616161 0%, #424242 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(97, 97, 97, 0.3);
  opacity: 0.8;
}

.collect-btn.ready {
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  cursor: pointer;
  opacity: 1;
}

.collect-btn.ready:hover {
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.6);
  transform: translateY(-2px);
}

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

.collect-btn:disabled {
  cursor: not-allowed;
}

.upgrade-btn {
  background: linear-gradient(135deg, #4c6fa6 0%, #2a3f57 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 111, 166, 0.3);
}

.upgrade-btn:hover {
  box-shadow: 0 6px 16px rgba(76, 111, 166, 0.5);
  transform: translateY(-2px);
}

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

.buy-btn {
  background: linear-gradient(135deg, #d4af37 0%, #a8860e 100%);
  color: #000;
  grid-column: 1 / -1;
}

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

/* Max Button */
.max-btn {
  padding: 8px 10px;
  background: rgba(76, 111, 166, 0.3);
  border: 1px solid rgba(76, 111, 166, 0.5);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.max-btn:hover {
  background: rgba(76, 111, 166, 0.5);
  border-color: rgba(76, 111, 166, 0.7);
}

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

/* Close Button */
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tab Buttons */
.tab-btn {
  padding: 10px;
  border: 2px solid rgba(76, 111, 166, 0.4);
  background: rgba(76, 111, 166, 0.1);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background-clip: padding-box;
}

.tab-btn.active {
  background: linear-gradient(135deg, #4c6fa6 0%, #2a3f57 100%);
  border-color: #d4af37;
  box-shadow: none;
}

.tab-btn[data-type="mine"].active {
  background: linear-gradient(135deg, rgba(78, 102, 160, 0.98) 0%, rgba(34, 46, 81, 0.98) 100%);
  border-color: rgba(230, 200, 120, 0.92);
}

.tab-btn[data-type="quarry"].active {
  background: linear-gradient(135deg, rgba(112, 116, 128, 0.98) 0%, rgba(63, 67, 78, 0.98) 100%);
  border-color: rgba(205, 210, 220, 0.9);
}

.tab-btn[data-type="lumber_mill"].active {
  background: linear-gradient(135deg, rgba(54, 126, 84, 0.98) 0%, rgba(25, 70, 45, 0.98) 100%);
  border-color: rgba(148, 214, 168, 0.9);
}

.tab-btn[data-type="farm"].active {
  background: linear-gradient(135deg, rgba(146, 74, 74, 0.98) 0%, rgba(82, 39, 39, 0.98) 100%);
  border-color: rgba(238, 175, 149, 0.9);
}

.tab-btn:hover:not(.active) {
  background: rgba(76, 111, 166, 0.2);
  border-color: rgba(76, 111, 166, 0.6);
}

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

.tab-btn:focus,
.tab-btn:focus-visible,
.tab-btn:focus-within,
.tab-btn:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: rgba(76, 111, 166, 0.4) !important;
}

.tab-btn.active:focus,
.tab-btn.active:focus-visible,
.tab-btn.active:focus-within,
.tab-btn.active:active {
  border-color: #d4af37 !important;
  box-shadow: none !important;
}

.tab-btn[data-type="mine"].active:focus,
.tab-btn[data-type="mine"].active:focus-visible,
.tab-btn[data-type="mine"].active:focus-within,
.tab-btn[data-type="mine"].active:active {
  border-color: rgba(230, 200, 120, 0.92) !important;
}

.tab-btn[data-type="quarry"].active:focus,
.tab-btn[data-type="quarry"].active:focus-visible,
.tab-btn[data-type="quarry"].active:focus-within,
.tab-btn[data-type="quarry"].active:active {
  border-color: rgba(205, 210, 220, 0.9) !important;
}

.tab-btn[data-type="lumber_mill"].active:focus,
.tab-btn[data-type="lumber_mill"].active:focus-visible,
.tab-btn[data-type="lumber_mill"].active:focus-within,
.tab-btn[data-type="lumber_mill"].active:active {
  border-color: rgba(148, 214, 168, 0.9) !important;
}

.tab-btn[data-type="farm"].active:focus,
.tab-btn[data-type="farm"].active:focus-visible,
.tab-btn[data-type="farm"].active:focus-within,
.tab-btn[data-type="farm"].active:active {
  border-color: rgba(238, 175, 149, 0.9) !important;
}

/* Quest Buttons */
.btn-quest {
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-quest-check {
  width: 100%;
  background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-quest-check:hover {
  box-shadow: 0 6px 16px rgba(255, 152, 0, 0.5);
  transform: translateY(-2px);
}

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

.btn-quest-action {
  flex: 1;
  background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-quest-action:hover {
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.5);
  transform: translateY(-2px);
}

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

.btn-quest-claim {
  width: 100%;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-quest-claim:hover {
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
  transform: translateY(-2px);
}

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

/* Coin Button */
.coin-button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 14px 0;
  min-height: auto;
  order: 0;
}

.coin-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.coin-floating-reward {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  color: #ffd966;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 217, 102, 0.28);
  pointer-events: none;
  animation: coinRewardFloat 0.9s ease-out forwards;
  z-index: 3;
}

@keyframes coinRewardFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.92);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -180%) scale(1.05);
  }
}

.coin-label {
  font-size: 12px;
  color: rgba(255, 214, 102, 0.82);
  font-weight: 600;
  margin: 0;
  text-align: center;
}

.btn-coin {
  width: 320px;
  height: 320px;
  padding: 0;
  border-radius: 50% !important;
  font-size: 0;
  flex: none !important;
  background: transparent !important;
  color: transparent;
  box-shadow: none !important;
  border: none !important;
  transition: transform 0.18s ease;
  flex: none;
  position: static;
  overflow: hidden;
  display: block;
  cursor: pointer;
  line-height: 1;
  outline: none;
  isolation: isolate;
}

.btn-coin::before {
  content: none !important;
  display: none !important;
}

.btn-coin:focus,
.btn-coin:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.btn-coin:hover {
  transform: none;
}

.btn-coin:active {
  transform: none;
  box-shadow: none;
  background: transparent !important;
}

.btn-coin.coin-click {
  animation: none;
  background: transparent !important;
}

/* Coin Mining Header */
.coin-mining-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 14px 10px;
  background: transparent;
  border-bottom: 0;
  border-radius: 0;
  margin: 0;
  order: -2;
}

.coin-energy-panel {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 14px 8px;
}

.coin-energy-card {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 35, 58, 0.96) 0%, rgba(12, 20, 34, 0.98) 100%);
  border: 1px solid rgba(93, 113, 168, 0.18);
}

.coin-energy-label {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.coin-energy-value {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #8fe7ff;
}

.coin-energy-refill-btn {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 10px 12px;
  font-size: 12px;
}

.jamcoin-earned {
  text-align: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 26, 14, 0.96) 0%, rgba(22, 18, 10, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.earned-label {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: rgba(255, 214, 102, 0.76);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.earned-amount {
  margin: 0;
  font-size: 28px;
  color: #ffd966;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.22);
}

/* Coin Mining Stats */
.coin-mining-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 14px 18px;
  background: transparent;
  order: 1;
}

.clicks-earned {
  text-align: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 24, 46, 0.96) 0%, rgba(12, 16, 31, 0.98) 100%);
  border: 1px solid rgba(93, 113, 168, 0.18);
}

.clicks-label {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clicks-amount {
  margin: 0;
  font-size: 22px;
  color: #ffd966;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.18);
}
