.container {
  display: flex;
  flex-direction: column;
}

:root {
  --pixelonia-font-family: Arial, Helvetica, sans-serif;
  --pixelonia-sidebar-width: 180px;
}

.container nav {
  white-space: nowrap;
}

@media (min-width: 768px) {
  .game-shell {
    display: block;
    min-height: 100vh;
  }

  .game-shell > div {
    margin-left: var(--pixelonia-sidebar-width);
    height: 100vh;
    overflow: auto;
  }

  .container > div > div {
    margin-left: auto;
    margin-right: auto;
    width: 624px;
  }
}

@media (min-width: 992px) {
  .container > div > div {
    width: 848px;
  }
}

/**
 * Based on Bootstrap, which is licensed MIT.
 * https://getbootstrap.com/
 */

/**
 * Document
 *
 * 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.
 * 2. Change the default font family in all browsers.
 * 3. Correct the line height in all browsers.
 * 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.
 * 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so
 *    we force a non-overlapping, non-auto-hiding scrollbar to counteract.
 * 6. Change the default tap highlight to be completely transparent in iOS.
 */

*,
*::before,
*::after {
  box-sizing: border-box; /* 1 */
}

html {
  font-family: var(--pixelonia-font-family); /* 2 */
  line-height: 1.15; /* 3 */
  font-size: 12px;
  -webkit-text-size-adjust: 100%; /* 4 */
  -ms-text-size-adjust: 100%; /* 4 */
  -ms-overflow-style: scrollbar; /* 5 */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* 6 */
}

/**
 * Body
 *
 * 1. Remove the margin in all browsers.
 */

body {
  background-image: url(background.webp);
  color: #eee;
  font-family: var(--pixelonia-font-family);
  margin: 0; /* 1 */
}

#public-home {
  min-height: 100vh;
}

.public-home-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1rem;
}

.public-home-main {
  margin: 0 auto;
  max-width: 848px;
  width: 100%;
}

.public-home-brand {
  align-items: stretch;
  display: flex;
  gap: 1rem;
  margin: 0 auto 1rem;
}

.pixelonia-logo-frame {
  aspect-ratio: 3.1;
  flex: 1 1 52%;
  min-width: 0;
  overflow: hidden;
}

.pixelonia-logo {
  display: block;
  height: 100%;
  mix-blend-mode: screen;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.pixelonia-about {
  align-items: center;
  background-color: rgba(20, 34, 62, .9);
  border: 1px solid #415680;
  display: flex;
  flex: 1 1 48%;
  line-height: 1.45;
  margin: 0;
  padding: .75rem;
}

.public-home-login {
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
}

.public-home-login form > table,
.public-home-login > table {
  margin-bottom: .5rem;
}

.registration-confirmation-modal {
  align-items: center;
  background: rgba(3, 8, 20, .78);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 1000;
}

.registration-confirmation-card {
  background: linear-gradient(145deg, rgba(38, 61, 99, .98), rgba(14, 28, 53, .98));
  border: 1px solid #7ea6dc;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  box-sizing: border-box;
  color: #f1f6ff;
  max-width: 34rem;
  padding: 1.25rem 1.5rem;
  text-align: center;
  width: 100%;
}

.registration-closed-notice {
  background: linear-gradient(145deg, rgba(38, 61, 99, .98), rgba(14, 28, 53, .98));
  border: 1px solid #7ea6dc;
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  color: #f1f6ff;
  margin: 10vh auto;
  max-width: 680px;
  padding: 2rem;
  text-align: center;
  width: calc(100% - 2rem);
}

.registration-closed-notice h1,
.registration-closed-notice h3 {
  color: #fff;
  margin-top: 0;
}

.registration-closed-notice p {
  line-height: 1.6;
}

.login-welcome-card {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.registration-confirmation-card h2 {
  color: #fff;
  font-size: 1.1rem;
  margin: 0 0 .85rem;
}

.registration-confirmation-card p {
  line-height: 1.5;
  margin: 0 0 .75rem;
}

.registration-confirmation-close {
  display: inline-block;
  margin-top: .25rem;
}

.public-home-main {
  max-width: 1100px;
}

.public-home-hero {
  align-items: stretch;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.6fr);
  margin: 1rem 0 1.5rem;
}

.public-home-brand {
  align-items: center;
  display: flex;
  margin: 0;
}

.public-home-brand .pixelonia-logo-frame {
  flex: 1 1 auto;
  width: 100%;
}

.pixelonia-about-panel,
.public-home-section,
.public-home-panel {
  background-color: rgba(16, 28, 52, .88);
  border: 1px solid #415680;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.pixelonia-about-panel {
  display: flex;
  align-items: stretch;
}

.pixelonia-about-panel .pixelonia-about {
  background: transparent;
  border: 0;
  flex: 1;
  padding: 1.25rem 1.5rem;
}

.public-home-section {
  margin: 0 0 1.5rem;
  padding: 1rem;
}

.public-home-section > h2,
.public-home-panel > h2 {
  background-color: rgba(57, 79, 117, .72);
  border-bottom: 1px solid #52698e;
  font-size: 1rem;
  margin: -1rem -1rem 1rem;
  padding: .65rem .85rem;
  text-align: left;
}

.public-home-section > p {
  line-height: 1.55;
  margin: 0;
}

.public-home-rules-ownership {
  margin-top: .75rem !important;
}

.public-home-rules-ownership a {
  display: inline-block;
  margin-left: .35rem;
}

.rules-page td {
  line-height: 1.5;
  padding: .65rem .75rem;
  text-align: left;
}

.public-screens-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.public-screen-card {
  aspect-ratio: 16 / 9;
  background-color: rgba(7, 14, 28, .72);
  border: 1px solid #52698e;
  margin: 0;
  min-height: 120px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.public-screen-image {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  width: 100%;
}

.public-screen-card figcaption {
  background: rgba(7, 14, 28, .85);
  bottom: 0;
  color: #e5edff;
  font-size: .78rem;
  left: 0;
  padding: .3rem .45rem;
  position: absolute;
  right: 0;
  text-align: center;
}

.public-table-wrap {
  overflow-x: auto;
}

.public-universe-table {
  margin: 0;
  min-width: 680px;
  width: 100%;
}

.public-universe-table th,
.public-universe-table td {
  padding: .65rem .75rem;
  text-align: center;
}

.public-universe-table th:first-child,
.public-universe-table td:first-child {
  text-align: left;
}

.public-universe-table .universe-name {
  color: #fff;
  font-weight: bold;
}

.universe-status {
  color: #a8e6b0;
}

.public-home-actions {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.public-home-panel {
  margin: 0;
  padding: 1rem;
}

.public-home-panel .public-home-login {
  max-width: none;
}

.public-home-panel > p {
  line-height: 1.55;
}

.public-current-universe {
  color: #b9d8ff;
  font-size: .9rem;
  margin: 0 0 .75rem;
}

.join-universe-selector {
  background-color: rgba(20, 35, 62, .72);
  border: 1px solid #52698e;
  margin-top: 1rem;
  padding: .75rem;
}

.join-universe-selector h2 {
  font-size: 1rem;
  margin: 0 0 .5rem;
}

.join-universe-selector h3 {
  font-size: .95rem;
  margin: 0 0 .5rem;
}

.join-universe-selector p {
  margin: 0 0 .5rem;
}

.join-universe-selector ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.join-universe-selector li {
  display: inline-block;
  margin: .15rem .5rem .15rem 0;
}

.public-home-register {
  display: flex;
  flex-direction: column;
}

.public-home-join-form {
  margin: 0;
}

.public-home-join-form table {
  margin: 0;
  width: 100%;
}

.public-home-join-form td:first-child {
  white-space: nowrap;
  width: 35%;
}

.public-home-join-form input,
.public-home-join-form select {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
}

.public-home-join-form button {
  margin-top: .15rem;
}

.public-home-primary-action {
  align-self: flex-start;
  background-color: #344566;
  border: 1px solid #6682b2;
  color: #fff;
  display: inline-block;
  margin-top: auto;
  padding: .55rem 1rem;
  text-decoration: none;
}

.public-home-primary-action:hover,
.public-home-primary-action:focus {
  background-color: #46618c;
}

#public-home #site-footer {
  margin-top: auto;
  padding-top: 1rem;
}

#other-games {
  min-height: 100vh;
}

.other-games-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2rem 1.25rem 1.25rem;
}

