:root {
  --ink: #1e2a4a;
  --blue: #3d7dff;
  --pink: #ff7aa8;
  --purple: #9b7ce8;
  --gold: #f7b731;
  --ok: #10b981;
  --bad: #f43f5e;
  --ice: #7dd3fc;
  --yaygin: #6ee7b7;
  --nadir: #60a5fa;
  --epik: #c084fc;
  --efsane: #f59e0b;
  --mitik: #f472b6;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: #fff;
  background: radial-gradient(1200px 700px at 80% -10%, #6d4ce0 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 110%, #ff7aa8 0%, transparent 55%),
              linear-gradient(160deg, #1b1f5e 0%, #2a1f6e 45%, #12163f 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Yıldızlı arka plan */
.sky, .sky::before, .sky::after { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky { background-image:
  radial-gradient(2px 2px at 20% 30%, #fff8 50%, transparent 51%), radial-gradient(2px 2px at 70% 20%, #fff9 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 40% 80%, #fff7 50%, transparent 51%), radial-gradient(2px 2px at 85% 65%, #fff8 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 10% 60%, #fff6 50%, transparent 51%), radial-gradient(1.5px 1.5px at 55% 45%, #fff6 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite alternate; }
.sky::before { content: ""; background-image:
  radial-gradient(1.5px 1.5px at 30% 15%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 90% 35%, #fde68a 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 65% 90%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 5% 90%, #bfdbfe 50%, transparent 51%);
  animation: twinkle 3s ease-in-out infinite alternate-reverse; }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
.planet { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; filter: blur(.3px); animation: float 9s ease-in-out infinite; }
.planet.p1 { width: 120px; height: 120px; right: -30px; top: 18%; background: radial-gradient(circle at 35% 30%, #ffd1e3, #ff7aa8 55%, #b4386a); opacity: .55; }
.planet.p2 { width: 70px; height: 70px; left: 4%; top: 58%; background: radial-gradient(circle at 35% 30%, #c7f9ff, #3d7dff 60%, #1e3a8a); opacity: .5; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-16px) rotate(8deg); } }

#app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; max-width: 980px; margin: 0 auto; padding: 10px 14px 0; }

/* HUD */
.hud { display: flex; align-items: center; gap: 10px; padding: 6px 0 10px; }
.hud[hidden] { display: none; }
.hud-btn { flex: none; width: 46px; height: 46px; border-radius: 16px; border: 0; background: #ffffff1f; color: #fff; display: grid; place-items: center; text-decoration: none; backdrop-filter: blur(6px); }
.hud-btn:hover { background: #ffffff33; }
.hud-btn svg { width: 24px; height: 24px; }
.hud-progress { flex: 1; min-width: 0; }
.hud-progress small { display: block; font-weight: 800; font-size: .85rem; opacity: .9; margin-bottom: 4px; }
.bar { height: 12px; border-radius: 99px; background: #ffffff26; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width .4s ease-out; }
.signal { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 16px; background: #ffffff1f; }
.signal .pips { display: flex; gap: 3px; }
.signal .pips i { width: 9px; height: 18px; border-radius: 4px; background: #ffffff30; transition: background .3s, transform .3s; }
.signal .pips i.on { background: linear-gradient(#fde68a, var(--gold)); box-shadow: 0 0 8px #f7b73199; transform: scaleY(1.1); }
.signal img { width: 26px; height: 26px; }
.stones { flex: none; display: flex; gap: 4px; }
.stone-chip { display: flex; align-items: center; gap: 2px; padding: 4px 8px 4px 4px; border-radius: 14px; background: #ffffff1f; font-weight: 800; font-size: .95rem; }
.stone-chip img { width: 28px; height: 28px; }
.stone-chip.pop { animation: pop .5s ease-out; }
@keyframes pop { 40% { transform: scale(1.35); } }
@media (max-width: 560px) { .stones .stone-chip:not(.has) { display: none; } .signal img { display: none; } }

/* Sahne */
#stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 8px; }
@media (max-width: 1100px) { body.playing #stage { padding-bottom: 150px; } }

/* Başlangıç ve bitiş ekranları */
.screen { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0 24px; animation: rise .5s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
.title { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.05; margin: 0; font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(90deg, #fde68a, #fff 40%, #ffd1e3); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 4px 30px #ff7aa855; }
.sub { font-size: 1.15rem; max-width: 34ch; margin: 0; color: #e0e7ff; }
.hero-beyni { width: min(260px, 60vw); filter: drop-shadow(0 18px 30px #0008); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-2deg); } }
.levels { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lvl { min-width: 104px; min-height: 64px; border: 3px solid #ffffff40; border-radius: 20px; background: #ffffff14; color: #fff; font-weight: 800; font-size: 1.05rem; transition: transform .15s, background .15s, border-color .15s; }
.lvl[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 6px 0 var(--gold); }
.big-btn { min-height: 64px; padding: 0 34px; border: 0; border-radius: 22px; font-size: 1.35rem; font-weight: 900; color: var(--ink);
  background: linear-gradient(180deg, #fde68a, var(--gold)); box-shadow: 0 7px 0 #b7791f, 0 14px 30px #f7b73155; transition: transform .1s; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 #b7791f; }
.big-btn.alt { background: #ffffff1f; color: #fff; box-shadow: 0 6px 0 #0004; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; width: 100%; }
.how div { background: #ffffff14; border-radius: 18px; padding: 12px 8px; font-size: .92rem; line-height: 1.3; }
.how img { width: 54px; height: 54px; object-fit: contain; display: block; margin: 0 auto 6px; }

/* Soru kartı */
.qcard { position: relative; background: #fff; color: var(--ink); border-radius: 30px; padding: 16px 16px 18px; box-shadow: 0 10px 0 #0003, 0 30px 60px #0005; animation: rise .35s ease-out; }
.qcard.frozen { box-shadow: 0 0 0 5px var(--ice), 0 0 40px #7dd3fcaa, 0 30px 60px #0005; }
.qcard.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.timer { height: 14px; border-radius: 99px; background: #eef2ff; overflow: hidden; margin-bottom: 12px; position: relative; }
.timer i { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--ok), #34d399); transform-origin: left; }
.timer.warn i { background: linear-gradient(90deg, var(--bad), #fb923c); }
.qcard.frozen .timer i { background: repeating-linear-gradient(45deg, #bae6fd 0 10px, #7dd3fc 10px 20px); }
.timer-label { position: absolute; right: 18px; top: 10px; font-weight: 900; font-size: .9rem; color: var(--ink); background: #fff; padding: 0 6px; border-radius: 8px; }
.qtype { display: inline-block; font-size: .8rem; font-weight: 900; color: #fff; background: var(--purple); padding: 3px 10px; border-radius: 99px; }
.qtext { font-size: clamp(1.1rem, 3.6vw, 1.45rem); font-weight: 800; line-height: 1.3; margin: 8px 0 12px; }
.qfig { background: #f4f6ff; border-radius: 20px; padding: 10px; display: flex; justify-content: center; margin-bottom: 12px; }
.qfig svg { max-width: 100%; height: auto; max-height: 200px; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.opt { position: relative; min-height: 70px; border: 4px solid #e3e8fb; border-radius: 20px; background: #fff; color: var(--ink); font-size: 1.25rem; font-weight: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; transition: transform .15s, border-color .15s, opacity .4s; }
.opt:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--blue); }
.opt .l { font-size: .75rem; color: #7c86a8; }
.opt svg { width: 76px; height: 76px; }
.opt.right { border-color: var(--ok); background: #d1fae5; animation: pop .45s; }
.opt.wrong { border-color: var(--bad); background: #ffe4e6; }
.opt.gone { opacity: 0; transform: scale(.6) rotate(-8deg); pointer-events: none; }
.opt.glow { border-color: var(--gold); box-shadow: 0 0 0 4px #fde68a, 0 0 28px #f7b731; animation: glowpulse 1s ease-in-out infinite; }
@keyframes glowpulse { 50% { box-shadow: 0 0 0 6px #fde68a, 0 0 44px #f7b731; } }
.opt:disabled { cursor: default; }
.shield { position: absolute; top: -14px; right: -8px; background: linear-gradient(#fde68a, var(--gold)); color: var(--ink); font-weight: 900; font-size: .8rem; padding: 4px 10px; border-radius: 99px; box-shadow: 0 4px 0 #b7791f; }
.ice { position: absolute; inset: 0; border-radius: 30px; pointer-events: none; background: linear-gradient(135deg, #e0f2fe55, transparent 40%, #bae6fd44); animation: iceIn .6s ease-out; }
@keyframes iceIn { from { opacity: 0; transform: scale(1.06); } }

/* Beyni */
.beyni { position: fixed; left: max(8px, calc(50% - 490px)); bottom: 132px; z-index: 5; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.beyni[hidden] { display: none; }
.beyni img { width: 96px; height: auto; filter: drop-shadow(0 10px 16px #0007); transition: transform .3s; }
.beyni.jump img { animation: jump .6s ease-out; }
@keyframes jump { 30% { transform: translateY(-26px) scale(1.06); } 60% { transform: translateY(0) scale(.97); } }
.bubble { max-width: 230px; background: #fff; color: var(--ink); font-weight: 800; font-size: .98rem; line-height: 1.3; padding: 10px 14px; border-radius: 18px 18px 18px 4px; box-shadow: 0 8px 20px #0005; margin-bottom: 64px; opacity: 0; transform: scale(.8) translateY(6px); transform-origin: bottom left; transition: opacity .25s, transform .25s; }
.bubble.show { opacity: 1; transform: none; }
@media (max-width: 700px) { .beyni { bottom: 128px; } .beyni img { width: 72px; } .bubble { max-width: 200px; font-size: .9rem; margin-bottom: 48px; } }

/* El (kartlar) */
.hand { position: sticky; bottom: 0; z-index: 4; height: 124px; display: flex; justify-content: center; align-items: flex-end; padding: 6px 0 10px;
  background: linear-gradient(transparent, #12163fcc 40%); }
.hand[hidden] { display: none; }
.hand-empty { color: #c7d2fe; font-weight: 700; font-size: .95rem; align-self: center; text-align: center; padding: 0 20px; }
.gcard { position: relative; width: 82px; height: 108px; margin: 0 -6px; border: 0; padding: 0; border-radius: 14px; background: transparent;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px)); transition: transform .2s ease-out, filter .2s; filter: drop-shadow(0 8px 10px #0007); }
.gcard img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; border: 3px solid var(--rc, #fff); }
.gcard:hover:not(:disabled), .gcard:focus-visible { transform: rotate(0) translateY(-22px) scale(1.12); z-index: 2; }
.gcard:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.gcard.new { animation: dealIn .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes dealIn { from { transform: translateY(-260px) rotate(-30deg) scale(1.4); opacity: 0; } }
.gcard.used { animation: useOut .55s ease-in forwards; }
@keyframes useOut { to { transform: translateY(-300px) scale(1.6) rotate(10deg); opacity: 0; } }
.rare-yaygin { --rc: var(--yaygin); } .rare-nadir { --rc: var(--nadir); } .rare-epik { --rc: var(--epik); } .rare-efsane { --rc: var(--efsane); } .rare-mitik { --rc: var(--mitik); }

/* Modal (kart ayrıntısı, kart açma) */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #0a0d2bcc; backdrop-filter: blur(6px); animation: fade .25s; padding: 16px; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.mbox { width: min(360px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mcard { width: min(240px, 62vw); aspect-ratio: 1; border-radius: 22px; border: 5px solid var(--rc, #fff); box-shadow: 0 0 50px var(--rc, #fff8), 0 20px 40px #0008; overflow: hidden; animation: zoomIn .45s cubic-bezier(.2, 1.4, .4, 1); }
.mcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes zoomIn { from { transform: scale(.4) rotate(-12deg); opacity: 0; } }
.rarity { font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; color: var(--rc); }
.mname { font-size: 1.7rem; font-weight: 900; margin: 0; }
.meffect { font-size: 1.1rem; color: #e0e7ff; margin: 0; }
.mrow { display: flex; gap: 10px; }

/* Kart açılışı: 3B çevirme */
.flip { width: min(240px, 62vw); aspect-ratio: 1; perspective: 1000px; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, 1.3, .5, 1); }
.flip.open .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.face.back { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #6d4ce0, #1b1f5e); border: 5px solid #fde68a; box-shadow: 0 0 60px #f7b73188; }
.face.back img { width: 52%; animation: bob 1.4s ease-in-out infinite; }
.face.back b { position: absolute; bottom: 14px; font-size: .95rem; color: #fde68a; }
.face.front { transform: rotateY(180deg); border: 5px solid var(--rc); box-shadow: 0 0 70px var(--rc); }
.face.front img { width: 100%; height: 100%; object-fit: cover; }
.flip.wiggle .flip-in { animation: wiggle .5s ease-in-out infinite; }
@keyframes wiggle { 25% { transform: rotate(-4deg) scale(1.03); } 75% { transform: rotate(4deg) scale(1.03); } }
.rays { position: absolute; width: 520px; height: 520px; left: 50%; top: 50%; margin: -260px 0 0 -260px; pointer-events: none; z-index: -1;
  background: repeating-conic-gradient(from 0deg, #fde68a33 0 10deg, transparent 10deg 20deg); border-radius: 50%; mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Uçan taş */
.flyer { position: fixed; z-index: 30; width: 64px; height: 64px; pointer-events: none; filter: drop-shadow(0 0 16px #fff); }
.toast { position: fixed; left: 50%; top: 22%; z-index: 25; transform: translateX(-50%); font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.6rem); pointer-events: none; white-space: nowrap;
  color: #fff; text-shadow: 0 4px 0 #0005, 0 0 30px var(--gold); animation: toast 1.2s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 28; }

/* Bitiş: albüm */
.stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stat { background: #ffffff1a; border-radius: 18px; padding: 10px 16px; min-width: 96px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; width: 100%; max-width: 720px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 3px solid var(--rc, #ffffff30); background: #ffffff10; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot.locked img { filter: grayscale(1) brightness(.35) blur(1px); }
.slot.locked::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fde68a' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2.5' fill='%23fde68a33'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / 40% no-repeat; }
.slot.c2only::before { content: "bilsemc2"; position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; font-size: .62rem; font-weight: 900; text-align: center; padding: 2px 0; color: #fff; background: linear-gradient(90deg, #ff7aa8, #9b7ce8); }
.slot .cnt { position: absolute; right: 4px; bottom: 4px; background: #000a; border-radius: 8px; padding: 0 6px; font-weight: 900; font-size: .8rem; }
.c2 { width: 100%; max-width: 720px; display: flex; align-items: center; gap: 14px; text-align: left; background: linear-gradient(120deg, #ff7aa8, #9b7ce8 55%, #3d7dff); border-radius: 26px; padding: 16px 18px; box-shadow: 0 10px 30px #0006; }
.c2 img { width: 84px; flex: none; animation: bob 2.4s ease-in-out infinite; }
.c2 h3 { margin: 0 0 4px; font-size: 1.25rem; }
.c2 p { margin: 0 0 10px; font-size: .95rem; }
.c2 a { display: inline-flex; min-height: 48px; align-items: center; padding: 0 18px; border-radius: 16px; background: #fff; color: var(--ink); font-weight: 900; text-decoration: none; box-shadow: 0 5px 0 #0003; }

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

/* Kupon kartları */
.coupons { display: grid; gap: 14px; width: 100%; max-width: 420px; }
.coupon { position: relative; display: flex; border-radius: 22px; overflow: hidden; text-align: left; color: var(--ink); background: #fff; box-shadow: 0 10px 0 #0003, 0 0 40px #f7b73155; animation: dealIn .8s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.coupon::before, .coupon::after { content: ""; position: absolute; left: 96px; width: 24px; height: 24px; border-radius: 50%; background: #1f1b5c; transform: translateX(-50%); }
.coupon::before { top: -12px; } .coupon::after { bottom: -12px; }
.c-left { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: linear-gradient(160deg, #f7b731, #ff7aa8); border-right: 3px dashed #fff8; }
.c-left b { font-size: 1.9rem; line-height: 1; font-weight: 900; }
.c-left span { font-size: .85rem; font-weight: 800; }
.c-right { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.c-right small { font-weight: 800; color: #6b5bd2; font-size: .8rem; }
.c-right code { font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem; font-weight: 900; letter-spacing: .06em; background: #f4f1ff; border: 2px dashed #9b7ce8; border-radius: 10px; padding: 4px 10px; align-self: flex-start; user-select: all; }
.c-right em { font-style: normal; font-size: .82rem; color: #64748b; }
.c-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.c-actions button, .c-actions a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 12px; font-weight: 800; font-size: .85rem; text-decoration: none; }
.c-actions button { border: 2px solid #9b7ce8; background: #fff; color: #6b5bd2; }
.c-actions a { background: var(--ink); color: #fff; }
.coupon.locked { filter: grayscale(.9); opacity: .65; box-shadow: none; }
