:root {
  --text-color: rgba(255, 255, 255, 0.87);
  --primary-color: #489dd9;
  --primary-hovered: #3e93cf;
  --sans-font: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  --background: #2b2a33;
  --background-dark: #1f1e24;

  font-family: var(--sans-font);
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: var(--text-color);
  background-color: var(--background);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
  width: 100%;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
  text-align: center;
}

h2 {
  font-size: 2.2em;
  line-height: 1.1;
  text-align: center;
}

input,
select {
  accent-color: var(--primary-color);
}

select {
  min-width: 3em;
}

input[type='number'] {
  width: 5em;
}

.main-panel {
  width: 300px;
  margin: auto;
}

.center {
  display: flex;
  align-items: center;
}

.configuration-panel {
  width: 500px;
  margin: auto;
  line-height: 1.75em;
}

button,
a.button,
input[type='submit'] {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--background-dark);
  cursor: pointer;
  transition: border-color 0.25s;
  color: var(--text-color);
  flex-grow: 1;
  text-align: center;
}

button:hover,
a.button:hover,
input[type='submit']:hover {
  border-color: var(--primary-color);
}

button:focus,
a.button:focus,
input[type='submit']:focus,
button:focus-visible,
a.button:focus-visible,
input[type='submit']:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

a,
a.button.primary,
button.primary,
input[type='submit'].primary.primary {
  color: var(--primary-color);
  text-decoration: inherit;
}

a:hover,
a.button.primary:hover,
button.primary:hover,
input[type='submit'].primary:hover {
  color: var(--primary-hovered);
}

.half-width {
  width: 50%;
}

form {
  text-align: left;
}

form h2 {
  border-bottom: 1px solid currentColor;
}

.fieldset {
  margin-inline: 2px;
  border-radius: 8px;
  padding: 0.75em;
  border-color: color-mix(in srgb, currentColor 50%, #000 50%);
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  margin-top: 0.75em;
}

fieldset {
  border-color: color-mix(in srgb, currentColor 50%, #000 50%);
  border-width: 1px;
  border-radius: 8px;
}

fieldset.no-text {
  padding-block: 0.75em;
  margin-top: 0.75em;
}

.buttons {
  display: flex;
  gap: 0.75em;
}

.column {
  flex-direction: column;
}

input.big {
  display: block;
  height: 2em;
  margin-inline: 2px;
  border-radius: 8px;
  padding-inline: 0.5em;
  font-size: 2em;
  border-color: color-mix(in srgb, currentColor 50%, #000 50%);
  border-width: 1px;
  border-radius: 8px;
  background: transparent;
}

input.big {
  font-family: monospace;
}

.code-input {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1em;
}

@media (prefers-color-scheme: light) {
  :root {
    --text-color: #213547;
    --primary-color: #216da3;
    --background: #eeeeee;
    --background-dark: #dddddd;
  }

  fieldset {
    border-color: color-mix(in srgb, currentColor 50%, #fff 50%);
  }
}

#game-canvas {
  width: 100%;
  height: 100%;
}

table {
  display: inline-block;
  border-collapse: collapse;
  margin-right: 10px;
}

td,
th {
  border: 1px solid rgb(117, 116, 122);
  padding: 5px;
  text-align: center;
}

tr:hover {
  background: rgba(117, 116, 122, 0.25);
}

tbody tr td:nth-child(3) input,
tbody tr td:nth-child(3) select {
  font-family: monospace;
}

/* tfoot td {
  border-style: none;
}

tfoot tr:hover {
  background: transparent;
} */

.error,
.warning,
.message,
.success {
  padding: 5px 10px;
  margin: 10px 0;
  border-radius: 8px;
}

.error {
  background: #d1105a55;
  border-left: 3px solid #d1105a;
}

.warning {
  background: #d1841055;
  border-left: 3px solid #d18410;
}

.message {
  background: #10b7d155;
  border-left: 3px solid #10b7d1;
}

.success {
  background: #08b93a55;
  border-left: 3px solid #08b93a;
}

input+label,
select+label,
input+input,
select+input,
input+select,
select+select {
  margin-left: 0.5em;
}

br+label+br+select {
  margin-left: 0.5em;
}