.other-games-main {
  margin: auto;
  max-width: 980px;
  width: 100%;
}

.other-games-nav {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.hub-nav-link,
.other-games-footer a {
  background: linear-gradient(135deg, #355487, #263d67);
  border: 1px solid #7896c5;
  color: #fff;
  display: inline-block;
  padding: .55rem .9rem;
  text-decoration: none;
  transition: background-color .15s ease, transform .15s ease;
}

.hub-nav-link:hover,
.hub-nav-link:focus,
.other-games-footer a:hover,
.other-games-footer a:focus {
  background: linear-gradient(135deg, #4d72ad, #355487);
  transform: translateY(-1px);
}

.hub-nav-label {
  color: #bcd2f5;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hub-language-switcher {
  display: flex;
  gap: .35rem;
}

.hub-language-link {
  font-size: .82rem;
  padding: .4rem .65rem;
}

.hub-language-link.active {
  background: linear-gradient(135deg, #5a7fbd, #3e5f94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.other-games-brand {
  align-items: center;
  background: linear-gradient(135deg, rgba(11, 21, 50, .96), rgba(23, 34, 77, .88));
  border: 1px solid #647eb2;
  border-radius: 12px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .35);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(190px, 280px) 1fr;
  margin-bottom: 1.25rem;
  overflow: hidden;
  padding: 1.25rem;
}

.other-games-brand-logo {
  align-items: center;
  display: flex;
  justify-content: center;
}

.other-games-brand-logo img {
  display: block;
  height: auto;
  max-width: 100%;
  width: 250px;
}

.other-games-brand-copy {
  border-left: 1px solid rgba(131, 162, 221, .45);
  color: #e5edff;
  font-size: 1.08rem;
  line-height: 1.7;
  padding: .75rem 1.5rem;
}

.other-games-brand-copy p {
  margin: 0;
}

.other-games-social {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.hub-social-link,
.other-game-link {
  align-items: center;
  border: 1px solid rgba(164, 204, 255, .7);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .16);
  color: #fff;
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  letter-spacing: .01em;
  min-height: 2.3rem;
  padding: .45rem .9rem;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.hub-social-link:hover,
.hub-social-link:focus,
.other-game-link:hover,
.other-game-link:focus {
  border-color: #d7ebff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .3), 0 0 0 3px rgba(119, 190, 255, .16);
  transform: translateY(-2px);
}

.hub-social-link.is-support {
  background: linear-gradient(135deg, #b84985, #713c91);
}

.hub-social-link.is-x {
  background: linear-gradient(135deg, #2f405b, #172335);
}

.hub-social-link.is-discord {
  background: linear-gradient(135deg, #5865f2, #3d4bb6);
}

.other-games-panel {
  background: rgba(11, 21, 45, .92);
  border: 1px solid #415680;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  padding: 1rem;
}

.other-games-panel h1 {
  background-color: rgba(57, 79, 117, .72);
  border-bottom: 1px solid #52698e;
  border-radius: 11px 11px 0 0;
  font-size: 1rem;
  margin: -1rem -1rem 1rem;
  padding: .65rem .85rem;
}

.other-games-panel > p {
  line-height: 1.5;
  margin: 0 0 1rem;
  text-align: center;
}

.other-games-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.other-game-card {
  align-items: center;
  background: linear-gradient(160deg, rgba(32, 53, 91, .9), rgba(18, 31, 59, .9));
  border: 1px solid #52698e;
  border-radius: 10px;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(130px, .78fr) 1.22fr;
  padding: 1rem;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.other-game-card:hover {
  border-color: #89b3f0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  transform: translateY(-2px);
}

.other-game-logo {
  display: block;
  height: 76px;
  max-width: 88%;
  object-fit: contain;
  width: 100%;
}

.other-game-logo-link {
  display: block;
  min-width: 0;
  text-decoration: none;
}

.other-game-logo-frame {
  align-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(45, 115, 184, .28), rgba(5, 11, 30, .92) 70%);
  border: 1px solid rgba(112, 177, 235, .62);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  display: flex;
  height: 96px;
  justify-content: center;
  margin: 0;
  max-width: none;
  overflow: hidden;
  padding: .5rem;
  position: relative;
}

.other-game-logo-frame::after {
  background: linear-gradient(90deg, transparent, rgba(68, 225, 255, .8), transparent);
  bottom: 0;
  content: "";
  height: 1px;
  left: 16%;
  position: absolute;
  right: 16%;
}

.other-game-kicker {
  color: #9bc7ff;
  display: block;
  font-size: .72rem;
  letter-spacing: .13em;
  margin-bottom: .45rem;
  text-transform: uppercase;
}

.other-game-card h2 {
  color: #fff;
  font-size: 1rem;
  margin: 0 0 .75rem;
  text-align: left;
}

.other-game-card p {
  line-height: 1.45;
  margin-bottom: 0;
  min-height: 0;
  text-align: left;
}

.other-game-card-copy {
  min-width: 0;
}

.other-game-link {
  background: linear-gradient(135deg, #2d91c7, #4b4fc3);
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

.other-games-footer {
  align-items: center;
  color: #c6d7f6;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
  margin: 1.25rem auto 0;
}

.other-games-footer > span {
  margin-right: .35rem;
}

@media (max-width: 767px) {
  .public-home-shell {
    padding: .5rem;
  }

  .public-language-switcher {
    flex-wrap: wrap;
  }

  .public-home-brand {
    flex-direction: column;
  }

  .public-home-hero,
  .public-home-actions {
    grid-template-columns: 1fr;
  }

  .public-screens-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pixelonia-logo-frame {
    flex-basis: auto;
    margin: 0 auto;
    max-width: 520px;
    width: 100%;
  }

  .pixelonia-about {
    flex-basis: auto;
  }
}

@media (max-width: 420px) {
  .public-screens-grid {
    grid-template-columns: 1fr;
  }
}

/**
 * Forms
 *
 * 1. Remove the default `border-radius` that macOS Chrome adds.
 */

a.btn,
button {
  background-color: #344566;
  border: 1px solid #415680;
  border-radius: 0; /* 1 */
  color: #eee;
  display: inline-block;
  font-family: var(--pixelonia-font-family);
  padding: .25rem .5rem;
  text-align: center;
}

a.btn.disabled,
button:disabled {
  color: #999;
  cursor: auto;
  text-decoration: none;
}

button:not(:disabled) {
  cursor: pointer;
}

a.btn:not(.disabled):hover,
button:not(:disabled):hover {
  border: 1px solid #234;
  text-decoration: none;
}

input,
select,
textarea {
  background-color: #344566;
  border: 1px solid #415680;
  border-radius: 0;
  color: #eee;
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  padding: .25rem .5rem;
}

textarea {
  width: 100%;
}

/**
 * Images
 *
 * 1. Remove the border on images inside links in IE 10.
 */

img {
  border-style: none; /* 1 */
  vertical-align: top;
}

/**
 * Links
 *
 * 1. Remove the gray background on active links in IE 10.
 * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
 */

a {
  background-color: transparent; /* 1 */
  color: #eee;
  text-decoration: none;
  -webkit-text-decoration-skip: objects; /* 2 */
}

a:hover {
  color: #fff;
  text-decoration: underline;
}

/**
 * Lists
 */

ul {
  list-style: none;
}

/**
 * Tables
 *
 * 1. Prevent double borders.
 */

table {
  background-color: #344566;
  border-collapse: collapse; /* 1 */
  max-width: 100%;
  width: 100%;
}

th,
td {
  border: 1px #415680 solid;
  padding: .25rem;
  vertical-align: middle;
}

th {
  background: linear-gradient(#202840, #283850);
  text-align: left;
}

.overview-section-count {
  float: right;
  font-weight: normal;
}

td {
  font-weight: normal;
  text-align: center;
}

/* Rapid-fire table: positive values are advantageous rapid fire, while
 * negative values indicate rapid fire received from another unit. */
.rf-positive {
  color: #7fe47d;
  font-weight: bold;
}

.rf-negative {
  color: #ff6b6b;
  font-weight: bold;
}

/* Admin player management: keep each player's controls compact and distinct. */
.admin-player-table td {
  vertical-align: top;
}

.admin-player-actions {
  min-width: 250px;
  padding: .5rem;
  text-align: center;
}

.admin-action-group {
  margin: 0;
}

.admin-action-group + .admin-action-group {
  border-top: 1px solid rgba(130, 160, 205, .55);
  margin-top: .5rem;
  padding-top: .5rem;
}

.admin-action-message {
  display: inline-block;
}

.admin-block-form {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.admin-action-row {
  align-items: center;
  display: flex;
  gap: .35rem;
  justify-content: center;
}

.admin-action-row label {
  white-space: nowrap;
}

.admin-block-duration {
  max-width: 4.5rem;
}

.admin-action-reason-row input[name="reason"] {
  flex: 1 1 9rem;
  min-width: 0;
}

.admin-action-delete a,
.admin-unblock-form button {
  display: inline-block;
}

.admin-chat-table td {
  vertical-align: top;
}

.admin-chat-message {
  max-width: 32rem;
  overflow-wrap: anywhere;
  text-align: left;
}

.admin-chat-actions {
  min-width: 13rem;
}

.admin-chat-actions form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  margin: .15rem 0;
}

.admin-chat-actions input[type="number"] {
  max-width: 4.5rem;
}

.admin-chat-muted {
  color: #ffcc66;
  font-size: .85em;
  margin-top: .25rem;
}

td.highlight {
  border: 2px #c00 solid;
}

td.debris-highlight {
  background-color: rgba(255, 204, 74, .22);
  box-shadow: inset 0 0 0 2px #ffcc4a;
}

.home-universe-links {
  line-height: 1.5;
}

.ranking-action-heading {
  text-align: center;
  width: 3rem;
}

.ranking-action-cell {
  text-align: center;
  width: 3rem;
}

.ranking-action {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  padding: .2rem;
}

.ranking-action img {
  display: block;
  height: 1.15rem;
  width: 1.15rem;
}

.ranking-header-icon {
  display: block;
  height: 1rem;
  margin: 0 auto;
  width: 1rem;
}

.ranking-action:hover,
.ranking-action:focus {
  background-color: #46618c;
  outline: 1px solid #8da9d6;
}

.current {
  background-color: #677899;
}

.own-player {
  color: #ffdc52 !important;
}

.alliance-player {
  color: #d7a8ff !important;
}

/**
 * Texts
 */

h2 {
  font-size: 1.05rem;
}

strong {
  font-weight: bolder;
}

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

.center-block {
  margin: auto;
  width: 50%;
}

#top-bar {
  display: flex;
  margin: 1rem 0 1rem 0;
}

#top-bar-bodies > div,
#top-bar-bodies > img {
  display: inline-block;
}

#top-bar-bodies img {
  height: 55px;
  width: 55px;
}

#top-bar-body-pointers form {
  display: inline-block;
  padding-top: .25rem;
}

#top-bar-resources {
  display: flex;
  flex-grow: 1;
}

#top-bar-resources > div {
  flex-grow: 1;
  text-align: center;
}

#top-bar-resources p {
  margin: .25rem 0 0 0;
}

#sidebar {
  padding: 1rem;
}

.game-shell > #sidebar {
  background: transparent;
  height: 100vh;
  left: 0;
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  top: 0;
  width: var(--pixelonia-sidebar-width);
  z-index: 20;
}

.sidebar-game-logo {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 68px;
  max-width: 100%;
  mix-blend-mode: screen;
  object-fit: contain;
  opacity: .92;
  width: 130px;
}

.sidebar-brand-row {
  display: flex;
  justify-content: center;
  margin: 0 0 .25rem;
}

.sidebar-server-clock {
  color: #d7e8ff;
  display: block;
  font-size: 8px;
  line-height: 1.25;
  margin-top: .2rem;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.mobile-menu-toggle {
  display: none;
}

#sidebar h2 {
  font-size: 10px;
  margin: 0;
  text-align: center;
}

.sidebar-game-version {
  color: #d7e8ff;
  font-size: 9px;
  font-weight: normal;
  margin-left: .2rem;
  white-space: nowrap;
}

#sidebar li form {
  margin: 0;
}

