:root {
  --bg: #0f1115;
  --yuzey: #181b23;
  --yazi: #eceef4;
  --soluk: #8b90a0;
  --vurgu: #8b7cff;
  --kabul: #34d399;
  --red: #f87171;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #1d2030, var(--bg));
  color: var(--yazi);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 440px; margin: 0 auto; padding: 28px 20px 40px; }
.ekran { display: flex; flex-direction: column; gap: 16px; }

h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 32px; }
.alt { margin: 0; color: var(--soluk); font-size: 14px; }
.orta { text-align: center; }
.hata { margin: 0; min-height: 1.5em; color: var(--red); font-size: 14px; }

form { display: flex; flex-direction: column; gap: 12px; }

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #2a2e3b;
  border-radius: 12px;
  background: var(--yuzey);
  color: inherit;
  font: inherit;
}
input:focus { outline: 2px solid var(--vurgu); border-color: transparent; }

button {
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--vurgu);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
button:hover { opacity: 0.9; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.ikincil { background: transparent; color: var(--soluk); border: 1px solid #2a2e3b; }

ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
li { padding: 12px 16px; border-radius: 12px; background: var(--yuzey); }
.kucuk-liste { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.kucuk-liste li { padding: 4px 12px; border-radius: 99px; font-size: 13px; color: var(--soluk); }

.ust { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--soluk); }
.cubuk { flex: 1; height: 6px; border-radius: 99px; background: #232736; overflow: hidden; }
#cubuk-dolu { height: 100%; width: 0; background: var(--vurgu); transition: width 0.2s; }

#kart-alani {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 2 / 3;
  margin: 8px auto;
}

.kart {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--renk), #0b0c10);
  box-shadow: 0 20px 50px #0008;
  touch-action: none;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease;
}
.kart img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.kart.arka { transform: scale(0.94) translateY(12px); filter: brightness(0.6); pointer-events: none; }

.kart .yazi {
  position: absolute;
  inset: auto 0 0 0;
  padding: 56px 20px 20px;
  background: linear-gradient(transparent, #000c);
}
.kart:not(:has(img)) .yazi {
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: none;
}
.kart h3 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
.kart:not(:has(img)) h3 { font-size: 38px; }
.kart .tur { font-size: 13px; opacity: 0.75; }

.damga {
  position: absolute;
  top: 24px;
  padding: 4px 12px;
  border: 3px solid;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0;
}
.damga.oyna { left: 20px; color: var(--kabul); transform: rotate(-12deg); }
.damga.gec { right: 20px; color: var(--red); transform: rotate(12deg); }

.kart.ucan { transition: none; pointer-events: none; animation: ucus 0.3s ease-in forwards; }
@keyframes ucus {
  to { transform: translateX(calc(var(--yon) * 130%)) rotate(calc(var(--yon) * 25deg)); opacity: 0; }
}

.dugmeler { display: flex; gap: 12px; }
.dugmeler button { flex: 1; }
.gec-btn { background: #2a1f26; color: var(--red); }
.oyna-btn { background: #17302a; color: var(--kabul); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #000b;
  backdrop-filter: blur(6px);
}
.modal-ic {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 28px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(160deg, var(--renk), #0b0c10);
  animation: pop 0.25s ease-out;
}
.modal-ic h2 { font-size: 34px; }
.modal-ic button { background: #fff; color: #111; }
.kucuk { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.8; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }

#baglanti {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 8px;
  background: var(--red);
  color: #1a0b0b;
  font-size: 14px;
  text-align: center;
}

select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #2a2e3b;
  border-radius: 12px;
  background: var(--yuzey);
  color: inherit;
  font: inherit;
}

.ayar { display: flex; flex-direction: column; gap: 6px; }
.ayar label { font-size: 14px; color: var(--soluk); }

details { padding: 12px 16px; border-radius: 12px; background: var(--yuzey); }
summary { cursor: pointer; font-weight: 600; }
details form { margin-top: 12px; }
details .hata { margin-top: 8px; }

#oyun-listesi { max-height: 260px; overflow-y: auto; }
#oyun-listesi li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #1f2330;
}
.sil { padding: 4px 10px; border: 1px solid #3a2a30; background: transparent; color: var(--red); font-size: 13px; }

.modal-ic .alt { color: inherit; opacity: 0.8; }
li small { display: block; color: var(--soluk); }
