.ui-helper-hidden-accessible {
  display: none;
}

html {
  font-family: Arial, Helvetica, Sans-serif;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--surface-background);
  height: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
}

p {
  margin: 10px 0;
}

strong {
  font-weight: 700;
}

b {
  font-weight: 700;
}

.weak {
  color: #999;
}

h1 {
  font-family: 'Acme';
}

h2 {
  font-family: 'Acme';
}

.background {
  background: var(--surface-background);
}

#main_body {
  width: 100%;
  min-height: 100%;
  min-width: 0;
  max-width: 1280px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px 20px rgba(0, 0, 0, 0.1);
  background: white;
}

body:not(.game_layout):not(.games_index_layout) > #main_body {
  box-sizing: border-box;
  padding-bottom: var(--footer-height, 52px);
}

td {
  padding: 10px 0;
}

a {
  color: #000;
  text-decoration: none;
}

.odd {
  background: aliceblue;
}

.even {
  background: #fff;
}

.links_out {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: 1280px;
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: 52px;
  justify-content: center;
  border-top: 3px solid var(--btn-primary);
  background: #263442;
  color: #aebdca;
  flex: none;
  margin-top: auto;
  font-size: 13px;

  .footer_inner {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1100px;
    padding: 10px 20px;
  }

  .footer_brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f3f8fc;
    font: 18px 'Acme';
  }

  .footer_android_icon {
    width: 20px;
    height: 20px;
    flex: none;
  }

  .footer_credit {
    white-space: nowrap;
  }

  a {
    color: #f3f8fc;
    text-decoration: none;
    font-weight: 700;

    &:hover, &:focus-visible {
      color: #8bd6fa;
      text-decoration: underline;
    }
  }
}

.links_out .app_footer_brand {
  display: none;
}

.games_index_layout .links_out {
  position: static;
  transform: none;
}

.games_index_layout > #main_body {
  align-self: flex-start;
}

.games_index_layout #content_wrapper {
  overflow: visible;
}

.native-app .links_out {
  .app_download_link {
    display: none;
  }

  .app_footer_brand {
    display: inline;
  }
}

.no_data {
  clear: both;
  text-align: center;
  color: #333;
  margin: 20px;
  padding: 20px;
  font-family: 'Acme';

  a {
    color: #333;
    text-decoration: underline;

    &:hover {
      color: dodgerblue;
    }
  }
}

.online {
  color: var(--online-green);
  cursor: pointer;
  display: block;
  line-height: 1;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.65);
  text-shadow: none;
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 1;

  &::before {
    visibility: hidden;
  }
}

.my_turn, .view_fin {
  left: 52px;
  bottom: 3px;
  top: auto;
}

.tp, .trp, .bp, .dp, .difference, .chain {
  cursor: pointer
}

.page_title {
  margin: 8px 0;
  font-size: 2em;
}

.page_subtitle {
  font-size: 1.5em;
  margin: 5px 0;
}

.dangerous {
  font-size: 0.8em;
  color: crimson;
}

@keyframes appear-then-fade {
  100% {
    opacity: 0;
    max-height: 0;
    display: none;
  }
  0%, 90% {
    opacity:1;
    max-height: 100%;
  }
}

#flash_area {
  position: fixed;
  z-index: 100;
  top: 58px;
  width: calc(100% - 24px);
  max-width: 1256px;
  margin-inline: 12px;
  box-sizing: border-box;
  border: 1px solid #bdd5e6;
  border-left: 4px solid #2986b8;
  border-radius: 12px;
  background: #f1f8fd;
  text-align: left;
  font-size: 17px;
  font-family: 'Acme';
  color: #263746;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(25, 48, 68, 0.16);
  animation: appear-then-fade 4s both;

  .inner_flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
  }

  .flash_icon {
    flex: none;
    color: #2986b8;
    font-size: 20px;
  }

  .flash_messages {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .flash_content {
    display: block;
  }

  a {
    color: #176b96;
    text-decoration: underline;
  }

  .flashx {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #bdd5e6;
    border-radius: 8px;
    background: #fff;
    color: #526171;
    cursor: pointer;
    font-size: 16px;

    &:hover {
      border-color: #2986b8;
      color: #176b96;
      background: #e8f4fc;
    }

    &:focus-visible {
      outline: 2px solid #2986b8;
      outline-offset: 2px;
    }
  }
}

.game_background, .game_layout {
  #flash_area {
    top: 77px;
  }
}

#error_explanation {
  border: 1px solid #777;
  padding: 10px;
  background: powderblue;
  font-size: 0.8em;
  margin-top: 10px;

  h2 {
    font-size: 1.7em;
    text-decoration: underline;
  }
}