#sidebar li button {
  background-color: #344566;
  border: 1px #415680 solid;
  border-radius: 0;
  color: #eee;
  display: block;
  font-family: inherit;
  font-size: inherit;
  padding: .35rem;
  text-align: center;
  width: 100%;
}

#sidebar li button:hover {
  background-color: #3c4d6e;
}

#site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  margin: 1.25rem 0 .75rem;
  padding: 0 .5rem;
  position: relative;
  text-align: center;
}

#site-footer .footer-btn,
#site-footer .footer-note {
  align-items: center;
  display: inline-flex;
  min-height: 26px;
  padding: .25rem .5rem;
}

#site-footer .footer-btn {
  background-color: #344566;
  border: 1px solid #415680;
  text-decoration: none;
}

#site-footer .footer-btn:hover {
  background-color: #3c4d6e;
  border-color: #234;
  text-decoration: none;
}

#site-footer .footer-note {
  color: #bbb;
  left: .5rem;
  position: absolute;
  top: 0;
}

#site-footer .footer-rugby {
  position: absolute;
  right: .5rem;
  top: 0;
}

#sidebar ul {
  list-style: none;
  padding: 0;
}

#sidebar li.admin-menu-section {
  color: #d7e8ff;
  font-size: .9rem;
  font-weight: bold;
  margin-top: .8rem;
  padding: .35rem .2rem .2rem;
  text-align: left;
  text-transform: uppercase;
}

