* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #050816;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  width: 100%;
  max-width: 480px;
  background: radial-gradient(circle at top, #0b1120, #020617 40%, #000000 100%);
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #ff8a00, #e52e71);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.balances {
  display: flex;
  gap: 10px;
}

.fls-balance-item {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(58, 123, 213, 0.25) 100%);
  padding: 8px 24px;
  border-radius: 999px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(0, 210, 255, 0.6);
  backdrop-filter: blur(10px);
}

.fls-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 15px #00d2ff;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px) scale(1);
  }

  50% {
    transform: translateY(-3px) scale(1.1);
  }

  100% {
    transform: translateY(0px) scale(1);
  }
}

.value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}

.currency-label {
  font-size: 0.8rem;
  color: #4ade80;
  font-weight: 800;
  letter-spacing: 1px;
  margin-left: 2px;
  display: flex;
  align-items: center;
}

/* Removed legacy conflicting styles */

main {
  flex: 1;
  padding: 12px 12px 100px 12px;
  overflow-y: auto;
}

.screen {
  display: none !important;
}

.screen.active {
  display: block !important;
}

.screen.active.mining-layout {
  display: flex !important;
}

.mining-layout {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  text-align: center;
  gap: 15px;
  padding: 20px 20px 80px 20px;
}

.rig-art {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-spin {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle, #00d2ff 0%, #3a7bd5 100%);
  box-shadow: 0 0 30px #00d2ff, inset 0 0 20px rgba(255, 255, 255, 0.5);
  transition: all 0.5s ease;
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid #00d2ff;
  border-radius: 50%;
  animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  display: none;
  z-index: 1;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7);
    opacity: 1;
  }

  70% {
    transform: scale(1.5);
    box-shadow: 0 0 0 20px rgba(0, 210, 255, 0);
    opacity: 0;
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0);
    opacity: 0;
  }
}

.mining-status {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px 30px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 10px;
}

.status-label {
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.status-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffeb3b;
  margin-top: 5px;
}

.timer {
  margin-top: 10px;
  text-align: center;
}

.timer-label {
  font-size: 0.8rem;
  color: #aaa;
}

.timer-value {
  font-size: 2.5rem;
  font-family: monospace;
  font-weight: 900;
  color: white;
}

.actions {
  display: flex;
  gap: 15px;
  width: 100%;
  max-width: 320px;
  margin: 20px auto 0 auto;
  justify-content: center;
  align-items: center;
}

button {
  font-family: inherit;
  outline: none;
}

.primary-btn,
.secondary-btn {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

/* 3D Press Effects */
.primary-btn:active,
.secondary-btn:active,
.mining-btn:active,
.collect-btn:not(:disabled):active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

/* Primary Button (FLS / Buy / Action) - Golden/Green */
.primary-btn {
  background: linear-gradient(135deg, rgba(32, 227, 178, 0.8) 0%, rgba(12, 235, 235, 0.8) 100%);
  box-shadow: 0 6px 0 rgba(7, 150, 115, 0.8), 0 10px 15px rgba(32, 227, 178, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #0b1120;
  text-shadow: none;
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(32, 227, 178, 1) 0%, rgba(12, 235, 235, 1) 100%);
  box-shadow: 0 6px 0 rgb(7, 150, 115), 0 10px 20px rgba(32, 227, 178, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

/* Secondary Button (TON / Default / Info) - Blue/Purple */
.secondary-btn {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.8) 0%, rgba(124, 58, 237, 0.8) 100%);
  box-shadow: 0 6px 0 rgba(49, 42, 163, 0.8), 0 10px 15px rgba(79, 70, 229, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(79, 70, 229, 1) 0%, rgba(124, 58, 237, 1) 100%);
  box-shadow: 0 6px 0 rgb(49, 42, 163), 0 10px 20px rgba(79, 70, 229, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

/* Disabled State */
button:disabled {
  background: linear-gradient(135deg, #222 0%, #333 100%) !important;
  box-shadow: 0 6px 0 #111 !important;
  color: #888 !important;
  transform: translateY(0) !important;
  cursor: not-allowed !important;
  border-color: #444 !important;
}

.mining-btn {
  flex: 1;
  padding: 15px;
  font-size: 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #0cebeb 0%, #20e3b2 50%, #29ffc6 100%);
  color: #0b1120;
  box-shadow: 0 6px 0 #079673, 0 10px 15px rgba(32, 227, 178, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.collect-btn {
  flex: 1;
  padding: 15px;
  font-size: 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #222 0%, #333 100%);
  color: #888;
  border: 1px solid #555;
  box-shadow: 0 6px 0 #000;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.collect-btn:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 6px 0 #b45309, 0 10px 15px rgba(245, 158, 11, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.convert-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.convert-info {
  display: flex;
  flex-direction: column;
}

.convert-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.convert-rate {
  font-size: 13px;
  color: #e5e7eb;
}

.chip-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.5);
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  background: #020617;
  color: #9ca3af;
  border: 1px solid #1f2937;
}

.tab-btn.active {
  background: #4f46e5;
  color: #e5e7eb;
  border-color: #6366f1;
}

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

.card {
  background: linear-gradient(145deg, #1c1c1e, #141415);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.buy-buttons {
  display: flex;
  gap: 10px;
}

.buy-btn-1 {
  flex: 1;
  padding: 10px 5px;
  font-size: 0.9em;
  border-radius: 8px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  color: white;
  cursor: pointer;
}

.buy-btn-2 {
  flex: 1;
  padding: 10px 5px;
  font-size: 0.9em;
  border-radius: 8px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border: none;
  color: white;
  cursor: pointer;
}

.wallet-card {
  background: linear-gradient(145deg, #1c1c1e, #141415);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.wallet-card h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  color: #fff;
}

.wallet-card p {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 10px;
}

.wallet-header {
  text-align: center;
  margin-bottom: 20px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  background: rgba(10, 10, 15, 0.95);
  padding: 10px 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #888;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  padding: 5px;
}

.nav-icon {
  font-size: 1.5rem;
  margin-bottom: 3px;
}

.nav-btn.active {
  color: #00d2ff !important;
  transform: translateY(-5px);
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.nav-btn:hover {
  color: white;
}

.spin-wheel-container {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  position: relative;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  padding: 20px 0;
  border-radius: 20px;
}

.spin-wheel {
  width: 250px;
  height: 250px;
  flex-shrink: 0;
  border-radius: 50%;
  margin: 10px auto;
  background: conic-gradient(#10b981 0deg 45deg,
      #3b82f6 45deg 90deg,
      #ef4444 90deg 135deg,
      #f59e0b 135deg 180deg,
      #10b981 180deg 225deg,
      #3b82f6 225deg 270deg,
      #8b5cf6 270deg 315deg,
      #f59e0b 315deg 360deg);
  border: 10px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.8),
    inset 0 0 15px rgba(0, 0, 0, 0.9),
    0 0 0 5px #0f172a;
  position: relative;
  will-change: transform;
}

.spin-wheel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
      transparent 0deg 44.5deg,
      rgba(0, 0, 0, 0.5) 44.5deg 45.5deg);
  pointer-events: none;
}

.spin-pointer {
  position: absolute;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 30px solid #ef4444;
  /* points down */
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8));
  z-index: 20;
}

.spin-wheel-inner {
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.05);
  z-index: 2;
}

