:root {
  --bg: #0b0d17;
  --bg2: #12152a;
  --card: #181c35;
  --line: #262b4d;
  --text: #eef0ff;
  --muted: #9aa0c7;
  --accent: #ff3b3b;
  --accent-ink: #ffffff;
  --hot: #ffc93c;
  --cool: #46d0ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #5c1f2a55, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.5 "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ---------- Üst çubuk ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 13, 23, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.logo .mark { width: 32px; height: 32px; flex: none; }
.search { flex: 1; max-width: 420px; margin-inline-start: auto; position: relative; }
.search input {
  width: 100%; padding-block: 9px; padding-inline: 36px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); }
.search::before { content: "⌕"; position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; }
.top .actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 14px 28px; font-size: 18px; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: 17px; }
.hidden { display: none !important; }

.offline-pill { display: none; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #3a2b10; color: #ffcf6b; white-space: nowrap; }
html.offline .offline-pill { display: inline-block; }

/* ---------- Ana sayfa ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 16px 16px 60px; }
.hello { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 18px; }
.hello h1 { font-size: clamp(22px, 4vw, 30px); margin: 0; letter-spacing: -.02em; }
.hello .muted { color: var(--muted); }
.streak { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-weight: 600; }
.name-edit { background: none; border: 0; color: var(--accent); cursor: pointer; text-decoration: underline dotted; padding: 0; }

.hero {
  position: relative; overflow: hidden; border-radius: 22px; min-height: 230px;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 20px;
  padding: 26px; margin-bottom: 26px; text-decoration: none;
  background: linear-gradient(120deg, #6b1d24, #12152a 70%); border: 1px solid var(--line);
}
.hero .tag { color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.hero h2 { font-size: clamp(26px, 5vw, 42px); margin: 6px 0 8px; line-height: 1.05; letter-spacing: -.03em; }
.hero p { color: var(--muted); margin: 0 0 16px; max-width: 46ch; }
.hero .art { border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; box-shadow: var(--shadow); transform: rotate(2deg); }
.hero .art img { width: 100%; height: 100%; object-fit: cover; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.section { margin: 8px 0 28px; }
.section h3 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
.section h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 200px); gap: 14px; overflow-x: auto; padding-bottom: 6px; }

.card { position: relative; display: block; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: transform .15s ease, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: #3b4380; }
.card .thumb { aspect-ratio: 4/3; background: var(--bg2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.05); }
.card .info { padding: 9px 11px 11px; }
.card .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .m { color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; }
.badge { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--hot); color: #1a1200; letter-spacing: .03em; }
.badge.offline-ok { inset-inline-start: auto; inset-inline-end: 8px; background: #0d3b2a; color: #7dffc4; }

/* ---------- Reklam alanları ---------- */
.ad-slot { position: relative; margin: 8px 0 28px; min-height: 90px; border-radius: var(--radius); overflow: hidden; }
.ad-slot:empty { display: none; }
.ad-label { position: absolute; top: 4px; inset-inline-end: 8px; font-size: 10px; color: var(--muted); z-index: 1; }
.house { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; background: linear-gradient(90deg, #2a1214, #12152a); border: 1px dashed #5a1d22; border-radius: var(--radius); }
.house b { color: var(--accent); }

/* ---------- Oyun sayfası ---------- */
.play-wrap { max-width: 1400px; margin: 0 auto; padding: 14px 16px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.stage { position: relative; background: #000; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/10; max-height: calc(100vh - 120px); width: 100%; }
.stage.portrait { aspect-ratio: 9/16; max-width: min(100%, calc((100vh - 120px) * 9 / 16)); margin: 0 auto; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.stage:fullscreen { border-radius: 0; max-height: none; max-width: none; aspect-ratio: auto; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; z-index: 2; background: #0b0d17; }
.overlay .cover { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(18px) brightness(.45); transform: scale(1.1); }
.overlay .inner { position: relative; }
.overlay h1 { margin: 0 0 6px; font-size: clamp(24px, 5vw, 38px); letter-spacing: -.02em; }
.overlay p { color: #c9cdf0; margin: 0 0 18px; }
.stage-bar { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.stage-bar h2 { font-size: 18px; margin: 0 auto 0 0; }
.side > * { margin-bottom: 16px; }
.panel-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel-box h3 { margin: 0 0 10px; font-size: 16px; }
.lb { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.lb li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); counter-increment: r; }
.lb li::before { content: counter(r); width: 22px; color: var(--muted); font-weight: 700; }
.lb li:nth-child(1)::before { color: #ffd34d; } .lb li:nth-child(2)::before { color: #d6dcf5; } .lb li:nth-child(3)::before { color: #ffa36b; }
.lb li span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li.me { color: var(--accent); }
.lb li:last-child { border: 0; }
.about { color: #c9cdf0; }
.about h3 { color: var(--text); }
.mini-list { display: grid; gap: 10px; }
.mini { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.mini img { width: 64px; height: 48px; object-fit: cover; border-radius: 10px; }
.mini small { color: var(--muted); display: block; }

/* ---------- Modal / onay / bildirim ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 20px; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.modal-icon { font-size: 40px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90; max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.consent p { margin: 0; flex: 1 1 300px; font-size: 14px; color: #c9cdf0; }
.consent a { color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 120; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.offline-screen { text-align: center; }
.offline-screen .big { font-size: 46px; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 16px 40px; text-align: center; }
footer a { color: var(--muted); margin: 0 8px; }

/* ---------- Metin sayfaları ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.doc h1 { letter-spacing: -.02em; }
.doc h2 { margin-top: 28px; font-size: 19px; }
.doc p, .doc li { color: #c9cdf0; }

@media (max-width: 900px) {
  .play-wrap { grid-template-columns: 1fr; padding: 0 0 40px; }
  .play-wrap > .main-col { padding: 0; }
  .stage { border-radius: 0; border-left: 0; border-right: 0; aspect-ratio: auto; height: calc(100svh - 58px); max-height: none; }
  .stage.portrait { max-width: none; aspect-ratio: auto; }
  .stage-bar, .side { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero .art { display: none; }
}
@media (max-width: 560px) {
  .top { gap: 8px; padding: 8px 12px; }
  .logo .txt { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  main { padding: 12px 12px 50px; }
}

/* ---------- Hesap ---------- */
.acct { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg2); color: var(--text); font-weight: 800; cursor: pointer; padding: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; inset-inline-end: 0; top: 46px; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; }
.menu-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.menu-head small { display: block; color: var(--muted); word-break: break-all; }
.menu button { display: block; width: 100%; text-align: start; padding: 11px 14px; background: none; border: 0; color: var(--text); cursor: pointer; }
.menu button:hover { background: var(--bg2); }

/* ---------- Dil seçici ve sağdan sola diller ---------- */
.lang-sel { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; font: inherit; font-size: 13px; max-width: 120px; cursor: pointer; }
[dir="rtl"] .back { transform: scaleX(-1); }
:lang(hi), :lang(bn), :lang(zh) { font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif; }
@media (max-width: 560px) { .lang-sel { max-width: 82px; padding: 6px 6px; } }
