/* Mayın Tarlası - ver:1.20 (renkler :root değişkenlerinde) */
:root{
	--zemin:#c0c0c0;       /* kare / panel zemini */
	--isik:#fff;           /* kabartma açık kenar */
	--golge:#808080;       /* kabartma koyu kenar */
	--cizgi:#818181;       /* açık kare çizgisi */
	--sayfa:#c0c0c0;       /* sayfa arka planı */
	--yazi:#333;
	--perde:rgba(48,48,48,.8);
	--isaret-zemin:#c0c0c0; /* bayrak / mayın gösterilen kare */
	--mod-zemin:#f3c9c9;   /* bayrak modu açıkken düğme */
	--r0:#000; --r1:blue; --r2:green; --r3:red; --r4:#000; --r5:brown; --r6:purple; --r7:#000; --r8:#000;
	--vurgu:#060;
}
*{
	box-sizing:border-box;
}
body{
	background-color:var(--sayfa);
	margin:0;
	user-select: none;
	-webkit-user-select: none; /* Safari */
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}
#cerceve{
    display: flex;
    justify-content: center;
    height: 100vh;
}
#ust{
	position:relative;
	background-color:var(--zemin);
	border-right: 3px solid var(--isik);
	border-bottom: 3px solid var(--isik);
	border-left: 3px solid var(--golge);
	border-top: 3px solid var(--golge);
	width:100%;
	padding:5px;
	display:flex;           /* sayaç | menü | yüz | bayrak | süre: dar ekranda üst üste binmez */
	align-items:center;
	gap:4px;
}
#tarla{
	background-color:var(--zemin);
	margin:8px auto 0;      /* oyun alanı üst çubuk için genişse tarla ortalanır */
	border-right: 3px solid var(--isik);
	border-bottom: 3px solid var(--isik);
	border-left: 3px solid var(--golge);
	border-top: 3px solid var(--golge);
	touch-action:none;      /* dokunma hareketlerini (yakınlaştırma, kaydırma) oyun yönetir */
	transition:opacity .15s;
}
#tarla.yakin{
	overflow:auto;
}
#tarla.bekle{
	opacity:.6;
}
.tarla-kutu{
	float:left;
	background-color:var(--zemin);
	width:var(--k,30px);
	height:var(--k,30px);
	line-height:calc(var(--k,30px) - 2px);
	text-align:center;
	overflow:hidden;
	font-family:arial;
	font-size:calc(var(--k,30px) * 0.73);
	font-weight:bold;
	-webkit-touch-callout:none;
	touch-action:none;
}
.border{
	border-right: 4px solid var(--golge);
	border-bottom: 4px solid var(--golge);
	border-left: 4px solid var(--isik);
	border-top: 4px solid var(--isik);
	border-width:calc(var(--k,30px) * 0.133);
}
/* basılı kare (oyun sürerken): kabartma içe döner */
#tarla:not(.bitti) .border.basili{
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
	background-color:var(--zemin);
}
.rakam-0,.rakam-1,.rakam-2,.rakam-3,.rakam-4,.rakam-5,.rakam-6,.rakam-7,.rakam-8{
	border: 1px solid var(--cizgi);
}
.rakam-0{ color:var(--r0); }
.rakam-1{ color:var(--r1); }
.rakam-2{ color:var(--r2); }
.rakam-3{ color:var(--r3); }
.rakam-4{ color:var(--r4); }
.rakam-5{ color:var(--r5); }
.rakam-6{ color:var(--r6); }
.rakam-7{ color:var(--r7); }
.rakam-8{ color:var(--r8); }
.tarla-line{
	overflow:hidden;
	width:calc(var(--k,30px) * var(--sut,15));
}
.bayrak{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M60 4v48L10 28z' fill='%23f00'/%3E%3Crect x='53' y='50' width='7' height='22'/%3E%3Crect x='34' y='70' width='45' height='10'/%3E%3Crect x='16' y='80' width='81' height='14'/%3E%3C/svg%3E") /*SVG:bayrak*/ center / 100% 100% no-repeat;
	background-color:var(--isaret-zemin);
}
.mayin{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 7v86M7 50h86' stroke='%23000' stroke-width='7'/%3E%3Cpath d='M22 22l56 56M78 22L22 78' stroke='%23000' stroke-width='7'/%3E%3Ccircle cx='50' cy='50' r='28'/%3E%3Crect x='35' y='35' width='12' height='12' fill='%23fff'/%3E%3C/svg%3E") /*SVG:mayin*/ center / 100% 100% no-repeat;
	background-color:var(--isaret-zemin);
	border: 1px solid var(--cizgi);
}
/* soru işareti (soru modu açıkken sağ tık: bayrak → ? → boş) */
.soru{
	color:var(--r0);
}
/* kaybedince yanlış konmuş bayrak: çarpılı mayın */
.yanlis{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 7v86M7 50h86' stroke='%23000' stroke-width='7'/%3E%3Cpath d='M22 22l56 56M78 22L22 78' stroke='%23000' stroke-width='7'/%3E%3Ccircle cx='50' cy='50' r='28'/%3E%3Crect x='35' y='35' width='12' height='12' fill='%23fff'/%3E%3Cpath d='M14 14l72 72M86 14L14 86' stroke='%23e00' stroke-width='9' stroke-linecap='round'/%3E%3C/svg%3E") /*SVG:yanlis*/ center / 100% 100% no-repeat;
	background-color:var(--isaret-zemin);
}
.patlayan{
	background-color:red !important;
	animation: patla .35s ease-out;
}
#text-mayin, #text-sure{
	flex:0 1 70px;
	min-width:44px;
	overflow:hidden;
	text-align:center;
	border: 1px solid var(--cizgi);
	background-color:#000;
	font-family: 'Sarpanch';
	font-size: 28px;
	color:red;
}
#text-mayin{ order:1; }
#score{ order:2; }
#icon{ order:3; }
#flag{ order:4; }
#text-sure{ order:5; }
#icon{
	flex:0 0 auto;
	margin: 0px auto 0px auto;
	background-color:var(--zemin);
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
	width:40px;
	height:40px;
	cursor:pointer;
}
#icon:active{
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
}
.new{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23f9d15b' stroke='%23e9a23b' stroke-width='5'/%3E%3Ccircle cx='35' cy='38' r='6' fill='%234a3520'/%3E%3Ccircle cx='65' cy='38' r='6' fill='%234a3520'/%3E%3Cpath d='M28 60q22 24 44 0' fill='none' stroke='%234a3520' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") /*SVG:gulen*/ center / 92% 92% no-repeat;
}
.oh{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23f9d15b' stroke='%23e9a23b' stroke-width='5'/%3E%3Ccircle cx='35' cy='38' r='7' fill='none' stroke='%234a3520' stroke-width='5'/%3E%3Ccircle cx='65' cy='38' r='7' fill='none' stroke='%234a3520' stroke-width='5'/%3E%3Cellipse cx='50' cy='68' rx='9' ry='11' fill='%234a3520'/%3E%3C/svg%3E") /*SVG:saskin*/ center / 92% 92% no-repeat;
}
.die{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23f9d15b' stroke='%23e9a23b' stroke-width='5'/%3E%3Cpath d='M27 29l14 14M41 29L27 43M59 29l14 14M73 29L59 43' stroke='%234a3520' stroke-width='6' stroke-linecap='round'/%3E%3Cpath d='M30 74q20-22 40 0' fill='none' stroke='%234a3520' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") /*SVG:olu*/ center / 92% 92% no-repeat;
}
.win{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23f9d15b' stroke='%23e9a23b' stroke-width='5'/%3E%3Cpath d='M10 30h80v7h-4l-4 13q-1 4-5 4H62q-4 0-5-4l-3-10h-8l-3 10q-1 4-5 4H23q-4 0-5-4l-4-13h-4z' fill='%234a3520'/%3E%3Cpath d='M28 60q22 24 44 0' fill='none' stroke='%234a3520' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") /*SVG:gozluk*/ center / 92% 92% no-repeat;
	animation: zipla .45s ease-in-out 2;
}
/* üst düğmeler: menü (≡) ve bayrak modu */
#score, #flag{
	flex:0 0 auto;
	width:38px;
	height:38px;
	cursor:pointer;
	background-color:var(--zemin);
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
}
#score{
	text-align:center;
	color:var(--yazi);
	font-size:25px;
	font-weight:bold;
	line-height:32px;
}
#score:active{
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
}
/* bayrak modu kapalı: soluk bayrak, kabarık düğme */
#flag.passive{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M60 4v48L10 28z' fill='%23f00'/%3E%3Crect x='53' y='50' width='7' height='22'/%3E%3Crect x='34' y='70' width='45' height='10'/%3E%3Crect x='16' y='80' width='81' height='14'/%3E%3C/svg%3E") /*SVG:bayrak*/ center / 70% 70% no-repeat;
	background-color:var(--zemin);
	filter:grayscale(1) opacity(.55);
}
/* bayrak modu açık: renkli bayrak, basılı düğme */
#flag.active{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M60 4v48L10 28z' fill='%23f00'/%3E%3Crect x='53' y='50' width='7' height='22'/%3E%3Crect x='34' y='70' width='45' height='10'/%3E%3Crect x='16' y='80' width='81' height='14'/%3E%3C/svg%3E") /*SVG:bayrak*/ center / 74% 74% no-repeat;
	background-color:var(--mod-zemin);
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
}
#oyun-alan{
	--ust-min:300px;        /* üst çubuğun rahat sığdığı en küçük genişlik (boyutla() okur) */
	position:relative;
	margin: auto;
	background-color:var(--zemin);
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
	padding:8px;
}
#start{
	z-index:199;
	position:absolute;
	left:0px;
	top:0px;
	margin:0px;
	right:0px;
	width: 100%;
	height: 100%;
	background-color:#333;
	text-align:center;
	font-size:22px;
	font-weight:bold;
	color:#fff;
    display: flex;
    justify-content: center;
    height: 100vh;
}
#intro{
	margin:auto;
}
/* tarlanın üstünde açılan katmanlar: menü, mesaj, özel seviye */
#menu, #mesaj, #ozel{
	z-index:99;
	position:absolute;
	left:var(--kat-sol,11px);    /* tarlanın iç alanı: boyutla() ölçüp yazar */
	top:var(--kat-ust,75px);
	right:var(--kat-sag,11px);
	bottom:var(--kat-alt,11px);
	background: var(--perde);
	font-family: "verdana";
	font-weight: bold;
	display:flex;
	overflow:auto;
}
#mesaj, #ozel{
	display:none;
}
#buttons, #mesaj-text, .panel{
	margin:auto;
	background-color:var(--zemin);
	color:var(--yazi);
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
	padding:8px;
}
#buttons{
	width:250px;
	display:grid;
	grid-template-columns:1fr 1fr;
	gap:5px;
}
.menu-buton{
	background-color:var(--zemin);
	text-align:center;
	padding:5px 2px;
	font-size:13px;
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
	cursor:pointer;
	color:var(--yazi);
}
.menu-buton:active{
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
}
.menu-buton.genis{
	grid-column:1 / -1;
}
/* menü bölümleri: seviye düğmeleri (varsayılan gri), ayraç, rekor tablosu (altın); DEVAM ve SES mavi-gri */
.menu-baslik{
	grid-column:1 / -1;
	font-size:10px;
	letter-spacing:2px;
	color:#555;
	text-align:center;
	margin:1px 0 -2px;
}
.renkli-buton{
	background-color:#bccbe0;
	color:#1c3354;
	border-left-color:#e6eef9;
	border-top-color:#e6eef9;
	border-right-color:#6c7f9c;
	border-bottom-color:#6c7f9c;
}
.renkli-buton:active{
	border-color:#6c7f9c #e6eef9 #e6eef9 #6c7f9c;
}
.menu-ayrac{
	grid-column:1 / -1;
	height:0;
	margin:3px 0;
	border-top:1px solid var(--golge);
	border-bottom:1px solid var(--isik);
}
.rekor-buton{
	display:flex;
	align-items:center;
	justify-content:center;
	gap:6px;
	padding:8px 2px;
	font-size:15px;
	letter-spacing:.5px;
	background-color:#f2c94c;
	background-image:linear-gradient(#f8dc7a,#e9b92f);
	color:#4a3200;
	border-left-color:#fff3c4;
	border-top-color:#fff3c4;
	border-right-color:#9c7410;
	border-bottom-color:#9c7410;
}
.rekor-buton:active{
	border-color:#9c7410 #fff3c4 #fff3c4 #9c7410;
	background-image:linear-gradient(#e9b92f,#f8dc7a);
}
.rekor-buton svg{
	width:18px;
	height:18px;
	fill:#6b4a00;
	flex:0 0 auto;
}
.ayar-buton{
	font-size:11px;
	padding:4px 2px;
}
/* kazanma mesajı */
#mesaj-text{
	width:240px;
	text-align:center;
}
.m-baslik{ font-size:20px; }
.m-alt{ font-size:11px; font-weight:normal; margin-top:2px; }
.m-sure{
	display:inline-block;
	margin:8px 0 4px;
	padding:0 12px;
	background:#000;
	color:red;
	font-family:'Sarpanch';
	font-size:34px;
	line-height:40px;
	border:1px solid var(--cizgi);
}
.m-sure small{ font-size:16px; }
.m-rekor{ color:var(--vurgu); font-size:13px; margin:2px 0; }
.m-rekor span{ font-weight:normal; font-size:11px; }
.m-not{ font-size:11px; font-weight:normal; margin:4px 0; }
.m-girdi{
	display:block;
	width:100%;
	margin-top:8px;
	text-align:center;
	font-size:14px;
	padding:4px;
}
.m-dugme{
	display:block;
	width:100%;
	margin-top:5px;
	font-family:verdana;
	font-weight:bold;
	font-size:12px;
	padding:5px;
	cursor:pointer;
	color:var(--yazi);
	background-color:var(--zemin);
	border-right: 2px solid var(--golge);
	border-bottom: 2px solid var(--golge);
	border-left: 2px solid var(--isik);
	border-top: 2px solid var(--isik);
}
.m-dugme:active{
	border-color: var(--golge) var(--isik) var(--isik) var(--golge);
}
.m-dugme:disabled{ opacity:.5; }
#rekor-uyari{ color:#c00; font-size:11px; font-weight:normal; margin-top:4px; }
/* özel seviye paneli */
.panel{
	width:280px;
	max-width:100%;
	font-size:12px;
}
.p-baslik{ font-size:15px; text-align:center; margin-bottom:6px; }
.p-metin{ font-weight:normal; line-height:1.45; }
.p-metin b{ font-weight:bold; }
.p-metin ul{ margin:4px 0; padding-left:16px; }
.p-satir{ display:flex; justify-content:space-between; align-items:center; margin:5px 0; font-weight:normal; }
.p-satir input{ width:70px; font-size:14px; padding:3px; text-align:center; }
#ozel-uyari{ color:#c00; font-size:11px; font-weight:normal; min-height:14px; }
.panel .menu-buton{ margin-top:5px; }
/* rekor tablosunda oyuncunun kendi satırı */
#score-liste li.benim{
	outline:3px solid #ffb31e;
	outline-offset:-3px;
}
/* ---- animasyonlar ---- */
.yeni-acik{
	animation: acil .18s ease-out both;
	animation-delay: var(--g,0ms);
}
.yeni-mayin{
	animation: mayinGoster .25s ease-out both;
	animation-delay: var(--g,0ms);
}
#oyun-alan.salla{
	animation: salla .4s ease-in-out;
}
#tarla.kazandi{
	animation: parilti .9s ease-out 2;
}
@keyframes acil{ from{ transform:scale(.55); opacity:.25; } to{ transform:none; opacity:1; } }
@keyframes mayinGoster{ from{ transform:scale(0); } to{ transform:none; } }
@keyframes patla{ 0%{ transform:scale(1); } 40%{ transform:scale(1.35); } 100%{ transform:scale(1); } }
@keyframes salla{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-6px); } 40%{ transform:translateX(6px); } 60%{ transform:translateX(-4px); } 80%{ transform:translateX(4px); } }
@keyframes zipla{ 0%,100%{ transform:none; } 50%{ transform:translateY(-5px) scale(1.08); } }
@keyframes parilti{ 0%{ box-shadow:0 0 0 0 rgba(255,215,0,.9); } 100%{ box-shadow:0 0 0 14px rgba(255,215,0,0); } }
@media (prefers-reduced-motion: reduce){
	*{ animation:none !important; transition:none !important; }
}
/* telefon (dar ya da alçak ekran): ince çerçeve, küçük üst çubuk */
@media (max-width:600px), (max-height:500px){
	#oyun-alan{ --ust-min:250px; padding:3px; border-width:1px; }
	#ust{ padding:3px; gap:3px; border-width:2px; }
	#tarla{ margin-top:3px; border-width:2px; }
	#text-mayin, #text-sure{ flex-basis:58px; font-size:23px; }
	#icon{ width:34px; height:34px; }
	#score, #flag{ width:32px; height:32px; }
	#score{ font-size:20px; line-height:27px; }
}
