:root {
  --bg: #0e1116;
  --panel: #151a22;
  --panel2: #1b2230;
  --line: #2a3344;
  --text: #e8eef8;
  --muted: #8b97ab;
  --accent: #3d9cf0;
  --accent2: #e8b84a;
  --ok: #3ecf8e;
  --danger: #f07178;
  --radius: 12px;
  --font: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2740 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #241a12 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(21, 26, 34, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(145deg, var(--accent), #1d5f9c);
  color: #fff;
}
.brand strong { display: block; font-size: 0.95rem; }
.brand span { color: var(--muted); font-size: 0.75rem; }

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px 0;
}
.side-search { padding: 10px 12px; }
.side-search input,
.top-tools input[type="search"] {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
}
.side-search input:focus,
.top-tools input[type="search"]:focus { border-color: var(--accent); }

.providers {
  flex: 1;
  overflow: auto;
  padding: 4px 8px 12px;
}
.provider {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
}
.provider:hover { background: var(--panel2); }
.provider.active {
  background: linear-gradient(90deg, rgba(61,156,240,0.18), transparent);
  outline: 1px solid rgba(61,156,240,0.35);
}
.provider .name { font-size: 0.88rem; }
.provider .badge {
  font-size: 0.72rem;
  color: var(--muted);
  background: #0f141c;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.provider.pragmatic .name { color: var(--accent2); font-weight: 650; }

.side-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
}
.side-foot a { color: var(--accent); text-decoration: none; }

.main { padding: 20px 24px 40px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.topbar h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 0.88rem; }
.top-tools { display: flex; gap: 12px; align-items: center; min-width: 320px; }
.top-tools input { min-width: 220px; }
.check { color: var(--muted); font-size: 0.82rem; display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.howto {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 16px;
}
.howto code {
  color: var(--accent2);
  background: #0f141c;
  padding: 1px 6px;
  border-radius: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.card-thumb {
  height: 120px;
  background: #0b0e14;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.card-thumb .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb .pill {
  position: absolute;
  left: 8px; top: 8px;
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 1;
}
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}
.meta { color: var(--muted); font-size: 0.75rem; word-break: break-all; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary {
  background: linear-gradient(180deg, #4aa6f5, #2b7fd0);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.btn.ghost { background: transparent; }
.file-btn { text-align: center; }
.btn:disabled { opacity: 0.5; cursor: wait; }
.har-ok { color: var(--ok); font-size: 0.72rem; }

.muted { color: var(--muted); }
.pad { padding: 16px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #10161f;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 50;
}
.toast.error { border-color: var(--danger); }

/* Aynı sayfada oyun (iframe) */
.play-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #07090d;
}
.play-panel[hidden] { display: none !important; }
.play-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(21, 26, 34, 0.98);
  border-bottom: 1px solid var(--line);
}
.play-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.play-meta strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-har {
  color: var(--muted);
  font-size: 0.72rem;
  word-break: break-all;
}
.play-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.play-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.play-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #000;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .topbar { flex-direction: column; }
  .top-tools { min-width: 0; width: 100%; flex-wrap: wrap; }
}
