body {
  font-family: Lato;
  font-size: 16px;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #000;
  background-image: url("jota-bg-dgb.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#interface {
	display: block;
	width: 1200px;
	border: 0px solid #5c522e;
}

#game {
	float: left;
	min-width: 1200px;
	border: 0px solid #5c522e;
}

#highscore {
	float: left;
	min-width: 200px;
	border: 1px solid #383838;
	width: fit-content;
	min-height: 780px;
	margin-left: 10px;
	padding: 10px;
	color: #858585;
	text-align: center;
	background-color: rgba(0, 0, 0, 0.7);
}

#highscore table {
	width: 100%;
}

#menu {
	float: left;
	border: 0px solid #5c522e;
	width: 851px;
	padding-top: 5px;
}

#menu-buttons {
	float: left;
	height: 35px;
}

#menu-song {
	height: 35px;
	float: right;
	color: #fff;
}

#menu button {
    display: inline-block;
    padding: 5px 15px;
    height: 30px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    background-color: #5c522e;
    color: #f2be00;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
	text-shadow: 1px 1px 2px black;
}

#menu button:hover {
    background-color: #e0ab00;
	color: #fff;
}

#menu button#sound-button {
	display: none;
}

#menu button#music-button {
	display: none;
}

#menu button#nextrandomtrack-button {
	display: none;
}

#topbar {
	height: 30px;
	color: #5c522e;
	width: 100%;
	margin: 0;
	padding: 0;
	width: 851px;
	font-weight: bold;
	text-shadow: 2px 2px 3px black;
}

#footerbar {
	float: left;
	height: 30px;
	color: #fff;
	width: 100%;
	margin-top: 20px;
	padding: 0;
	width: 851px;
	text-align: center;
	font-weight: bold;
	text-shadow: 2px 2px 3px black;
}

#title {
	float: left;
	width: auto;
	text-align: left;
	margin: 0;
	padding: 0;
	color: #f2be00;
}

#level {
	float: right;
	width: auto;
	text-align: left;
	margin: 0;
	padding: 0;
	color: #016701;
}

#health {
	float: right;
	width: auto;
	text-align: left;
	margin: 0;
	padding-right: 10px;
	color: #b30003;
}

#score {
	float: right;
	width: auto;
	text-align: left;
	margin: 0;
	padding: 0;
	padding-right: 10px;
	color: #fff;
}

#game-area {
	float: left;
	font-family: Terminal;
	font-size: 16px;
}

#game-container {
	display: grid;
	grid-template-columns: repeat(50, 16px); /* Fixed width to prevent jumping */
	grid-template-rows: repeat(50, 16px);
	gap: 0px; /* No gap looks more like a classic retro game */
	border: 2px solid #5c522e;
	width: 800px;
	height: 800px;
	background-color: #000;
	background-image: url("jota-gamebg-dgb.jpg");
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	overflow: hidden;
	margin: 0 auto;
}

#game-container span {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 16px;
	height: 16px;
	font-size: 14px;
	line-height: 1;
	color: white;
	transition: background-color 0.2s ease, opacity 0.3s ease; /* Smooth visual transitions */
}

#game-container row {
	display: flex;
}

#game-container .explored {
	background-color: #141414;
	color: white;
}

#game-container .hidden {
	visibility: hidden;
}

#game-container .player-vision {
	background-color: rgba(64, 49, 10, 0.8) !important;
	color: white;
}

#game-container .monster-vision {
	background-color: rgba(255, 0, 0, 0.3);
	color: white;
}

#game-container .monster-hidden {
	background-color: #141414;
}

#game-container .player-los {
	border: 1px solid rgba(0, 0, 255, 0.3);
}

#game-container .monster-los {
	border: 1px solid rgba(255, 0, 0, 0.3);
}

#game-container .gray {
	color: #3b3b3b;
}

#game-container .brown {
	color: #332e1a;
}

#popupContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    text-align: center;
	color: #8a721b;
}

#popupContainer2 {
	display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    text-align: center;
	color: #8a721b;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(41, 41, 41, 1);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    max-width: 80%;
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.content {
	float: left;
	clear: left;
}

h1 {
    font-size: 28px;
    margin: 10px 0;
	color: #f2be00;
}

h2 {
    font-size: 20px;
    margin: 10px 0;
	color: #f2be00;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    font-size: 16px;
    margin-bottom: 10px;
}

.emoji {
    font-size: 20px;
    margin-right: 10px;
	color: #f2be00;
}

.emoji img {
	vertical-align: middle;
}

.donate {
	-webkit-touch-callout: text;
	-webkit-user-select: text;
	-khtml-user-select: text;
	-moz-user-select: text;
	-ms-user-select: text;
	user-select: text;
}

#showPopup {
    cursor: pointer;
}

#showPopup:hover {
    text-decoration: underline;
}

a {
	text-decoration: none;
}

a:link {
  color: #f2be00;
}

a:visited {
  color: #f2be00;
}

a:hover {
  color: #f7df87;
}

a:active {
  color: #f2be00;
}

/* Media Queries for Mobile Responsiveness (and now Vertical Monitors) - HIDE Highscore and CENTER Game - NO STRETCH - FIXED CENTER */
@media (max-width: 1000px), (orientation: portrait) { /* Adjust max-width as needed */
    #interface {
		width: 851px;
        align-items: center; /* Ensure interface content stays centered */
    }

    #game {
        flex-direction: column; /* Stack game and (hidden) highscore vertically */
        align-items: center;     /* Center game area horizontally within #game */
        min-width: 851px;          /* NEW: Ensure #game takes full width of #interface */
    }

    #game-area {
        align-self: center;    /* NEW: Explicitly center game-area horizontally in #game */
    }

    #highscore {
        display: none; /* HIDE highscore section */
    }

    #menu {
        justify-content: center;      /* Center menu */
        align-items: center;         /* Center menu items */
    }

    #menu-buttons {
        justify-content: center; /* Center buttons in menu buttons container */
    }

    #topbar {
        text-align: center; /* Center topbar text */
    }
}