*{
	box-sizing: border-box;
	-moz-box-sizing:border-box; /* Firefox */
	-webkit-box-sizing:border-box; /* Safari */
}
html,body,div{
	margin:0;
	padding:0;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #2c3e50;
    color: #ecf0f1;
}

/* Game Area */
.game-container, .start-container{
	width:620px;
	height: 620px;
	margin: 50px auto;
	position: relative;
	box-sizing: content-box;
	background-color: #34495e;
	border-radius: 10px;
	box-shadow: 0 0 20px rgba(0,0,0,0.5);
	padding: 10px;
}
.game-container{
	display: none;
}
/* Start Screen */
.start-container{
	/* Tech Theme Background */
	background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
	position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 0;
    overflow: hidden;
}

/* Tech Grid Overlay */
.start-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* Ensure content is above the grid */
.start-container > * {
    z-index: 1;
}

.start-container h1 {
    font-size: 80px;
    color: #ecf0f1;
    text-shadow: 4px 4px 0px #2c3e50, 8px 8px 0px #000;
    margin-bottom: 60px;
    font-weight: 900;
    letter-spacing: 5px;
    font-family: 'Segoe UI', sans-serif;
    transform: rotate(-5deg);
}

.start-container p{
	width: 100%;
    text-align: center;
}
.start-container p button{
	width: 200px;
	height: 50px;
	display: block;
	margin: 0 auto;
	margin-bottom: 20px;
	border-radius: 25px;
	font-weight: bold;
	font-size:18px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.start-container p button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

.start-container .btn{
	outline: none; 
    border: 0px solid transparent;
}

/* Level Selector Styling */
.level-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.level-selector label {
    color: #ecf0f1;
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.level-selector select {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    font-size: 18px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    /* Custom appearance */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 80px;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

.level-selector select:hover, .level-selector select:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #00bc8c;
    box-shadow: 0 0 10px rgba(0, 188, 140, 0.5);
}
.level-selector select option {
    background-color: #2c3e50;
    color: #fff;
}
/* Remove bootstrap outline */
.btn:focus,    
.btn:active:focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,.btn.active.focus {
    outline: none;          
}

/* Modal Dialog */
.modal-dialog{
	display: none;
	color:#fff;
	font-weight: 400;
}
.modal-dialog .modal-body{
	position: fixed;
    height: auto;
    min-height: 500px;
    width: 450px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0; /* Reset margins */
    background: rgba(44, 62, 80, 0.95);
    z-index: 100;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border: 2px solid #00bc8c;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px;
}
.modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #00bc8c;
    font-weight: bold;
    letter-spacing: 2px;
}
.setting-group {
    margin-bottom: 20px;
    width: 100%;
    text-align: left;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.key-settings {
    width: 100%;
    text-align: left;
}
.key-settings h4 {
    color: #ecf0f1;
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 3px solid #00bc8c;
    padding-left: 10px;
}
.key-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.2);
    padding: 8px 15px;
    border-radius: 5px;
}
.key-row label {
    margin: 0;
    font-weight: normal;
}
.key-btn {
    background: #34495e;
    border: 1px solid #7f8c8d;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 100px;
    transition: all 0.2s;
    outline: none;
}
.key-btn:hover {
    background: #2c3e50;
    border-color: #00bc8c;
}
.key-btn.active {
    background: #00bc8c;
    border-color: #00bc8c;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 188, 140, 0.5);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.instruction {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}
.modal-dialog::after{
	content:'';
	position:fixed;
	top:0;
	right:0;
	left:0;
	bottom:0;
	background: rgba(0,0,0,0.5);
    z-index: 90;
}

.game-container .panel{
	width:100px;
	margin-bottom: 0;
	border: 1px solid #555;
    background-color: #2c3e50;
    border-radius: 5px;
    overflow: hidden;
}
.game-container .panel .panel-body{
	padding:0;
    background-color: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Game Main Display */
.game-main-panel{
	position: absolute;
	left:115px; /* Adjusted for spacing */
	top:10px;
	width:390px;
	height: 600px;
	border: 2px solid #555;
    background-color: #000;
}
.game-container canvas {
    width: 100px;
}
.game-main-panel canvas {
    width: 390px;
    height:600px;
}

/* Side Panels */
.timer-panel{
	height:100px;
    position: absolute;
    left: 5px;
    top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.timer-panel .panel-heading,
.leval-panel .panel-heading,
.score-panel .panel-heading,
.high-score-panel .panel-heading,
.next-panel .panel-heading {
    width: 100%;
    text-align: center;
    padding: 5px 0;
    font-size: 14px;
    letter-spacing: 1px;
}

.help-panel{
	height: 380px;
	line-height: 1.2;
	text-align: center;
    position: absolute;
    left: 5px;
    top: 120px;
    font-size: 12px;
    padding: 5px;
}
.help-panel .panel-body {
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
.help-item {
    margin: 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.help-item:last-child {
    border-bottom: none;
}
.help-keys {
    color: #00bc8c;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
    word-break: break-all;
    line-height: 1.2;
}
.help-label {
    color: #ecf0f1;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leval-panel{
	height: 100px;
    position: absolute;
    left: 5px;
    top: 510px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.next-panel{
	position: absolute;
	top:10px;
	right:5px;
	height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.setting-panel{
	position: absolute;
	top:170px;
	right:5px;
	height:180px;
	display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 10px 0;
    align-items: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.setting-panel .panel-body {
    background: transparent;
    flex-direction: column;
    gap: 15px;
}

.setting-panel button{
	color:#fff;
	font-weight: bold;
    width: 90px;
    height: 40px;
    border-radius: 20px;
}
.score-panel{
	position: absolute;
	top:360px;
	right:5px;
	height:120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.high-score-panel{
	position: absolute;
	top:490px;
	right:5px;
	height:120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
