:root {
  --bg: #0c0e11;
  --panel: #12151a;
  --panel-2: #161a20;
  --head: #1a1f26;
  --line: #232932;
  --text: #eceef1;
  --text-2: #b7bec8;
  --muted: #7d8794;
  --gold: #e0b04a;
  --gold-2: #b98a2b;
  --up: #2fbf68;
  --up-bg: rgba(47, 191, 104, .16);
  --down: #ec4a4f;
  --down-bg: rgba(236, 74, 79, .16);
  --rowh: 56px;       /* JS ekran yüksekliğine göre ayarlar */
  --fs: 22px;         /* fiyat yazı boyutu */
  --cols: 3;
  --gut: 16px;
  --top: #07080a;
  --arrow-idle: #4a525d;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eceef1;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --head: #f1f3f6;
  --line: #dfe3e8;
  --text: #14171c;
  --text-2: #3b424c;
  --muted: #6c7581;
  --gold: #a8740f;
  --gold-2: #8a5f0c;
  --up: #16924a;
  --up-bg: rgba(22, 146, 74, .14);
  --down: #d6363c;
  --down-bg: rgba(214, 54, 60, .12);
  --top: #ffffff;
  --arrow-idle: #b3bac3;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.4 "Barlow", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ---------- üst ---------- */
.top { background: var(--top); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; padding: 10px var(--gut); min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 46px; height: 38px; flex: none; overflow: visible; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 700 24px/1.05 "Barlow Semi Condensed", "Barlow", sans-serif; letter-spacing: .01em; color: var(--gold); }   /* ad, admin panelinde yazıldığı gibi görünür */
.brand-tag { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock-time { font: 600 22px "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-date { font-size: 12px; color: var(--muted); }
.live { display: flex; align-items: center; gap: 7px; font: 700 12px "Barlow Semi Condensed", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #56606c; }
.live.on i { background: var(--up); }
.live.warn i { background: #e6a23c; }
.live.off i { background: var(--down); }
.live.on i.beat { animation: beat .7s ease-out; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 70%, transparent); transform: scale(1.35); }
  100% { box-shadow: 0 0 0 7px transparent; transform: scale(1); }
}

/* dil seçimi */
.lang { position: relative; }
.lang-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { border-color: #3a424d; }
.lang-btn::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.flag { width: 22px; height: 15px; border-radius: 2px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); display: block; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; margin: 0; padding: 4px; list-style: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; min-width: 170px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.lang-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; font-size: 14px; }
.lang-menu button:hover { background: var(--head); }
.lang-menu button[aria-selected="true"] { color: var(--gold); }
.lang-hint { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted); }
.lang-pos { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 11px "Barlow", sans-serif; font-style: normal; border: 1px solid var(--line); color: transparent; }
.lang-menu button[aria-selected="true"] .lang-pos { background: var(--gold); border-color: var(--gold); color: #111; }
.lang-btn .flag + .flag { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); }

/* ---------- iki dil aynı anda ---------- */
.alt { display: block; font-weight: 500; color: var(--muted); }
.p-name .alt { font-size: .82em; margin-top: 2px; color: var(--text-2); opacity: .75; }
.cat-name .alt { font-size: .68em; margin-top: 2px; color: var(--gold); opacity: .7; font-weight: 600; }
.ptable th .alt { font-size: .9em; margin-top: 2px; letter-spacing: .06em; opacity: .75; }
.tk-label .alt { font-size: .92em; opacity: .75; }
body.dual .p-sub { display: none; }

/* ---------- şerit ---------- */
.top, .strip, .foot { flex-shrink: 0; }   /* kısa ekranda şerit ve bantlar ezilip kaybolmasın */
.strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 12px var(--gut) 0; }
.strip::-webkit-scrollbar { display: none; }
.tk { flex: 1 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; white-space: nowrap; }
.tk-label { font: 600 12px "Barlow Semi Condensed", sans-serif; letter-spacing: .08em; color: var(--muted); margin-right: auto; }
.tk-val { font: 600 19px "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; padding: 0 3px; border-radius: 3px; }

/* ---------- pano ---------- */
.board { flex: 1 0 auto; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; padding: 12px var(--gut); align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ptable { width: 100%; border-collapse: collapse; table-layout: auto; }
.ptable th { padding: 16px 18px 12px; text-align: right; font: 600 12px "Barlow Semi Condensed", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; vertical-align: bottom; border-bottom: 1px solid var(--line); }
.ptable th.cat { text-align: left; white-space: normal; }
.cat-name { display: block; font: 700 20px/1.1 "Barlow Semi Condensed", sans-serif; letter-spacing: .02em; text-transform: none; color: var(--gold); }
.cat-meta { display: block; margin-top: 4px; font: 500 12.5px "Barlow", sans-serif; letter-spacing: 0; text-transform: none; color: var(--muted); }
.cat-meta b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cat-meta > span { white-space: nowrap; }
.cat-meta b { border-radius: 3px; padding: 0 2px; }
.cat-meta b.tick { animation: tick .8s ease-out; }
@keyframes tick { 0% { color: var(--gold); background: color-mix(in srgb, var(--gold) 22%, transparent); } 100% { background: transparent; } }
body.compact .unit { display: none; }
body.compact .ptable td, body.compact .ptable th { padding-left: 14px; padding-right: 14px; }
.ptable td { height: var(--rowh); padding: 0 18px; vertical-align: middle; }
.ptable tbody tr + tr td { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.ptable tbody tr:hover td { background: var(--panel-2); }
.p-main { display: flex; align-items: center; gap: 12px; }
.p-text { min-width: 0; }
.p-icon {
  flex: none; width: calc(var(--fs) * 1.45); height: calc(var(--fs) * 1.45); min-width: 30px; min-height: 30px;
  border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  font: 700 max(13px, calc(var(--fs) * .62)) / 1 "Barlow Semi Condensed", sans-serif;
}
.p-icon.wide { font-size: max(11px, calc(var(--fs) * .46)); letter-spacing: -.01em; }
.unit { font: 500 max(11px, calc(var(--fs) * .5)) / 1 "Barlow", sans-serif; color: var(--muted); margin-left: -2px; }
.p-name { display: block; font: 600 max(14px, calc(var(--fs) * .7)) / 1.15 "Barlow", sans-serif; }
.p-sub { display: block; font-size: max(11.5px, calc(var(--fs) * .46)); color: var(--muted); margin-top: 2px; }

.price { width: 1%; text-align: right; white-space: nowrap; }
.price-in { display: inline-flex; align-items: center; gap: 6px; }
.price-val { font: 600 var(--fs) / 1 "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .01em; padding: 4px 6px; border-radius: 6px; }
.price-val .frac { font-size: .7em; opacity: .7; }

/* dönen rakamlar (slot makinesi makaraları) */
.price-val, .tk-val { display: inline-flex; align-items: flex-end; }
.d, .sep { display: inline-block; height: 1.12em; line-height: 1.12em; }
.d { overflow: hidden; position: relative; }
.d .s { display: block; will-change: transform; }
.d .s i { display: block; height: 1.12em; font-style: normal; text-align: center; }
.d.f, .sep.f { font-size: .7em; opacity: .7; }
.price.buy .price-val { color: var(--text-2); font-weight: 500; }

/* ---------- yön okları ---------- */
.arrow { position: relative; width: calc(var(--fs) * .62); height: calc(var(--fs) * .62); min-width: 12px; min-height: 12px; flex: none; overflow: hidden; }
.tk .arrow { width: 13px; height: 13px; }
.arrow svg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.arrow.up { color: var(--up); }
.arrow.down { color: var(--down); }
.arrow.up .i-up, .arrow.down .i-down { display: block; }
/* yükselişte ok aşağıdan yukarı, düşüşte yukarıdan aşağı akar */
.arrow.go.up .i-up { animation: riseUp .55s cubic-bezier(.2, .7, .3, 1) 3; }
.arrow.go.down .i-down { animation: fallDown .55s cubic-bezier(.2, .7, .3, 1) 3; }
@keyframes riseUp { 0% { transform: translateY(110%); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(0); } }
@keyframes fallDown { 0% { transform: translateY(-110%); opacity: 0; } 35% { opacity: 1; } 100% { transform: translateY(0); } }

.flash-up { animation: flashUp 1.6s ease-out; }
.flash-down { animation: flashDown 1.6s ease-out; }
@keyframes flashUp { 0%, 25% { background: var(--up-bg); color: var(--up); } 100% { background: transparent; } }
@keyframes flashDown { 0%, 25% { background: var(--down-bg); color: var(--down); } 100% { background: transparent; } }

.empty { padding: 20px 14px; color: var(--muted); }

/* ---------- alt bant ---------- */
.foot { background: var(--top); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding: 10px var(--gut); }
.fi { display: flex; flex-direction: column; gap: 1px; padding: 0 22px; border-left: 1px solid var(--line); min-width: 0; }
.fi:first-child { padding-left: 0; border-left: 0; }
.fi small { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.fi b { font-weight: 600; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.fi a:hover, .fi a.map { color: var(--gold); }
.foot-notice { margin: 0 0 0 auto; padding-left: 22px; max-width: 560px; text-align: right; font-size: 12px; line-height: 1.45; color: var(--muted); }
.foot-notice span { display: block; }

.theme-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--text-2); flex: none; }
.theme-btn:hover { color: var(--text); border-color: var(--muted); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }

/* ---------- tam ekran (masaüstü): JS "fit" sınıfını ekler ---------- */
body.fit { height: 100vh; overflow: hidden; }
body.fit .board { align-items: stretch; flex: 1 1 0; min-height: 0; }
body.fit .panel { display: flex; flex-direction: column; }

/* ---------- mobil ---------- */
@media (max-width: 900px) {
  :root { --cols: 1 !important; --gut: 12px; }
  .board { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 640px) {
  .top-in { min-height: 56px; gap: 10px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .brand-mark { width: 38px; height: 32px; }
  .brand-name { font-size: 19px; }
  .brand-tag { font-size: 12px; }
  .top-right { gap: 10px; }
  .clock-date { display: none; }
  .clock-time { font-size: 17px; }
  .live span { display: none; }
  .lang-btn { height: 32px; padding: 0 8px; }
  .theme-btn { width: 32px; height: 32px; }
  .lang-btn .lang-code { display: none; }
  .strip { gap: 8px; padding-top: 10px; }
  .tk { padding: 8px 12px; gap: 8px; }
  .tk-val { font-size: 16px; }
  .ptable th { padding: 12px 12px 9px; font-size: 11px; }
  .cat-name { font-size: 18px; }
  .ptable td { padding: 0 12px; }
  .price-in { gap: 4px; }
  .foot-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: start; }
  .fi, .fi:first-child { padding: 0; border-left: 0; }
  .fi b { white-space: normal; }
  .foot-notice { grid-column: 1 / -1; margin: 0; padding: 8px 0 0; max-width: none; text-align: left; border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .brand-tag { display: none; }
  .top-in { flex-wrap: nowrap; }
  .ptable th, .ptable td { padding-left: 9px; padding-right: 9px; }
  .price-in { gap: 4px; }
}
@media (max-width: 480px) {
  .unit { display: none; }
  .p-main { gap: 9px; }
  .p-icon { min-width: 28px; min-height: 28px; }
}
@media (max-width: 380px) {
  .p-icon { display: none; }
  .ptable th, .ptable td { padding-left: 8px; padding-right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
