html, body {
    height: 100%;
    overflow: hidden;
}


#grid {
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
}

#grid .tile,
#grid .object,
#grid .object .shape {
    position:absolute;
}

/* Logo */

#matrx_logo {
    width: 103px;
    height: 43px;
    border-radius: 2px;
    padding: 2px 5px;
}


/* Toggle the start button to pause or vice versa if pressed */
.hidden {
    display: none;
}

.agent_menu_preview,
.god_preview {
    display: inline-block;
    margin-right: 10px;
    width: 30px;
    height: 30px;
}

.agent_menu_preview img {
    max-height: 30px;
    max-width: 30px;
    height: auto;
    width: auto;
}

#agent_dropdown .dropdown-item,
#view_mode .dropdown-item {
    padding: .4rem 1.5rem;
    display: flex;
}


/* Selection styling */
.matrx_object_selected {
    width: 110%;
    z-index: 999;
    position: absolute;
    height: 110%;
    left: -5%;
    top: -5%;
    pointer-events: none;
}



/* Chat styling */
.new_chat_option {
    cursor: pointer;
}

.chat-notification {
    background: #ffb100;
    border-radius: 50%;
    height: 8px;
    width: 8px;
    margin-left: 5px;
    margin-bottom: 1px;
}


.toolbar {
  padding-top: 0.1em;
  padding-bottom: 0.1em;
  padding-left: 1em;
  /* position: sticky; */
  z-index: 100000000000;
}

.row {
  margin-right: 0;
}

.tile.draw_mode:hover {
  cursor: url("pencil-alt.svg") 0 15, pointer;
  background-color: indianred;
}

.tile.erase_mode:hover {
  cursor: url("eraser.svg") 0 15, pointer;
}

.agent {
  z-index: 1;
  color: #fff;
  background-color: #17a2b8;
}

.agent:hover {
  cursor: pointer;
  background-color: #138496;
}

.grid {
  background-color: lightgray;
}

.contact {
  background-color: #f8f9fa;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  transition: color 0.05s ease-in-out, background-color 0.05s ease-in-out, border-color 0.05s ease-in-out, box-shadow 0.05s ease-in-out;
  margin-bottom: 0.5em;
  word-break: break-word;
}

.contact:hover {
  cursor: pointer;
  background-color: #424649;
  color: white;
}

.contact_active {
  background-color: #424649;
  color: white;
}

#messages {
    overflow-y: auto;
    max-height: 50vh;
}

.message_you {
    color: #fff;
    position: relative;
    background: #00aabb;
    border-radius: .4em;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.5em;
    width: fit-content;
    margin-left: auto;
    margin-right: 10px;
    max-width: 90%;
}

.message_you:after {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	width: 0;
	height: 0;
	border: 8px solid transparent;
	border-left-color: #00aabb;
	border-right: 0;
	border-top: 0;
	margin-top: -4px;
	margin-right: -8px;
}

.message_other {
	position: relative;
	background: white;
	border-radius: .4em;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0.5em;
    width: fit-content;
    margin-left: 10px;
    color:black;
    max-width: 90%;
}

.message_other:after {
  content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 0;
	height: 0;
	border: 8px solid transparent;
	border-right-color: white;
	border-left: 0;
	border-top: 0;
	margin-top: -4px;
	margin-left: -8px;
}

.form-control {
  margin-bottom: 0.5em;
}

h5 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

#chat {
  background-color: rgb(229 221 213 / 95%);
  padding-bottom: 1em;
  padding-left: 0.5em;
  padding-right: 0;
  z-index: 100000000000;
  position: absolute;
  top: 46px;
  right: 0;
  width: 100%;
  max-width: 800px;
  height: calc(100% - 46px);
}

#chatrooms_list {
     max-height: 90vh;
}

.object:hover {
    cursor: pointer;
}

.chat-mssg-sender {
    font-weight: bold;
}

.matrx_object_busy {
    position: absolute;
}

.matrx_core_version {
    position: absolute;
    bottom: 0;
    right: 10px;
    font-size: 0.8em;
}

.disconnected_notification {
    position:absolute;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    top: 10px;
    color: red;
    font-weight: bold;
    font-size: 1.2rem;
}

.disconnected_notification span {
    font-size: 1rem;
}

#chat_form_submit {
    border: none;
    background-color: #0795bb;

}

#chat_form_submit:hover {
    background-color: #056681;
    -webkit-transition: background-color 100ms linear;
    -ms-transition: background-color 100ms linear;
    transition: background-color 100ms linear;
}

/* subtile + context menu bug fix. Subtile objects only block when exactly on top of eachother. */
.object {
    pointer-events: none;
}

.shape {
    pointer-events: auto;
}

.statistics_bar {
    padding: 10px;
    display: flex;
    justify-content: center;
    background: #f8f9fa!important;
}

