/* Oyun Evreni — giriş ekranı ve oyun kütüphanesi. Karanlık evren teması, cam kartlar, sistem yazı tipleri. */
:root {
  --bg: #0b0a1c; --bg2: #13112e; --ink: #f0f1ff; --muted: #a8abd4; --faint: #6f72a3;
  --line: rgba(255, 255, 255, 0.09); --line2: rgba(255, 255, 255, 0.16);
  --glass: rgba(24, 21, 56, 0.62); --glass2: rgba(34, 30, 76, 0.72);
  --violet: #8b74ff; --violet2: #6a52f0; --teal: #2ad4c5; --honey: #f5b743; --rose: #ff6f9f;
  --ok: #3ddc97; --warn: #ffb547; --err: #ff6b7d;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 24px 60px rgba(3, 2, 14, 0.55), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  display: flex; flex-direction: column;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(139, 116, 255, 0.45); }

/* ---------- gökyüzü ---------- */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; }
.nebula {
  position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 20%, rgba(124, 92, 255, 0.28), transparent 70%),
    radial-gradient(35% 30% at 85% 15%, rgba(42, 212, 197, 0.16), transparent 70%),
    radial-gradient(45% 40% at 70% 90%, rgba(255, 111, 159, 0.14), transparent 70%),
    radial-gradient(30% 30% at 30% 85%, rgba(245, 183, 67, 0.08), transparent 70%);
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(2%, -2%, 0) scale(1.05); } }

