:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  --background: #000000;
  --surface: #101010;
  --field: #181818;
  --border: #383124;
  --gold: #ffd447;
  --gold-hover: #ffe581;
  --neon-green: #39ff14;
  --text: #f4f1e9;
  --muted: #b5ae9d;
  background: var(--background);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); }
main { max-width: 1440px; margin: auto; padding: 28px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 22px; }
h1 { font-size: 22px; letter-spacing: 1px; color: var(--gold); }
h2 { font-size: 18px; }
a { color: var(--gold); }
button, input, select { font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--field); color: inherit; }
button { cursor: pointer; background: var(--gold); color: #111111; border-color: var(--gold); font-weight: 650; }
button:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
label { display: block; margin: 12px 0; }
input { max-width: 100%; }
input::placeholder { color: var(--muted); }
label input { display: block; width: 100%; margin-top: 7px; }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 22px; margin: 20px 0; }
.login { max-width: 460px; margin: 8vh auto; }
.stats, .filters, .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.stats > div { flex: 1; min-width: 150px; }
.stats strong { display: block; font-size: 24px; color: var(--gold); margin-top: 8px; }
.scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
td, th { text-align: left; padding: 13px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); }
/* Her iki taramada coin adları altın, fiyat ve kutu/kırılım seviyeleri neon yeşil. */
#live td:nth-child(1), #closed td:nth-child(1) {
  color: var(--gold);
  font-weight: 700;
}
#bist-rows td:nth-child(2) {
  color: var(--gold);
  font-weight: 700;
}
#bist-rows td:nth-child(5), #bist-rows td:nth-child(6) {
  color: var(--neon-green);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
#live td:nth-child(3), #live td:nth-child(4),
#closed td:nth-child(3), #closed td:nth-child(4) {
  color: var(--neon-green);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px #39ff1426;
}
p { line-height: 1.6; }
#message, [role=alert] { color: var(--gold-hover); white-space: pre-wrap; }
.danger { border: 2px solid #f05b64; }
.muted { color: var(--muted); }
dialog { max-width: 90vw; background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: 14px; }
dialog::backdrop { background: #000b; }
@media (max-width: 600px) {
  main { padding: 14px; }
  h1 { font-size: 17px; }
  .card { padding: 14px; }
}

#live td:nth-child(1) a, #closed td:nth-child(1) a { color: var(--gold); text-decoration: none; }
#live td:nth-child(1) a:hover, #closed td:nth-child(1) a:hover { text-decoration: underline; }

/* Telefon ve tablet: içerik taşmadan okunur, dokunma hedefleri en az 44 px. */
[hidden] { display: none !important; }
main, header, .card, .stats > div, .filters > *, .actions > * { min-width: 0; }
h1, h2, h3, #who, #once, [role=alert] { overflow-wrap: anywhere; }
button, input, select { min-height: 44px; }
input, select { font-size: 16px; }
.actions { align-items: center; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; }
.stats strong { overflow-wrap: anywhere; }
dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px; }
#password-form > button { margin-top: 8px; }
@media (max-width: 1000px) {
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > div { margin: 12px 0 0; min-width: 0; }
  .stats strong { font-size: 20px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > * { width: 100%; }
}
@media (max-width: 700px) {
  main { width: 100%; padding: 16px 12px; }
  header { align-items: stretch; gap: 10px; padding-bottom: 14px; }
  header h1 { width: 100%; font-size: 18px; line-height: 1.45; margin: 0; }
  header .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #who { grid-column: 1 / -1; color: var(--muted); }
  header .actions > button, header .actions > a { justify-content: center; text-align: center; width: 100%; }
  .card { padding: 14px; margin: 14px 0; }
  .card h2 { font-size: 17px; line-height: 1.45; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats > div { padding: 12px; margin: 10px 0 0; font-size: 13px; }
  .stats strong { font-size: 17px; line-height: 1.45; }
  .stats > div:nth-child(2) strong { font-size: 15px; }
  .login { margin: 4vh auto; max-width: 460px; }
  .login h1 { font-size: 19px; line-height: 1.5; }
  #login button { width: 100%; }
  .scroll { overflow: visible; }
  table, tbody { display: block; width: 100%; white-space: normal; }
  /* Başlıklar ekran okuyucularında kalır; değerler kartlarda etiketlidir. */
  thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tbody tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; padding: 4px 10px; background: var(--field); }
  tbody td { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
  tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 400; text-shadow: none; }
  tbody td:last-child { border-bottom: 0; }
  tbody td[colspan] { display: block; padding: 16px 0; color: var(--muted); }
  tbody td[colspan]::before { content: none; }
  #live td:nth-child(1) a, #closed td:nth-child(1) a { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0; }
  #users td:last-child, #blocks td:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  #users td:last-child::before, #blocks td:last-child::before { flex-basis: 100%; }
  #users td:last-child button { flex: 1 1 120px; }
  dialog { padding: 16px; }
  #password-form > button { width: 100%; }
}
@media (max-width: 380px) {
  .filters { grid-template-columns: minmax(0, 1fr); }
  header .actions { grid-template-columns: minmax(0, 1fr); }
  tbody td { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 8px; }
}

/* İmzanın siyah kenar boşlukları yalnızca görünümde kırpılır; orijinal görsel korunur. */
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; max-width: 100%; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: .05em; }
.brand-signature { position: relative; flex: 0 0 auto; width: 200px; aspect-ratio: 2.05; overflow: hidden; background: #000; }
.brand-signature img { position: absolute; width: 185%; height: auto; max-width: none; left: -42%; top: -58%; }
.login .brand { flex-direction: column; gap: 12px; text-align: center; }
.login .brand-signature { width: min(280px, 100%); }
.login .brand h1 { font-size: 19px; }
@media (max-width: 1000px) {
  header > .brand { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 700px) {
  header > .brand { flex-direction: column; align-items: center; width: 100%; text-align: center; gap: 10px; }
  .brand h1, .login .brand h1 { font-size: 17px; line-height: 1.5; letter-spacing: .03em; }
  .brand-signature { width: 220px; max-width: 100%; }
  .login .brand-signature { width: min(260px, 100%); }
}

/* Sabit üst alan: kayan içeriğin üstünde, opak siyah zeminle kalır. */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: -28px -28px 0;
  padding: 12px 28px;
  background: var(--background);
  box-shadow: 0 8px 20px #0008;
}
.login { margin: 0 auto; }
.login > header { justify-content: center; }
@media (max-width: 700px) {
  header { margin: -16px -12px 0; padding: 8px 12px; gap: 8px; }
  header .brand-signature { width: 160px; }
  header .actions { gap: 6px; }
  .login { margin: 0 auto; }
  .login > header .brand-signature { width: min(220px, 100%); }
}

#users td:nth-child(5) { white-space: normal; overflow-wrap: anywhere; min-width: 220px; max-width: 420px; }
@media (max-width: 700px) { #users td:nth-child(5) { min-width: 0; max-width: none; } }

.language-control { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.language-control select { width: auto; min-width: 112px; max-width: 150px; }
html[dir=rtl] th, html[dir=rtl] td { text-align: right; }
html[dir=rtl] td:first-child, html[dir=rtl] td:nth-child(2), html[dir=rtl] td:nth-child(3), html[dir=rtl] td:nth-child(4) { unicode-bidi: plaintext; }
@media (max-width:700px) { .language-control { grid-column: 1 / -1; justify-content: flex-end; } }