#sidebar li.admin-menu-section:first-child {
  margin-top: 0;
}

#sidebar .sidebar-section + .sidebar-section {
  margin-top: 1rem;
}

#sidebar li a {
  background-color: #344566;
  border-left: 1px #415680 solid;
  border-right: 1px #415680 solid;
  border-top: 1px #415680 solid;
  display: block;
  padding: .35rem;
  text-align: center;
  text-decoration: none;
}

#sidebar li .sidebar-placeholder {
  background-color: #2d3d5d;
  border: 1px #415680 solid;
  color: #9ca9be;
  cursor: default;
  display: block;
  padding: .35rem;
  text-align: center;
}

.retention-notice {
  color: #b9c9e2;
  display: block;
  padding: .35rem;
  text-align: center;
}

#sidebar li:last-child a {
  border-bottom: 1px #415680 solid;
}

#sidebar li a:hover {
  background-color: #3c4d6e;
}

#sidebar li a.sidebar-unread,
#sidebar li a.sidebar-unread:hover,
#sidebar li button.sidebar-unread,
#sidebar li button.sidebar-unread:hover {
  background-color: #00b9d6;
  border-color: #69efff;
  color: #06151e;
  font-weight: bold;
  text-shadow: none;
}

.chat-panel {
  background: rgba(16, 28, 52, .98);
  border: 1px solid #6682b2;
  bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  display: none;
  flex-direction: column;
  position: fixed;
  right: 1rem;
  width: min(300px, calc(100vw - 2rem));
  z-index: 30;
}

