/*
 The shared look of the game: blocks, tables, buttons and fields, menu, messages, galaxy and report colours, all on
 the palette variables (:root below, a theme's own values on :root in its formate.css). It comes after main.css and
 before the theme's formate.css, which keeps its images and what really is its own.
 */

:root {
  /* The palette every theme starts from; a theme gives these its own values on :root in its formate.css. */
  --font-family: Verdana, Geneva, Tahoma, sans-serif;
  --font-size: 12px;
  --surface-page: #0d0d0d;
  --surface: rgba(13, 16, 20, 0.95);
  --surface-header: rgba(13, 16, 20, 0.95);
  --surface-alt: #1e2530;
  --surface-block: rgba(21, 25, 30, 0.95);
  --surface-title: #161618;
  --surface-raised: #212428;
  --surface-control: #2a2e31;
  --surface-input: var(--surface-control);
  --surface-heading: linear-gradient(180deg, rgba(20, 30, 38, 1) 43%, rgb(6 7 8) 100%);
  --border-strong: #000;
  --border: #444;
  --border-control: #ffeec0;
  --text: #fff;
  --text-soft: #ddd;
  --text-input: var(--text);
  --accent: #2cbbf7;
  --accent-alt: #00d2be;
  --notice: rgba(32, 140, 129, 0.77);
  --metal: #ff3300;
  --crystal: #00a6ff;
  --deuterium: #399151;
  --icon-button-bg: var(--surface-control);
  --icon-button-border: var(--border-control);
  --icon-button-color: var(--text);
  --icon-button-hover: var(--accent);
  --control-radius: 0;
  --surface-cell: var(--surface);
  --block-radius: 15px;
  --title-padding: 5px;
  --title-gap: 8px;
  --heading-align: left;
  --block-border: none;
  --title-align: center;
  --title-weight: normal;
  --block-padding: 0 0 5px;
  --block-gap: 10px;
  --block-shadow: none;
  --cell-blur: none;
  --cell-spacing: 2px;
  --cell-border-style: solid;
  --surface-tutorial: var(--notice);
  --surface-tutorial-header: var(--surface-trade-disallowed);
  --notice-border: none;
  --notice-shadow: none;
  --notice-blur: none;
  --image-border: 0;
  --image-shadow: none;
  --font-weight: normal;
  --letter-spacing: normal;
  --line-height: 14px;
  --control-blur: none;
  --heading-variant: normal;
  --control-shadow: none;
  --control-hover-filter: none;
  --menu-item-bg: transparent;
  --menu-item-border: none;
  --menu-item-shadow: none;
  --menu-item-blur: none;
  --menu-item-margin: 0;
  --menu-item-hover-bg: var(--row-hover);
  --menu-item-hover-border: var(--menu-item-border);
  --menu-item-active-bg: var(--row-active);

  /* States, players and alliances, honor ranks */
  --success: #0f0;
  --success-soft: #addc8d;
  --danger: #f00;
  --warning: orange;
  --highlight: #ff0;
  --info: #87ceeb;
  --loss: #ee4d2e;
  --federation: rgb(51, 153, 102);
  --ticket-open: green;
  --drive-upgrade-1: #ff0;
  --drive-upgrade-2: pink;
  --player-noob: #a0ffa0;
  --player-strong: #ffa0a0;
  --player-inactive: #ccc;
  --player-longinactive: #999;
  --player-vacation: #659ec7;
  --ally-member: #99ff66;
  --ally-friend: #99ffff;
  --ally-trade: #28fab0;
  --ally-secret: #ff66ff;
  --honor-top1: gold;
  --honor-top: #1b6f1b;
  --honor-low: #7f06fb;
  --honor-low1: #920505;
  --medal-bronze: #8c7853;
  --surface-trade-disallowed: #001004;
  --control-selected: #1c1fd3;
  --progress-bg: #55386b;
  --progress-texture: url(../../images/processbar.gif);
  --page-image-position: center;

  --layout-top-height: 100px;
  --layout-gap: 16px;
  --text-muted: #7f7f7f;
  --row-hover: rgba(255, 255, 255, 0.05);
  --row-active: var(--surface-alt);
  --divider: rgba(255, 255, 255, 0.12);
  --scrollbar: rgba(255, 255, 255, 0.25) transparent;
  --notice-error: rgba(178, 40, 40, 0.8);
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

/* The page background. A theme gives only its image, as html { background-image: url(img/…) } in its formate.css: a
   url() in a variable resolves against the stylesheet that uses it, so it can't come from the theme as a variable. */
html {
  background: no-repeat fixed var(--page-image-position) var(--surface-page);
  background-size: cover;
}

body {
  font-size: var(--font-size);
  font-family: var(--font-family);
  font-weight: var(--font-weight);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--letter-spacing);
  line-height: var(--line-height);
}

body, input, select, button, textarea, a, a:visited, .link-button {
  color: var(--text);
}

