:root {
  --bg: #f5f6f9;
  --panel: #ffffff;
  --ink: #161a23;
  --ink-soft: #717784;
  --line: #edeef2;
  --gold-1: #e7c97a;
  --gold-2: #b8893c;
  --gold-soft: #faf4e6;
  --up: #1c9c52;
  --up-soft: #e7f6ed;
  --down: #d8443c;
  --down-soft: #fcebea;
  --shadow: 0 22px 50px rgba(22, 26, 35, 0.07);
  --radius: 22px;

  color-scheme: light;
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Karanlık tema ---------- */
html[data-theme='dark'] {
  --bg: #0b0d12;
  --panel: #161a23;
  --ink: #f1f3f8;
  --ink-soft: #8d93a2;
  --line: #262b36;
  --gold-1: #e7c97a;
  --gold-2: #c79a48;
  --gold-soft: #241f12;
  --up: #2fb863;
  --up-soft: #16261b;
  --down: #f0635a;
  --down-soft: #2b1816;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

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

html,
body {
  height: 100%;
}

body {
  background:
    radial-gradient(1100px 520px at 88% -12%, #fdf6e6 0%, transparent 56%),
    radial-gradient(900px 480px at 0% 110%, #f1f3f8 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  overflow: hidden;
}

html[data-theme='dark'] body {
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(120, 92, 30, 0.18) 0%, transparent 56%),
    radial-gradient(900px 480px at 0% 110%, rgba(40, 50, 75, 0.25) 0%, transparent 50%),
    var(--bg);
}

.screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: clamp(14px, 1.5vw, 28px);
  gap: clamp(12px, 1.3vh, 20px);
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 1.5vw, 26px) clamp(22px, 2.2vw, 38px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ince altın üst şerit */
.topbar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold-1), var(--gold-2));
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 2.8vw, 3rem);
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #d9b25a 0%, #a9762d 55%, #d9b25a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  color: var(--ink-soft);
  font-size: clamp(0.68rem, 0.9vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.clock {
  text-align: center;
}

.clock-time {
  font-size: clamp(1.5rem, 2.8vw, 2.8rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.clock-date {
  color: var(--ink-soft);
  font-size: clamp(0.74rem, 1vw, 1.05rem);
  font-weight: 600;
  text-transform: capitalize;
}

.live {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.live-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink-soft);
  flex: 0 0 auto;
}

.live.on .live-dot {
  background: var(--up);
  animation: pulse 1.8s infinite;
}

.live.off .live-dot {
  background: var(--down);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(28, 156, 82, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(28, 156, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(28, 156, 82, 0); }
}

.live-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.live-text strong {
  font-size: clamp(0.82rem, 1vw, 1.05rem);
}

.live-text span {
  color: var(--ink-soft);
  font-size: clamp(0.7rem, 0.85vw, 0.92rem);
  font-variant-numeric: tabular-nums;
}


/* ---------- Board ---------- */
.board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.1vw, 22px);
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(13px, 1.05vw, 19px) clamp(16px, 1.3vw, 24px);
  background: linear-gradient(100deg, var(--gold-soft), var(--panel) 70%);
  border-bottom: 1px solid var(--line);
}

.panel-head::before {
  content: '';
  width: 7px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  flex: 0 0 auto;
}

.panel-head h2 {
  font-size: clamp(1.1rem, 1.5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.col-head,
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 0.5vw, 12px);
  padding: clamp(10px, 0.9vw, 16px) clamp(13px, 1.05vw, 20px);
}

.col-head {
  color: var(--ink);
  font-size: clamp(0.82rem, 1vw, 1.25rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.col-head .num,
.row .num {
  text-align: right;
}

.rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.row {
  border-top: 1px solid var(--line);
}

.row .name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: clamp(0.95rem, 1.1vw, 1.4rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  flex: 0 0 auto;
  font-size: 0.8em;
  line-height: 1;
}

.name .label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.row.up .arrow { color: var(--up); }
.row.down .arrow { color: var(--down); }
.row.neutral .arrow { color: var(--ink-soft); }

.price {
  position: relative;
  text-align: right;
  font-size: clamp(1rem, 1.3vw, 1.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* % değişim akıştan çıkarıldı: satış rakamını yukarı itmez, alışla hizalı kalır. */
.price .change {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  line-height: 1;
  font-size: clamp(0.72rem, 0.85vw, 1.1rem);
  font-weight: 700;
}

.row.up .price .change { color: var(--up); }
.row.down .price .change { color: var(--down); }
.row.neutral .price .change { color: var(--ink-soft); }

/* Alış ve satış simetrik: aynı boyut, ağırlık ve renk */
.price.sell,
.price.buy { color: var(--ink); }

/* flash on update */
.row.flash-up { animation: flashUp 0.9s ease; }
.row.flash-down { animation: flashDown 0.9s ease; }
@keyframes flashUp { from { background: var(--up-soft); } to { background: transparent; } }
@keyframes flashDown { from { background: var(--down-soft); } to { background: transparent; } }

/* ---------- Placeholder ---------- */
.placeholder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.4rem);
  font-weight: 600;
  text-align: center;
  padding: 24px;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--gold-2);
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: clamp(0.7rem, 0.85vw, 0.92rem);
  font-weight: 500;
  padding: 0 8px;
}

.contact {
  display: flex;
  gap: clamp(8px, 0.8vw, 14px);
}

.phone {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: clamp(8px, 0.7vw, 11px) clamp(13px, 1vw, 18px);
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: clamp(0.82rem, 0.95vw, 1.05rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.phone:hover {
  transform: translateY(-1px);
  border-color: var(--gold-1);
}

.phone svg {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  fill: var(--gold-2);
}

.updated {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.updated b {
  color: var(--ink);
  font-weight: 700;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Geniş ekran ama 4 sütun dar kalırsa -> 2 sütun */
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet / küçük dizüstü */
@media (max-width: 900px) {
  body { overflow: auto; }
  .screen {
    height: auto;
    min-height: 100dvh;
  }
  .board { flex: none; }
  .rows { justify-content: flex-start; }
  .row { padding-top: 14px; padding-bottom: 14px; }
}

/* Telefon */
@media (max-width: 620px) {
  .screen { padding: 12px; gap: 12px; }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
    padding: 20px 18px;
  }
  .brand { align-items: center; }
  .live { justify-content: center; }

  .board { grid-template-columns: 1fr; }

  .clock-time { font-size: 2rem; }
  .brand h1 { font-size: 2.1rem; }

  .col-head, .row {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
    padding: 14px 16px;
  }
  .row .name { font-size: 0.92rem; }
  .price { font-size: 1rem; }
  .price .change { font-size: 0.78rem; }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .row .name { font-size: 0.9rem; }
  .price { font-size: 0.95rem; }
}
