* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

html {
  min-height: 100vh;
  background: black;
  position: relative;
}

body {
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
  background: transparent;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

canvas#backgroundCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

::-webkit-scrollbar {
  display: none;
}

.content-wrapper {
  opacity: 1;
  position: relative;
  z-index: 10;
}

.top-coin-alert {
  margin: 16px 0;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.alert-title-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-icon {
  width: 22px;
  height: 22px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.alert-title {
  font-size: 15px;
  font-weight: 600;
  color: #10b981;
}

.alert-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-left {
  flex: 1;
}

.alert-coin {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-price-change {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.8;
}

.alert-level {
  background: #10b981;
  color: #000;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  min-width: 85px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-points {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.alert-level.level-1 { background: #ef4444; color: #fff; }
.alert-level.level-2 { background: #fbbf24; color: #000; }
.alert-level.level-3 { background: #f59e0b; color: #000; }
.alert-level.level-4 { background: #059669; color: #fff; }
.alert-level.level-5 { background: #10b981; color: #000; }

.indicators {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 20px;
}

.indicator {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.indicator-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  font-weight: 500;
}

.indicator-value {
  font-size: 16px;
  font-weight: bold;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.indicator-value.animate-up {
  animation: smoothSlideUp 0.8s ease-out;
}

.indicator-value.animate-down {
  animation: smoothSlideDown 0.8s ease-out;
}

@keyframes smoothSlideUp {
  0% { transform: translateY(15px); opacity: 0.5; }
  50% { transform: translateY(-2px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes smoothSlideDown {
  0% { transform: translateY(-15px); opacity: 0.5; }
  50% { transform: translateY(2px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 1; }
}

.good { color: #10b981; }
.bad { color: #ef4444; }
.neutral { color: #fbbf24; }

.chart-container {
  margin: 0 0 24px;
  height: 120px;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.fear-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-line {
  width: 100%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 60'%3E%3Cpath d='M0 45 Q30 35 60 40 T120 35 Q150 25 180 30 T240 20 Q270 15 300 10' stroke='%23fff' stroke-width='2' fill='none' opacity='0.8'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  margin-top: 20px;
}

.coin-list {
  padding: 0;
}

.coin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 16px;
  opacity: 0.25;
  min-width: 0%;
  transition: width 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
}

.progress-bar.loading {
  animation: progressLoad 2s ease-out;
}

@keyframes progressLoad {
  0% { width: 0% !important; opacity: 0.1; }
  60% { opacity: 0.3; }
  100% { opacity: 0.25; }
}

.level-1 .progress-bar { background: #ef4444; }
.level-2 .progress-bar { background: #fbbf24; }
.level-3 .progress-bar { background: #f59e0b; }
.level-4 .progress-bar { background: #059669; }
.level-5 .progress-bar { background: #10b981; }

.coin-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.coin-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  z-index: 2;
  transition: background-color 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin-item.level-5::before { background: #10b981; }
.coin-item.level-4::before { background: #059669; }
.coin-item.level-3::before { background: #f59e0b; }
.coin-item.level-2::before { background: #fbbf24; }
.coin-item.level-1::before { background: #ef4444; }

.coin-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coin-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.coin-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coin-info {
  flex: 1;
}

.coin-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-price {
  font-size: 14px;
  opacity: 0.7;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin-change-inline {
  font-size: 12px;
  font-weight: 600;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.buy-level {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-5 .buy-level { background: #10b981; color: #000; }
.level-4 .buy-level { background: #059669; color: #fff; }
.level-3 .buy-level { background: #f59e0b; color: #000; }
.level-2 .buy-level { background: #fbbf24; color: #000; }
.level-1 .buy-level { background: #ef4444; color: #fff; }

.coin-points {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.coin-points.animate-up {
  animation: smoothSlideUp 0.8s ease-out;
}

.coin-points.animate-down {
  animation: smoothSlideDown 0.8s ease-out;
}

.positive { color: #10b981; }
.negative { color: #ef4444; }

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 16px;
  opacity: 0.7;
}

.live-indicator {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.9);
  color: #000;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.live-indicator.show {
  opacity: 1;
}

.info-btn {
  position: fixed;
  bottom: 20px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(45deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
  transition: transform 0.2s ease;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-btn:active {
  transform: scale(0.92);
}

.legend-popup {
  position: fixed;
  bottom: 75px;
  right: 16px;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  max-width: 280px;
  font-size: 13px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.legend-popup.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.legend-popup h4 {
  margin-bottom: 12px;
  color: #10b981;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 6px 0;
  gap: 8px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

@media (max-width: 390px) {
  .coin-item {
    padding: 12px;
  }
  .coin-name {
    font-size: 15px;
  }
  .legend-popup {
    right: 8px;
    max-width: 260px;
  }
  .info-btn {
    right: 12px;
  }
  .indicators {
    grid-template-columns: repeat(2, 1fr);
  }
}

input, select, textarea {
  font-size: 16px;
}

.coin-item, .top-coin-alert, .chart-container {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}