html, body { margin: 0;	padding: 0;	}

body {
	background:	#1e293b; /* Dunklerer, moderner Hintergrund */
	font-family: 'Arial', sans-serif;
}
body, table, input {
	font-size: 11px;
	line-height: 1.2em;
	font-family: 'Arial', sans-serif;
	color: #e2e8f0;
}

#tetris	{
	position: relative;
	width: 300px;
	height:	309px;
	background:	#334155; /* Dunklerer Hintergrund für das Spielfeld */
	border:	#64748b 1px solid;
	border-radius: 8px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#tetris	.left {
	background:	#475569; /* Dunklere Seitenleiste */
	position: absolute;
	width: 131px;
	height:	100%;
	left: 0px;
	top: 0px;
	border-radius: 8px 0 0 8px;
}
.left-border { background: #64748b;	position: absolute;	z-index: 100; top: 0px;	left: 130px; width:	1px; height: 100%; }

#tetris-area {
	/* 168,308 +2px	borders	*/
	background:	#1e293b; /* Dunklerer Spielbereich */
	position: absolute;
	width: 167px;
	height:	307px;
	left: 132px;
	top: 1px;
	overflow: hidden;
	border-radius: 0 8px 8px 0;
}

/* Touch-Controls für Smartphone - Verbesserte Version */
#touch-controls {
	display: none; /* Standard: ausgeblendet, wird auf mobilen Geräten angezeigt */
	position: fixed; /* Fixed position statt absolute */
	bottom: 20px;
	left: 0;
	width: 100%;
	padding: 15px 0;
	text-align: center;
	z-index: 1000;
	background: rgba(23, 37, 84, 0.7);
	border-radius: 15px 15px 0 0;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	/* Neue Eigenschaften für bessere Positionierung */
	max-width: 500px;
	margin: 0 auto;
	right: 0;
}

.touch-button {
	display: inline-block;
	width: 70px; /* Größere Buttons */
	height: 70px; /* Größere Buttons */
	background: rgba(99, 102, 241, 0.5);
	border-radius: 50%;
	margin: 10px;
	line-height: 70px;
	text-align: center;
	font-size: 32px;
	color: white;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.2s, transform 0.1s;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.touch-button:active {
	background: rgba(99, 102, 241, 0.8);
	transform: scale(0.95);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#touch-row {
	display: flex;
	justify-content: center;
	margin: 10px 0;
}

#touch-space {
	width: 150px;
	border-radius: 30px;
	background: rgba(239, 68, 68, 0.5);
	font-weight: bold;
}

#touch-space:active {
	background: rgba(239, 68, 68, 0.8);
}

#touch-up {
	background: rgba(74, 222, 128, 0.5);
}

#touch-up:active {
	background: rgba(74, 222, 128, 0.8);
}

.grid1,	.grid2,	.grid3,	.grid4,	.grid5,	.grid6 { 
    z-index: 10; 
    position:	absolute; 
    top: 0px;	
    width: 13px; 
    height: 307px;	
    background:	rgba(255, 255, 255, 0.05);
}
.grid1 { left: 14px; }
.grid2 { left: 42px; }
.grid3 { left: 70px; }
.grid4 { left: 98px; }
.grid5 { left: 126px; }
.grid6 { left: 154px; }

#tetris	.block0,
#tetris	.block1,
#tetris	.block2,
#tetris	.block3,
#tetris	.block4,
#tetris	.block5,
#tetris	.block6	{
	z-index: 1000;
	font-size: 10px;
	line-height: 1em;
	font-family: arial;
	position: absolute;
	width: 13px;
	height:	13px;
	border:	0.5px solid #1e293b;
	border-radius: 2px;
	box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
	/* with	margin 0.5px there were	problems with offsetLeft and offsetTop */
}

#tetris .left h1, #tetris .left h2 {
	color: #e2e8f0;
	font-size: 11px;
	font-family: "Arial", sans-serif;
	font-weight: bold;
	text-align:	center;
	margin-top:	10px;
	margin-bottom: 10px;
}
#tetris	.left h1 a {
	color: #38bdf8;
	text-decoration: none;
}
#tetris	.left h1 a:hover {
	color: #0ea5e9;
	text-decoration: none;
}

/* menu	*/