.chat-panel-open {
  display: flex;
}

.chat-panel-header {
  align-items: center;
  background: linear-gradient(#202840, #283850);
  border-bottom: 1px solid #415680;
  display: flex;
  justify-content: space-between;
  padding: .35rem .5rem;
}

.chat-panel-header button {
  line-height: 1;
  padding: .1rem .4rem;
}

.chat-messages {
  max-height: 320px;
  min-height: 100px;
  overflow-y: auto;
  padding: .5rem;
}

.chat-message,
.chat-empty {
  border-bottom: 1px solid rgba(102, 130, 178, .45);
  margin: 0;
  padding: .35rem 0;
  overflow-wrap: anywhere;
}

.chat-message strong {
  color: #fff;
  margin-right: .35rem;
}

.chat-time {
  color: #9ca9be;
  font-size: 9px;
}

.chat-message-text {
  display: block;
  margin-top: .2rem;
}

.chat-form {
  border-top: 1px solid #415680;
  display: flex;
  gap: .35rem;
  padding: .5rem;
}

.chat-form textarea {
  flex: 1 1 auto;
  resize: vertical;
}

.tooltip {
  background-color: #344566;
  border: 1px #234 solid;
  color: #eee;
  padding: .25rem;
}

.tooltip p {
  margin: 0;
  padding-bottom: .25rem;
}

.event mark {
  background: transparent;
  color: #eee;
}

.overview-body a,
.overview-body span {
  display: block;
  padding-top: .1rem;
}

#overview-other-planets {
  display: flex;
  flex-wrap: wrap;
}

#overview-other-planets > div {
  flex-basis: 33%;
  padding-bottom: .5rem;
}

.item-image {
  width: 100px;
  height: 100px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.item-image img {
  display: block;
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  margin: 0 auto;
  object-fit: contain;
  image-rendering: auto;
}

.item-info {
  padding: .25rem;
  text-align: left;
  vertical-align: top;
}

.item-info h2,
.item-info p {
  margin: 0 0 .5rem 0;
}

.item-info > p:first-of-type {
  text-align: justify;
  text-justify: inter-word;
}

.formula-explanation {
  display: block;
  margin-top: .2rem;
  color: #b9d8ff;
  font-size: .85em;
}

.needed-satellites {
  margin-left: 1.25rem;
}

.item-actions {
  padding: .25rem;
}

.item-actions button,
.item-actions input {
  margin: .125rem;
}

.construction-levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  margin-top: .125rem;
  white-space: nowrap;
}

.construction-levels select {
  max-width: 4rem;
}

.queue-entry-actions form {
  display: inline-block;
}

#galaxy-navigation {
  display: flex;
  justify-content: center;
}

#galaxy-navigation table {
  margin: .5rem .25rem .5rem .25rem;
  width: auto;
}

#galaxy-reload,
#phalanx-reload {
  text-align: center;
}

.message {
  margin-top: .5rem;
}

#messages-pagination,
#reports-pagination {
  display: flex;
  justify-content: center;
}

#messages-pagination table,
#reports-pagination table {
  margin-top: .5rem;
  width: auto;
}

.report-actions form,
.report-actions button {
  display: inline-block;
}

.combat-report-combatants {
  margin-bottom: .5rem;
}

/* Combat report presentation: compact, centered battle tables inspired by the
 * classic OGame combat report layout. Data and report generation are unchanged. */
.combat-report-page {
  background-color: #171d2c;
  background-image: none;
}

.combat-report-container {
  min-height: 100vh;
}

.combat-report-container > div > #combat-report {
  color: #a8c7e6;
  margin: 0 auto;
  max-width: 1280px;
  padding: 1rem 1.5rem 2rem;
  text-align: center;
  width: 100%;
}

#combat-report table {
  background-color: transparent;
  margin: 0 auto;
}

#combat-report th,
#combat-report td {
  background-color: transparent;
  border-color: #536b89;
}

.combat-report-date {
  margin: 0 0 1rem;
}

.combat-report-combatants {
  margin: 0 auto 1rem;
  overflow-x: auto;
}

.combat-report-combatant {
  min-width: max-content;
  width: 100%;
}

.combat-report-combatant > tbody > tr:first-child th.combatant-title {
  border: 0;
  border-bottom: 1px solid #536b89;
  color: #7de47d;
  font-size: 1.2rem;
  font-weight: bold;
  padding: .35rem .5rem .4rem;
  text-align: center;
}

.combatant-technologies {
  border: 0;
  color: #9cb9d8;
  padding: .35rem .5rem;
}

.combatant-technologies span {
  display: inline-block;
  margin: 0 .65rem;
}