/* ---------- üst çubuk ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(11, 10, 28, 0.92), rgba(11, 10, 28, 0.55));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 14px rgba(139, 116, 255, 0.45)); }
.brand-name { font: 700 19px/1.1 var(--font-display); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-end { display: flex; align-items: center; gap: 8px; }
.chip, .me-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover, .me-chip:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line2); }
.chip svg, .me-chip svg { width: 17px; height: 17px; opacity: 0.85; }
.me-chip { padding-inline: 4px 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 13px/1 var(--font-display); color: #10102a; background: linear-gradient(135deg, var(--honey), var(--rose));
}
.me-nick { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop { position: relative; }
.menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; border-radius: 14px; z-index: 30;
  background: rgba(22, 19, 52, 0.97); border: 1px solid var(--line2); box-shadow: var(--shadow);
  display: flex; flex-direction: column; animation: pop 0.16s ease-out;
}
.menu > * { text-align: start; padding: 10px 12px; border-radius: 9px; border: 0; background: none; font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu > *:hover, .menu > [aria-current="true"] { background: rgba(139, 116, 255, 0.18); }
.menu small { color: var(--faint); font-weight: 700; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

.banner {
  margin: 12px auto 0; width: min(1160px, calc(100% - 32px)); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(139, 116, 255, 0.4); background: rgba(139, 116, 255, 0.14);
}
.banner.success { border-color: rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.12); }
.banner.warning { border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 181, 71, 0.12); }

main { flex: 1; width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; }

/* ---------- giriş ekranı ---------- */
.auth-wrap { display: grid; gap: 28px; align-items: start; }
@media (min-width: 920px) { .auth-wrap { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 420px); gap: 44px; padding-top: 18px; } }
.hero h1 { margin: 0 0 12px; font: 800 clamp(30px, 5.2vw, 52px)/1.05 var(--font-display); letter-spacing: -0.02em; }
.hero h1 .grad { background: linear-gradient(92deg, #fff 10%, #c9bdff 45%, #6fe8dc 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin: 0 0 26px; color: var(--muted); font-size: clamp(15px, 1.6vw, 17.5px); max-width: 560px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin: 0 0 10px; }
.show { display: grid; gap: 14px; }
@media (min-width: 620px) { .show { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
  position: relative; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.auth { padding: 26px 24px 22px; }
@media (min-width: 920px) { .auth { position: sticky; top: 92px; } }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 13px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { height: 38px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--muted); transition: background 0.15s, color 0.15s; }
.tabs button[aria-selected="true"] { background: linear-gradient(180deg, rgba(139, 116, 255, 0.36), rgba(106, 82, 240, 0.28)); color: var(--ink); box-shadow: 0 0 0 1px rgba(139, 116, 255, 0.45) inset; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { margin: 0; font: 700 21px/1.2 var(--font-display); }
.form .sub { margin: -6px 0 2px; color: var(--muted); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.input { position: relative; display: flex; }
.input input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(5, 4, 18, 0.45);
  font-size: 15px; transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none; appearance: none;
}
.input input::placeholder { color: var(--faint); }
.input input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 116, 255, 0.22); }
.input input[aria-invalid="true"] { border-color: var(--err); }
.input .eye { position: absolute; inset-inline-end: 6px; top: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 700; color: var(--muted); }
.input input.has-eye { padding-inline-end: 76px; }
.err { min-height: 18px; margin: -4px 0 0; font-size: 13px; font-weight: 600; color: var(--err); }
.err:empty { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; border: 0;
  font-weight: 750; font-size: 15px; letter-spacing: 0.01em; text-decoration: none; transition: transform 0.12s, filter 0.15s, background 0.15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #9a86ff, #6a52f0); box-shadow: 0 10px 24px rgba(106, 82, 240, 0.35), 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.btn-primary:hover:not([disabled]) { filter: brightness(1.08); }
.btn-ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line2); }
.btn-ghost:hover:not([disabled]) { background: rgba(255, 255, 255, 0.11); }
.btn-honey { color: #241404; background: linear-gradient(180deg, #ffd27a, #f0a531); box-shadow: 0 10px 24px rgba(240, 165, 49, 0.28), 0 1px 0 rgba(255, 255, 255, 0.4) inset; }
.btn-teal { color: #04201d; background: linear-gradient(180deg, #5ef0e1, #22bfb1); box-shadow: 0 10px 24px rgba(34, 191, 177, 0.26), 0 1px 0 rgba(255, 255, 255, 0.4) inset; }
.btn-danger { color: #fff; background: linear-gradient(180deg, #ff7f8f, #e04661); }
.btn-block { width: 100%; }
.link { border: 0; background: none; padding: 0; font-size: 13.5px; font-weight: 700; color: #c4b8ff; text-decoration: underline; text-decoration-color: rgba(196, 184, 255, 0.35); text-underline-offset: 3px; }
.link:hover { color: #fff; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.or { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; color: var(--faint); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.guest-note { margin: 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- oyun kartları ---------- */
.game {
  position: relative; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.game:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--gc, #8b74ff) 45%, transparent); }
/* başlıktaki oyun sayfası bağlantısı kartın tamamını kaplar; düğmeler ve rozetler onun üstünde kalır */
.game .g-link { color: inherit; text-decoration: none; outline: none; }
.game .g-link::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.game .g-link:focus-visible::after { box-shadow: 0 0 0 3px var(--gc, #8b74ff) inset; }
.game:hover .g-link { color: #fff; }
.game .game-actions { position: relative; z-index: 4; }
.cover {
  position: relative; aspect-ratio: 16 / 8.4; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #3a2a6e, #120f2c 70%);
  background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--gc, #8b74ff) 55%, #1a1640), #120f2c 70%);
}
.cover img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); }
.game:hover .cover img.art { transform: scale(1.035); }
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(11, 10, 28, 0.82)); }
.cover .icon { position: absolute; inset-inline-start: 16px; bottom: -22px; width: 64px; height: 64px; border-radius: 16px; z-index: 2; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(11, 10, 28, 0.9); }
.cover .badges { position: absolute; inset-inline-end: 12px; top: 12px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 750; background: rgba(8, 7, 22, 0.66); border: 1px solid var(--line2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.badge.maint { color: #2a1a00; background: var(--warn); border-color: transparent; }
.game-body { padding: 30px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.game-body h3 { margin: 0; font: 750 20px/1.2 var(--font-display); }
.game-body p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.modes { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-tag { font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; color: #cfc6ff; padding: 3px 9px; border-radius: 7px; background: rgba(139, 116, 255, 0.14); border: 1px solid rgba(139, 116, 255, 0.28); }
.mode-tag.world { color: #9ff3ea; background: rgba(42, 212, 197, 0.12); border-color: rgba(42, 212, 197, 0.3); }
.game-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-actions .btn { height: 44px; padding: 0 12px; font-size: 14.5px; }
.show .game-actions { display: none; }
.show .game-body { padding-bottom: 16px; }

/* ---------- kütüphane ---------- */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.lib-head h1 { margin: 0; font: 800 clamp(26px, 4vw, 38px)/1.1 var(--font-display); letter-spacing: -0.015em; }
.lib-head p { margin: 6px 0 0; color: var(--muted); }
.lib-grid { display: grid; gap: 18px; }
@media (min-width: 680px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lib-grid .game:first-child:only-child { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .lib-grid .game.hero-card { grid-column: 1 / -1; flex-direction: row; }
  .lib-grid .game.hero-card .cover { flex: 1.35; aspect-ratio: auto; min-height: 320px; }
  .lib-grid .game.hero-card .cover .icon { bottom: 20px; }
  .lib-grid .game.hero-card .game-body { flex: 1; padding: 30px 28px; justify-content: center; }
  .lib-grid .game.hero-card .game-body h3 { font-size: 30px; }
  .lib-grid .game.hero-card .game-body p { flex: 0; font-size: 15.5px; }
  .lib-grid .game.hero-card .game-actions { margin-top: 10px; }
  .lib-grid .game.hero-card .game-actions .btn { height: 50px; font-size: 15.5px; }
}
.guest-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; padding: 14px 16px;
  border-radius: 14px; border: 1px solid rgba(245, 183, 67, 0.32); background: linear-gradient(90deg, rgba(245, 183, 67, 0.13), rgba(255, 111, 159, 0.08));
  font-size: 14px; font-weight: 600;
}
.guest-bar .btn { height: 38px; font-size: 13.5px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.maint-box { max-width: 520px; margin: 40px auto; padding: 36px 28px; text-align: center; }
.maint-box h1 { margin: 0 0 8px; font: 800 28px/1.2 var(--font-display); }
.maint-box p { margin: 0; color: var(--muted); }

/* ---------- pencere ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(4, 3, 14, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: min(88vh, 860px); overflow: auto; padding: 24px; border-radius: 20px; background: rgba(20, 17, 48, 0.98); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: rise 0.22s cubic-bezier(.2, .9, .3, 1.1); scrollbar-width: thin; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sheet-head .avatar { width: 52px; height: 52px; font-size: 20px; }
.sheet-head h2 { margin: 0; font: 750 21px/1.2 var(--font-display); }
.sheet-head small { color: var(--muted); font-weight: 600; }
.sheet-head .x { margin-inline-start: auto; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); font-size: 20px; line-height: 1; }
.sec { padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sec h3 { margin: 0; font-size: 14.5px; font-weight: 750; }
.sec p { margin: 0; font-size: 13.5px; color: var(--muted); }
.sec .line { display: flex; gap: 8px; }
.sec .line .input { flex: 1; }
.sec .line .btn { height: 46px; }
.sec.danger h3 { color: #ff97a5; }
.role { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 800; background: rgba(42, 212, 197, 0.16); color: #8ff0e5; margin-inline-start: 6px; vertical-align: 2px; }
.role.guest { background: rgba(245, 183, 67, 0.16); color: #ffd590; }
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.35); border: 1px dashed rgba(245, 183, 67, 0.5); direction: ltr;
}
.code-box code { font: 700 clamp(15px, 4.4vw, 20px)/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.08em; color: #ffd27a; word-break: break-all; }

.toast {
  position: fixed; inset-inline: 0; bottom: max(22px, env(safe-area-inset-bottom)); margin: 0 auto; width: fit-content; max-width: calc(100% - 32px); z-index: 60;
  padding: 12px 18px; border-radius: 12px; background: rgba(24, 21, 56, 0.97); border: 1px solid var(--line2); box-shadow: var(--shadow); font-weight: 650; font-size: 14px;
  animation: rise 0.2s ease-out;
}
.toast.bad { border-color: rgba(255, 107, 125, 0.5); }
.toast.good { border-color: rgba(61, 220, 151, 0.5); }

.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 max(22px, env(safe-area-inset-bottom)); color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); }
.plat-row { display: inline-flex; align-items: center; gap: 8px; }
.plat-row svg { width: 16px; height: 16px; }

.skeleton { border-radius: var(--r); background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  main { padding-top: 18px; }
  .auth { padding: 22px 18px 18px; }
  .brand-name { font-size: 17px; }
  .me-nick { display: none; }
  .game-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* marka yazısı: Looper + vurgulu Game */
.brand-name b { font-weight: 800; background: linear-gradient(92deg, #8b74ff, #2ad4c5 55%, #f5b743); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* sayfa kayar ama kaydırma çubuğu görünmez */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