.field_with_errors {
  display: inline-block;
  background: powderblue;
  padding: 5px;
  margin: 0;
}

.pagination {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  font-family: 'Acme';

  a, .current {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    background: #f8fafc;
    color: #34475a;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
  }

  a:hover, a:focus-visible {
    background: #eaf4fb;
    border-color: #9dc6df;
    color: #176b96;
  }

  a:focus-visible {
    outline: 2px solid var(--btn-primary);
    outline-offset: 2px;
  }

  .current {
    background: var(--btn-primary);
    border-color: #1686bb;
    color: #08354d;
    font-weight: 700;
  }

  .gap {
    padding: 0 3px;
    color: #7b8793;
  }
}

@media (max-width: 480px) {
  .pagination {
    gap: 4px;
    padding: 12px 8px;

    a, .current {
      min-width: 34px;
      min-height: 34px;
      padding: 6px 9px;
    }
  }
}

.page_info {
  font-size: 0.8em;
  text-align: center;
  padding: 5px 0 10px;
  clear: both;
}

table.main {
  margin: 20px auto;
  text-align: center;
  width: 100%;
  border: 1px solid #aaa;
  font-size: 0.8em;

  th {
    color: darkred;
    padding: 10px;
    background: #fff;
  }

  td {
    padding: 3px 8px;
  }

  a {
    &:hover {
      color: steelblue;
    }
  }

  tr:hover {
    background: #fff;
  }
}

table.admin {
  font-size: 0.7em;

  th, td {
    padding: 2px;
  }

  tr {
    border-bottom: 1px solid #aaa;
  }
}

.admin_form {
  .field {
    padding: 10px;
  }
}

.generic_page_wrap {
  height: 100%;
}

.generic_page {
  height: 100%;
  overflow: auto;
  text-align: center;
  padding: 20px 0;

  form {
    /* max-width: 600px; */
    margin: 0 20px;
  }

  .sub_nav {
    margin-bottom: 10px;
  }
}

.error_page {
  margin-top: 20px;
  padding: 30px 50px 50px;
  text-align: center;

  h2 {
    color: crimson;
    font-size: 1.5em;
  }

  .error_notes {
    color: #555;
    font-style: italic;
    font-size: 0.9em;
    em {
      text-decoration: underline;
      color: #333;
    }
    a {
      color: steelblue;
      &:hover {
        color: black;
      }
    }
  }
}

.btn_link {
  cursor: pointer;
  display:inline-block;
  vertical-align: baseline;
  background: var(--btn-primary) var(--tile-sheen);
  border: 1px solid var(--btn-border);
  color: #000;
  border-radius: 3px;
  padding: 7px 10px;
  font-size: 1.2em;
  font-family: 'Acme';

  &:hover {
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3);
  }

  &:active {
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.6);
  }
}

.btn_link[disabled='disabled'], .btn_link.disabled {
  color: #ccc;
  background-color: #666;
  background-image: none;
}

.btn_danger {
  background-color: var(--btn-danger);
}

.btn_success {
  background-color: var(--btn-success);
}

input[type='email'], input[type='password'], input[type='text'] {
  font-family: Arial, Helvetica, Sans-serif;
  padding: 8px 10px;
  font-size: 1em;
  border: 1px solid #999;
  border-radius: 3px;
  color: #333;
  width: 280px;
}

#spinner {
  background: rgba(0,0,0,0.7);
  height: 100%;
  width: 100%;
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10000;

  #actual_spinner {
    background: #f8fafc;
    border: 1px solid #bdd5e6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    height: 150px;
    width: 150px;
    border-radius: 18px;
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -75px 0 0 -75px;

    &::before {
      content: '';
      position: absolute;
      top: 32px;
      left: 51px;
      width: 40px;
      height: 40px;
      border: 4px solid #d7e8f1;
      border-top-color: #1686bb;
      border-radius: 50%;
      animation: loading-spin 800ms linear infinite;
    }

    &::after {
      content: 'Loading…';
      position: absolute;
      top: 99px;
      left: 0;
      width: 100%;
      text-align: center;
      color: #34475a;
      font: 17px 'Acme';
    }
  }
}

#nav_spinner {
  height: 35px;
  width: 45px;
  display: none;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    width: 19px;
    height: 19px;
    border: 3px solid rgba(174, 210, 230, 0.25);
    border-top-color: #8bd6fa;
    border-radius: 50%;
    animation: loading-spin 800ms linear infinite;
  }
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #spinner #actual_spinner::before, #nav_spinner::before {
    animation: none;
  }
}

::-webkit-input-placeholder { color: #888 }
:-moz-placeholder           { color: #888 }
::-moz-placeholder          { color: #888 }
:-ms-input-placeholder      { color: #888 }

.no_select {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}