.combat-units-table {
  border-bottom: 1px solid #536b89;
  border-top: 1px solid #536b89;
  table-layout: auto;
  white-space: nowrap;
}

.combat-units-table td {
  border-left: 0;
  border-right: 0;
  padding: .18rem .5rem;
  text-align: center;
}

.combat-units-table td:first-child {
  color: #9cb9d8;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
  width: 1%;
}

/* Keep the combat-line explanations on the left while centering the ship or
 * defense names and values in the remaining width of the combat table. */
.combat-units-table td:not(:first-child) {
  text-align: center;
}

.combat-unit-small_cargo,
.combat-unit-large_cargo,
.combat-unit-battleship,
.combat-unit-colony_ship,
.combat-unit-rocket_launcher,
.combat-unit-heavy_laser {
  color: #e9ae48;
}

.combat-unit-little_fighter,
.combat-unit-heavy_fighter,
.combat-unit-solar_satellite,
.combat-unit-light_laser,
.combat-unit-small_shield_dome,
.combat-unit-large_shield_dome {
  color: #81df72;
}

.combat-unit-cruiser,
.combat-unit-recycler,
.combat-unit-espionage_probe,
.combat-unit-ion_cannon {
  color: #58c9ee;
}

.combat-unit-bomber,
.combat-unit-plasma_turret,
.combat-unit-interplanetary_missile {
  color: #ee78df;
}

.combat-unit-destroyer {
  color: #f07868;
}

.combat-unit-death_star,
.combat-unit-gaius_cannon,
.combat-unit-anti_ballistic_missile {
  color: #c3d1e2;
}

.combat-round-title {
  border-top: 1px solid #536b89;
  color: #e9ae48;
  font-size: 1.05rem;
  font-weight: bold;
  margin: 1.25rem auto .6rem;
  padding-top: .7rem;
}

.combat-report-round {
  margin-bottom: .75rem;
}

.combat-report-summary {
  border-top: 1px solid #536b89;
  margin-top: 1rem;
  padding-top: .7rem;
}

.combat-report-summary hr {
  display: none;
}

.combat-report-summary p {
  margin: .55rem 0;
}

.combat-report-summary strong {
  color: #f2a51d;
}

.wiki-fleet-propulsion {
  margin-top: .5rem;
}

.wiki-fleet-propulsion th,
.wiki-fleet-propulsion td {
  text-align: left;
}

.wiki-fleet-propulsion th:last-child,
.wiki-fleet-propulsion td:last-child {
  text-align: center;
}

.wiki-moon-diameters {
  margin-top: .5rem;
}

.wiki-moon-diameters th,
.wiki-moon-diameters td {
  text-align: center;
}

.wiki-external-bar {
  background: #344a6d;
  border: 1px solid #536b89;
  margin-top: .5rem;
  padding: .5rem;
  text-align: center;
}

.wiki-external-bar a {
  color: #fff;
  font-weight: bold;
}

.simulator-page > table,
.simulator-page > form,
.simulator-result {
  margin-bottom: .75rem;
}

.simulator-page form table,
.simulator-result > table {
  margin-bottom: .75rem;
}

.simulator-page .simulator-input-table,
.simulator-page .simulator-tech-table {
  table-layout: fixed;
}

.simulator-page .simulator-input-table th:first-child,
.simulator-page .simulator-input-table td:first-child,
.simulator-page .simulator-tech-table th:first-child,
.simulator-page .simulator-tech-table td:first-child {
  width: 42%;
}

.simulator-page .simulator-input-table input[data-numeric-input="true"],
.simulator-page .simulator-tech-table input[data-numeric-input="true"] {
  max-width: 9rem;
  width: 100%;
}

.simulator-attacker {
  color: #f0b24f;
}

.simulator-defender {
  color: #7fe47d;
}

.simulator-result {
  border-top: 1px solid #536b89;
  padding-top: .75rem;
}

.simulator-outcome {
  color: #f0b24f;
  font-size: 1.1rem;
  font-weight: bold;
}

.simulator-result-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simulator-result-grid section {
  min-width: 0;
}

.simulator-result-grid h3 {
  background: linear-gradient(#202840, #283850);
  border: 1px solid #415680;
  color: #7fe47d;
  margin: 0;
  padding: .35rem .5rem;
  text-align: center;
}

.simulator-result-grid table {
  margin: 0;
}

@media (max-width: 767px) {
  .simulator-result-grid {
    grid-template-columns: 1fr;
  }
}

.error {
  color: red;
}

.date {
  color: #5f5;
}

.requirement-not-met {
  color: red;
}

.requirement-met {
  color: #8f0;
}

.no-capacity, .no-energy {
  color: red;
}

.storage-alert {
  display: inline-block;
  margin-right: .15rem;
  padding: 0 .18rem;
  border: 1px solid #ffd34d;
  border-radius: 50%;
  background: #c00;
  color: #fff;
  font-size: .7rem;
  font-weight: bold;
  line-height: 1.1;
  vertical-align: 1px;
}

#top-bar-resources img.resource-metal {
  filter: sepia(1) saturate(2.2) hue-rotate(350deg) brightness(1.12);
}

#top-bar-resources img.resource-crystal {
  filter: none;
}

#top-bar-resources img.resource-deuterium {
  filter: none;
}

#top-bar-resources img.resource-energy {
  filter: sepia(1) saturate(3.2) hue-rotate(315deg) brightness(1.1);
}

#top-bar-resources img.resource-pixel {
  filter: none;
}

.own-attack, .own-destroy {
  color: #0ff;
}

.own-colonization, .own-harvest {
  color: #8f0;
}

.own-deployment, .own-transport {
  color: #0f0;
}

.own-espionage {
  color: #0f8;
}

