:root {
  --blue: #1565c0;
  --red: #b00020;
  --green: #0b8043;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/AtkinsonHyperlegibleNext-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/AtkinsonHyperlegibleNext-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  padding: 2rem 0 0 0;
  font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body, p, td, th, input, select {
  font-size: 14pt;
}

h1 {
  font-size: 20pt;
  line-height: 1.3em;
}

main {
  flex: 1;
  max-width: 640px;
  margin: auto;
  padding: 0 5px 6rem 5px;
}

footer {
  background: #f1f1f1;
  padding: 15px 5px 35px;
  line-height: 1em;
  color: #555;
}

footer .footer-slot {
  max-width: 640px;
  margin: auto;
  font-size: 75%;
}

form {
  label {
    display: block;
    font-weight: bold;
  }

  input + label {
    line-height: 1em;
  }

  input[type=text] {
    margin-bottom: 1.5rem;
    display: block;
    width: 100%;
    padding: 0.1rem 0.2rem;
  }

  input[type=checkbox] {
    transform: scale(1.3);
    margin-right: 0.4rem;
  }

  select {
    display: block;
    margin-bottom: 1.5rem;
    width: 100%;
    padding: 3px;
  }

  button {
    margin-top: 2rem;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    cursor: pointer;
  }
}

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-top: 3rem;
}

table td {
  vertical-align: middle;
  padding: 20px 5px;
}

table td:first-child {
  padding-left: 10px;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

table td:last-child {
  padding-right: 10px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

table td.rank-cell {
  white-space: nowrap;
  width: 0.1%;
  vertical-align: middle;
}

table td.rank-cell .badge {
  font-family: 'Courier New', Courier, monospace;
  height: 22px;
  width: 22px;
  font-size: 12pt;
  letter-spacing: -1px;
  font-weight: bold;
  color: white;
  background: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  border-radius: 4px;
}

tr:hover {
  background: #eaeaea;
  cursor: pointer;
}

.back-button {
  margin-top: 2rem;
  display: inline-block;
  font-size: 90%;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:visited {
  color: var(--blue);
}

.result-card {
  font-size: 90%;
}

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

.result-row--player {
  overflow: clip;
  max-width: 150%;
  text-overflow: ellipsis;
}

.result-row > * {
  display: flex;
  align-items: center;
}

.result-row--white-square {
  width: 16px;
  height: 16px;
  background-color: #fff;
  border: 1px solid #666;
  display: inline-block;
  margin-right: 8px;
}

.result-row--black-square {
  width: 16px;
  height: 16px;
  background-color: #000;
  border: 1px solid #666;
  display: inline-block;
  margin-right: 8px;
}

.result-row--result {
  font-family: 'Courier New', Courier, monospace;
}

.result-row--result.winner {
  color: var(--green);
}

.result-row--result.loser {
  color: var(--red);
}

.acpl {
  font-weight: bold;
  margin-bottom: .5rem;
}

.game-id, .date, .moves {
  font-size: 80%;
}

.opening {
  font-size: 80%;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 7px;
}

.message {
  color: #b00020;
  white-space: pre-line;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

@media (max-width: 420px) {
  td {
    font-size: 12pt;
  }
}