#tetris	.left .menu	{
	margin-top:	1em;
}
#tetris	.menu a, #tetris .menu a:visited {
	display: block;
	text-decoration: none;
	color: #e2e8f0;
	background:	#334155;
	border-width: 1px;
	margin-bottom: 8px;
	border-style: solid;
	border-color: #64748b;
	border-radius: 6px;
	cursor:	pointer;
	text-align:	center;
	padding: 0 10px;
	height: 30px;
	line-height: 30px;
	width: 90px;
	margin-left: 20px;
	transition: all 0.2s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	font-weight: bold;
	letter-spacing: 0.5px;
}
#tetris .menu a:hover { 
    background: #475569;
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
#tetris .menu a:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* game	over */

#tetris-gameover {
	position: absolute;
	width: 100%;
	top: 50%;
	text-align:	center;
	font-weight: bold;
	display: none;
	color: #ef4444;
	font-size: 18px;
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

/* next	puzzle */
#tetris-nextpuzzle {
	position: absolute;
	top: 47%;
	left: 35%;
	background:	#334155;
	border-radius: 4px;
	overflow: visible;
	display: none;
}
#tetris-keys {
	position: absolute;
	left: 25px;
	top: 135px;
}
#tetris div.h5 { margin-bottom: 0.5em; display: block; font-weight: bold; color: #e2e8f0; }
#tetris-keys td { padding-right: 1px; padding-bottom: 1px; }
#tetris-keys img { border-width: 0px; }

/* stats */

#tetris	.left .stats {
	position: absolute;
	left: 25px;
	bottom:	5px;
}
#tetris	.stats td {	padding-bottom:	1px; line-height: 1.25em; }

#tetris	.stats .level {	text-align:	left; padding-right: 5px; }
#tetris-stats-level	{ font-weight: bold; color: #e2e8f0; }

#tetris	.stats .time { text-align: left; padding-right:	5px; }
#tetris-stats-time { font-weight: bold; color: #e2e8f0; }

#tetris	.stats .apm	{ text-align: left;	padding-right: 5px;	}
#tetris-stats-apm {	font-weight: bold; color: #e2e8f0; }

#tetris	.stats .lines {	text-align:	left; padding-right: 5px; }
#tetris-stats-lines	{ font-weight: bold; color: #e2e8f0; }

#tetris	.stats .score {	text-align:	left; padding-right: 5px; }
#tetris-stats-score	{ font-weight: bold; color: #e2e8f0; }


/*
	|
	---
*/
#tetris	.block1	{ 
    background: #38bdf8; 
    box-shadow: inset 0 0 8px rgba(56, 189, 248, 0.6);
}

/*
	  |
	---
*/
#tetris	.block0	{ 
    background: #4ade80; 
    box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.6);
}

/*
	--
   --
*/
#tetris	.block2	{ 
    background: #fb923c; 
    box-shadow: inset 0 0 8px rgba(251, 146, 60, 0.6);
}

/*
	--
	 --
*/
#tetris	.block3	{ 
    background: #f97316; 
    box-shadow: inset 0 0 8px rgba(249, 115, 22, 0.6);
}

/*
	|
   ---
*/
#tetris	.block4	{ 
    background: #c084fc; 
    box-shadow: inset 0 0 8px rgba(192, 132, 252, 0.6);
}

/*
	--
	--
*/
#tetris	.block5	{ 
    background: #94a3b8; 
    box-shadow: inset 0 0 8px rgba(148, 163, 184, 0.6);
}

/*
	----
*/
#tetris	.block6	{ 
    background: #f87171; 
    box-shadow: inset 0 0 8px rgba(248, 113, 113, 0.6);
}


/*** window	***/

#tetris	.window	{
	background:	#334155;
	position: absolute;
	width: 167px;
	height:	307px;
	left: 132px;
	top: 1px;
	z-index: 50000;
	display: none;
	border-radius: 0 8px 8px 0;
}
#tetris	.window	.top {
	position: relative;
	background:	#475569;
	color: #e2e8f0;
	letter-spacing: +1px;
	height:	30px;
	line-height: 30px;
	vertical-align:	middle;
	border-bottom: 1px solid #64748b;
	text-indent: 10px;
	border-radius: 0 8px 0 0;
}
#tetris	.window	.top .close	{
	position: absolute;
	background:	#475569;
	font-family: verdana;
	font-weight: bold;
	right: 0px;
	top: 0px;
	height:	30px;
	line-height: 30px;
	text-indent: 10px;
	width: 30px;
	border-left: 1px solid #64748b;
	cursor:	pointer;
	border-radius: 0 8px 0 0;
	transition: background 0.2s;
}
#tetris	.window	.top .close:hover {
	background:	#64748b;
}
#tetris	.window	.content {
	margin:	10px;
	color: #e2e8f0;
}
#tetris	.window	.content a {
	color: #38bdf8;
	text-decoration: none;
}
#tetris	.window	.content a:hover {
	color: #0ea5e9;
}