.own-hold {
  color: #8f8;
}

.foreign-attack, .foreign-destroy {
  color: #f00;
}

.foreign-colonization, .foreign-harvest {
  color: #f88;
}

.foreign-deployment, .foreign-transport {
  color: #ff0;
}

.foreign-espionage {
  color: #f80;
}

.foreign-hold {
  color: #ff8;
}

/* Keep the mission-specific colours while making the direction of travel
   immediately distinguishable: outbound events are brighter and returning
   events are slightly muted. */
.event.flight-event-arriving {
  filter: brightness(1.08);
}

.event.flight-event-returning {
  filter: brightness(.84);
}

.vacation {
  color: #6cf;
}

.banned {
  text-decoration: line-through;
}

.noob {
  color: #0f0;
}

.strong {
  color: #f00;
}

.short-inactive {
  color: #FFB266;
}

.long-inactive {
  color: #A0A0A0;
}

.record-new {
  color: #0f0;
}

.win {
  color: #0f0;
}

.loss {
  color: #f00;
}

.draw {
  color: #ff0;
}

/* Resource and duration colors used throughout the game UI and tooltips. */
.resource-metal {
  color: #ffdc52 !important;
}

.resource-crystal {
  color: #9edcff !important;
}

.resource-deuterium {
  color: #73e39a !important;
}

.resource-pixel {
  color: #c084ff !important;
}

.resource-energy {
  color: #ff7777 !important;
}

.construction-time,
.construction-time span,
.construction-time strong {
  color: #63e6ff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .9);
}

.research-time,
.research-time span,
.research-time strong {
  color: #63e6ff !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .9);
}

.public-language-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px auto 12px;
  font-size: 11px;
}

.public-language-switcher a {
  padding: 2px 6px;
  border: 1px solid #6d84aa;
  background: #30466b;
  color: #fff;
  text-decoration: none;
}

.public-language-switcher a:hover {
  background: #46638f;
}

/* Optional smartphone layout. It is enabled only through the player's
 * settings and therefore leaves the desktop layout unchanged by default. */
body.smartphone-mode {
  overflow-x: hidden;
}

body.smartphone-mode.mobile-menu-open {
  overflow: hidden;
}

body.smartphone-mode .game-shell {
  display: block;
  min-height: 100vh;
}

body.smartphone-mode .game-shell > div {
  height: auto;
  margin-left: 0;
  min-height: 100vh;
  overflow: visible;
}

body.smartphone-mode .game-shell > div > div,
body.smartphone-mode .container > div > div {
  margin-left: auto;
  margin-right: auto;
  max-width: none;
  min-width: 0;
  padding-left: .5rem;
  padding-right: .5rem;
  width: 100%;
}

body.smartphone-mode #sidebar {
  background: transparent;
  height: 0;
  left: 0;
  overflow: visible;
  padding: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 40;
}

/* The drawer gets its own opaque scrim while open.  This keeps the page
 * underneath from showing through the navigation and prevents accidental
 * taps on the content behind it. */
body.smartphone-mode #sidebar.mobile-menu-open {
  background: rgba(5, 10, 20, .9);
  height: 100vh;
  height: 100dvh;
  pointer-events: auto;
}

body.smartphone-mode .mobile-menu-toggle {
  display: block;
  left: .5rem;
  min-height: 2.4rem;
  padding: .45rem .7rem;
  pointer-events: auto;
  position: fixed;
  top: .5rem;
  z-index: 43;
}

body.smartphone-mode .sidebar-brand-row {
  left: 50%;
  margin: 0;
  pointer-events: none;
  position: fixed;
  top: .35rem;
  transform: translateX(-50%);
  width: 105px;
  z-index: 41;
}

body.smartphone-mode .sidebar-game-logo {
  max-height: 52px;
  width: 94px;
}

body.smartphone-mode #sidebar-navigation {
  background: rgba(16, 28, 52, .98);
  border-right: 1px solid #6682b2;
  box-shadow: 8px 0 24px rgba(0, 0, 0, .5);
  height: 100vh;
  height: 100dvh;
  left: 0;
  max-width: 300px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 3.5rem .75rem 1rem;
  pointer-events: auto;
  position: fixed;
  top: 0;
  transform: translateX(-105%);
  transition: transform .2s ease-out;
  width: min(88vw, 300px);
  z-index: 42;
}

body.smartphone-mode #sidebar.mobile-menu-open #sidebar-navigation {
  transform: translateX(0);
}

body.smartphone-mode #sidebar-navigation h2 {
  margin-top: .25rem;
}

body.smartphone-mode #sidebar .sidebar-section + .sidebar-section {
  margin-top: .6rem;
}

body.smartphone-mode #sidebar li a,
body.smartphone-mode #sidebar li button {
  min-height: 2.5rem;
  padding: .6rem .4rem;
}

body.smartphone-mode #top-bar {
  background: rgba(5, 12, 25, .64);
  border: 1px solid rgba(89, 119, 164, .75);
  border-radius: .2rem;
  display: grid;
  gap: .5rem;
  grid-template-columns: 1fr;
  margin: 3.65rem 0 .75rem;
  padding: .4rem;
}

body.smartphone-mode #top-bar-bodies {
  align-items: center;
  background: rgba(40, 58, 91, .82);
  border: 1px solid #52698e;
  display: grid;
  gap: .35rem;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto;
  justify-content: stretch;
  min-width: 0;
  padding: .3rem;
}

body.smartphone-mode #top-bar-bodies > img {
  grid-row: 1 / span 2;
}

body.smartphone-mode #top-bar-bodies > div {
  display: grid;
  gap: .3rem;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