.spin-wheel-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
      from 0deg,
      transparent 0deg 44.5deg,
      rgba(0,0,0,0.6) 44.5deg 45.5deg
  );
  pointer-events: none;
  z-index: 1; /* just below the text labels */
}

.spin-wheel-center {
  width: 55px;
  height: 55px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.9);
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.5), inset 0 0 8px rgba(255, 255, 255, 0.3);
  z-index: 5;
  border: 2px solid #00d2ff;
  object-fit: cover;
  padding: 4px;
  position: relative;
}

.spin-segment-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  font-size: 19px;
  font-family: 'Arial Black', Impact, sans-serif;
  font-weight: 900;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0,0,0,0.8);
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255,255,255,0.2);
  z-index: 4;
}

.spin-segment-label.seg-1 {
  transform: translate(-50%, -50%) rotate(22.5deg) translateY(-60px);
}

.spin-segment-label.seg-2 {
  transform: translate(-50%, -50%) rotate(67.5deg) translateY(-60px);
}

.spin-segment-label.seg-3 {
  transform: translate(-50%, -50%) rotate(112.5deg) translateY(-60px);
}

.spin-segment-label.seg-4 {
  transform: translate(-50%, -50%) rotate(157.5deg) translateY(-60px);
}

.spin-segment-label.seg-5 {
  transform: translate(-50%, -50%) rotate(202.5deg) translateY(-60px);
}

.spin-segment-label.seg-6 {
  transform: translate(-50%, -50%) rotate(247.5deg) translateY(-60px);
}

.spin-segment-label.seg-7 {
  transform: translate(-50%, -50%) rotate(292.5deg) translateY(-60px);
}

.spin-segment-label.seg-8 {
  transform: translate(-50%, -50%) rotate(337.5deg) translateY(-60px);
}

.spin-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.spin-modal.visible {
  display: flex;
}

.spin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(3px);
}

.spin-modal-content {
  position: relative;
  width: 90%;
  max-width: 320px;
  border-radius: 16px;
  padding: 16px 14px 14px 14px;
  background: radial-gradient(circle at top, #020617, #030712);
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spin-modal-title {
  font-size: 15px;
  font-weight: 600;
}

.spin-modal-amount {
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
}

.spin-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.spin-modal-btn {
  flex: 1;
}

#spin-result {
  min-height: 24px;
  font-size: 13px;
  color: #a5b4fc;
  text-align: center;
}

.spin-buttons {
  display: flex;
  gap: 8px;
}

.withdraw-section {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.withdraw-section input {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  font-size: 14px;
}

.withdraw-section input::placeholder {
  color: #6b7280;
}

.screen-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}