* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #ffffff;
  color: #000000;
  font-family: "Courier New", Courier, monospace;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  display: block;
  min-height: 100dvh;
  padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right))
    calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
}

.board-shell {
  width: min(700px, 100%);
  max-width: 100%;
  margin: 0 auto;
  border: 2px solid #000000;
  background: #ffffff;
  padding: 14px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.language-switch,
.back-link {
  margin: 8px 0 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.back-link {
  margin-bottom: 12px;
}

.site-footer {
  margin-top: 12px;
  border-top: 2px solid #000000;
  padding-top: 10px;
}

.site-footer-links {
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.site-footer-note {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
}

a {
  color: #000000;
  text-decoration: underline;
}

.language-switch a[aria-current="page"] {
  text-decoration: none;
  font-weight: bold;
}

.card {
  border: 2px solid #000000;
  padding: 10px;
  margin-top: 10px;
  background: #ffffff;
}

h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

p {
  margin: 0;
  line-height: 1.45;
}

.table-wrap {
  width: 100%;
  max-height: 300px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid #000000;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  border: 1px solid #000000;
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2f2f2;
}

tbody tr:nth-child(even) {
  background: #fbfbfb;
}

.empty-cell {
  text-align: center;
}

.outcome-win {
  color: rgb(0, 120, 0);
  font-weight: bold;
}

.outcome-loss {
  color: rgb(170, 0, 0);
  font-weight: bold;
}

.pet-name-cell {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-card-wrap {
  margin-top: 8px;
  border: 2px solid #000000;
  padding: 8px;
  background: #ffffff;
  overflow: hidden;
}

#share-card-canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid #000000;
  background: #ffffff;
  image-rendering: auto;
}

.share-card-wrap.card-bounce {
  animation: card-bounce 260ms ease-out;
}

button.btn-clicked {
  animation: button-pop 220ms ease-out;
}

.share-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#summary-line,
#share-status,
.card p {
  overflow-wrap: anywhere;
}

button {
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
  text-transform: lowercase;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

@keyframes button-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes card-bounce {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-3px);
  }
  70% {
    transform: translateY(1px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .board-shell {
    padding: 9px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 16px;
  }

  th,
  td {
    padding: 5px;
    font-size: 12px;
  }

  table {
    min-width: 620px;
  }

  .table-wrap {
    max-height: 260px;
  }

  #share-card-canvas {
    max-width: 100%;
  }

  .share-actions {
    flex-direction: column;
  }

  .share-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body {
    padding: calc(6px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  }

  .board-shell {
    border-width: 1px;
    padding: 8px;
  }

  h1 {
    font-size: 18px;
  }

  .card {
    border-width: 1px;
    padding: 8px;
  }

  th,
  td {
    padding: 4px;
    font-size: 11px;
  }

  table {
    min-width: 520px;
  }

  .table-wrap {
    max-height: 230px;
  }

  button {
    padding: 7px 8px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  table {
    min-width: 470px;
  }

  .table-wrap {
    max-height: 210px;
  }

  .pet-name-cell {
    max-width: 120px;
  }
}