body.smartphone-mode #top-bar-bodies select {
  font-size: 12px;
  max-width: none;
  min-height: 2.25rem;
  width: 100%;
}

body.smartphone-mode #top-bar-bodies img {
  align-self: center;
  height: 48px;
  width: 48px;
}

body.smartphone-mode #top-bar-body-pointers {
  display: flex;
  gap: .3rem;
}

body.smartphone-mode #top-bar-body-pointers form {
  flex: 1 1 0;
  padding-top: 0;
}

body.smartphone-mode #top-bar-body-pointers button {
  min-height: 2.1rem;
  padding: .25rem .5rem;
  width: 100%;
}

body.smartphone-mode #top-bar-resources {
  align-items: stretch;
  display: grid;
  gap: .25rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.smartphone-mode #top-bar-resources > div {
  background: rgba(39, 57, 89, .92);
  border: 1px solid #52698e;
  border-radius: .15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: .25rem .1rem;
}

body.smartphone-mode #top-bar-resources img {
  height: 30px;
  max-width: 100%;
  object-fit: contain;
  width: 30px;
}

body.smartphone-mode #top-bar-resources p {
  font-size: 10px;
  line-height: 1.15;
  margin: .15rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.smartphone-mode #top-bar-resources p:last-child {
  font-size: 11px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

body.smartphone-mode table {
  font-size: 11px;
  table-layout: auto;
}

body.smartphone-mode th,
body.smartphone-mode td {
  overflow-wrap: anywhere;
  padding: .35rem .25rem;
}

body.smartphone-mode form table td:first-child {
  white-space: normal;
}

body.smartphone-mode input,
body.smartphone-mode select,
body.smartphone-mode textarea {
  max-width: 100%;
}

body.smartphone-mode button,
body.smartphone-mode a.btn {
  min-height: 2.25rem;
}

body.smartphone-mode .item-image,
body.smartphone-mode .item-image img {
  height: 76px;
  max-height: 76px;
  max-width: 76px;
  width: 76px;
}

body.smartphone-mode .item-info > p:first-of-type {
  text-align: left;
}

body.smartphone-mode #overview-other-planets > div {
  flex-basis: 50%;
}

body.smartphone-mode #galaxy-navigation {
  flex-wrap: wrap;
  gap: .25rem;
}

body.smartphone-mode #galaxy-navigation table {
  margin: .25rem 0;
  width: auto;
}

body.smartphone-mode .chat-panel {
  bottom: .5rem;
  left: .5rem;
  max-height: 78vh;
  max-height: 78dvh;
  right: .5rem;
  width: auto;
}

body.smartphone-mode .chat-messages {
  max-height: 55vh;
  max-height: 55dvh;
}

body.smartphone-mode #site-footer {
  gap: .25rem;
  margin-bottom: .5rem;
  margin-top: .75rem;
}

@media (max-width: 767px) {
  #site-footer .footer-note {
    position: static;
  }

  #site-footer .footer-other-games {
    position: static;
  }

  .other-games-shell {
    padding: .5rem;
  }

  .other-games-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-language-switcher {
    align-self: flex-end;
  }

  .hub-nav-label {
    order: -1;
    text-align: center;
  }

  .other-games-brand {
    gap: 1rem;
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .other-games-brand-logo img {
    width: min(220px, 70vw);
  }

  .other-games-brand-copy {
    border-left: 0;
    border-top: 1px solid rgba(131, 162, 221, .45);
    font-size: .95rem;
    padding: 1rem .25rem .25rem;
    text-align: center;
  }

  .other-games-grid {
    grid-template-columns: 1fr;
  }

  .other-game-card {
    gap: .75rem;
    grid-template-columns: minmax(112px, .72fr) 1.28fr;
    padding: .75rem;
  }

  .other-game-logo-frame {
    height: 86px;
  }

  .other-game-logo {
    height: 66px;
  }
}

/* Administration layout: keep the navigation in a compact left rail and
 * reserve the main column for the selected administration page. */
@media (min-width: 768px) {
  .admin-shell {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: var(--pixelonia-sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
  }

  .admin-shell > #sidebar {
    align-self: start;
    height: calc(100vh - 2rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem .5rem;
    position: sticky;
    top: 1rem;
    width: var(--pixelonia-sidebar-width);
  }

  .admin-shell > div {
    min-width: 0;
  }

  .admin-shell > div > div {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .admin-shell {
    display: flex;
    flex-direction: column;
    gap: .5rem;
  }

  .admin-shell > #sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: .5rem;
    position: static;
    width: 100%;
  }

  .admin-shell > div,
  .admin-shell > div > div {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
}

/* The optional smartphone mode uses a drawer for the game rail.  The admin
 * rail remains a normal document block so that every administration link is
 * immediately available above the selected page. */
@media (max-width: 767px) {
  body.smartphone-mode .admin-shell > #sidebar {
    background: transparent;
    height: auto;
    left: auto;
    overflow: visible;
    padding: .5rem;
    pointer-events: auto;
    position: static;
    top: auto;
    width: 100%;
  }
}
/* Record legend */
.records-legend {
  color: #b8c8e8;
  font-size: .85em;
  text-align: center;
}

/* Administrative bulk level controls */
.admin-multi-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 4px 12px;
  text-align: left;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px 8px;
}

.admin-multi-select label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-multi-select input[type="checkbox"] {
  width: auto;
}

.combat-result-won { color: #39e36d; font-weight: 700; }
.combat-result-draw { color: #ffb347; font-weight: 700; }
.combat-result-lost { color: #ff5555; font-weight: 700; }

.expedition-position {
  background: rgba(116, 72, 165, .28);
  color: #e0c7ff;
}

.expedition-position a {
  color: #e7c9ff;
  font-weight: 700;
}