/* Robot chat panel */
#robot-chat-panel {
    position: fixed;
    right: 0;
    top: 50px;
    bottom: 0;
    width: 260px;
    background: #f5f5f5;
    border-left: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    z-index: 999;
}

#robot-chat-header {
    background: #00A6D6;
    color: white;
    padding: 10px 14px;
    font-weight: bold;
    font-size: 1em;
    flex-shrink: 0;
}

#robot-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.robot-message {
    margin-bottom: 10px;
}

.robot-sender {
    font-weight: bold;
    font-size: 0.8em;
    color: #555;
    display: block;
    margin-bottom: 3px;
    margin-left: 10px;
}

.robot-bubble {
    position: relative;
    background: white;
    border-radius: 0.4em;
    padding: 8px 12px;
    color: black;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-left: 10px;
}

.robot-bubble:before {
    content: '';
    position: absolute;
    left: -8px;
    top: 12px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: white;
    border-left: 0;
}

.robot-speak-indicator {
    position: absolute;
    font-size: 2.2em;
    pointer-events: none;
    z-index: 9999;
    animation: speak-fade 2s ease-out forwards;
}

@keyframes speak-fade {
    0%   { opacity: 1; transform: translateY(0); }
    70%  { opacity: 1; transform: translateY(-6px); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.timer .team {
    padding: 2px;
    margin: 4px 0;
    color: grey;
}
.timer {
    text-align: center;
}

.team {
    text-align: left;
}

/* Pause button next to the timer */
.game-pause-btn {
    margin-left: 16px;
    padding: 4px 14px;
    background-color: #00A6D6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 100ms linear;
}

.game-pause-btn:hover {
    background-color: #007a9e;
}

.game-pause-btn i {
    margin-right: 4px;
}

/* Pause overlay showing controls */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000000001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pause-overlay-content {
    background: white;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    text-align: center;
}

.pause-overlay-content h2 {
    margin-top: 0;
    color: #00A6D6;
}

.pause-overlay-content h4 {
    margin-top: 16px;
    margin-bottom: 12px;
    color: #333;
}

.controls-table {
    margin: 0 auto 20px auto;
    border-collapse: separate;
    border-spacing: 0 8px;
    text-align: left;
}

.controls-table td {
    padding: 4px 12px;
    vertical-align: middle;
}

.controls-table td:first-child {
    white-space: nowrap;
}

.key {
    display: inline-block;
    min-width: 24px;
    padding: 3px 8px;
    margin: 0 2px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.resume-btn {
    margin-top: 10px;
    padding: 10px 30px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 100ms linear;
}

.resume-btn:hover {
    background-color: #1e7e34;
}

.resume-btn i {
    margin-right: 6px;
}

/* End-game overlay */
.end-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100000000002;
    display: flex;
    justify-content: center;
    align-items: center;
}

.end-overlay-content {
    background: white;
    padding: 40px 60px;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 520px;
}

.end-overlay-content h2 {
    margin: 0;
    color: #00A6D6;
    font-size: 2em;
}

.end-overlay-subtitle {
    margin: 8px 0 24px 0;
    color: #555;
    font-size: 1em;
}

.end-score {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 18px 24px;
    margin: 0 auto 24px auto;
    display: inline-block;
}

.end-score-label {
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.end-score-value {
    color: #00A6D6;
    font-size: 2.6em;
    font-weight: bold;
}

.finish-btn {
    padding: 12px 38px;
    background-color: #00A6D6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.15em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 100ms linear;
}

.finish-btn:hover {
    background-color: #007a9e;
}

.finish-btn i {
    margin-right: 8px;
}

/* Mid-game trust overlay */
.trust-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000000003;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trust-overlay-content {
    background: #00A6D6;
    color: white;
    padding: 36px 48px;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 640px;
}

.trust-overlay-content h2 {
    margin: 0 0 16px 0;
    font-size: 1.8em;
}

.trust-question {
    font-size: 1.15em;
    margin: 0 0 8px 0;
}

.trust-scale-label {
    font-size: 0.95em;
    opacity: 0.9;
    margin: 0 0 20px 0;
}

.trust-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 16px 0;
    flex-wrap: wrap;
}

.trust-buttons button {
    min-width: 44px;
    padding: 10px 12px;
    background: white;
    color: #00A6D6;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 1.05em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 100ms linear, transform 80ms linear, border-color 100ms linear;
}

.trust-buttons button:hover {
    background: #cce8f3;
}

.trust-buttons button:active {
    transform: scale(0.95);
}

.trust-buttons button[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.trust-buttons button.trust-selected {
    background: #ffd166;
    color: #00567a;
    border-color: white;
}

.trust-question-block {
    margin: 12px 0 18px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.trust-question-block:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 10px;
}

.trust-overlay-content #trust_submit_btn {
    margin-top: 14px;
}

.trust-overlay-content #trust_submit_btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.trust-hint {
    font-size: 0.85em;
    opacity: 0.85;
    margin: 6px 0 0 0;
}