/* Without weight, so a colour class on a cell still wins though the header declares those before this file. */
:where(.cell, .head-cell) {
  color: var(--text);
}

body.mceContentBody, input, button, select, option, textarea, .ui-widget-content {
  background: var(--surface-control);
  padding: 2px;
}

/* Fields to type or pick in, apart from the buttons */
body.mceContentBody, input:not([type="button"], [type="submit"], [type="reset"], [type="radio"], [type="checkbox"]), select, option, textarea {
  background: var(--surface-input);
  color: var(--text-input);
}

/* The open list of a select in the colours and shape of the theme, where the browser lets a page style it; the others
   keep their own list. There a select is as wide as its chosen option, not its longest. */
@supports (appearance: base-select) {
  select:not([multiple], [size]),
  select:not([multiple], [size])::picker(select) {
    appearance: base-select;
  }

  select:not([multiple], [size]) {
    position: relative;
    overflow: hidden;
    padding-right: 18px;
    white-space: nowrap;
  }

  /* over the end of a chosen option too long for its select, which would push it out of sight */
  select:not([multiple], [size])::picker-icon {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding-inline: 3px;
    background: inherit;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  select:not([multiple], [size])::picker(select) {
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
    background: var(--surface);
    color: var(--text);
  }

  select:not([multiple], [size]) option {
    padding: 3px 6px;
    background: none;
    color: inherit;
    white-space: nowrap;
  }

  select:not([multiple], [size]) option:checked,
  select:not([multiple], [size]) option:hover,
  select:not([multiple], [size]) option:focus-visible {
    outline: 0;
    background: var(--row-active);
  }

  select:not([multiple], [size]) option::checkmark {
    display: none;
  }
}

input[type="radio"] {
  background: transparent;
  border: 0 none;
}

#menu {
  max-width: 180px;
}

a:hover, .link-button:hover {
  color: var(--text);
  text-decoration: underline;
}

.cell {
  font-weight: 400
}

img {
  border: var(--image-border);
  border-radius: 0;
  box-shadow: var(--image-shadow);
}

/* Tailwind's preflight makes every image a block; in a cell an icon follows the cell's alignment again, like the
   envelope in the statistics or the buttons of the buddy list. */
.grid-table .cell img, .grid-table .head-cell img {
  display: inline-block;
}

input, select, textarea, button {
  border: 1px solid var(--border-control);
}

button.selected {
  border: 1px solid var(--control-selected);
}

.head-cell input, .tip, .cell {
  border: 1px var(--cell-border-style) var(--border-strong);
}

.tip, .cell {
  text-align: center;
  background: var(--surface-cell);
  -webkit-backdrop-filter: var(--cell-blur);
  backdrop-filter: var(--cell-blur);
}

input, button {
  text-align: center
}

input[type="submit"], input[type="button"], button {
  box-shadow: var(--control-shadow);
}

input, select, textarea, button {
  -webkit-backdrop-filter: var(--control-blur);
  backdrop-filter: var(--control-blur);
}

input[type="submit"]:hover, input[type="button"]:hover, button:hover {
  filter: var(--control-hover-filter);
}

.head-cell, .ui-widget-header {
  background: var(--surface-heading);
  color: var(--text);
  font-weight: 700;
  font-variant-caps: var(--heading-variant);
  text-align: var(--heading-align);
  border: 1px solid var(--border-strong);
}

.trade-disallowed > .cell {
  background: var(--surface-trade-disallowed);
}

.no-background, .no-background > .cell, .no-background > .head-cell {
  background-image: none;
  background: transparent;
}

.center {
  text-align: center;
}

.no-border, .no-border > .cell, .no-border > .head-cell {
  border: 0px;
}

.head-cell a:hover, .ui-widget-header a:hover {
  color: var(--text);
  text-decoration: underline;
  font-weight: bold;
}

textarea {
  background: transparent;
}

select {
  border: 1px solid var(--surface-block)
}

.admin {
  color: var(--danger);
}

.mod {
  color: var(--highlight);
}

.ops {
  color: var(--info);
}

.galaxy-alliance-member {
  color: var(--ally-member);
}

.galaxy-alliance-friend, .galaxy-friend {
  color: var(--ally-friend);
}

.galaxy-alliance-trade {
  color: var(--ally-trade);
}

.galaxy-alliance-enemy {
  color: var(--danger);
}

.galaxy-alliance-secret {
  color: var(--ally-secret);
}

.galaxy-short-noob,
.galaxy-username-noob {
  color: var(--player-noob)
}

.galaxy-short-strong,
.galaxy-username-strong {
  color: var(--player-strong)
}

.galaxy-short-inactive,
.galaxy-username-inactive {
  color: var(--player-inactive)
}

.galaxy-short-longinactive,
.galaxy-username-longinactive {
  color: var(--player-longinactive)
}

