/* Sudoku - ver 2.05 (2026-10-12). Tüm ölçüler tahta kenarı --B'ye göre (js boyutla()) */
:root{
	--B: 360px;
	--zemin: #eef1f6;
	--cizgi-kalin: #34405a;
	--cizgi-ince: #bcc4d2;
	--kare: #fff;
	--verilen: #1d2738;
	--oyuncu: #2a62c9;
	--ipucu: #7b3fbf;
	--yanlis: #d42a2a;
	--sec: #b9d1fa;
	--vurgu: #e4ebf6;
	--ayni: #c8dafa;
	--cakisma: #fbdcdc;
	--buton: #fff;
	--buton-yazi: #34405a;
	--renkli: #2a62c9;
	font-family: "Segoe UI", Roboto, Arial, sans-serif;
}
*{ box-sizing: border-box; }
html, body{ margin: 0; height: 100%; overflow: hidden; background: var(--zemin); }
body{
	user-select: none; -webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	color: var(--verilen);
}
button{ font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus{ outline: none; }
button:focus-visible{ outline: 2px solid var(--renkli); outline-offset: 2px; }

#oyun{
	position: absolute; left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	display: flex; flex-direction: column;
	gap: calc(var(--B) * 0.02);
}
body.dik #oyun{ width: var(--B); }
body.yatay #oyun{ width: calc(var(--B) * 1.66); }

/* üst çubuk */
#ust{
	height: calc(var(--B) * 0.1);
	display: flex; align-items: center; justify-content: space-between;
	font-weight: 700;
	font-size: calc(var(--B) * 0.045);
}
body.yatay #ust{ height: calc(var(--B) * 0.09); font-size: calc(var(--B) * 0.042); }
.ust-b{
	height: 100%; aspect-ratio: 1;
	display: flex; align-items: center; justify-content: center;
	border-radius: calc(var(--B) * 0.02);
	color: var(--buton-yazi);
}
.ust-b:hover{ background: rgba(52,64,90,.08); }
.ust-b svg{ width: 62%; height: 62%; fill: currentColor; }
#ust-sol{ flex: 1 1 0; min-width: 0; display: flex; align-items: center; height: 100%; gap: calc(var(--B) * 0.012); }
#seviye-ad{ letter-spacing: .08em; color: var(--cizgi-kalin); text-align: center; }
#sure-kutu{ flex: 1 1 0; min-width: 0; justify-content: flex-end; }
#sure-kutu{ display: flex; align-items: center; height: 100%; gap: calc(var(--B) * 0.01); font-variant-numeric: tabular-nums; }
#sure{ min-width: 3.2em; text-align: right; }

#govde{ display: flex; gap: calc(var(--B) * 0.03); }
body.dik #govde{ flex-direction: column; }
body.yatay #govde{ flex-direction: row; gap: calc(var(--B) * 0.04); }

