@font-face {
  font-family: "FreePixel";
  src: url("/static/fonts/FreePixel.ttf");
}

* {
  font-family: "FreePixel";
  color: lightgray;
}

html, body {
    height: 100%;
}

body {
    background-color: black;
}

hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid dimgrey;
}

button {
    background-color: gray;
}

.navigation_bar {
    display: flex;
    justify-content: space-between;
}

a.navigation_button {
    display: inline-block;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 6px;
    padding-right: 6px;
    background-color: dimgrey;
}

h1, h2 {
  text-align: center;
}

h1 {
  margin-bottom: 1rem;
}

/* Main content area: breathing room and readable width */
.content {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

.content > p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.content > p.message,
.content > p.error {
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.content > p.error {
  background-color: #2a1515;
  border: 1px solid #663333;
}

.content_toolbar {
  margin-bottom: 1rem;
}

.content_intro {
  margin-bottom: 0.5rem;
}

.content_empty {
  margin-top: 1rem;
  color: gray;
}

/* Maps list: uniform width for action buttons (Enable / Disable / Delete) */
.content table td.maps_actions button {
  min-width: 5.5em;
  box-sizing: border-box;
}

p.text {
    text-indent: 2em;
    text-align: justify;
    padding-left: 8px;
    padding-right: 8px;
}

p.centered_text {
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid lightgray;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

tbody > tr:nth-child(odd) {
    background-color: #151010;
}

th, td {
  border: 1px solid lightgray;
  padding: 6px 8px;
}

th {
    background-color: dimgrey;
}

/* Home */

img.cover {
    object-fit: contain;
    width: 300px;
}

th.leaderboard_column_position {
    width: 72px;
}
th.leaderboard_column_player {
    width: auto;
}
th.leaderboard_column_score {
    width: 96px;
}

td.rank_icon {
    text-align: center;
}

img.rank {
    width: 32px;
    height: 20px;
    image-rendering: pixelated;
    vertical-align: middle;
}

img.avatar {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
    vertical-align: middle;
}

span.short_rank {
    width: 72px;
    display: inline-block;
    text-align: right;
    vertical-align: middle;
}

span.username {
    vertical-align: middle;
}

img.error {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
}

.error_content_container {
    width: 100%;
    height: 100%;
    display: grid;
    align-content: center;
    text-align: center;
}

/* Chat */

th.chat_column_player {
    width: 172px;
}

th.chat_column_message {
    width: auto;
}

.chat_message_cell {
    overflow-wrap: anywhere;
}

.chat_navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
    padding-left: 8px;
    padding-right: 8px;
}

/* Forms (map add/edit, profile-style alignment) */

.content form {
  margin-top: 1.25rem;
}

.content form p,
.content form .form_row {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.content form .form_row:first-of-type {
  margin-top: 0;
}

.content form label {
    display: block;
    margin-bottom: 0.25rem;
}

/* Keep checkbox/radio labels on same line as the control */
.content form input[type=checkbox] + label,
.content form input[type=radio] + label {
    display: inline;
    margin-bottom: 0;
}

.content form input[type="text"],
.content form input[type="file"],
.content form textarea {
    font-family: "FreePixel";
    color: lightgray;
    background-color: #252020;
    border: 1px solid dimgrey;
    padding: 4px 6px;
    box-sizing: border-box;
}

.content form input[type="text"]:focus,
.content form textarea:focus {
    border-color: gray;
    outline: none;
}

.content form textarea {
    width: 100%;
    max-width: 480px;
    min-height: 4em;
    resize: vertical;
}

.content form input[type="text"] {
    width: 100%;
    max-width: 320px;
}

.content form .hint {
    display: block;
    margin-top: 2px;
    font-size: 0.95em;
    color: gray;
}

.content form .form_actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid dimgrey;
}

.content form .form_actions button,
.content form .form_actions a {
  margin-right: 0.75rem;
}

.content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  max-width: 100%;
}

/* Mobile: full-width content, tighter padding */
@media screen and (max-width: 480px) {
    .content {
        max-width: none;
    }

    a.navigation_button {
        font-size: small;
    }

    span.short_rank {
        width: 48px;
    }

    th.leaderboard_column_score {
        width: 64px;
    }

    th.chat_column_player {
        width: 128px;
    }

    tr.leaderboard_record_row, tr.chat_message_row {
        font-size: xx-small;
    }
}