  :root{
  --bg:#1A3D64; /* خلفية */
  --card:#FFF;
  --muted:#94a3b8;
  --accent:#f6c84c; /* ذهبي */
  --accent-2:#333; /* فضي */
  --glass: rgba(255,255,255,0.03);
  --success: #16a34a;
  --danger:#ef4444;
  --radius:14px;
  font-feature-settings: "lnum";
  font-family: "Cairo", sans-serif;
}
*{box-sizing:border-box}
html, body {
  height: 100%;
  margin: 0;
  background: #1A3D64;
  color: #fff;
  min-width: 320px;
  font-feature-settings: "lnum";
  overflow-x: hidden;
}
.app {
  max-width: 1200px;
  width: 95%;
  margin: 32px auto;
  padding: 28px 12px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #f08b3a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #07111a;
}
.title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
}
.subtitle {
  font-size: 18px;
  color: var(--muted);
}
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  background: var(--glass);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  color: #fff;
}
.btn.primary {
  background: linear-gradient(90deg, rgba(246,200,76,0.12), rgba(191,199,214,0.04));
  border: 1px solid rgb(136, 99, 0);
}
.btn {
  background: var(--glass);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  color: #fff;
}
.btn.primary {
  background: linear-gradient(90deg, rgba(246,200,76,0.12), rgba(191,199,214,0.04));
  border: 1px solid rgb(136, 99, 0);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.card {
  grid-column: span 4;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  padding: 18px;
  font-feature-settings: "lnum";
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(3,10,18,0.6);
  border: 1px solid rgba(255,255,255,0.03);
}
.chart-card {
  grid-column: span 12;
  font-feature-settings: "lnum";
  padding: 18px;
}
.card h3 {
  margin: 0 0 8px 0;
  font-feature-settings: "lnum";
  font-size: 14px;
  color: #fff;
}
.price {
  font-weight: 800;
  font-feature-settings: "lnum";
  font-size: 22px;
  margin-top: 6px;
  color: #fff;
}
.change {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.pair {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pair .left {
  display: flex;
  flex-direction: column;
}
.pair .right {
  text-align: left;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #fff;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
th, td {
  padding: 8px;
  text-align: right;
  border-bottom: 1px dashed rgba(255,255,255,0.03);
}
th {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}
.spark {
  width: 110px;
  height: 36px;
}
/* responsive */
@media (max-width: 980px) {
  .card {
    grid-column: span 6;
  }
  .chart-card {
    grid-column: span 12;
  }
}
@media (max-width: 640px) {
  .app {
    padding: 16px;
  }
  .card {
    grid-column: span 12 !important;
  }
  .chart-card {
    grid-column: span 12 !important;
  }
}
@media (max-width: 480px) {
  .title {
    font-size: 19px;
  }
  .price {
    font-size: 18px;
  }
  .change, .subtitle, th, td, .small {
    font-size: 11px;
  }
  header {
    flex-wrap: wrap;
  }
  .controls {
    flex-wrap: wrap;
    gap: 6px;
  }
}
/* footer */
footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
/* toggle */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
@keyframes logoPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  0% { opacity:0; }
  100% { opacity:1; }
}

@keyframes fadeOut {
  0% { opacity:1; }
  100% { opacity:0; visibility:hidden; }
}
.btn.primary:hover {
  background: linear-gradient(90deg, #16365a, #122d4d);
  box-shadow: 0 0 16px #1A3D64ff;
}

/* مودال */
#loginModal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#loginModal.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

#loginModal .modal-content {
  background: #1A3D64;
  padding: 24px 28px;
  border-radius: 12px;
  min-width: 320px;
  max-width: 90%;
  box-shadow: 0 0 20px #1A3D64aa;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.4s ease;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#loginModal.show .modal-content {
  transform: translateY(0);
}

#loginModal h3 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 700;
}

#loginModal input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #143256;
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
  outline: none;
  box-sizing: border-box;
  box-shadow: inset 0 0 6px #0f2946;
}

#loginModal #loginError {
  color: #f44336;
  display: none;
  margin-top: 10px;
  font-size: 14px;
}

#loginModal .close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.title .beta {
  font-size: 12px;
  background: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  color: #1A3D64;
  opacity: 0.85;
}