/* tahta */
#tahta-kap{ position: relative; width: var(--B); height: var(--B); flex: none; }
#tahta{
	width: 100%; height: 100%;
	display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
	gap: max(2px, calc(var(--B) * 0.006));
	padding: max(2px, calc(var(--B) * 0.006));
	background: var(--cizgi-kalin);
	border-radius: calc(var(--B) * 0.012);
	touch-action: none;
}
.kutu3{
	display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
	gap: 1px; background: var(--cizgi-ince);
	min-width: 0; min-height: 0;
}
.h{
	position: relative;
	background: var(--kare);
	display: flex; align-items: center; justify-content: center;
	font-size: calc(var(--B) * 0.068);
	line-height: 1;
	cursor: pointer;
	min-width: 0; min-height: 0;
	transition: background-color .12s;
}
.h.verilen{ font-weight: 700; color: var(--verilen); }
.h.oyuncu{ color: var(--oyuncu); font-weight: 500; }
.h.ipucu{ color: var(--ipucu); font-weight: 600; }
.h.vurgu{ background: var(--vurgu); }
.h.ayni{ background: var(--ayni); }
.h.cakisma{ background: var(--cakisma); }
.h.yanlis, .h.oyuncu.cakisma{ color: var(--yanlis); }
.h.sec{ background: var(--sec); box-shadow: inset 0 0 0 2px var(--renkli); }
.notlar{
	position: absolute; inset: 4%;
	display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
	font-size: calc(var(--B) * 0.027);
	color: #5d6880; font-weight: 600;
}
.notlar i{ font-style: normal; display: flex; align-items: center; justify-content: center; }
.notlar i.n-ayni{ background: var(--renkli); color: #fff; border-radius: 50%; }
.h.isaret{ animation: isaret 1.5s ease; }
@keyframes isaret{ 0%, 60%{ box-shadow: inset 0 0 0 3px #f2b705; background: #fff3c4; } 100%{ } }
.h.parla{ animation: parla .7s ease both; }
@keyframes parla{ 0%{ } 35%{ background: #cfe9d6; transform: scale(1.06); } 100%{ } }
#tahta.kazandi .h{ animation: kazan 1s ease both; }
@keyframes kazan{ 0%{ } 40%{ background: #bfe3c9; transform: scale(.9); } 100%{ } }

/* duraklatma perdesi */
#perde{
	position: absolute; inset: 0;
	display: none; flex-direction: column; align-items: center; justify-content: center;
	gap: calc(var(--B) * 0.04);
	background: var(--zemin); border: max(2px, calc(var(--B) * 0.006)) solid var(--cizgi-kalin);
	border-radius: calc(var(--B) * 0.012);
	font-weight: 700; font-size: clamp(15px, calc(var(--B) * 0.05), 26px); color: var(--cizgi-kalin);
}
#oyun.duraklatildi #perde{ display: flex; }

/* bildirim (ipucu açıklaması vb.) */
#bildirim{
	position: absolute; left: 50%; bottom: 3%;
	transform: translate(-50%, 0) scale(.9); /* 2026-11-07: gizliyken aşağı kaydırma yok (alçak yatayda sayfayı 1-4 px uzatıyordu) */
	width: max-content; max-width: 92%;
	padding: .55em .9em; border-radius: .6em;
	background: rgba(29,39,56,.93); color: #fff;
	font-size: clamp(12px, calc(var(--B) * 0.038), 18px); line-height: 1.3; text-align: center;
	opacity: 0; visibility: hidden; pointer-events: none;
	transition: opacity .2s, transform .2s, visibility .2s;
}
#bildirim.acik{ opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }

/* panel: araçlar + rakamlar */
#panel{ display: flex; flex-direction: column; gap: calc(var(--B) * 0.02); }
body.yatay #panel{ width: calc(var(--B) * 0.62); height: var(--B); gap: calc(var(--B) * 0.03); }
#araclar{ display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--B) * 0.02); }
body.dik #araclar{ height: calc(var(--B) * 0.15); }
body.yatay #araclar{ grid-template-columns: repeat(2, 1fr); height: calc(var(--B) * 0.32); }
.arac{
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 6%;
	background: var(--buton); color: var(--buton-yazi);
	border-radius: calc(var(--B) * 0.025);
	box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px rgba(52,64,90,.08);
	font-size: calc(var(--B) * 0.034); font-weight: 600;
	min-height: 44px;
}
.arac svg{ width: calc(var(--B) * 0.06); height: calc(var(--B) * 0.06); fill: currentColor; }
.arac span{ white-space: nowrap; }
.arac i{ display: none; }
.arac.acik{ background: var(--renkli); color: #fff; }
.arac.pasif{ opacity: .4; }
@media (hover: hover){ .arac:hover:not(.pasif), .rakam:hover:not(.bitti){ filter: brightness(.95); } }
.arac:active:not(.pasif), .rakam:active{ transform: scale(.96); }

#rakamlar{ display: grid; gap: calc(var(--B) * 0.012); }
body.dik #rakamlar{ grid-template-columns: repeat(9, 1fr); height: calc(var(--B) * 0.16); }
body.yatay #rakamlar{ grid-template-columns: repeat(3, 1fr); flex: 1; gap: calc(var(--B) * 0.02); }
.rakam{
	position: relative;
	display: flex; align-items: center; justify-content: center;
	background: var(--buton); color: var(--oyuncu);
	border-radius: calc(var(--B) * 0.02);
	box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 1px rgba(52,64,90,.08);
	font-size: calc(var(--B) * 0.08); font-weight: 600;
	min-height: 44px;
}
body.yatay .rakam{ font-size: calc(var(--B) * 0.09); }
.rakam small{
	position: absolute; right: 8%; bottom: 4%;
	font-size: calc(var(--B) * 0.026); color: #8a93a6; font-weight: 600;
}
.rakam.sec{ box-shadow: inset 0 0 0 2px var(--renkli); }
.rakam.bitti{ opacity: .3; }

/* katmanlar: menü, bitiş, bekleme */
.katman{
	position: fixed; inset: 0;
	display: none; align-items: center; justify-content: center;
	background: rgba(29,39,56,.55);
	z-index: 5;
	padding: 8px;
}
.katman.acik{ display: flex; }
.pencere{
	--f: clamp(13px, calc(var(--B) * 0.042), 20px);
	font-size: var(--f);
	width: min(100%, max(250px, calc(var(--f) * 17)));
	max-height: 100%; overflow: auto;
	background: #fff; border-radius: 14px;
	padding: calc(var(--f) * 1) calc(var(--f) * 1.1);
	box-shadow: 0 10px 30px rgba(0,0,0,.3);
	display: flex; flex-direction: column; gap: calc(var(--f) * .5);
	text-align: center;
}
.p-baslik{ font-size: 1.5em; font-weight: 800; letter-spacing: .1em; color: var(--cizgi-kalin); margin-bottom: .1em; }
.p-ara{ font-size: .75em; font-weight: 700; letter-spacing: .12em; color: #8a93a6; margin-top: .3em; }
.m-b{
	display: flex; align-items: center; justify-content: center; gap: .5em;
	width: 100%; min-height: max(40px, 2.3em);
	padding: 0 1em;
	border-radius: 10px;
	background: #eef1f6; color: var(--cizgi-kalin);
	font-weight: 700; letter-spacing: .05em;
}
.m-b:hover{ background: #e2e7ef; }
.m-b.m-seviye{ justify-content: flex-start; }
.m-b.m-seviye small{ margin-left: auto; }
.m-b small{ font-size: .72em; font-weight: 600; color: #6b7590; letter-spacing: 0; }
.m-b.m-seviye.secili{ background: #dde8fd; color: var(--renkli); box-shadow: inset 0 0 0 2px var(--renkli); }
.m-b.m-seviye.secili::before{ content: ""; flex: none; width: .32em; height: .62em; margin: -.2em .15em 0 .05em; border: solid currentColor; border-width: 0 .16em .16em 0; transform: rotate(45deg); }
.m-b.basla{ background: #1f9d55; color: #fff; justify-content: center; font-size: 1.08em; min-height: max(44px, 2.6em); margin-top: .2em; }
.m-b.basla:hover{ background: #1a8a4a; }
.onay-metin{ line-height: 1.45; color: var(--cizgi-kalin); margin: .1em 0 .4em; }
.onay-metin b{ color: var(--renkli); }
.onay-metin small{ font-size: .8em; color: #8a93a6; }
#onay .pencere{ width: min(100%, max(250px, calc(var(--f) * 18))); }
.p-uyari{ font-size: .72em; color: #8a93a6; margin-top: -.25em; }
.m-b.renkli{ background: var(--renkli); color: #fff; justify-content: center; }
.m-b.renkli:hover{ background: #2456b3; }
#perde .m-b{ width: auto; font-size: clamp(14px, calc(var(--B) * 0.045), 22px); }
.p-ayar{ display: grid; grid-template-columns: 1fr 1fr; gap: .5em; margin-top: .3em; }
.m-b.ayar{ justify-content: center; font-size: .78em; font-weight: 600; letter-spacing: 0; padding: 0 .5em; }
.m-b.ayar b{ color: var(--renkli); }
#bitis-icerik{ display: flex; flex-direction: column; gap: .35em; margin-bottom: .4em; }
.b-satir{ display: flex; justify-content: space-between; padding: .25em .2em; border-bottom: 1px solid #e6e9ef; }
.b-satir span{ color: #6b7590; }
.b-rekor{ margin-top: .3em; font-weight: 800; color: #c47f00; }
.b-rekor small{ font-weight: 600; color: #8a93a6; }
.b-not{ margin-top: .3em; font-size: .85em; color: #6b7590; }
#bekle .pencere{ flex-direction: row; align-items: center; justify-content: center; font-weight: 600; }
.donen{
	width: 1.2em; height: 1.2em; border-radius: 50%;
	border: 3px solid #d5dbe6; border-top-color: var(--renkli);
	animation: don .8s linear infinite;
}
@keyframes don{ to{ transform: rotate(360deg); } }

/* yatay ve alçak ekranda seviye düğmeleri yan yana */
@media (orientation: landscape) and (max-height: 720px){
	#menu .pencere{ width: min(100%, 560px); display: grid; grid-template-columns: repeat(5, 1fr); }
	#menu .p-baslik, #menu #m-devam, #menu .p-ara, #menu .p-ayar, #menu #m-basla, #menu .p-uyari{ grid-column: 1 / -1; }
	#menu .m-seviye small{ margin-left: 0; }
	#menu .m-seviye.secili::before{ display: none; }
	#menu .m-seviye{ flex-direction: column; justify-content: center; padding: .3em .2em; gap: .1em; font-size: .9em; }
	#bitis .pencere{ width: min(100%, 440px); gap: .4em; padding-top: .7em; padding-bottom: .7em; }
	#bitis-icerik{ display: grid; grid-template-columns: 1fr 1fr; column-gap: 1em; row-gap: .2em; margin-bottom: .2em; }
	.b-rekor, .b-not{ grid-column: 1 / -1; }
}

@media (orientation: portrait) and (max-height: 680px){
	#menu .pencere{ gap: .35em; padding-top: .8em; padding-bottom: .8em; }
	#menu .m-b{ min-height: 36px; }
	#menu .m-b.basla{ min-height: 42px; }
	#menu .p-baslik{ font-size: 1.3em; }
}
@media (prefers-reduced-motion: reduce){
	.h.parla, #tahta.kazandi .h, .h.isaret, .donen{ animation: none; }
}
