/* Small turn-based games: no render loop, filters or full-screen touch interception. */
#app.ui-refresh .tb-screen {
  padding: 16px 16px 24px;
  max-width: 540px;
  margin: auto;
}
#app.ui-refresh .tb-screen .top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}
#app.ui-refresh .tb-screen .top > div {
  flex: 1;
  min-width: 0;
}
#app.ui-refresh .tb-screen h1 {
  font-size: clamp(18px, 5.4vw, 25px);
  line-height: 1.25;
  margin: 4px 0;
}
#app.ui-refresh .tb-screen .economy-bar {
  margin: 0 0 20px;
}
#app.ui-refresh .tb-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0;
  min-height: 48px;
}
#app.ui-refresh .tb-player {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 46%;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  line-height: 1.3;
}
#app.ui-refresh .tb-player span {
  overflow-wrap: anywhere;
}
#app.ui-refresh .tb-player.current {
  border-color: #7952cc;
}
#app.ui-refresh .tb-player > i {
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid #30233f;
  border-radius: 50%;
  background: #7952cc;
}
#app.ui-refresh .tb-player.owner-2 > i {
  background: #ddf57b;
}
#app.ui-refresh .tb-player > b {
  font-size: 20px;
  margin-left: 4px;
}
#app.ui-refresh .tb-versus {
  color: #8b7c90;
}
#app.ui-refresh .tb-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}
#app.ui-refresh .tb-stat span {
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: #74637d;
  max-width: 72px;
}
#app.ui-refresh .tb-stat b {
  font-size: 24px;
  color: #30233f;
}
#app.ui-refresh .tb-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
}
#app.ui-refresh .tb-status > span {
  font-size: 10px;
  color: #74637d;
  white-space: nowrap;
}
#app.ui-refresh .tb-status b {
  overflow-wrap: anywhere;
}
#app.ui-refresh .tb-board-wrap {
  margin: 16px auto 20px;
  width: 100%;
  max-width: 400px;
}
#app.ui-refresh .tb-board-wrap button {
  border: 0;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  color: #30233f;
}
#app.ui-refresh .tb-board-wrap button:disabled {
  opacity: 1;
  cursor: default;
}
#app.ui-refresh .tb-board-wrap button:focus-visible {
  outline: 3px solid #7952cc;
  outline-offset: 2px;
  z-index: 2;
}
#app.ui-refresh .tb-drop {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px;
  margin-bottom: 6px;
}
#app.ui-refresh .tb-drop button {
  height: 34px;
  background: transparent;
  font-size: 22px;
}
#app.ui-refresh .tb-drop button:disabled {
  color: #a89aaf;
}
#app.ui-refresh .tb-connect {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  padding: 12px;
  border: 1px solid #30233f;
  border-radius: 14px;
  background: #d7c5f0;
}
#app.ui-refresh .tb-connect .tb-disc {
  aspect-ratio: 1;
  border: 1px solid #30233f;
  border-radius: 50%;
  background: #f5f1e8;
}
#app.ui-refresh .tb-connect .owner-1 {
  background: #7952cc;
}
#app.ui-refresh .tb-connect .owner-2 {
  background: #ddf57b;
}
#app.ui-refresh .tb-connect .last {
  outline: 2px solid #30233f;
  outline-offset: -5px;
}
#app.ui-refresh .tb-reversi {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 1px solid #30233f;
  border-radius: 9px;
  overflow: hidden;
  background: #dfe6cf;
}
#app.ui-refresh .tb-reversi button {
  aspect-ratio: 1;
  background: transparent;
  border-right: 1px solid #30233f22;
  border-bottom: 1px solid #30233f22;
  display: grid;
  place-items: center;
  position: relative;
}
#app.ui-refresh .tb-reversi i {
  width: 75%;
  height: 75%;
  border-radius: 50%;
}
#app.ui-refresh .tb-reversi .owner-1 i {
  background: #7952cc;
  border: 1px solid #30233f;
}
#app.ui-refresh .tb-reversi .owner-2 i {
  background: #fffdf7;
  border: 1px solid #30233f;
}
#app.ui-refresh .tb-reversi .legal i {
  width: 19%;
  height: 19%;
  background: #7952cc55;
}
#app.ui-refresh .tb-reversi .last::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background: #ddf57b;
  border: 1px solid #30233f;
  border-radius: 50%;
}
#app.ui-refresh .tb-boxes {
  display: grid;
  grid-template-columns: 10px 1fr 10px 1fr 10px 1fr 10px 1fr 10px;
  grid-template-rows: 10px 1fr 10px 1fr 10px 1fr 10px 1fr 10px;
  aspect-ratio: 1;
  padding: 10px;
}
#app.ui-refresh .tb-dot {
  background: #30233f;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  z-index: 1;
  pointer-events: none;
}
#app.ui-refresh .tb-edge {
  position: relative;
  background: transparent;
  border-radius: 3px;
}
#app.ui-refresh .tb-edge::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}
#app.ui-refresh .tb-edge.vertical::before {
  inset: 0 -10px;
}
#app.ui-refresh .tb-edge::after {
  content: "";
  position: absolute;
  inset: 3px 0;
  background: #cbbdd4;
  border-radius: 6px;
}
#app.ui-refresh .tb-edge.vertical::after {
  inset: 0 3px;
}
#app.ui-refresh .tb-edge.owner-1::after {
  background: #7952cc;
}
#app.ui-refresh .tb-edge.owner-2::after {
  background: #8c9f35;
}
#app.ui-refresh .tb-square {
  display: grid;
  place-items: center;
  font-size: 23px;
  color: #7952cc;
  background: transparent;
  border: 5px solid #f5f1e8;
  pointer-events: none;
}
#app.ui-refresh .tb-square.owner-1 {
  background: #d7c5f0;
}
#app.ui-refresh .tb-square.owner-2 {
  background: #ddf57b;
  color: #546227;
}
#app.ui-refresh .tb-pairs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
#app.ui-refresh .tb-pairs button {
  aspect-ratio: 0.84;
  background: #7952cc;
  border: 1px solid #30233f;
  border-radius: 9px;
  color: #e9dcff;
  font-size: 30px;
  font-weight: 800;
}
#app.ui-refresh .tb-pairs .revealed {
  background: #fffdf7;
  color: #30233f;
}
#app.ui-refresh .tb-pairs .matched {
  background: #ddf57b;
  color: #30233f;
  border-color: #b5c662;
}
#app.ui-refresh .tb-pairs button svg {
  width: 48px;
  height: 48px;
  max-width: 65%;
  display: block;
  margin: auto;
}
#app.ui-refresh .tb-pairs .matched span {
  opacity: 0.65;
}
#app.ui-refresh .tb-merge {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #30233f;
  background: #ddd3df;
  border-radius: 13px;
  touch-action: none;
  user-select: none;
}
#app.ui-refresh .tb-merge .tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #f5f1e866;
  border-radius: 6px;
  font-size: clamp(19px, 6vw, 29px);
  font-weight: 800;
}
#app.ui-refresh .tb-merge .level-1 {
  background: #fffdf7;
}
#app.ui-refresh .tb-merge .level-2 {
  background: #e7edcd;
}
#app.ui-refresh .tb-merge .level-3 {
  background: #ddf57b;
}
#app.ui-refresh .tb-merge .level-4 {
  background: #d7c5f0;
}
#app.ui-refresh .tb-merge .level-5 {
  background: #b397df;
}
#app.ui-refresh .tb-merge :is(.level-6, .level-7) {
  background: #7952cc;
  color: #fffdf7;
}
#app.ui-refresh .tb-merge :is(.level-8, .level-9, .level-10, .level-11) {
  background: #30233f;
  color: #ddf57b;
}
#app.ui-refresh .tb-directions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
#app.ui-refresh .tb-directions button {
  flex: 1;
  height: 44px;
  border: 1px solid #c2b4c9;
  border-radius: 8px;
  background: #fffdf7;
  font-size: 24px;
}
#app.ui-refresh .tb-lights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: #30233f;
  border-radius: 13px;
}
#app.ui-refresh .tb-lights button {
  aspect-ratio: 1;
  background: #50425f;
  border: 1px solid #766484;
  border-radius: 7px;
  display: grid;
  place-items: center;
}
#app.ui-refresh .tb-lights button.lit {
  background: #ddf57b;
  border-color: #ddf57b;
}
#app.ui-refresh .tb-lights button span {
  width: 24%;
  height: 24%;
  border-radius: 50%;
  border: 1px solid #aa96b8;
}
#app.ui-refresh .tb-lights .lit span {
  background: #30233f;
  border-color: #30233f;
}
#app.ui-refresh .tb-rules,
#app.ui-refresh .tb-end {
  border-top: 1px solid #d8ced7;
  padding: 15px 0;
  margin: 12px 0;
  font-size: 12px;
}
#app.ui-refresh .tb-rules summary,
#app.ui-refresh .tb-end summary {
  cursor: pointer;
  font-weight: 750;
}
#app.ui-refresh .tb-rules summary svg {
  width: 15px;
  height: 15px;
  vertical-align: middle;
  float: right;
}
#app.ui-refresh .tb-rules p,
#app.ui-refresh .tb-end p,
#app.ui-refresh .tb-note {
  font-size: 12px;
  color: #74637d;
  line-height: 1.65;
}
#app.ui-refresh .tb-result {
  border: 1px solid #c7b9cb;
  border-radius: 12px;
  background: #fffdf7;
  padding: 20px;
  margin-top: 20px;
}
#app.ui-refresh .tb-result h2 {
  font-size: 21px;
}
#app.ui-refresh .tb-result p {
  font-size: 12px;
  color: #74637d;
}
#app.ui-refresh .tb-invitation {
  text-align: center;
  padding: 12px 0 24px;
}
#app.ui-refresh .tb-invitation .wd-cover {
  width: 125px;
  height: 125px;
  margin: auto;
  display: block;
  border: 1px solid #30233f;
  border-radius: 14px;
}
#app.ui-refresh .tb-invitation h2 {
  font-size: 22px;
  line-height: 1.4;
  margin-top: 22px;
}
#app.ui-refresh .tb-invitation p {
  font-size: 13px;
  color: #74637d;
  line-height: 1.6;
}
#app.ui-refresh .tb-screen .primary {
  background: #7952cc;
  color: #fffdf7;
  border-radius: 9px;
  box-shadow: none;
  min-height: 44px;
}
#app.ui-refresh .tb-screen .soft {
  background: #fffdf7;
  color: #59436a;
  border: 1px solid #c7b9cb;
  border-radius: 9px;
  min-height: 44px;
}
@media (prefers-reduced-motion: no-preference) {
  #app.ui-refresh .tb-pairs button,
  #app.ui-refresh .tb-lights button {
    transition: background-color 130ms;
  }
  #app.ui-refresh .tb-drop button:active {
    transform: translateY(2px);
  }
}
@media (max-width: 350px) {
  #app.ui-refresh .tb-screen {
    padding: 12px;
  }
  #app.ui-refresh .tb-connect {
    padding: 9px;
    gap: 5px;
  }
  #app.ui-refresh .tb-status {
    align-items: flex-start;
  }
  #app.ui-refresh .tb-status > span {
    white-space: normal;
    text-align: right;
    max-width: 95px;
  }
  #app.ui-refresh .tb-stat b {
    font-size: 21px;
  }
}
#app.ui-refresh .tb-screen:has(.tb-reversi) .tb-player.owner-2 > i {
  background: #fffdf7;
}
