html {
  scroll-behavior: smooth;
}

body {
  max-width: 800px;
  margin: auto;
  background: #f2f2f2;
  font-family: sans-serif;
  line-height: 1.2;
}

body[data-horizontal] {
  max-width: 1600px;
}

.title {
  font-size: 2.5em;
  text-align: center;
  margin-bottom: -0.2em;
}

.subtitle {
  font-size: smaller;
  text-align: center;
}

dl {
  display: grid;
  grid-template-columns: max-content auto;
}

dt {
  grid-column-start: 1;
  text-align: right;
}

dd {
  grid-column-start: 2;
}

section {
  background: #f2f2f2;
}

a.no-visit {
  color: inherit;
}

a.chapter {
  text-decoration: none;
}

.face,
.back {
  filter: url(#inset-shadow);
  fill: #f2f2f2;
}

.back {
  fill: #ffba1e;
}

.tile {
  width: 25px;
  height: 35px;
  vertical-align: middle;
}

summary {
  cursor: pointer;
}

details.collapse {
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: .5em .5em 0;
}

details.collapse summary {
  font-weight: bold;
  margin: -.5em -.5em 0;
  padding: .5em;
}

details[open].collapse {
  padding: .5em;
  margin-bottom: .5em;
}

details[open].collapse summary {
  border-bottom: 1px solid #aaa;
  margin-bottom: .5em;
}

.turn-info {
  font-weight: normal;
}

.kyoku-toc,
.kyoku-heading {
  display: flex;
}

.end-status-list {
  list-style: none;
  padding-left: 0;
}

.end-status-item {
  margin-left: 2em;
}

.end-status {
  color: #666;
}

.kyoku-heading {
  font-size: 2em;
}

.kyoku-heading .end-status {
  font-size: 75%;
  font-weight: normal;
  line-height: 75%;
}

.tehai-state {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
}

.tsumo {
  margin-left: .5em;
}

.tsumo::before {
  content: attr(before);
}

.tsumo::after {
  content: attr(after);
}

.fuuro {
  display: flex;
  list-style: none;
  padding-left: 0;
  margin-left: .5em;
}

:not(.fuuro)+.fuuro {
  margin-left: 1em;
}

.consumed {
  display: flex;
  list-style: none;
  padding-left: 0;
}

.rotated {
  transform: rotate(-90deg) translateY(35px);
  transform-origin: bottom left;
  margin-right: 10px;
}

.rotated.added {
  transform: rotate(-90deg) translateY(35px);
  transform-origin: bottom left;
  margin-right: -15px;
}

.sticky {
  position: sticky;
  top: 0;
  background: #f2f2f2;
}

iframe.tenhou {
  width: 100%;
  height: 480px;
  display: block;
  margin: auto;
}

.order-loss {
  color: #f55;
}

.role {
  display: inline-block;
  font-weight: bold;
  width: 5.5em;
}

table.data {
  table-layout: fixed;
  text-align: center;
  width: 100%;
}

table.data th,
table.data td {
  padding: 3px;
}

table.data th {
  font-size: 85%;
  background: #ddd;
}

table.data tbody tr:hover {
  background: lightyellow;
}

table.data td {
  font-size: 90%;
  line-height: 32px;
}

.int,
.frac {
  display: inline-block;
  width: 50%;
}

.int {
  text-align: right;
}

.frac {
  text-align: left;
}

.l-box[data-horizontal] {
  float: left;
  width: 50%;
}

.r-box[data-horizontal] {
  margin-left: 50%;
}

#top-button {
  display: inline-block;
  background-color: steelblue;
  border: 0;
  width: 50px;
  height: 50px;
  text-align: center;
  border-radius: 50%;
  position: fixed;
  bottom: 30px;
  right: 30px;
  transition: background-color .3s, opacity .5s, visibility .5s;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  color: white;
  font-size: 30px;
}
#top-button:hover {
  cursor: pointer;
  background-color: #333;
}
#top-button:active {
  background-color: #555;
}
#top-button.show {
  opacity: 1;
  visibility: visible;
}