.galaxy-short-vacation,
.galaxy-username-vacation {
  color: var(--player-vacation)
}

.galaxy-short-banned {
  text-decoration: line-through
}

/* The places of a podium, like in the hall of fame */
.gold {
  color: var(--honor-top1);
}

.silver {
  color: var(--text-soft);
}

.bronze {
  color: var(--medal-bronze);
}

.colony, .deploy, .harvest, .transport, .success {
  color: var(--success)
}

/* The build button looks like every other button of the theme, only larger as the main action of its card */
.build_submit {
  text-align: center;
  font-weight: bold;
  padding: 3px;
  min-width: 150px;
  min-height: 35px;
}

.onlist {
  color: var(--text-soft);
  border: 0px;
  background: none;
  min-width: 0px;
  min-height: 0px;
}

/** LOGO **/

.logo .layout-inner {
  background: var(--surface-header);
  border-bottom: 1px solid var(--border-strong);
}

/** MENU **/

nav a {
  text-align: center;
  background: var(--surface-control);

}

nav a:hover {
  color: var(--accent);
}

div#disclamer a {
  background: unset;
  border-top: unset;
}

.tip .head-cell {
  text-align: center
}

.transparent, .cell.transparent {
  background: transparent;
  border: none;
  filter: none !important;
}

a, .link-button {
  text-decoration: none
}

.head-cell a, .res_current, .head-cell .link-button {
  color: var(--text)
}

.attack, .error {
  color: var(--danger)
}

.federation {
  color: var(--federation)
}

.raportWin {
  color: var(--success);
}

.raportLose {
  color: var(--danger);
}

.ui-progressbar-value {
  border-color: var(--border-strong);
  background-image: var(--progress-texture);
  background-position: top left;
}

.spyRaportContainerHead {
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  margin: 3px 0;
  padding: 3px;
}

.spyRaportContainerRow {
  border-top: 1px solid var(--text-soft);
}

.spyRaportContainerHead + .spyRaportContainerRow {
  border-top: 0 none;
}

.message-box {
  margin: 0 0 0 744px;
  position: fixed;
  top: 100px;
  max-width: 175px;
}

.message {
  background-color: var(--notice);
  padding: 8px;
  text-align: center;
  border: var(--notice-border);
  border-radius: var(--block-radius) 0 var(--block-radius) var(--block-radius);
  box-shadow: var(--notice-shadow);
  -webkit-backdrop-filter: var(--notice-blur);
  backdrop-filter: var(--notice-blur);
  height: fit-content;
  margin-bottom: 5px;
}

@media screen and (min-width: 700px) and (max-width: 1600px) {
  .message-box {
    right: 10.5%;
    margin: 0;
  }
}

@media screen and (max-width: 699px) {
  .message-box {
    bottom: 0;
    width: 100%;
    max-width: unset;
    top: unset;
    margin: 0;
  }

  .message {
    border-radius: var(--block-radius) var(--block-radius) 0 0;
    margin-top: 5px;
    margin-bottom: 0px;
  }

}

.planeto {
  background: var(--surface-title);
  text-align: var(--title-align);
  font-weight: var(--title-weight);
  font-variant-caps: var(--heading-variant);
  border-radius: var(--block-radius) var(--block-radius) 0 0;
  padding: var(--title-padding);
  margin-bottom: var(--title-gap);
}

.infos {
  text-align: center;
  background: var(--surface-block);
  border: var(--block-border);
  border-radius: var(--block-radius);
  box-shadow: var(--block-shadow);
  margin-top: var(--block-gap);
  overflow: auto;
  height: auto;
  padding: var(--block-padding);
}

.moon {
  float: left;
  width: 30%;
  padding: 10px;

}

.planeth {
  line-height: 1.4;
  padding: 10px;
}

.planeth img {
  margin: 8px;
}

.bulida {
  float: left;
  width: 35%;
  line-height: 1.4;
  padding: 8px;
  height: 69px;
  border-bottom: solid 1px var(--accent-alt);
}

.buildb {
  float: left;
  width: 65%;
  line-height: 1.4;
  padding: 12px;
  height: 69px;
  border-bottom: solid 1px var(--accent-alt);
}

.buildl {
  float: left;
  width: 50%;
  line-height: 1.4;
  padding: 10px;
  text-align: center;
  height: auto;
}

.shipl {
  margin-top: 10px;
  padding: 10px;
  overflow: auto;
  border: none;
  border-radius: var(--block-radius);
}

input:hover {
  color: var(--accent);
}

.ui-progressbar, .ui-progressbar-value {
  border-radius: 5px;
}

.ui-progressbar {
  background: var(--progress-bg);
}

@media screen and (max-width: 520px) {

  div .buildb {
    border: none;
  }

  div .bulida {
    border: none;
  }
}

input:invalid, textarea:invalid {
  background-color: var(--surface-input);
}