/* Responsive Design für verschiedene Bildschirmgrößen - Verbessert */
/* Desktop und größere Tablets - keine Touch-Controls anzeigen */
@media (min-width: 1025px) {
	#touch-controls {
		display: none !important; /* Immer verstecken auf großen Bildschirmen */
	}
	
	body {
		padding-bottom: 0; /* Kein zusätzliches Padding benötigt */
	}
	
	#tetris {
		margin: 0 auto; /* Zentrieren */
	}
}

/* Mittlere Bildschirme - Touch-Controls nur anzeigen, wenn mobile Erkennung zutrifft */
@media (min-width: 601px) and (max-width: 1024px) {
	/* Touch-Controls nur für erkannte mobile Geräte */
	body.mobile-device #touch-controls {
		display: block;
		position: fixed;
		bottom: 0;
		width: 100%;
		max-width: 600px;
		margin: 0 auto;
		left: 0;
		right: 0;
	}
	
	body.mobile-device {
		padding-bottom: 180px;
	}
	
	#tetris {
		margin: 0 auto;
	}
}

/* Kleine Bildschirme/Smartphones */
@media (max-width: 600px) {
	#tetris {
		width: 100%;
		max-width: 300px;
		height: auto;
		min-height: 400px;
		margin: 20px auto;
	}
	
	#touch-controls {
		display: block;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 15px 0 25px 0; /* Mehr Padding unten */
		z-index: 2000;
		border-radius: 15px 15px 0 0;
	}
	
	#tetris-keys {
		display: none !important;
	}
	
	body {
		padding-bottom: 200px; /* Mehr Platz für Touch-Controls */
	}
	
	.touch-button {
		margin: 5px;
		width: 55px;
		height: 55px;
		line-height: 55px;
		font-size: 24px;
	}
	
	#touch-space {
		width: 130px;
	}
}

/* Für sehr kleine Bildschirme */
@media (max-width: 340px) {
	#tetris {
		transform: scale(0.9);
		transform-origin: top center;
	}
	
	.touch-button {
		width: 45px;
		height: 45px;
		line-height: 45px;
		font-size: 20px;
		margin: 3px;
	}
	
	#touch-space {
		width: 100px;
		font-size: 16px;
	}
}

/* Landscape-Modus für mobile Geräte */
@media (max-height: 500px) and (orientation: landscape) {
	#touch-controls {
		padding: 5px 0;
	}
	
	.touch-button {
		width: 45px;
		height: 45px;
		line-height: 45px;
		margin: 3px;
	}
	
	#touch-space {
		width: 90px;
	}
	
	body {
		padding-bottom: 120px;
	}
}

/* Für Tablets in Landscape-Modus */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: landscape) {
	#tetris {
		margin-left: 20px;
		float: left;
	}
	
	#touch-controls {
		display: block;
		position: absolute;
		top: 50%;
		right: -200px;
		width: 180px;
		transform: translateY(-50%);
	}
	
	.touch-button {
		margin: 10px;
	}
}

/* Für bessere Animationen */
@keyframes buttonPulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

#tetris-menu-start {
	background: #3b82f6; /* Hervorheben des Start-Buttons */
	animation: buttonPulse 2s infinite;
}

#tetris-menu-start:hover {
	background: #2563eb;
	animation: none;
}

/* Animationen für Blöcke */
@keyframes blockAppear {
	from { opacity: 0; transform: scale(0.8); }
	to { opacity: 1; transform: scale(1); }
}

#tetris .block0, 
#tetris .block1, 
#tetris .block2, 
#tetris .block3, 
#tetris .block4, 
#tetris .block5, 
#tetris .block6 {
	animation: blockAppear 0.2s ease-out;
}