:root {
  --bg: #0d0d1a;
  --bg2: #161629;
  --card: rgba(30, 30, 58, .72);
  --border: rgba(255, 255, 255, .08);
  --text: #eef0f7;
  --muted: #9aa0bd;
  --accent: #e94560;
  --accent2: #ffb547;
  --ok: #5fd28a;
  --danger: #ff7a8a;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 10% -10%, rgba(233, 69, 96, .18), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(255, 181, 71, .12), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  backdrop-filter: blur(12px);
  background: rgba(13, 13, 26, .6);
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 18px;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  animation: fadeIn .5s ease both;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: clamp(24px, 4vw, 34px); }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { border-color: rgba(255, 255, 255, .15); }

/* Giriş / qeydiyyat */
.auth-wrap {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
}
.auth { width: 100%; max-width: 420px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, .25);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
}
.tab {
  text-align: center;
  padding: 10px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: all .2s ease;
}
.tab.active {
  background: linear-gradient(135deg, var(--accent), #c73652);
  color: #fff;
  box-shadow: 0 6px 18px rgba(233, 69, 96, .35);
}

/* Formalar */
.form { display: flex; flex-direction: column; gap: 14px; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
input {
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px; /* iOS-da avtomatik böyütməni dayandırır */
  transition: border-color .2s, box-shadow .2s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, .25);
}
label small { font-size: 12px; color: #6f7594; }

.btn {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #c73652);
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(233, 69, 96, .3);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  min-height: 46px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(233, 69, 96, .4); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  animation: fadeIn .3s ease both;
}
.alert.ok { background: rgba(95, 210, 138, .12); color: var(--ok); border: 1px solid rgba(95, 210, 138, .3); }
.alert.error { background: rgba(255, 122, 138, .12); color: var(--danger); border: 1px solid rgba(255, 122, 138, .3); }

/* Şəxsi kabinet */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.badge {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.badge.pro {
  background: linear-gradient(135deg, var(--accent2), #ff8c42);
  color: #1b1020;
  border: none;
  box-shadow: 0 8px 22px rgba(255, 181, 71, .35);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  animation: fadeIn .5s ease both;
}
.stat strong { font-size: 24px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.grid .card p { margin: 0 0 10px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .container { padding: 16px 12px 32px; }
  .card { padding: 18px; }
  .stat strong { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ===== Tam ekran tətbiq qabığı (giriş, qeydiyyat, kabinet) ===== */
body.app { height: 100%; overflow: hidden; }
body.app .foot { display: none; }
body.app main.container {
  height: calc(100vh - 56px); height: calc(100dvh - 56px);
  display: flex; flex-direction: column; padding: 12px 14px; max-width: 980px; animation: none;
}
body.app .auth-wrap {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; min-height: 0;
  -webkit-overflow-scrolling: touch;
}
body.app .auth { margin: auto; }
body.app .dash-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
body.app .hero { margin-bottom: 12px; }
body.app h1 { font-size: 22px; }

@media (max-width: 640px) {
  body.app main.container { padding: 10px 12px; }
  body.app .tabs { margin-bottom: 12px; padding: 4px; }
  body.app .tab { padding: 9px; }
  body.app .card { padding: 14px; }
  body.app .form { gap: 10px; }
  body.app label { gap: 4px; font-size: 13px; }
  body.app input { padding: 10px 12px; }
  body.app .btn { min-height: 44px; padding: 11px 14px; }
  body.app .alert { padding: 9px 12px; margin-bottom: 10px; font-size: 13px; }
  body.app .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
  body.app .stat { padding: 12px; gap: 3px; }
  body.app .stat strong { font-size: 18px; }
  body.app .grid { grid-template-columns: 1fr; gap: 10px; }
  body.app .grid .card p { margin: 0 0 6px; font-size: 14px; }
  body.app .grid .card h2 { font-size: 16px; margin-bottom: 6px; }
  body.app .hero h1 { font-size: 22px; }
}


/* ===== Paytaxt sualı bildirişi (yuxarıda) ===== */
.hidden { display: none !important; }
.tq { position: relative; flex: 0 0 auto; }
.tq-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(255,255,255,.08); font-size: 18px; cursor: pointer; position: relative;
}
.tq-dot {
  position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff4d6d; box-shadow: 0 0 0 3px rgba(255,77,109,.25);
}
.tq-panel {
  position: absolute; right: 0; top: 50px; width: min(300px, 86vw); z-index: 80;
  background: #18182e; border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow);
}
.tq-h { font-weight: 800; font-size: 13px; color: var(--accent2); margin-bottom: 6px; }
.tq-text { font-size: 14px; line-height: 1.4; }
.tq-text b { color: #fff; }
.tq-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tq-form { display: flex; gap: 6px; margin-top: 10px; }
.tq-form input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px; border-radius: 999px; }
.tq-form button {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), #c73652); color: #fff;
}
.tq-form button:disabled, .tq-form input:disabled { opacity: .45; cursor: not-allowed; }
.tq-msg { font-size: 12px; margin-top: 6px; min-height: 1em; }
.tq-msg.ok { color: #5fd28a; }
.tq-msg.bad { color: #ff7a8a; }
.tq-banner {
  position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 70;
  width: min(92vw, 560px); padding: 10px 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(120deg, #b5203d, #e94560); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); animation: fadeIn .3s ease both;
}

/* Son qalib (sual olmayanda panel içində) */
.tq-last { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.tq-lasth { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.tq-lastb { font-size: 13px; line-height: 1.45; color: var(--text); }

/* ===== Rank nişanı (I–V) ===== */
.rk-badge {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 18px; height: 18px; padding: 0 4px; margin-left: 5px; border-radius: 9px; cursor: pointer; user-select: none;
  font-size: 9px; font-weight: 800; line-height: 1; color: #1b1020; letter-spacing: -.2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.35);
}
.rk-badge.tier-1 { background: linear-gradient(135deg, #e0a070, #a0602c); }                 /* I – bürünc */
.rk-badge.tier-2 { background: linear-gradient(135deg, #f4f6fa, #aab3c2); }                 /* II – gümüş */
.rk-badge.tier-3 { background: linear-gradient(135deg, #ffe08a, #e9a526); }                 /* III – qızıl */
.rk-badge.tier-4 { background: linear-gradient(135deg, #6ee7b7, #059669); color: #fff; }    /* IV – zümrüd */
.rk-badge.tier-5 { background: linear-gradient(135deg, #93c5fd, #1d4ed8); color: #fff; }    /* V – safir */
.rk-badge.tier-6 { background: linear-gradient(135deg, #d8b4fe, #7e22ce); color: #fff; }    /* VI – ametist */
.rk-badge.tier-7 { background: linear-gradient(135deg, #fca5a5, #b91c1c); color: #fff; }    /* VII – yaqut */
.rk-badge.tier-8 { background: linear-gradient(135deg, #fdf2f8, #f0abfc); color: #3b0764; } /* VIII – brilyant */
.rk-pop {
  position: fixed; z-index: 120; background: #18182e; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 12px;
  font-weight: 700; box-shadow: var(--shadow); pointer-events: none;
}

/* ===== Pro ===== */
.pro-tag {
  display: inline-block; font-size: 8px; font-weight: 800; letter-spacing: .6px; line-height: 1;
  padding: 3px 5px; margin-right: 5px; border-radius: 5px; vertical-align: middle;
  background: linear-gradient(135deg, #ffe08a, #e9a526); color: #2a1700;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.motto { text-align: center; font-style: italic; color: var(--accent2); font-size: 13px; margin-top: 4px; }

/* ===== Pro: hərəkətli çərçivəli ad ===== */
.pro-frame {
  display: inline-block; padding: 1px 8px; border-radius: 9px; line-height: 1.5;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--frame-bg, #1c1c34), var(--frame-bg, #1c1c34)) padding-box,
    linear-gradient(90deg, #ff4d6d, #ffb547, #34d399, #60a5fa, #a855f7, #ff4d6d) border-box;
  background-size: 100% 100%, 300% 100%;
  background-position: 0 0, 0% 0;
  animation: pfShift 2.2s linear infinite;
  box-shadow: 0 0 8px rgba(255,181,71,.35);
}
@keyframes pfShift {
  from { background-position: 0 0, 0% 0; }
  to   { background-position: 0 0, 100% 0; }
}
