:root {
  --bg: #05070a;
  --surface: #0b0f14;
  --ink: #f4f7fa;
  --muted: #8b95a8;
  --call: #2de698;
  --call-dim: rgba(45, 230, 152, 0.18);
  --put: #ff5a6b;
  --put-dim: rgba(255, 90, 107, 0.18);
  --gold: #f5b942;
  --border: #1d2833;
  --line: rgba(244, 247, 250, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Tajawal", system-ui, sans-serif;
  overflow: hidden;
}

.wrap {
  max-width: 720px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 14px 16px 10px;
}

header {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ffe9b0, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.price-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  direction: ltr;
}

.price-line strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--call);
  font-size: 12px;
  font-weight: 600;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--call);
  box-shadow: 0 0 8px var(--call);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.map {
  flex: 1;
  overflow-y: auto;
  padding: 8px 2px 4px;
  direction: ltr;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-drag: none;
}

.waiting {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 14px;
}

.spot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}

.spot-row::before,
.spot-row::after {
  content: "";
  flex: 1;
  height: 1px;
  border-top: 1px dashed var(--line);
  margin: 0 10px;
}

.strike-row {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}

.strike-row:hover { background: rgba(255,255,255,0.03); }

.strike-row .label {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
}

.strike-row .bar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.strike-row .bar-wrap {
  position: relative;
  flex: 1;
  height: 18px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
}

.strike-row .bar {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.35s ease;
}

.strike-row.call .bar { background: linear-gradient(90deg, rgba(45,230,152,0.25), var(--call)); }
.strike-row.put .bar { background: linear-gradient(90deg, rgba(255,90,107,0.25), var(--put)); }

.strike-row .liq-label {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  min-width: 34px;
}

.strike-row .price {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: nowrap;
}

.strike-row.call .price { color: var(--call); }
.strike-row.put .price { color: var(--put); }

.star {
  color: var(--gold);
  font-size: 12px;
  margin-left: 3px;
}

.strip {
  display: flex;
  justify-content: space-around;
  gap: 6px;
  padding: 10px 0 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 8px 0 6px;
  overflow-x: auto;
  direction: ltr;
  flex-shrink: 0;
}

.strip-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 58px;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background 0.12s;
}

.strip-item:hover { background: rgba(255,255,255,0.04); }

.strip-item .vol {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.strip-item .k {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.strip-item .star {
  font-size: 11px;
  margin: 0;
}

.pick {
  text-align: center;
  padding: 6px 0 4px;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.pick .put { color: var(--put); }
.pick .call { color: var(--call); }
.pick .none { color: var(--muted); }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal.active { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 18px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  left: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-box h2 {
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 14px;
  text-align: center;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-grid .cell {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 8px 10px;
}

.modal-grid .cell.full { grid-column: 1 / -1; }

.modal-grid .cell .lab {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.modal-grid .cell .val {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .wrap { padding: 10px 12px 8px; }
  header h1 { font-size: 15px; }
  .price-line strong { font-size: 24px; }
  .strike-row { grid-template-columns: 52px 1fr 52px; gap: 8px; }
  .strike-row .label { font-size: 12px; }
  .strike-row .liq-label { font-size: 10px; min-width: 30px; }
  .strike-row .price { font-size: 12px; }
  .strip-item .vol { font-size: 11px; }
  .strip-item .k { font-size: 10px; }
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
